diff options
| author | Scott Mansell <phiren@gmail.com> | 2021-11-25 11:01:37 +1300 |
|---|---|---|
| committer | Scott Mansell <phiren@gmail.com> | 2021-11-25 11:11:01 +1300 |
| commit | f5c550e9cb8f5bbc6a4f9bd77bc84c077671c480 (patch) | |
| tree | 9f6f6c9c2ff3ccc59c0865c31f460350905bb8e6 /Source/Core/VideoCommon/BPStructs.cpp | |
| parent | 0b81640dd1ce436519368556a69eb7fc650a60fa (diff) | |
Delay singlecore gpu interrupts
Fixes Bomberman Jetters in single core mode.
When single core mode pauses the CPU to execute the GPU
FIFO it greedily executes the whole thing. Before this commit,
Finish and Token interrupts would happen instantly, not even
taking into account how long the current FIFO window has
taken to execute. The interrupts would be effectively backdated
to the start of this execution window.
This commit does two things: It pipes the current FIFO window
execution time though to the interrupt scheduling and it enforces
a minimum delay of 500 cycles before an interrupt will be fired.
Diffstat (limited to 'Source/Core/VideoCommon/BPStructs.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/BPStructs.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index 1ec097fe6e..0fc4ca6785 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -50,7 +50,7 @@ void BPInit() bpmem.bpMask = 0xFFFFFF; } -static void BPWritten(const BPCmd& bp) +static void BPWritten(const BPCmd& bp, int cycles_into_future) { /* ---------------------------------------------------------------------------------------------------------------- @@ -180,7 +180,7 @@ static void BPWritten(const BPCmd& bp) g_texture_cache->FlushEFBCopies(); g_framebuffer_manager->InvalidatePeekCache(false); if (!Fifo::UseDeterministicGPUThread()) - PixelEngine::SetFinish(); // may generate interrupt + PixelEngine::SetFinish(cycles_into_future); // may generate interrupt DEBUG_LOG_FMT(VIDEO, "GXSetDrawDone SetPEFinish (value: {:#04X})", bp.newvalue & 0xFFFF); return; @@ -193,14 +193,14 @@ static void BPWritten(const BPCmd& bp) g_texture_cache->FlushEFBCopies(); g_framebuffer_manager->InvalidatePeekCache(false); if (!Fifo::UseDeterministicGPUThread()) - PixelEngine::SetToken(static_cast<u16>(bp.newvalue & 0xFFFF), false); + PixelEngine::SetToken(static_cast<u16>(bp.newvalue & 0xFFFF), false, cycles_into_future); DEBUG_LOG_FMT(VIDEO, "SetPEToken {:#06X}", bp.newvalue & 0xFFFF); return; case BPMEM_PE_TOKEN_INT_ID: // Pixel Engine Interrupt Token ID g_texture_cache->FlushEFBCopies(); g_framebuffer_manager->InvalidatePeekCache(false); if (!Fifo::UseDeterministicGPUThread()) - PixelEngine::SetToken(static_cast<u16>(bp.newvalue & 0xFFFF), true); + PixelEngine::SetToken(static_cast<u16>(bp.newvalue & 0xFFFF), true, cycles_into_future); DEBUG_LOG_FMT(VIDEO, "SetPEToken + INT {:#06X}", bp.newvalue & 0xFFFF); return; @@ -717,7 +717,7 @@ static void BPWritten(const BPCmd& bp) } // Call browser: OpcodeDecoding.cpp ExecuteDisplayList > Decode() > LoadBPReg() -void LoadBPReg(u32 value0) +void LoadBPReg(u32 value0, int cycles_into_future) { int regNum = value0 >> 24; int oldval = ((u32*)&bpmem)[regNum]; @@ -730,10 +730,10 @@ void LoadBPReg(u32 value0) if (regNum != BPMEM_BP_MASK) bpmem.bpMask = 0xFFFFFF; - BPWritten(bp); + BPWritten(bp, cycles_into_future); } -void LoadBPRegPreprocess(u32 value0) +void LoadBPRegPreprocess(u32 value0, int cycles_into_future) { int regNum = value0 >> 24; // masking could hypothetically be a problem @@ -742,13 +742,13 @@ void LoadBPRegPreprocess(u32 value0) { case BPMEM_SETDRAWDONE: if ((newval & 0xff) == 0x02) - PixelEngine::SetFinish(); + PixelEngine::SetFinish(cycles_into_future); break; case BPMEM_PE_TOKEN_ID: - PixelEngine::SetToken(newval & 0xffff, false); + PixelEngine::SetToken(newval & 0xffff, false, cycles_into_future); break; case BPMEM_PE_TOKEN_INT_ID: // Pixel Engine Interrupt Token ID - PixelEngine::SetToken(newval & 0xffff, true); + PixelEngine::SetToken(newval & 0xffff, true, cycles_into_future); break; } } |
