CPU: Fix assertion tripping in debug builds

This commit is contained in:
Stenzek 2024-08-19 22:03:07 +10:00
parent 41c8607782
commit ef59a0da12
No known key found for this signature in database
1 changed files with 8 additions and 5 deletions

View File

@ -2306,11 +2306,12 @@ ALWAYS_INLINE_RELEASE void CPU::MemoryBreakpointCheck(VirtualMemoryAddress addre
template<PGXPMode pgxp_mode, bool debug> template<PGXPMode pgxp_mode, bool debug>
[[noreturn]] void CPU::ExecuteImpl() [[noreturn]] void CPU::ExecuteImpl()
{ {
for (;;) if (g_state.pending_ticks >= g_state.downcount)
{
TimingEvents::RunEvents(); TimingEvents::RunEvents();
while (g_state.pending_ticks < g_state.downcount) for (;;)
{
do
{ {
if constexpr (debug) if constexpr (debug)
{ {
@ -2369,7 +2370,9 @@ template<PGXPMode pgxp_mode, bool debug>
ExitExecution(); ExitExecution();
} }
} }
} } while (g_state.pending_ticks < g_state.downcount);
TimingEvents::RunEvents();
} }
} }