From 60db4c353099e8656a330ede03fdbe57a421fa47 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 2 Aug 2020 22:36:57 -0300 Subject: Implement a Macro JIT (#1445) * Implement a Macro JIT * Nit: space --- Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoClass.cs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoClass.cs') diff --git a/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoClass.cs b/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoClass.cs index 958253ec..0e87aa3d 100644 --- a/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoClass.cs +++ b/Ryujinx.Graphics.Gpu/Engine/GPFifo/GPFifoClass.cs @@ -13,6 +13,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo class GPFifoClass : IDeviceState { private readonly GpuContext _context; + private readonly GPFifoProcessor _parent; private readonly DeviceState _state; private const int MacrosCount = 0x80; @@ -24,18 +25,15 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo private readonly Macro[] _macros; private readonly int[] _macroCode; - /// - /// MME Shadow RAM Control. - /// - public ShadowRamControl ShadowCtrl { get; private set; } - /// /// Creates a new instance of the GPU General Purpose FIFO class. /// /// GPU context - public GPFifoClass(GpuContext context) + /// Parent GPU General Purpose FIFO processor + public GPFifoClass(GpuContext context, GPFifoProcessor parent) { _context = context; + _parent = parent; _state = new DeviceState(new Dictionary { { nameof(GPFifoClassState.Semaphored), new RwCallback(Semaphored, null) }, @@ -155,7 +153,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo } /// - /// Send macro code/data to the MME + /// Sends macro code/data to the MME. /// /// Method call argument public void LoadMmeInstructionRam(int argument) @@ -164,7 +162,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo } /// - /// Bind a macro index to a position for the MME + /// Binds a macro index to a position for the MME /// /// Method call argument public void LoadMmeStartAddressRam(int argument) @@ -173,12 +171,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo } /// - /// Change the shadow RAM setting + /// Changes the shadow RAM control. /// /// Method call argument public void SetMmeShadowRamControl(int argument) { - ShadowCtrl = (ShadowRamControl)argument; + _parent.SetShadowRamControl((ShadowRamControl)argument); } /// @@ -208,7 +206,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.GPFifo /// Current GPU state public void CallMme(int index, GpuState state) { - _macros[index].Execute(_macroCode, ShadowCtrl, state); + _macros[index].Execute(_macroCode, state); } } } -- cgit v1.2.3