Fix Metroid: Other M
During boot of Other M, there is momentarily a period when VICallback's cycles late is larger than GetTicksPerHalfLine(). Because GetTicksPerHalfLine() returns a u32 and c++'s weird type promotion rules, cycleslate gets promoted from a s32 to a u32 and the result of the substraction is a really large u32. Before ScheduleEvent accuracy improvements, ScheduleEvent took a s32, so the result got cast back to the small negitave we expect. But it now takes a s64 and the u32 to s64 conversion gives us a really large number (around two seconds) and Other M times out while waiting for something.
This commit is contained in:
parent
94098a50c2
commit
28e0607522
|
@ -118,7 +118,7 @@ static void IPC_HLE_UpdateCallback(u64 userdata, int cyclesLate)
|
|||
static void VICallback(u64 userdata, int cyclesLate)
|
||||
{
|
||||
VideoInterface::Update();
|
||||
CoreTiming::ScheduleEvent(VideoInterface::GetTicksPerHalfLine() - cyclesLate, et_VI);
|
||||
CoreTiming::ScheduleEvent(s64(VideoInterface::GetTicksPerHalfLine()) - cyclesLate, et_VI);
|
||||
}
|
||||
|
||||
static void DecrementerCallback(u64 userdata, int cyclesLate)
|
||||
|
|
Loading…
Reference in New Issue