// Options //\r
#define FAMEC_ROLL_INLINE\r
#define FAMEC_EMULATE_TRACE\r
-#define FAMEC_IRQ_CYCLES\r
#define FAMEC_CHECK_BRANCHES\r
-// #define FAMEC_USE_DATA_BANKS\r
-// #define FAMEC_EXTRA_INLINE\r
+#define FAMEC_EXTRA_INLINE\r
// #define FAMEC_DEBUG\r
-#define FAMEC_NO_GOTOS\r
+//#define FAMEC_NO_GOTOS\r
#define FAMEC_ADR_BITS 24\r
// #define FAMEC_FETCHBITS 8\r
#define FAMEC_DATABITS 8\r
#ifndef FAMEC_EXTRA_INLINE\r
#define FAMEC_EXTRA_INLINE\r
#else\r
+#undef FAMEC_EXTRA_INLINE\r
#define FAMEC_EXTRA_INLINE INLINE\r
#endif\r
\r
typedef signed int s32;\r
*/\r
\r
-#ifdef FAMEC_EMULATE_TRACE\r
-static u32 flag_T;\r
-#endif\r
-static u32 flag_C;\r
-static u32 flag_V;\r
-static u32 flag_NotZ;\r
-static u32 flag_N;\r
-static u32 flag_X; // 16 bytes aligned\r
-static u32 flag_S;\r
-static u32 flag_I;\r
-\r
#ifndef M68K_OK\r
#define M68K_OK 0\r
#endif\r
#define M68K_PPL (m68kcontext.sr >> 8) & 7\r
\r
#define GET_PC \\r
- (u32)PC - BasePC;\r
+ ((u32)PC - BasePC)\r
\r
\r
#ifndef FAMEC_32BIT_PC\r
\r
#define SET_PC(A) \\r
- BasePC = g_m68kcontext->Fetch[((A) >> M68K_FETCHSFT) & M68K_FETCHMASK]; \\r
- /* BasePC -= (A) & 0xFF000000; */ \\r
- PC = (u16*)(((A) & M68K_ADR_MASK) + BasePC);\r
+{ \\r
+ u32 pc = A; \\r
+ BasePC = m68kcontext.Fetch[(pc >> M68K_FETCHSFT) & M68K_FETCHMASK]; \\r
+ PC = (u16*)((pc & M68K_ADR_MASK) + BasePC); \\r
+}\r
\r
#else\r
\r
#define SET_PC(A) \\r
- BasePC = g_m68kcontext->Fetch[((A) >> M68K_FETCHSFT) & M68K_FETCHMASK]; \\r
- BasePC -= (A) & 0xFF000000; \\r
- PC = (u16*)((A) + BasePC);\r
+{ \\r
+ u32 pc = A; \\r
+ BasePC = m68kcontext.Fetch[(pc >> M68K_FETCHSFT) & M68K_FETCHMASK]; \\r
+ BasePC -= pc & 0xFF000000; \\r
+ PC = (u16*)(pc + BasePC); \\r
+}\r
\r
#endif\r
\r
if (interrupt_chk__()) \\r
{ \\r
cycles_needed=m68kcontext.io_cycle_counter-(CLK); \\r
- m68kcontext.io_cycle_counter= (CLK); \\r
+ m68kcontext.io_cycle_counter=(CLK); \\r
}\r
\r
\r
#define CHECK_BRANCH_EXCEPTION(_PC_) \\r
if ((_PC_)&1) \\r
{ \\r
- u32 pr_PC=GET_PC; \\r
+ u32 new_PC, pr_PC=GET_PC; \\r
m68kcontext.execinfo |= FM68K_EMULATE_GROUP_0; \\r
- execute_exception_group_0(M68K_ADDRESS_ERROR_EX, 0, pr_PC, 0x12 ); \\r
+ new_PC = execute_exception_group_0(M68K_ADDRESS_ERROR_EX, 0, pr_PC, 0x12 ); \\r
+ SET_PC(new_PC); \\r
CHECK_BRANCH_EXCEPTION_GOTO_END \\r
}\r
#else\r
\r
static int init_jump_table(void);\r
\r
-/* Custom function handler */\r
-typedef void (*icust_handler_func)(u32 vector);\r
-\r
// global variable\r
///////////////////\r
\r
M68K_CONTEXT *g_m68kcontext;\r
#define m68kcontext (*g_m68kcontext)\r
\r
-/* static s32 io_cycle_counter; */\r
-static s32 cycles_needed=0;\r
+#ifdef FAMEC_NO_GOTOS\r
+static u32 Opcode;\r
+static s32 cycles_needed;\r
static u16 *PC;\r
static u32 BasePC;\r
-// static u32 Fetch[M68K_FETCHBANK];\r
+static u32 flag_V;\r
+static u32 flag_NotZ;\r
+static u32 flag_N;\r
+static u32 flag_X;\r
+#endif\r
+\r
+#ifdef FAMEC_EMULATE_TRACE\r
+static u32 flag_T;\r
+#endif\r
+static u32 flag_S;\r
+static u32 flag_I;\r
+\r
+static u32 initialised = 0;\r
\r
/* Custom function handler */\r
typedef void (*opcode_func)(void);\r
\r
static opcode_func JumpTable[0x10000];\r
\r
-\r
-static u32 initialised = 0;\r
-\r
// exception cycle table (taken from musashi core)\r
static const s32 exception_cycle_table[256] =\r
{\r
/****************************************************************************/\r
u32 fm68k_get_pc(M68K_CONTEXT *context)\r
{\r
+#ifdef FAMEC_NO_GOTOS\r
return (context->execinfo & M68K_RUNNING)?(u32)PC-BasePC:context->pc;\r
+#else\r
+ return context->pc; // approximate PC in this mode\r
+#endif\r
}\r
\r
\r
return interrupt_chk__();\r
}\r
\r
-static FAMEC_EXTRA_INLINE void execute_exception(s32 vect)\r
+static FAMEC_EXTRA_INLINE u32 execute_exception(s32 vect, u32 oldPC, u32 oldSR)\r
{\r
- extern u32 flag_S;\r
-#ifndef FAMEC_IRQ_CYCLES\r
- if ((vect<24)||(vect>31))\r
-#endif\r
+ u32 newPC;\r
+ //u32 oldSR = GET_SR;\r
+\r
m68kcontext.io_cycle_counter -= exception_cycle_table[vect];\r
- {\r
- u32 newPC;\r
- u32 oldPC;\r
- u32 oldSR = GET_SR;\r
\r
- PRE_IO\r
+ PRE_IO\r
\r
- READ_LONG_F(vect * 4, newPC)\r
+ READ_LONG_F(vect * 4, newPC)\r
\r
- /* swap A7 and USP */\r
- if (!flag_S)\r
- {\r
- u32 tmpSP;\r
+ /* swap A7 and USP */\r
+ if (!flag_S)\r
+ {\r
+ u32 tmpSP;\r
\r
- tmpSP = ASP;\r
- ASP = AREG(7);\r
- AREG(7) = tmpSP;\r
- }\r
+ tmpSP = ASP;\r
+ ASP = AREG(7);\r
+ AREG(7) = tmpSP;\r
+ }\r
\r
- oldPC = (u32)(PC) - BasePC;\r
- PUSH_32_F(oldPC)\r
- PUSH_16_F(oldSR)\r
+ //oldPC = GET_PC;\r
+ PUSH_32_F(oldPC)\r
+ PUSH_16_F(oldSR)\r
\r
- /* adjust SR */\r
- flag_S = M68K_SR_S;\r
+ /* adjust SR */\r
+ flag_S = M68K_SR_S;\r
\r
#ifndef FAMEC_32BIT_PC\r
- newPC&=M68K_ADR_MASK\r
+ newPC&=M68K_ADR_MASK\r
#endif\r
- newPC&=~1; // don't crash on games with bad vector tables\r
+ newPC&=~1; // don't crash on games with bad vector tables\r
\r
- SET_PC(newPC)\r
+ // SET_PC(newPC)\r
\r
- POST_IO\r
- }\r
+ POST_IO\r
+\r
+ return newPC;\r
}\r
\r
-static FAMEC_EXTRA_INLINE void execute_exception_group_0(s32 vect, u16 inst_reg, s32 addr, u16 spec_info)\r
+static FAMEC_EXTRA_INLINE u32 execute_exception_group_0(s32 vect, s32 addr, u16 spec_info, u32 oldSR)\r
{\r
- execute_exception(vect);\r
+ u32 newPC;\r
+ u16 inst_reg = 0;\r
+ newPC = execute_exception(vect, addr, oldSR);\r
//if (!(m68kcontext.icust_handler && m68kcontext.icust_handler[vect]))\r
{\r
PUSH_16_F(inst_reg);\r
PUSH_32_F(addr);\r
PUSH_16_F(spec_info);\r
}\r
+ return newPC;\r
}\r
\r
\r
static void setup_jumptable(void);\r
-static u32 Opcode;\r
\r
#ifdef FAMEC_NO_GOTOS\r
\r
\r
int fm68k_emulate(s32 cycles)\r
{\r
+#ifndef FAMEC_NO_GOTOS\r
+ u32 Opcode;\r
+ s32 cycles_needed;\r
+ u16 *PC;\r
+ u32 BasePC;\r
+ u32 flag_C;\r
+ u32 flag_V;\r
+ u32 flag_NotZ;\r
+ u32 flag_N;\r
+ u32 flag_X;\r
+#endif\r
+\r
if (!initialised)\r
{\r
#ifdef FAMEC_NO_GOTOS\r
else\r
m68kcontext.interrupts[0] = 0;\r
\r
- execute_exception(line + 0x18);\r
+ SET_PC(execute_exception(line + 0x18, GET_PC, GET_SR));\r
flag_I = (u32)line;\r
if (m68kcontext.io_cycle_counter <= 0) goto famec_End;\r
}\r
if (flag_T)\r
{\r
m68kcontext.execinfo |= FM68K_EMULATE_TRACE;\r
- cycles_needed= m68kcontext.io_cycle_counter;\r
+ cycles_needed = m68kcontext.io_cycle_counter;\r
m68kcontext.io_cycle_counter=0;\r
}\r
#endif\r
#ifdef FAMEC_EMULATE_TRACE\r
if (m68kcontext.execinfo & FM68K_EMULATE_TRACE)\r
{\r
- m68kcontext.io_cycle_counter= cycles_needed;\r
+ m68kcontext.io_cycle_counter = cycles_needed;\r
+ cycles_needed = 0;\r
m68kcontext.execinfo &= ~FM68K_EMULATE_TRACE;\r
m68kcontext.execinfo |= FM68K_DO_TRACE;\r
- execute_exception(M68K_TRACE_EX);\r
+ SET_PC(execute_exception(M68K_TRACE_EX, GET_PC, GET_SR));\r
flag_T=0;\r
if (m68kcontext.io_cycle_counter > 0)\r
{\r
- NEXT\r
+ //NEXT\r
+ goto famec_Exec;\r
}\r
}\r
else\r
#endif\r
if (cycles_needed != 0)\r
{\r
+ m68kcontext.io_cycle_counter = cycles_needed;\r
+ cycles_needed = 0;\r
s32 line=interrupt_chk__();\r
- m68kcontext.io_cycle_counter= cycles_needed;\r
if (line>0)\r
{\r
if (m68kcontext.iack_handler != NULL)\r
else\r
m68kcontext.interrupts[0] = 0;\r
\r
- execute_exception(line + 0x18);\r
+ SET_PC(execute_exception(line + 0x18, GET_PC, GET_SR));\r
flag_I = (u32)line;\r
}\r
#ifdef FAMEC_EMULATE_TRACE\r
- else if (!(flag_T))\r
+ if (!(flag_T))\r
#endif\r
if (m68kcontext.io_cycle_counter > 0)\r
{\r
}
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
}
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)
}
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(0)
}
RET(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(12)
}
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)
}
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)
}
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)
}
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)
}
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)
}
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)
}
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)
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)
}
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)
}
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)
}
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)
}
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)
// ILLEGAL
OPCODE(0x4AFC)
{
- u32 oldPC=GET_PC;
- SET_PC(oldPC-2)
- execute_exception(M68K_ILLEGAL_INSTRUCTION_EX);
+ 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);
+ 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);
+ SET_PC(execute_exception(M68K_1111_EX, GET_PC-2, GET_SR));
RET(0) // 4 already taken by exc. handler
}
// 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)
}
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);
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;
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
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);
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
OPCODE(0x4E76)
{
if (flag_V & 0x80)
- execute_exception(M68K_TRAPV_EX);
+ SET_PC(execute_exception(M68K_TRAPV_EX, GET_PC, GET_SR));
RET(4)
}
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)
}
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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