aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/MacroInterpreter.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-04-25 10:56:56 -0300
committerGitHub <noreply@github.com>2020-04-25 23:56:56 +1000
commit9261ec6bc858948c7ba73e1ff1301e19623be933 (patch)
tree2d1ff1b7010d6f2abc4814f94d6d97db1fb50e36 /Ryujinx.Graphics.Gpu/MacroInterpreter.cs
parent1c9aba6de1520aea5480c032e0ff5664ac1bb36f (diff)
Fix MME shadow RAM implementation (#1051)
Diffstat (limited to 'Ryujinx.Graphics.Gpu/MacroInterpreter.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/MacroInterpreter.cs34
1 files changed, 10 insertions, 24 deletions
diff --git a/Ryujinx.Graphics.Gpu/MacroInterpreter.cs b/Ryujinx.Graphics.Gpu/MacroInterpreter.cs
index fa8a4a48..8d2d6202 100644
--- a/Ryujinx.Graphics.Gpu/MacroInterpreter.cs
+++ b/Ryujinx.Graphics.Gpu/MacroInterpreter.cs
@@ -82,8 +82,7 @@ namespace Ryujinx.Graphics.Gpu
/// <param name="param">Optional argument passed to the program, 0 if not used</param>
/// <param name="shadowCtrl">Shadow RAM control register value</param>
/// <param name="state">Current GPU state</param>
- /// <param name="shadowState">Shadow GPU state</param>
- public void Execute(int[] mme, int position, int param, ShadowRamControl shadowCtrl, GpuState state, GpuState shadowState)
+ public void Execute(int[] mme, int position, int param, ShadowRamControl shadowCtrl, GpuState state)
{
Reset();
@@ -95,11 +94,11 @@ namespace Ryujinx.Graphics.Gpu
FetchOpCode(mme);
- while (Step(mme, state, shadowState));
+ while (Step(mme, state));
// Due to the delay slot, we still need to execute
// one more instruction before we actually exit.
- Step(mme, state, shadowState);
+ Step(mme, state);
}
/// <summary>
@@ -124,9 +123,8 @@ namespace Ryujinx.Graphics.Gpu
/// </summary>
/// <param name="mme">Program code to execute</param>
/// <param name="state">Current GPU state</param>
- /// <param name="shadowState">Shadow GPU state</param>
/// <returns>True to continue execution, false if the program exited</returns>
- private bool Step(int[] mme, GpuState state, GpuState shadowState)
+ private bool Step(int[] mme, GpuState state)
{
int baseAddr = _pc - 1;
@@ -172,7 +170,7 @@ namespace Ryujinx.Graphics.Gpu
{
SetDstGpr(FetchParam());
- Send(state, shadowState, result);
+ Send(state, result);
break;
}
@@ -182,7 +180,7 @@ namespace Ryujinx.Graphics.Gpu
{
SetDstGpr(result);
- Send(state, shadowState, result);
+ Send(state, result);
break;
}
@@ -204,7 +202,7 @@ namespace Ryujinx.Graphics.Gpu
SetMethAddr(result);
- Send(state, shadowState, FetchParam());
+ Send(state, FetchParam());
break;
}
@@ -216,7 +214,7 @@ namespace Ryujinx.Graphics.Gpu
SetMethAddr(result);
- Send(state, shadowState,(result >> 12) & 0x3f);
+ Send(state, (result >> 12) & 0x3f);
break;
}
@@ -489,24 +487,12 @@ namespace Ryujinx.Graphics.Gpu
/// Performs a GPU method call.
/// </summary>
/// <param name="state">Current GPU state</param>
- /// <param name="shadowState">Shadow GPU state</param>
/// <param name="value">Call argument</param>
- private void Send(GpuState state, GpuState shadowState, int value)
+ private void Send(GpuState state, int value)
{
- // TODO: Figure out what TrackWithFilter does, compared to Track.
- if (_shadowCtrl == ShadowRamControl.Track ||
- _shadowCtrl == ShadowRamControl.TrackWithFilter)
- {
- shadowState.Write(_methAddr, value);
- }
- else if (_shadowCtrl == ShadowRamControl.Replay)
- {
- value = shadowState.Read(_methAddr);
- }
-
MethodParams meth = new MethodParams(_methAddr, value);
- state.CallMethod(meth);
+ state.CallMethod(meth, _shadowCtrl);
_methAddr += _methIncr;
}