From 10a2b9dca3610a759926e6be564c8813be8d8618 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 26 Apr 2020 19:22:18 -0300 Subject: [PATCH] Fix shadow RAM affecting MME methods (#1168) --- Ryujinx.Graphics.Gpu/State/GpuState.cs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Ryujinx.Graphics.Gpu/State/GpuState.cs b/Ryujinx.Graphics.Gpu/State/GpuState.cs index 677fed660..70c4ed614 100644 --- a/Ryujinx.Graphics.Gpu/State/GpuState.cs +++ b/Ryujinx.Graphics.Gpu/State/GpuState.cs @@ -77,15 +77,19 @@ namespace Ryujinx.Graphics.Gpu.State { int value = meth.Argument; - // TODO: Figure out what TrackWithFilter does, compared to Track. - if (shadowCtrl == ShadowRamControl.Track || - shadowCtrl == ShadowRamControl.TrackWithFilter) + // Methods < 0x80 shouldn't be affected by shadow RAM at all. + if (meth.Method >= 0x80) { - _shadow[meth.Method] = value; - } - else if (shadowCtrl == ShadowRamControl.Replay) - { - value = _shadow[meth.Method]; + // TODO: Figure out what TrackWithFilter does, compared to Track. + if (shadowCtrl == ShadowRamControl.Track || + shadowCtrl == ShadowRamControl.TrackWithFilter) + { + _shadow[meth.Method] = value; + } + else if (shadowCtrl == ShadowRamControl.Replay) + { + value = _shadow[meth.Method]; + } } Register register = _registers[meth.Method];