X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2Ffame%2Ffamec.c;h=041413f2538a8c4c27c84bc4747e7f3433533831;hb=b5e5172d049a83251874fb33e65a53c9654dc0bc;hp=2549147c27e1bf962a007c43fd2144d236c9940c;hpb=9caf44b59bf20d0beb614d4249cf908c7fb7434d;p=picodrive.git diff --git a/cpu/fame/famec.c b/cpu/fame/famec.c index 2549147..041413f 100644 --- a/cpu/fame/famec.c +++ b/cpu/fame/famec.c @@ -28,6 +28,7 @@ #define USE_CYCLONE_TIMING #define USE_CYCLONE_TIMING_DIV +#define PICODRIVE_HACK // Options // @@ -521,6 +522,10 @@ static u32 flag_I; static u32 initialised = 0; +#ifdef PICODRIVE_HACK +extern M68K_CONTEXT PicoCpuFS68k; +#endif + /* Custom function handler */ typedef void (*opcode_func)(void); @@ -793,6 +798,9 @@ int fm68k_emulate(s32 cycles) // won't emulate double fault // if (m68kcontext.execinfo & M68K_FAULTED) return -1; + // Cache PPL + flag_I = M68K_PPL; + if (m68kcontext.execinfo & FM68K_HALTED) { if (interrupt_chk__() <= 0) @@ -812,9 +820,6 @@ int fm68k_emulate(s32 cycles) // Cache SR SET_SR(m68kcontext.sr) - // Cache PPL - flag_I = M68K_PPL; - // Fijar PC SET_PC(m68kcontext.pc) @@ -943,8 +948,6 @@ init_jump_table: #endif u32 i, j; - m68kcontext.sr = 0x2704; // Z flag - for(i = 0x0000; i <= 0xFFFF; i += 0x0001) JumpTable[0x0000 + i] = CAST_OP(0x4AFC); for(i = 0x0000; i <= 0x0007; i += 0x0001)