slightly optimize main loop

This commit is contained in:
Jaklyy 2024-12-15 22:02:41 -05:00
parent c40efab62f
commit e77c2011bc
1 changed files with 33 additions and 37 deletions

View File

@ -1757,11 +1757,8 @@ u32 NDS::RunFrame()
ARM9Target = target << ARM9ClockShift;
//ARM7Target = target;
//while ((std::max(std::max(ARM9Timestamp, DMA9Timestamp), A9ContentionTS << ARM9ClockShift) < (target << ARM9ClockShift)) && (ARM7Timestamp < target))
while (std::max(std::max(ARM9Timestamp, DMA9Timestamp), A9ContentionTS << ARM9ClockShift) < ARM9Target)
{
//while (std::max(std::max(ARM9Timestamp, DMA9Timestamp), A9ContentionTS << ARM9ClockShift) < (target << ARM9ClockShift))
{
//ARM9Target = target << ARM9ClockShift;
CurCPU = 0;
RunTimers(0);
GPU.GPU3D.Run();
@ -1800,7 +1797,6 @@ u32 NDS::RunFrame()
//if (MainRAMHandle()) break;
MainRAMHandle();
}
target = std::max(std::max(ARM9Timestamp, DMA9Timestamp) >> ARM9ClockShift, A9ContentionTS);
if (target == ARM7Timestamp) target++;