X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2Ffame%2Ffamec_opcodes.h;h=c690b45c640c36608a9066c873c673ab29bf0b99;hb=ad949800e42b25e498d58ff73e656df4c0bc2c6d;hp=76918994bac9f1fe08ad63c9d9769ef9ead7bae4;hpb=be26eb239bd06fd83ab740dca5582841eac652dd;p=picodrive.git diff --git a/cpu/fame/famec_opcodes.h b/cpu/fame/famec_opcodes.h index 7691899..c690b45 100644 --- a/cpu/fame/famec_opcodes.h +++ b/cpu/fame/famec_opcodes.h @@ -1,4 +1,10 @@ +#ifdef PICODRIVE_HACK +#define NOT_POLLING g_m68kcontext->not_polling = 1; +#else +#define NOT_POLLING +#endif + // ORI OPCODE(0x0000) { @@ -23298,6 +23304,8 @@ OPCODE(0x51C8) u32 adr, res; u32 src, dst; + NOT_POLLING + res = DREGu16((Opcode >> 0) & 7); res--; DREGu16((Opcode >> 0) & 7) = res; @@ -23321,6 +23329,8 @@ OPCODE(0x52C8) u32 adr, res; u32 src, dst; + NOT_POLLING + if ((!flag_NotZ) || (flag_C & 0x100)) { res = DREGu16((Opcode >> 0) & 7); @@ -23352,6 +23362,8 @@ OPCODE(0x53C8) u32 adr, res; u32 src, dst; + NOT_POLLING + if (flag_NotZ && (!(flag_C & 0x100))) { res = DREGu16((Opcode >> 0) & 7); @@ -23383,6 +23395,8 @@ OPCODE(0x54C8) u32 adr, res; u32 src, dst; + NOT_POLLING + if (flag_C & 0x100) { res = DREGu16((Opcode >> 0) & 7); @@ -23414,6 +23428,8 @@ OPCODE(0x55C8) u32 adr, res; u32 src, dst; + NOT_POLLING + if (!(flag_C & 0x100)) { res = DREGu16((Opcode >> 0) & 7); @@ -23445,6 +23461,8 @@ OPCODE(0x56C8) u32 adr, res; u32 src, dst; + NOT_POLLING + if (!flag_NotZ) { res = DREGu16((Opcode >> 0) & 7); @@ -23476,6 +23494,8 @@ OPCODE(0x57C8) u32 adr, res; u32 src, dst; + NOT_POLLING + if (flag_NotZ) { res = DREGu16((Opcode >> 0) & 7); @@ -23507,6 +23527,8 @@ OPCODE(0x58C8) u32 adr, res; u32 src, dst; + NOT_POLLING + if (flag_V & 0x80) { res = DREGu16((Opcode >> 0) & 7); @@ -23538,6 +23560,8 @@ OPCODE(0x59C8) u32 adr, res; u32 src, dst; + NOT_POLLING + if (!(flag_V & 0x80)) { res = DREGu16((Opcode >> 0) & 7); @@ -23569,6 +23593,8 @@ OPCODE(0x5AC8) u32 adr, res; u32 src, dst; + NOT_POLLING + if (flag_N & 0x80) { res = DREGu16((Opcode >> 0) & 7); @@ -23600,6 +23626,8 @@ OPCODE(0x5BC8) u32 adr, res; u32 src, dst; + NOT_POLLING + if (!(flag_N & 0x80)) { res = DREGu16((Opcode >> 0) & 7); @@ -23631,6 +23659,8 @@ OPCODE(0x5CC8) u32 adr, res; u32 src, dst; + NOT_POLLING + if ((flag_N ^ flag_V) & 0x80) { res = DREGu16((Opcode >> 0) & 7); @@ -23662,6 +23692,8 @@ OPCODE(0x5DC8) u32 adr, res; u32 src, dst; + NOT_POLLING + if (!((flag_N ^ flag_V) & 0x80)) { res = DREGu16((Opcode >> 0) & 7); @@ -23693,6 +23725,8 @@ OPCODE(0x5EC8) u32 adr, res; u32 src, dst; + NOT_POLLING + if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { res = DREGu16((Opcode >> 0) & 7); @@ -23724,6 +23758,8 @@ OPCODE(0x5FC8) u32 adr, res; u32 src, dst; + NOT_POLLING + if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { res = DREGu16((Opcode >> 0) & 7); @@ -40012,20 +40048,18 @@ RET(8) } +extern int SekIsIdleReady(void); extern int SekIsIdleCode(unsigned short *dst, int bytes); extern int SekRegisterIdlePatch(unsigned int pc, int oldop, int newop, void *ctx); OPCODE(idle_detector_bcc8) { - extern int idledet_start_frame; - extern char Pico[]; int frame_count, cond_true, bytes, ret, newop; u16 *dest_pc; dest_pc = PC + (((s8)(Opcode & 0xFE)) >> 1); - frame_count = *(int *)(Pico+0x22208+0x1c); // Pico.m.frame_count - if (frame_count < idledet_start_frame) + if (!SekIsIdleReady()) goto end; bytes = 0 - (s8)(Opcode & 0xFE) - 2;