Skip to content

Commit

Permalink
CPU: Fix assertion tripping in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Aug 19, 2024
1 parent 41c8607 commit ef59a0d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/core/cpu_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2306,11 +2306,12 @@ ALWAYS_INLINE_RELEASE void CPU::MemoryBreakpointCheck(VirtualMemoryAddress addre
template<PGXPMode pgxp_mode, bool debug>
[[noreturn]] void CPU::ExecuteImpl()
{
for (;;)
{
if (g_state.pending_ticks >= g_state.downcount)
TimingEvents::RunEvents();

while (g_state.pending_ticks < g_state.downcount)
for (;;)
{
do
{
if constexpr (debug)
{
Expand Down Expand Up @@ -2350,7 +2351,7 @@ template<PGXPMode pgxp_mode, bool debug>
{
if (g_state.m_regs.v1 != g_state.m_regs.v0)
printf("Got %08X Expected? %08X\n", g_state.m_regs.v1, g_state.m_regs.v0);
}
}
#endif

// execute the instruction we previously fetched
Expand All @@ -2369,7 +2370,9 @@ template<PGXPMode pgxp_mode, bool debug>
ExitExecution();
}
}
}
} while (g_state.pending_ticks < g_state.downcount);

TimingEvents::RunEvents();
}
}

Expand Down

0 comments on commit ef59a0d

Please # to comment.