x64 dynarec: don't reset the cycle counter but add a time slice
This is how the interpreter and other dynarecs work. Better scheduling precison. Fixes Gundam Side Story freeze at boot.
This commit is contained in:
parent
0d720ae0d6
commit
d438f6d9c9
|
@ -42,15 +42,16 @@ void ngen_mainloop(void* v_cntx)
|
|||
{
|
||||
Sh4RCB* ctx = (Sh4RCB*)((u8*)v_cntx - sizeof(Sh4RCB));
|
||||
|
||||
cycle_counter = 0;
|
||||
cycle_counter = SH4_TIMESLICE;
|
||||
|
||||
while (sh4_int_bCpuRun) {
|
||||
cycle_counter = SH4_TIMESLICE;
|
||||
do {
|
||||
DynarecCodeEntryPtr rcb = bm_GetCode(ctx->cntx.pc);
|
||||
rcb();
|
||||
} while (cycle_counter > 0);
|
||||
|
||||
cycle_counter += SH4_TIMESLICE;
|
||||
|
||||
if (UpdateSystem()) {
|
||||
rdv_DoInterrupts_pc(ctx->cntx.pc);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue