rec-x86: Load PC from sh4 context in ngen_mainloop

Fixes load state freeze and problems when pausing the emu thread
This commit is contained in:
Flyinghead 2018-09-23 12:04:07 +02:00
parent 3c60d4745c
commit 98da3a28dc
2 changed files with 10 additions and 2 deletions

View File

@ -93,7 +93,10 @@ ngen_mainloop:
push ebp
push ebx
mov ecx,[0xA0000000] # PC
mov ecx, [p_sh4rcb]
add ecx, [nextpc_offset]
mov ecx, [ecx]
mov dword ptr cycle_counter, 448 #SH4_TIMESLICE
lea eax, no_update

View File

@ -60,6 +60,7 @@ naked void ngen_FailedToFindBlock_()
}
const u32 cpurun_offset=offsetof(Sh4RCB,cntx.CpuRunning);
const u32 nextpc_offset=offsetof(Sh4RCB,cntx.pc);
void (*ngen_FailedToFindBlock)()=&ngen_FailedToFindBlock_;
naked void ngen_mainloop(void* cntx)
@ -71,7 +72,10 @@ naked void ngen_mainloop(void* cntx)
push ebp;
push ebx;
mov ecx,0xA0000000;
mov ecx, [p_sh4rcb];
add ecx, [nextpc_offset];
mov ecx, [ecx];
mov [cycle_counter],SH4_TIMESLICE;
mov [loop_no_update],offset no_update;
@ -133,6 +137,7 @@ naked void DYNACALL ngen_blockcheckfail2(u32 addr)
#else
u32 gas_offs=offsetof(Sh4RCB,cntx.jdyn);
u32 cpurun_offset=offsetof(Sh4RCB,cntx.CpuRunning);
u32 nextpc_offset=offsetof(Sh4RCB,cntx.pc);
void (*ngen_FailedToFindBlock)()=&ngen_FailedToFindBlock_;
#endif
#endif