mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
32x: fix lockstep code
This commit is contained in:
parent
0c720b9144
commit
7d025f8ad0
1 changed files with 13 additions and 13 deletions
|
@ -254,21 +254,21 @@ p32x_poll_event(3, 0);
|
||||||
#define STEP_68K 24
|
#define STEP_68K 24
|
||||||
#define CPUS_RUN_LOCKSTEP(m68k_cycles,s68k_cycles) \
|
#define CPUS_RUN_LOCKSTEP(m68k_cycles,s68k_cycles) \
|
||||||
{ \
|
{ \
|
||||||
int i; \
|
int slice; \
|
||||||
for (i = 0; i <= (m68k_cycles) - STEP_68K; i += STEP_68K) { \
|
SekCycleAim += m68k_cycles; \
|
||||||
|
while (SekCycleCnt < SekCycleAim) { \
|
||||||
|
slice = SekCycleCnt; \
|
||||||
run_m68k(STEP_68K); \
|
run_m68k(STEP_68K); \
|
||||||
if (!(Pico32x.emu_flags & (P32XF_MSH2POLL|P32XF_MSH2VPOLL))) \
|
if (!(Pico32x.regs[0] & P32XS_nRES)) \
|
||||||
sh2_execute(&msh2, CYCLES_M68K2SH2(STEP_68K)); \
|
continue; /* SH2s reseting */ \
|
||||||
if (!(Pico32x.emu_flags & (P32XF_SSH2POLL|P32XF_SSH2VPOLL))) \
|
slice = SekCycleCnt - slice; /* real count from 68k */ \
|
||||||
sh2_execute(&ssh2, CYCLES_M68K2SH2(STEP_68K)); \
|
if (!(Pico32x.emu_flags & (P32XF_SSH2POLL|P32XF_SSH2VPOLL))) { \
|
||||||
|
sh2_execute(&ssh2, CYCLES_M68K2SSH2(slice)); \
|
||||||
|
} \
|
||||||
|
if (!(Pico32x.emu_flags & (P32XF_MSH2POLL|P32XF_MSH2VPOLL))) { \
|
||||||
|
sh2_execute(&msh2, CYCLES_M68K2MSH2(slice)); \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
/* last step */ \
|
|
||||||
i = (m68k_cycles) - i; \
|
|
||||||
run_m68k(i); \
|
|
||||||
if (!(Pico32x.emu_flags & (P32XF_MSH2POLL|P32XF_MSH2VPOLL))) \
|
|
||||||
sh2_execute(&msh2, CYCLES_M68K2SH2(i)); \
|
|
||||||
if (!(Pico32x.emu_flags & (P32XF_SSH2POLL|P32XF_SSH2VPOLL))) \
|
|
||||||
sh2_execute(&ssh2, CYCLES_M68K2SH2(i)); \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CPUS_RUN CPUS_RUN_SIMPLE
|
#define CPUS_RUN CPUS_RUN_SIMPLE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue