diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-03-21 18:08:11 +0100 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-03-21 18:08:11 +0100 |
commit | 91f46b00fb0c5e6765a59f03259e9f49ec1c4f34 (patch) | |
tree | e3e5912c864d0e62888390dc386e0d7c32d59586 /src/GPU3D.cpp | |
parent | 3590d210f3c0dde8d071f7cb7f87110c1edec72c (diff) |
fix bug that occured when a flush command was sent between lines 192 and 215
Diffstat (limited to 'src/GPU3D.cpp')
-rw-r--r-- | src/GPU3D.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp index 939cb8a..6f7e7b7 100644 --- a/src/GPU3D.cpp +++ b/src/GPU3D.cpp @@ -1570,7 +1570,7 @@ void ExecuteCommand() break; case 0x50: // flush - FlushRequest = 1; + FlushRequest |= 0x1; FlushAttributes = ExecParams[0] & 0x3; CycleCount = 392; break; @@ -1592,7 +1592,7 @@ void ExecuteCommand() void Run(s32 cycles) { - if (FlushRequest) + if (FlushRequest & 0x1) return; if (CycleCount <= 0 && CmdPIPE->IsEmpty()) return; @@ -1635,7 +1635,7 @@ void CheckFIFODMA() void VBlank() { - if (FlushRequest) + if (FlushRequest & 0x1) { RenderVertexRAM = CurVertexRAM; RenderPolygonRAM = CurPolygonRAM; @@ -1647,6 +1647,9 @@ void VBlank() NumVertices = 0; NumPolygons = 0; + + FlushRequest &= ~0x1; + FlushRequest |= 0x2; } } @@ -1655,11 +1658,11 @@ void VCount215() // TODO: detect other conditions that could require rerendering // the DS is said to present new 3D frames all the time, even if no commands are sent - if (FlushRequest) + if (FlushRequest & 0x2) { SoftRenderer::RenderFrame(RenderVertexRAM, RenderPolygonRAM, RenderNumPolygons); - FlushRequest = 0; + FlushRequest &= ~0x2; } } |