#if defined(EMU_C68K)\r
struct Cyclone *context = is_sub ? &PicoCpuCS68k : &PicoCpuCM68k;\r
memcpy(cpu,context->d,0x40);\r
- pc=context->pc-context->membase;\r
+ *(u32 *)(cpu+0x40)=context->pc-context->membase;\r
*(u32 *)(cpu+0x44)=CycloneGetSr(context);\r
*(u32 *)(cpu+0x48)=context->osp;\r
cpu[0x4c] = context->irq;\r
void *oldcontext = m68ki_cpu_p;\r
m68k_set_context(is_sub ? &PicoCpuMS68k : &PicoCpuMM68k);\r
memcpy(cpu,m68ki_cpu_p->dar,0x40);\r
- pc=m68ki_cpu_p->pc;\r
+ *(u32 *)(cpu+0x40)=m68ki_cpu_p->pc;\r
*(u32 *)(cpu+0x44)=m68k_get_reg(NULL, M68K_REG_SR);\r
*(u32 *)(cpu+0x48)=m68ki_cpu_p->sp[m68ki_cpu_p->s_flag^SFLAG_SET];\r
cpu[0x4c] = CPU_INT_LEVEL>>8;\r
#elif defined(EMU_F68K)\r
M68K_CONTEXT *context = is_sub ? &PicoCpuFS68k : &PicoCpuFM68k;\r
memcpy(cpu,context->dreg,0x40);\r
- pc=context->pc;\r
+ *(u32 *)(cpu+0x40)=context->pc;\r
*(u32 *)(cpu+0x44)=context->sr;\r
*(u32 *)(cpu+0x48)=context->asp;\r
cpu[0x4c] = context->interrupts[0];\r
cpu[0x4d] = (context->execinfo & FM68K_HALTED) ? 1 : 0;\r
#endif\r
\r
- *(u32 *)(cpu+0x40) = pc;\r
- *(u32 *)(cpu+0x50) =\r
- is_sub ? SekCycleCntS68k : Pico.t.m68c_cnt;\r
+ if (is_sub) {\r
+ *(u32 *)(cpu+0x50) = SekCycleCntS68k;\r
+ *(s16 *)(cpu+0x4e) = SekCycleCntS68k - SekCycleAimS68k;\r
+ } else {\r
+ *(u32 *)(cpu+0x50) = Pico.t.m68c_cnt;\r
+ *(u32 *)(cpu+0x4e) = Pico.t.m68c_cnt - Pico.t.m68c_aim;\r
+ }\r
}\r
\r
PICO_INTERNAL void SekUnpackCpu(const unsigned char *cpu, int is_sub)\r
context->execinfo &= ~FM68K_HALTED;\r
if (cpu[0x4d]&1) context->execinfo |= FM68K_HALTED;\r
#endif\r
- if (is_sub)\r
+ if (is_sub) {\r
SekCycleCntS68k = *(u32 *)(cpu+0x50);\r
- else\r
+ SekCycleAimS68k = SekCycleCntS68k - *(s16 *)(cpu+0x4e);\r
+ } else {\r
Pico.t.m68c_cnt = *(u32 *)(cpu+0x50);\r
+ Pico.t.m68c_aim = Pico.t.m68c_cnt - *(s16 *)(cpu+0x4e);\r
+ }\r
}\r
\r
\r
z80_unpack(buff_z80);\r
\r
// due to dep from 68k cycles..\r
- Pico.t.m68c_frame_start = Pico.t.m68c_aim = Pico.t.m68c_cnt;\r
+ Pico.t.m68c_frame_start = Pico.t.m68c_aim;\r
if (PicoIn.AHW & PAHW_32X)\r
Pico32xStateLoaded(0);\r
if (PicoIn.AHW & PAHW_MCD)\r
- {\r
- SekCycleAimS68k = SekCycleCntS68k;\r
pcd_state_loaded();\r
- }\r
\r
Pico.m.dirtyPal = 1;\r
Pico.video.status &= ~(SR_VB | SR_F);\r