X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=cpu%2Ffame%2Ffamec_opcodes.h;h=8586603b2c9369b952326378c5a67856b1be4c4c;hb=9caf44b59bf20d0beb614d4249cf908c7fb7434d;hp=de1ce1708c61dfd36b478286fcb2cbf2fbed4754;hpb=9112b6ce9fd42ee46adb7e8148e587a7f60e35f4;p=picodrive.git diff --git a/cpu/fame/famec_opcodes.h b/cpu/fame/famec_opcodes.h index de1ce17..8586603 100644 --- a/cpu/fame/famec_opcodes.h +++ b/cpu/fame/famec_opcodes.h @@ -638,9 +638,7 @@ OPCODE(0x007C) } else { - u32 newPC = (u32)(PC) - BasePC; - SET_PC(newPC-2); - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); #ifdef USE_CYCLONE_TIMING RET(0) #else @@ -1298,9 +1296,7 @@ OPCODE(0x027C) } else { - u32 newPC = (u32)(PC) - BasePC; - SET_PC(newPC-2); - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(20) @@ -1950,10 +1946,8 @@ OPCODE(0x0A7C) } else { - u32 newPC = (u32)(PC) - BasePC; - SET_PC(newPC-2); - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); + RET(0) } RET(20) } @@ -5213,7 +5207,11 @@ OPCODE(0x0108) READ_BYTE_F(adr + 2, src) DREGu16((Opcode >> 9) & 7) = (res << 8) | src; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(16) +#else RET(24) +#endif } // MOVEPLaD @@ -5237,7 +5235,11 @@ OPCODE(0x0148) READ_BYTE_F(adr, src) DREG((Opcode >> 9) & 7) = res | src; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(24) +#else RET(32) +#endif } // MOVEPWDa @@ -5253,7 +5255,11 @@ OPCODE(0x0188) WRITE_BYTE_F(adr + 0, res >> 8) WRITE_BYTE_F(adr + 2, res >> 0) POST_IO +#ifdef USE_CYCLONE_TIMING +RET(16) +#else RET(24) +#endif } // MOVEPLDa @@ -5274,7 +5280,11 @@ OPCODE(0x01C8) adr += 2; WRITE_BYTE_F(adr, res >> 0) POST_IO +#ifdef USE_CYCLONE_TIMING +RET(24) +#else RET(32) +#endif } // MOVEB @@ -5460,6 +5470,7 @@ OPCODE(0x1F00) RET(8) } +#if 0 // MOVEB OPCODE(0x1008) { @@ -5692,6 +5703,7 @@ OPCODE(0x1F08) */ RET(8) } +#endif // MOVEB OPCODE(0x1010) @@ -8167,7 +8179,7 @@ OPCODE(0x2100) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; PRE_IO - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(12) } @@ -8279,7 +8291,7 @@ OPCODE(0x2F00) adr = AREG(7) - 4; AREG(7) = adr; PRE_IO - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(12) } @@ -8350,7 +8362,7 @@ OPCODE(0x2108) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; PRE_IO - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(12) } @@ -8462,7 +8474,7 @@ OPCODE(0x2F08) adr = AREG(7) - 4; AREG(7) = adr; PRE_IO - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(12) } @@ -8539,7 +8551,7 @@ OPCODE(0x2110) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(20) } @@ -8657,7 +8669,7 @@ OPCODE(0x2F10) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(20) } @@ -8738,7 +8750,7 @@ OPCODE(0x2118) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(20) } @@ -8862,7 +8874,7 @@ OPCODE(0x2F18) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(20) } @@ -8943,7 +8955,7 @@ OPCODE(0x2120) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(22) } @@ -9067,7 +9079,7 @@ OPCODE(0x2F20) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(22) } @@ -9148,7 +9160,7 @@ OPCODE(0x2128) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(24) } @@ -9272,7 +9284,7 @@ OPCODE(0x2F28) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(24) } @@ -9353,7 +9365,7 @@ OPCODE(0x2130) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(26) } @@ -9477,7 +9489,7 @@ OPCODE(0x2F30) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(26) } @@ -9554,7 +9566,7 @@ OPCODE(0x2138) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(24) } @@ -9672,7 +9684,7 @@ OPCODE(0x2F38) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(24) } @@ -9749,7 +9761,7 @@ OPCODE(0x2139) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(28) } @@ -9867,7 +9879,7 @@ OPCODE(0x2F39) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(28) } @@ -9948,7 +9960,7 @@ OPCODE(0x213A) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(24) } @@ -10072,7 +10084,7 @@ OPCODE(0x2F3A) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(24) } @@ -10153,7 +10165,7 @@ OPCODE(0x213B) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(26) } @@ -10277,7 +10289,7 @@ OPCODE(0x2F3B) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(26) } @@ -10348,7 +10360,7 @@ OPCODE(0x213C) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; PRE_IO - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(20) } @@ -10460,7 +10472,7 @@ OPCODE(0x2F3C) adr = AREG(7) - 4; AREG(7) = adr; PRE_IO - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(20) } @@ -10541,7 +10553,7 @@ OPCODE(0x211F) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(20) } @@ -10665,7 +10677,7 @@ OPCODE(0x2F1F) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(20) } @@ -10746,7 +10758,7 @@ OPCODE(0x2127) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(22) } @@ -10870,7 +10882,7 @@ OPCODE(0x2F27) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - WRITE_LONG_F(adr, res) + WRITE_LONG_DEC_F(adr, res) POST_IO RET(22) } @@ -16552,9 +16564,7 @@ OPCODE(0x46C0) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(12) @@ -16583,9 +16593,7 @@ OPCODE(0x46D0) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(16) @@ -16615,9 +16623,7 @@ OPCODE(0x46D8) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(16) @@ -16647,9 +16653,7 @@ OPCODE(0x46E0) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(18) @@ -16679,9 +16683,7 @@ OPCODE(0x46E8) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(20) @@ -16711,9 +16713,7 @@ OPCODE(0x46F0) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(22) @@ -16743,9 +16743,7 @@ OPCODE(0x46F8) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(20) @@ -16774,9 +16772,7 @@ OPCODE(0x46F9) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(24) @@ -16802,13 +16798,11 @@ OPCODE(0x46FA) ASP = res; } POST_IO - CHECK_INT_TO_JUMP(24) + CHECK_INT_TO_JUMP(20) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(20) @@ -16838,9 +16832,7 @@ OPCODE(0x46FB) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(22) @@ -16866,9 +16858,7 @@ OPCODE(0x46FC) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(16) @@ -16898,9 +16888,7 @@ OPCODE(0x46DF) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(16) @@ -16930,9 +16918,7 @@ OPCODE(0x46E7) } else { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } RET(18) @@ -18455,28 +18441,22 @@ RET(10) // ILLEGAL OPCODE(0x4AFC) { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_ILLEGAL_INSTRUCTION_EX); -RET(4) + SET_PC(execute_exception(M68K_ILLEGAL_INSTRUCTION_EX, GET_PC-2, GET_SR)); +RET(0) } // ILLEGAL A000-AFFF OPCODE(0xA000) { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_1010_EX); -RET(4) + SET_PC(execute_exception(M68K_1010_EX, GET_PC-2, GET_SR)); +RET(0) } // ILLEGAL F000-FFFF OPCODE(0xF000) { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_1111_EX); -RET(4) + SET_PC(execute_exception(M68K_1111_EX, GET_PC-2, GET_SR)); +RET(0) // 4 already taken by exc. handler } // MOVEMaR @@ -19036,7 +19016,7 @@ RET(12) // TRAP OPCODE(0x4E40) { - execute_exception(M68K_TRAP_BASE_EX + (Opcode & 0xF)); + SET_PC(execute_exception(M68K_TRAP_BASE_EX + (Opcode & 0xF), GET_PC, GET_SR)); RET(4) } @@ -19107,9 +19087,7 @@ OPCODE(0x4E60) if (!flag_S) { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } res = AREGu32((Opcode >> 0) & 7); @@ -19125,9 +19103,7 @@ OPCODE(0x4E68) if (!flag_S) { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } res = ASP; @@ -19143,9 +19119,7 @@ OPCODE(0x4E70) if (!flag_S) { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } PRE_IO @@ -19169,9 +19143,7 @@ OPCODE(0x4E72) if (!flag_S) { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } FETCH_WORD(res); @@ -19183,7 +19155,7 @@ OPCODE(0x4E72) AREG(7) = ASP; ASP = res; } - m68kcontext.execinfo |= M68K_HALTED; + m68kcontext.execinfo |= FM68K_HALTED; m68kcontext.io_cycle_counter = 0; RET(4) } @@ -19196,9 +19168,7 @@ OPCODE(0x4E73) if (!flag_S) { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); + SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR)); RET(4) } PRE_IO @@ -19213,7 +19183,7 @@ OPCODE(0x4E73) ASP = res; } POST_IO - m68kcontext.execinfo &= ~(M68K_EMULATE_GROUP_0|M68K_EMULATE_TRACE|M68K_DO_TRACE); + m68kcontext.execinfo &= ~(FM68K_EMULATE_GROUP_0|FM68K_EMULATE_TRACE|FM68K_DO_TRACE); CHECK_INT_TO_JUMP(20) RET(20) } @@ -19236,7 +19206,7 @@ RET(16) OPCODE(0x4E76) { if (flag_V & 0x80) - execute_exception(M68K_TRAPV_EX); + SET_PC(execute_exception(M68K_TRAPV_EX, GET_PC, GET_SR)); RET(4) } @@ -19499,7 +19469,7 @@ OPCODE(0x4180) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } RET(10) } @@ -19517,7 +19487,7 @@ OPCODE(0x4190) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(14) @@ -19537,7 +19507,7 @@ OPCODE(0x4198) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(14) @@ -19557,7 +19527,7 @@ OPCODE(0x41A0) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(16) @@ -19577,7 +19547,7 @@ OPCODE(0x41A8) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(18) @@ -19597,7 +19567,7 @@ OPCODE(0x41B0) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(20) @@ -19616,7 +19586,7 @@ OPCODE(0x41B8) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(18) @@ -19635,7 +19605,7 @@ OPCODE(0x41B9) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(22) @@ -19655,7 +19625,7 @@ OPCODE(0x41BA) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(18) @@ -19675,7 +19645,7 @@ OPCODE(0x41BB) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(20) @@ -19692,7 +19662,7 @@ OPCODE(0x41BC) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(14) @@ -19712,7 +19682,7 @@ OPCODE(0x419F) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(14) @@ -19732,7 +19702,7 @@ OPCODE(0x41A7) if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; - execute_exception(M68K_CHK_EX); + SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR)); } POST_IO RET(16) @@ -23892,7 +23862,7 @@ OPCODE(0x5048) dst = AREGu32((Opcode >> 0) & 7); res = dst + src; AREG((Opcode >> 0) & 7) = res; -#ifdef USE_CYCLONE_TIMING_ // breaks Project-X +#ifdef USE_CYCLONE_TIMING RET(4) #else RET(8) @@ -26965,7 +26935,7 @@ OPCODE(0x80C0) src = DREGu16((Opcode >> 0) & 7); if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(140) #else @@ -27013,7 +26983,7 @@ OPCODE(0x80D0) READ_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(144) #else @@ -27062,7 +27032,7 @@ OPCODE(0x80D8) READ_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(144) #else @@ -27111,7 +27081,7 @@ OPCODE(0x80E0) READ_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(146) #else @@ -27160,7 +27130,7 @@ OPCODE(0x80E8) READ_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(148) #else @@ -27209,7 +27179,7 @@ OPCODE(0x80F0) READ_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(150) #else @@ -27257,7 +27227,7 @@ OPCODE(0x80F8) READ_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(148) #else @@ -27305,7 +27275,7 @@ OPCODE(0x80F9) READ_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(162) #else @@ -27354,7 +27324,7 @@ OPCODE(0x80FA) READ_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(148) #else @@ -27403,7 +27373,7 @@ OPCODE(0x80FB) READ_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(160) #else @@ -27449,7 +27419,7 @@ OPCODE(0x80FC) FETCH_WORD(src); if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(144) #else @@ -27498,7 +27468,7 @@ OPCODE(0x80DF) READ_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(144) #else @@ -27547,7 +27517,7 @@ OPCODE(0x80E7) READ_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV RET(146) #else @@ -27593,7 +27563,7 @@ OPCODE(0x81C0) src = (s32)DREGs16((Opcode >> 0) & 7); if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81C0; #endif @@ -27649,7 +27619,7 @@ OPCODE(0x81D0) READSX_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81D0; #endif @@ -27706,7 +27676,7 @@ OPCODE(0x81D8) READSX_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81D8; #endif @@ -27763,7 +27733,7 @@ OPCODE(0x81E0) READSX_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81E0; #endif @@ -27820,7 +27790,7 @@ OPCODE(0x81E8) READSX_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81E8; #endif @@ -27877,7 +27847,7 @@ OPCODE(0x81F0) READSX_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81F0; #endif @@ -27933,7 +27903,7 @@ OPCODE(0x81F8) READSX_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81F8; #endif @@ -27989,7 +27959,7 @@ OPCODE(0x81F9) READSX_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81F9; #endif @@ -28046,7 +28016,7 @@ OPCODE(0x81FA) READSX_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81FA; #endif @@ -28103,7 +28073,7 @@ OPCODE(0x81FB) READSX_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81FB; #endif @@ -28157,7 +28127,7 @@ OPCODE(0x81FC) FETCH_SWORD(src); if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81FC; #endif @@ -28214,7 +28184,7 @@ OPCODE(0x81DF) READSX_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81DF; #endif @@ -28271,7 +28241,7 @@ OPCODE(0x81E7) READSX_WORD_F(adr, src) if (src == 0) { - execute_exception(M68K_ZERO_DIVIDE_EX); + SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR)); #ifdef USE_CYCLONE_TIMING_DIV goto end81E7; #endif @@ -28333,6 +28303,7 @@ RET(4) } // SUBaD +#if 0 OPCODE(0x9008) { u32 adr, res; @@ -28352,6 +28323,7 @@ OPCODE(0x9008) */ RET(4) } +#endif // SUBaD OPCODE(0x9010) @@ -30026,7 +29998,11 @@ OPCODE(0x90D0) res = dst - src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(12) +#else RET(10) +#endif } // SUBA @@ -30043,7 +30019,11 @@ OPCODE(0x90D8) res = dst - src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(12) +#else RET(10) +#endif } // SUBA @@ -30060,7 +30040,11 @@ OPCODE(0x90E0) res = dst - src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(14) +#else RET(12) +#endif } // SUBA @@ -30077,7 +30061,11 @@ OPCODE(0x90E8) res = dst - src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(16) +#else RET(14) +#endif } // SUBA @@ -30094,7 +30082,11 @@ OPCODE(0x90F0) res = dst - src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(18) +#else RET(16) +#endif } // SUBA @@ -30110,7 +30102,11 @@ OPCODE(0x90F8) res = dst - src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(16) +#else RET(14) +#endif } // SUBA @@ -30126,7 +30122,11 @@ OPCODE(0x90F9) res = dst - src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(20) +#else RET(18) +#endif } // SUBA @@ -30143,7 +30143,11 @@ OPCODE(0x90FA) res = dst - src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(16) +#else RET(14) +#endif } // SUBA @@ -30160,7 +30164,11 @@ OPCODE(0x90FB) res = dst - src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(18) +#else RET(16) +#endif } // SUBA @@ -30190,7 +30198,11 @@ OPCODE(0x90DF) res = dst - src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(12) +#else RET(10) +#endif } // SUBA @@ -30207,7 +30219,11 @@ OPCODE(0x90E7) res = dst - src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(14) +#else RET(12) +#endif } // SUBA @@ -30461,6 +30477,7 @@ RET(4) } // CMP +#if 0 OPCODE(0xB008) { u32 adr, res; @@ -30479,6 +30496,7 @@ OPCODE(0xB008) */ RET(4) } +#endif // CMP OPCODE(0xB010) @@ -34756,6 +34774,7 @@ RET(4) } // ADDaD +#if 0 OPCODE(0xD008) { u32 adr, res; @@ -34775,6 +34794,7 @@ OPCODE(0xD008) */ RET(4) } +#endif // ADDaD OPCODE(0xD010) @@ -36449,7 +36469,11 @@ OPCODE(0xD0D0) res = dst + src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(12) +#else RET(10) +#endif } // ADDA @@ -36466,7 +36490,11 @@ OPCODE(0xD0D8) res = dst + src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(12) +#else RET(10) +#endif } // ADDA @@ -36483,7 +36511,11 @@ OPCODE(0xD0E0) res = dst + src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(14) +#else RET(12) +#endif } // ADDA @@ -36500,7 +36532,11 @@ OPCODE(0xD0E8) res = dst + src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(16) +#else RET(14) +#endif } // ADDA @@ -36517,7 +36553,11 @@ OPCODE(0xD0F0) res = dst + src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(18) +#else RET(16) +#endif } // ADDA @@ -36533,7 +36573,11 @@ OPCODE(0xD0F8) res = dst + src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(16) +#else RET(14) +#endif } // ADDA @@ -36549,7 +36593,11 @@ OPCODE(0xD0F9) res = dst + src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(20) +#else RET(18) +#endif } // ADDA @@ -36566,7 +36614,11 @@ OPCODE(0xD0FA) res = dst + src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(16) +#else RET(14) +#endif } // ADDA @@ -36583,7 +36635,11 @@ OPCODE(0xD0FB) res = dst + src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(18) +#else RET(16) +#endif } // ADDA @@ -36613,7 +36669,11 @@ OPCODE(0xD0DF) res = dst + src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(12) +#else RET(10) +#endif } // ADDA @@ -36630,7 +36690,11 @@ OPCODE(0xD0E7) res = dst + src; AREG((Opcode >> 9) & 7) = res; POST_IO +#ifdef USE_CYCLONE_TIMING +RET(14) +#else RET(12) +#endif } // ADDA