// internals core macros\r
/////////////////////////\r
\r
-#define DREG(X) (m68kcontext.dreg[(X)].D)\r
-#define DREGu32(X) (m68kcontext.dreg[(X)].D)\r
-#define DREGs32(X) (m68kcontext.dreg[(X)].SD)\r
-#define DREGu16(X) (m68kcontext.dreg[(X)].W)\r
-#define DREGs16(X) (m68kcontext.dreg[(X)].SW)\r
-#define DREGu8(X) (m68kcontext.dreg[(X)].B)\r
-#define DREGs8(X) (m68kcontext.dreg[(X)].SB)\r
-\r
-#define AREG(X) (m68kcontext.areg[(X)].D)\r
-#define AREGu32(X) (m68kcontext.areg[(X)].D)\r
-#define AREGs32(X) (m68kcontext.areg[(X)].SD)\r
-#define AREGu16(X) (m68kcontext.areg[(X)].W)\r
-#define AREGs16(X) (m68kcontext.areg[(X)].SW)\r
-\r
-#define ASP (m68kcontext.asp)\r
+#define DREG(X) (ctx->dreg[(X)].D)\r
+#define DREGu32(X) (ctx->dreg[(X)].D)\r
+#define DREGs32(X) (ctx->dreg[(X)].SD)\r
+#define DREGu16(X) (ctx->dreg[(X)].W)\r
+#define DREGs16(X) (ctx->dreg[(X)].SW)\r
+#define DREGu8(X) (ctx->dreg[(X)].B)\r
+#define DREGs8(X) (ctx->dreg[(X)].SB)\r
+\r
+#define AREG(X) (ctx->areg[(X)].D)\r
+#define AREGu32(X) (ctx->areg[(X)].D)\r
+#define AREGs32(X) (ctx->areg[(X)].SD)\r
+#define AREGu16(X) (ctx->areg[(X)].W)\r
+#define AREGs16(X) (ctx->areg[(X)].SW)\r
+\r
+#define ASP (ctx->asp)\r
\r
#define LSL(A, C) ((A) << (C))\r
#define LSR(A, C) ((A) >> (C))\r
\r
#ifdef FAMEC_ROLL_INLINE\r
#define RET(A) \\r
- m68kcontext.io_cycle_counter -= (A); \\r
- if (m68kcontext.io_cycle_counter <= 0) goto famec_Exec_End; \\r
+ ctx->io_cycle_counter -= (A); \\r
+ if (ctx->io_cycle_counter <= 0) goto famec_Exec_End; \\r
NEXT\r
#else\r
#define RET(A) \\r
- m68kcontext.io_cycle_counter -= (A); \\r
- if (m68kcontext.io_cycle_counter <= 0) goto famec_Exec_End; \\r
+ ctx->io_cycle_counter -= (A); \\r
+ if (ctx->io_cycle_counter <= 0) goto famec_Exec_End; \\r
goto famec_Exec;\r
#endif\r
\r
#define RET0() \\r
- m68kcontext.io_cycle_counter = -6; \\r
+ ctx->io_cycle_counter = -6; \\r
goto famec_End;\r
\r
#else\r
\r
#define NEXT \\r
- do{ \\r
- FETCH_WORD(Opcode); \\r
- JumpTable[Opcode](); \\r
- }while(m68kcontext.io_cycle_counter>0);\r
+ do { \\r
+ FETCH_WORD(Opcode); \\r
+ JumpTable[Opcode](ctx); \\r
+ } while (ctx->io_cycle_counter > 0);\r
\r
#define RET(A) \\r
- m68kcontext.io_cycle_counter -= (A); \\r
+ ctx->io_cycle_counter -= (A); \\r
return;\r
\r
#define RET0() \\r
- m68kcontext.io_cycle_counter = -6; \\r
+ ctx->io_cycle_counter = -6; \\r
return;\r
\r
#endif\r
\r
-#define M68K_PPL (m68kcontext.sr >> 8) & 7\r
+#define M68K_PPL (ctx->sr >> 8) & 7\r
\r
#define GET_PC \\r
(u32)((uptr)PC - BasePC)\r
{ \\r
u32 pc = A; \\r
FORCE_ALIGNMENT(pc); \\r
- BasePC = m68kcontext.Fetch[(pc >> M68K_FETCHSFT) & M68K_FETCHMASK]; \\r
+ BasePC = ctx->Fetch[(pc >> M68K_FETCHSFT) & M68K_FETCHMASK]; \\r
PC = (u16*)((pc & M68K_ADR_MASK) + BasePC); \\r
}\r
\r
{ \\r
u32 pc = A; \\r
FORCE_ALIGNMENT(pc); \\r
- BasePC = m68kcontext.Fetch[(pc >> M68K_FETCHSFT) & M68K_FETCHMASK]; \\r
+ BasePC = ctx->Fetch[(pc >> M68K_FETCHSFT) & M68K_FETCHMASK]; \\r
BasePC -= pc & 0xFF000000; \\r
PC = (u16*)(pc + BasePC); \\r
}\r
// CCnt = io_cycle_counter;\r
\r
#define READ_BYTE_F(A, D) \\r
- D = m68kcontext.read_byte(A) & 0xFF;\r
+ D = ctx->read_byte(A) & 0xFF;\r
\r
#define READ_WORD_F(A, D) \\r
- D = m68kcontext.read_word(A) & 0xFFFF;\r
+ D = ctx->read_word(A) & 0xFFFF;\r
\r
#define READ_LONG_F(A, D) \\r
- D = m68kcontext.read_long(A);\r
+ D = ctx->read_long(A);\r
\r
#define READSX_LONG_F READ_LONG_F\r
\r
#define WRITE_LONG_F(A, D) \\r
- m68kcontext.write_long(A, D);\r
+ ctx->write_long(A, D);\r
\r
#define WRITE_LONG_DEC_F(A, D) \\r
- m68kcontext.write_word((A) + 2, (D) & 0xFFFF); \\r
- m68kcontext.write_word((A), (D) >> 16);\r
+ ctx->write_word((A) + 2, (D) & 0xFFFF); \\r
+ ctx->write_word((A), (D) >> 16);\r
\r
#define PUSH_32_F(D) \\r
AREG(7) -= 4; \\r
- m68kcontext.write_long(AREG(7), D);\r
+ ctx->write_long(AREG(7), D);\r
\r
#define POP_32_F(D) \\r
- D = m68kcontext.read_long(AREG(7)); \\r
+ D = ctx->read_long(AREG(7)); \\r
AREG(7) += 4;\r
\r
#ifndef FAME_BIG_ENDIAN\r
#endif\r
\r
#define READSX_BYTE_F(A, D) \\r
- D = (s8)m68kcontext.read_byte(A);\r
+ D = (s8)ctx->read_byte(A);\r
\r
#define READSX_WORD_F(A, D) \\r
- D = (s16)m68kcontext.read_word(A);\r
+ D = (s16)ctx->read_word(A);\r
\r
\r
#define WRITE_BYTE_F(A, D) \\r
- m68kcontext.write_byte(A, D);\r
+ ctx->write_byte(A, D);\r
\r
#define WRITE_WORD_F(A, D) \\r
- m68kcontext.write_word(A, D);\r
+ ctx->write_word(A, D);\r
\r
#define PUSH_16_F(D) \\r
- m68kcontext.write_word(AREG(7) -= 2, D); \\r
+ ctx->write_word(AREG(7) -= 2, D); \\r
\r
#define POP_16_F(D) \\r
- D = (u16)m68kcontext.read_word(AREG(7)); \\r
+ D = (u16)ctx->read_word(AREG(7)); \\r
AREG(7) += 2;\r
\r
#define GET_CCR \\r
#endif\r
\r
#define CHECK_INT_TO_JUMP(CLK) \\r
- if (interrupt_chk__()) \\r
+ if (interrupt_chk__(ctx)) \\r
{ \\r
- cycles_needed=m68kcontext.io_cycle_counter-(CLK); \\r
- m68kcontext.io_cycle_counter=(CLK); \\r
+ cycles_needed=ctx->io_cycle_counter-(CLK); \\r
+ ctx->io_cycle_counter=(CLK); \\r
}\r
\r
\r
#ifdef FAMEC_CHECK_BRANCHES\r
\r
#ifdef FAMEC_NO_GOTOS\r
-#define CHECK_BRANCH_EXCEPTION_GOTO_END m68kcontext.io_cycle_counter=0; return;\r
+#define CHECK_BRANCH_EXCEPTION_GOTO_END ctx->io_cycle_counter=0; return;\r
#else\r
#define CHECK_BRANCH_EXCEPTION_GOTO_END goto famec_Exec_End;\r
#endif\r
if ((_PC_)&1) \\r
{ \\r
u32 new_PC, pr_PC=GET_PC; \\r
- m68kcontext.execinfo |= FM68K_EMULATE_GROUP_0; \\r
- new_PC = execute_exception_group_0(M68K_ADDRESS_ERROR_EX, 0, pr_PC, 0x12 ); \\r
+ ctx->execinfo |= FM68K_EMULATE_GROUP_0; \\r
+ new_PC = execute_exception_group_0(ctx, M68K_ADDRESS_ERROR_EX, 0, pr_PC, 0x12 ); \\r
SET_PC(new_PC); \\r
CHECK_BRANCH_EXCEPTION_GOTO_END \\r
}\r
#define CHECK_BRANCH_EXCEPTION(_PC_)\r
#endif\r
\r
-\r
-// global variable\r
-///////////////////\r
-\r
-/* Current CPU context */\r
-M68K_CONTEXT *g_m68kcontext;\r
-#define m68kcontext (*g_m68kcontext)\r
-\r
#ifdef FAMEC_NO_GOTOS\r
-#define Opcode m68kcontext.Opcode\r
-#define cycles_needed m68kcontext.cycles_needed\r
-#define PC m68kcontext.PC\r
-#define BasePC m68kcontext.BasePC\r
-#define flag_C m68kcontext.flag_C\r
-#define flag_V m68kcontext.flag_V\r
-#define flag_NotZ m68kcontext.flag_NotZ\r
-#define flag_N m68kcontext.flag_N\r
-#define flag_X m68kcontext.flag_X\r
+#define Opcode ctx->Opcode\r
+#define cycles_needed ctx->cycles_needed\r
+#define PC ctx->PC\r
+#define BasePC ctx->BasePC\r
+#define flag_C ctx->flag_C\r
+#define flag_V ctx->flag_V\r
+#define flag_NotZ ctx->flag_NotZ\r
+#define flag_N ctx->flag_N\r
+#define flag_X ctx->flag_X\r
#endif\r
\r
-#define flag_T m68kcontext.flag_T\r
-#define flag_S m68kcontext.flag_S\r
-#define flag_I m68kcontext.flag_I\r
+#define flag_T ctx->flag_T\r
+#define flag_S ctx->flag_S\r
+#define flag_I ctx->flag_I\r
+\r
+// global variable\r
+///////////////////\r
\r
static u32 initialised = 0;\r
\r
#endif\r
\r
/* Custom function handler */\r
-typedef void (*opcode_func)(void);\r
+typedef void (*opcode_func)(M68K_CONTEXT *ctx);\r
\r
static opcode_func JumpTable[0x10000];\r
\r
if (!initialised)\r
init_jump_table();\r
\r
- g_m68kcontext = ctx;\r
-\r
// Si la CPU esta en ejecucion, salir con M68K_RUNNING\r
- if (m68kcontext.execinfo & M68K_RUNNING)\r
+ if (ctx->execinfo & M68K_RUNNING)\r
return M68K_RUNNING;\r
\r
// Resetear registros\r
- //memset(&m68kcontext.dreg[0], 0, 16*4);\r
+ //memset(&ctx->dreg[0], 0, 16*4);\r
\r
// Resetear interrupts, execinfo y ASP\r
- m68kcontext.interrupts[0] = 0;\r
- m68kcontext.execinfo = 0;\r
+ ctx->interrupts[0] = 0;\r
+ ctx->execinfo = 0;\r
ASP = 0;\r
\r
// Fijar registro de estado\r
- m68kcontext.sr = (m68kcontext.sr & 0xff) | 0x2700;\r
+ ctx->sr = (ctx->sr & 0xff) | 0x2700;\r
\r
// Obtener puntero de pila inicial y PC\r
- AREG(7) = m68kcontext.read_long(0);\r
- m68kcontext.pc = m68kcontext.read_long(4);\r
+ AREG(7) = ctx->read_long(0);\r
+ ctx->pc = ctx->read_long(4);\r
\r
#ifdef FAMEC_DEBUG\r
puts("Reset 68k done!\n");\r
- printf("PC = 0x%08X\n",m68kcontext.pc);\r
+ printf("PC = 0x%08X\n",ctx->pc);\r
#endif\r
\r
return M68K_OK;\r
/* No recibe parametros */\r
/* Retorna 68k PC */\r
/****************************************************************************/\r
-u32 fm68k_get_pc(M68K_CONTEXT *context)\r
+u32 fm68k_get_pc(const M68K_CONTEXT *ctx)\r
{\r
#ifdef FAMEC_NO_GOTOS\r
- return (context->execinfo & M68K_RUNNING)?(uptr)PC-BasePC:context->pc;\r
+ return (ctx->execinfo & M68K_RUNNING)?(uptr)PC-BasePC:ctx->pc;\r
#else\r
- return context->pc; // approximate PC in this mode\r
+ return ctx->pc; // approximate PC in this mode\r
#endif\r
}\r
\r
\r
//////////////////////////\r
// Chequea las interrupciones y las inicia\r
-static FAMEC_EXTRA_INLINE s32 interrupt_chk__(void)\r
+static FAMEC_EXTRA_INLINE s32 interrupt_chk__(M68K_CONTEXT *ctx)\r
{\r
- if (m68kcontext.interrupts[0] > flag_I)\r
- return m68kcontext.interrupts[0];\r
+ if (ctx->interrupts[0] > flag_I)\r
+ return ctx->interrupts[0];\r
\r
return 0;\r
}\r
\r
int fm68k_would_interrupt(M68K_CONTEXT *ctx)\r
{\r
- return interrupt_chk__();\r
+ return interrupt_chk__(ctx);\r
}\r
\r
-static FAMEC_EXTRA_INLINE u32 execute_exception(s32 vect, u32 oldPC, u32 oldSR)\r
+static FAMEC_EXTRA_INLINE u32 execute_exception(M68K_CONTEXT *ctx, s32 vect, u32 oldPC, u32 oldSR)\r
{\r
u32 newPC;\r
//u32 oldSR = GET_SR;\r
\r
- m68kcontext.io_cycle_counter -= exception_cycle_table[vect];\r
+ ctx->io_cycle_counter -= exception_cycle_table[vect];\r
#ifdef FAMEC_EMULATE_TRACE\r
- m68kcontext.execinfo &= ~FM68K_EMULATE_TRACE;\r
+ ctx->execinfo &= ~FM68K_EMULATE_TRACE;\r
#endif\r
\r
PRE_IO\r
return newPC;\r
}\r
\r
-static FAMEC_EXTRA_INLINE u32 execute_exception_group_0(s32 vect, s32 addr, u16 spec_info, u32 oldSR)\r
+static FAMEC_EXTRA_INLINE u32 execute_exception_group_0(M68K_CONTEXT *ctx, s32 vect, s32 addr, u16 spec_info, u32 oldSR)\r
{\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
+ newPC = execute_exception(ctx, vect, addr, oldSR);\r
+ //if (!(ctx->icust_handler && ctx->icust_handler[vect]))\r
{\r
PUSH_16_F(inst_reg);\r
PUSH_32_F(addr);\r
\r
#ifdef FAMEC_NO_GOTOS\r
\r
-#define OPCODE(N_OP) static void OP_##N_OP(void)\r
+#define OPCODE(N_OP) static void OP_##N_OP(M68K_CONTEXT *ctx)\r
#define CAST_OP(N_OP) (opcode_func)&OP_##N_OP\r
#include "famec_opcodes.h"\r
#endif\r
}\r
#endif // FAMEC_NO_GOTOS\r
\r
- g_m68kcontext = ctx;\r
-\r
// won't emulate double fault\r
- // if (m68kcontext.execinfo & M68K_FAULTED) return -1;\r
+ // if (ctx->execinfo & M68K_FAULTED) return -1;\r
\r
// Cache PPL\r
flag_I = M68K_PPL;\r
\r
- if (m68kcontext.execinfo & FM68K_HALTED)\r
+ if (ctx->execinfo & FM68K_HALTED)\r
{\r
- if (interrupt_chk__() <= 0)\r
+ if (interrupt_chk__(ctx) <= 0)\r
{\r
return cycles;\r
}\r
- m68kcontext.execinfo &= ~FM68K_HALTED;\r
+ ctx->execinfo &= ~FM68K_HALTED;\r
}\r
\r
#ifdef FAMEC_DEBUG\r
#endif\r
\r
/* Poner la CPU en estado de ejecucion */\r
- m68kcontext.execinfo |= M68K_RUNNING;\r
+ ctx->execinfo |= M68K_RUNNING;\r
\r
// Cache SR\r
- SET_SR(m68kcontext.sr)\r
+ SET_SR(ctx->sr)\r
\r
// Fijar PC\r
- SET_PC(m68kcontext.pc)\r
+ SET_PC(ctx->pc)\r
\r
#ifdef FAMEC_DEBUG\r
printf("PC: %p\n",PC);\r
#endif\r
\r
/* guardar ciclos de ejecucion solicitados */\r
- m68kcontext.io_cycle_counter = cycles;\r
+ ctx->io_cycle_counter = cycles;\r
cycles_needed = 0;\r
\r
#ifdef FAMEC_EMULATE_TRACE\r
- if (!(m68kcontext.execinfo & FM68K_EMULATE_TRACE))\r
+ if (!(ctx->execinfo & FM68K_EMULATE_TRACE))\r
#endif\r
{\r
- s32 line=interrupt_chk__();\r
+ s32 line=interrupt_chk__(ctx);\r
if (line>0)\r
{\r
/* comprobar si hay rutina de acknowledge */\r
- if (m68kcontext.iack_handler != NULL)\r
- m68kcontext.iack_handler(line);\r
+ if (ctx->iack_handler != NULL)\r
+ ctx->iack_handler(line);\r
else\r
- m68kcontext.interrupts[0] = 0;\r
+ ctx->interrupts[0] = 0;\r
\r
- SET_PC(execute_exception(line + 0x18, GET_PC, GET_SR));\r
+ SET_PC(execute_exception(ctx, line + 0x18, GET_PC, GET_SR));\r
flag_I = (u32)line;\r
- if (m68kcontext.io_cycle_counter <= 0) goto famec_End;\r
+ if (ctx->io_cycle_counter <= 0) goto famec_End;\r
}\r
#ifdef FAMEC_EMULATE_TRACE\r
else\r
if (flag_T)\r
{\r
- m68kcontext.execinfo |= FM68K_EMULATE_TRACE;\r
- cycles_needed = m68kcontext.io_cycle_counter;\r
- m68kcontext.io_cycle_counter=0;\r
+ ctx->execinfo |= FM68K_EMULATE_TRACE;\r
+ cycles_needed = ctx->io_cycle_counter;\r
+ ctx->io_cycle_counter=0;\r
}\r
#endif\r
}\r
#endif\r
\r
#ifdef FAMEC_EMULATE_TRACE\r
- if (m68kcontext.execinfo & FM68K_EMULATE_TRACE)\r
+ if (ctx->execinfo & FM68K_EMULATE_TRACE)\r
{\r
- m68kcontext.io_cycle_counter += cycles_needed;\r
+ ctx->io_cycle_counter += cycles_needed;\r
cycles_needed = 0;\r
- m68kcontext.execinfo &= ~FM68K_EMULATE_TRACE;\r
- m68kcontext.execinfo |= FM68K_DO_TRACE;\r
- SET_PC(execute_exception(M68K_TRACE_EX, GET_PC, GET_SR));\r
- if (m68kcontext.io_cycle_counter > 0)\r
+ ctx->execinfo &= ~FM68K_EMULATE_TRACE;\r
+ ctx->execinfo |= FM68K_DO_TRACE;\r
+ SET_PC(execute_exception(ctx, M68K_TRACE_EX, GET_PC, GET_SR));\r
+ if (ctx->io_cycle_counter > 0)\r
{\r
//NEXT\r
goto famec_Exec;\r
if (cycles_needed != 0)\r
{\r
u32 line;\r
- m68kcontext.io_cycle_counter += cycles_needed;\r
+ ctx->io_cycle_counter += cycles_needed;\r
cycles_needed = 0;\r
- //if (m68kcontext.io_cycle_counter <= 0) goto famec_End;\r
- line=interrupt_chk__();\r
+ //if (ctx->io_cycle_counter <= 0) goto famec_End;\r
+ line=interrupt_chk__(ctx);\r
if (line>0)\r
{\r
- if (m68kcontext.iack_handler != NULL)\r
- m68kcontext.iack_handler(line);\r
+ if (ctx->iack_handler != NULL)\r
+ ctx->iack_handler(line);\r
else\r
- m68kcontext.interrupts[0] = 0;\r
+ ctx->interrupts[0] = 0;\r
\r
- SET_PC(execute_exception(line + 0x18, GET_PC, GET_SR));\r
+ SET_PC(execute_exception(ctx, line + 0x18, GET_PC, GET_SR));\r
flag_I = (u32)line;\r
}\r
#ifdef FAMEC_EMULATE_TRACE\r
if (!(flag_T))\r
#endif\r
- if (m68kcontext.io_cycle_counter > 0)\r
+ if (ctx->io_cycle_counter > 0)\r
{\r
//NEXT\r
goto famec_Exec;\r
}\r
\r
famec_End:\r
- m68kcontext.sr = GET_SR;\r
- m68kcontext.pc = GET_PC;\r
+ ctx->sr = GET_SR;\r
+ ctx->pc = GET_PC;\r
\r
- m68kcontext.execinfo &= ~M68K_RUNNING;\r
+ ctx->execinfo &= ~M68K_RUNNING;\r
\r
#ifdef FAMEC_DEBUG\r
printf("En really end...\n");\r
printf("PC: %p\n",PC);\r
printf("BasePC: 0x%08x\n",BasePC);\r
- printf("pc: 0x%08x\n",m68kcontext.pc);\r
+ printf("pc: 0x%08x\n",ctx->pc);\r
#endif\r
\r
- return cycles - m68kcontext.io_cycle_counter;\r
+ return cycles - ctx->io_cycle_counter;\r
\r
#ifndef FAMEC_NO_GOTOS\r
init_jump_table:\r
#ifdef PICODRIVE_HACK
-#define NOT_POLLING g_m68kcontext->not_polling = 1;
+#define NOT_POLLING ctx->not_polling = 1;
#else
#define NOT_POLLING
#endif
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
#ifdef USE_CYCLONE_TIMING
RET(0)
#else
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(20)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(0)
}
RET(20)
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
flag_C = 0;
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(12)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(16)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(16)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(18)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(20)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(22)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(20)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(24)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(20)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(22)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(16)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(16)
}
else
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
RET(18)
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(8)
#else
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
- m68kcontext.io_cycle_counter -= (dst - adr) * 2;
+ ctx->io_cycle_counter -= (dst - adr) * 2;
RET(8)
}
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(14)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
} while (res >>= 1);
AREG(7) = adr;
POST_IO
- m68kcontext.io_cycle_counter -= (dst - adr) * 2;
+ ctx->io_cycle_counter -= (dst - adr) * 2;
RET(8)
}
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(8)
#else
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
- m68kcontext.io_cycle_counter -= (dst - adr) * 2;
+ ctx->io_cycle_counter -= (dst - adr) * 2;
RET(8)
}
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(14)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
} while (res >>= 1);
AREG(7) = adr;
POST_IO
- m68kcontext.io_cycle_counter -= (dst - adr) * 2;
+ ctx->io_cycle_counter -= (dst - adr) * 2;
RET(8)
}
flag_NotZ = res;
flag_N = res;
#ifdef PICODRIVE_HACK
- if (g_m68kcontext == &PicoCpuFS68k) {
+ if (ctx == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
flag_N = res;
#ifdef PICODRIVE_HACK
- if (g_m68kcontext == &PicoCpuFS68k) {
+ if (ctx == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
flag_N = res;
#ifdef PICODRIVE_HACK
- if (g_m68kcontext == &PicoCpuFS68k) {
+ if (ctx == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
flag_N = res;
#ifdef PICODRIVE_HACK
- if (g_m68kcontext == &PicoCpuFS68k) {
+ if (ctx == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
flag_N = res;
#ifdef PICODRIVE_HACK
- if (g_m68kcontext == &PicoCpuFS68k) {
+ if (ctx == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
flag_N = res;
#ifdef PICODRIVE_HACK
- if (g_m68kcontext == &PicoCpuFS68k) {
+ if (ctx == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
flag_N = res;
#ifdef PICODRIVE_HACK
- if (g_m68kcontext == &PicoCpuFS68k) {
+ if (ctx == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
flag_N = res;
#ifdef PICODRIVE_HACK
- if (g_m68kcontext == &PicoCpuFS68k) {
+ if (ctx == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
flag_N = res;
#ifdef PICODRIVE_HACK
- if (g_m68kcontext == &PicoCpuFS68k) {
+ if (ctx == &PicoCpuFS68k) {
res |= 0x80;
WRITE_BYTE_F(adr, res);
}
extern void SekFinishIdleDet(void);
SekFinishIdleDet();
#endif
- SET_PC(execute_exception(M68K_ILLEGAL_INSTRUCTION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ILLEGAL_INSTRUCTION_EX, GET_PC-2, GET_SR));
RET(0)
}
// ILLEGAL A000-AFFF
OPCODE(0xA000)
{
- SET_PC(execute_exception(M68K_1010_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_1010_EX, GET_PC-2, GET_SR));
RET(0)
}
// ILLEGAL F000-FFFF
OPCODE(0xF000)
{
- SET_PC(execute_exception(M68K_1111_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_1111_EX, GET_PC-2, GET_SR));
RET(0) // 4 already taken by exc. handler
}
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
RET(12)
}
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(20)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
} while (res >>= 1);
AREG(7) = adr;
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
RET(12)
}
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(12)
#else
} while (res >>= 1);
AREG((Opcode >> 0) & 7) = adr;
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
RET(12)
}
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(20)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(16)
#else
psrc++;
} while (res >>= 1);
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
#ifdef USE_CYCLONE_TIMING
RET(18)
#else
} while (res >>= 1);
AREG(7) = adr;
POST_IO
- m68kcontext.io_cycle_counter -= (adr - dst) * 2;
+ ctx->io_cycle_counter -= (adr - dst) * 2;
RET(12)
}
// TRAP
OPCODE(0x4E40)
{
- SET_PC(execute_exception(M68K_TRAP_BASE_EX + (Opcode & 0xF), GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_TRAP_BASE_EX + (Opcode & 0xF), GET_PC, GET_SR));
RET(4)
}
if (!flag_S)
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
res = AREGu32((Opcode >> 0) & 7);
if (!flag_S)
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
res = ASP;
if (!flag_S)
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
PRE_IO
- if (m68kcontext.reset_handler) m68kcontext.reset_handler();
+ if (ctx->reset_handler) ctx->reset_handler();
// CPU->Reset_CallBack();
POST_IO
RET(132)
if (!flag_S)
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
FETCH_WORD(res);
AREG(7) = ASP;
ASP = res;
}
- m68kcontext.execinfo |= FM68K_HALTED;
+ ctx->execinfo |= FM68K_HALTED;
RET0()
}
if (!flag_S)
{
- SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
RET(4)
}
PRE_IO
ASP = res;
}
POST_IO
- m68kcontext.execinfo &= ~(FM68K_EMULATE_GROUP_0|FM68K_EMULATE_TRACE|FM68K_DO_TRACE);
+ ctx->execinfo &= ~(FM68K_EMULATE_GROUP_0|FM68K_EMULATE_TRACE|FM68K_DO_TRACE);
CHECK_INT_TO_JUMP(20)
RET(20)
}
OPCODE(0x4E76)
{
if (flag_V & 0x80)
- SET_PC(execute_exception(M68K_TRAPV_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_TRAPV_EX, GET_PC, GET_SR));
RET(4)
}
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
RET(10)
}
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(14)
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(14)
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(16)
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(18)
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(20)
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(18)
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(22)
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(18)
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(20)
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(14)
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(14)
if ((res < 0) || (res > src))
{
flag_N = res >> 8;
- SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_CHK_EX, GET_PC, GET_SR));
}
POST_IO
RET(16)
if (flag_NotZ && (!(flag_C & 0x100)))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if ((!flag_NotZ) || (flag_C & 0x100))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if (!(flag_C & 0x100))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if (flag_C & 0x100)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if (flag_NotZ)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if (!flag_NotZ)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if (!(flag_V & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if (flag_V & 0x80)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if (!(flag_N & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if (flag_N & 0x80)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if (!((flag_N ^ flag_V) & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if ((flag_N ^ flag_V) & 0x80)
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
{
PC += ((s8)(Opcode & 0xFE)) >> 1;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}
src = DREGu16((Opcode >> 0) & 7);
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(140)
#else
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(146)
#else
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(148)
#else
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(150)
#else
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(148)
#else
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(152)
#else
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(148)
#else
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(150)
#else
FETCH_WORD(src);
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
RET(144)
#else
READ_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, 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)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81C0;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81C0: m68kcontext.io_cycle_counter -= 50;
+end81C0: ctx->io_cycle_counter -= 50;
#endif
RET(108)
}
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81D0;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81D0: m68kcontext.io_cycle_counter -= 50;
+end81D0: ctx->io_cycle_counter -= 50;
#endif
RET(112)
}
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81D8;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81D8: m68kcontext.io_cycle_counter -= 50;
+end81D8: ctx->io_cycle_counter -= 50;
#endif
RET(112)
}
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81E0;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81E0: m68kcontext.io_cycle_counter -= 50;
+end81E0: ctx->io_cycle_counter -= 50;
#endif
RET(114)
}
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81E8;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81E8: m68kcontext.io_cycle_counter -= 50;
+end81E8: ctx->io_cycle_counter -= 50;
#endif
RET(116)
}
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81F0;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81F0: m68kcontext.io_cycle_counter -= 50;
+end81F0: ctx->io_cycle_counter -= 50;
#endif
RET(118)
}
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81F8;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81F8: m68kcontext.io_cycle_counter -= 50;
+end81F8: ctx->io_cycle_counter -= 50;
#endif
RET(116)
}
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81F9;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81F9: m68kcontext.io_cycle_counter -= 50;
+end81F9: ctx->io_cycle_counter -= 50;
#endif
RET(120)
}
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81FA;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81FA: m68kcontext.io_cycle_counter -= 50;
+end81FA: ctx->io_cycle_counter -= 50;
#endif
RET(116)
}
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81FB;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81FB: m68kcontext.io_cycle_counter -= 50;
+end81FB: ctx->io_cycle_counter -= 50;
#endif
RET(118)
}
FETCH_SWORD(src);
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81FC;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81FC: m68kcontext.io_cycle_counter -= 50;
+end81FC: ctx->io_cycle_counter -= 50;
#endif
RET(112)
}
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81DF;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81DF: m68kcontext.io_cycle_counter -= 50;
+end81DF: ctx->io_cycle_counter -= 50;
#endif
RET(112)
}
READSX_WORD_F(adr, src)
if (src == 0)
{
- SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
+ SET_PC(execute_exception(ctx, M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
#ifdef USE_CYCLONE_TIMING_DIV
goto end81E7;
#endif
DREGu32((Opcode >> 9) & 7) = res;
}
#ifdef USE_CYCLONE_TIMING_DIV
-end81E7: m68kcontext.io_cycle_counter -= 50;
+end81E7: ctx->io_cycle_counter -= 50;
#endif
RET(114)
}
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
dst = DREGu8((Opcode >> 9) & 7);
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
dst = DREGu8((Opcode >> 9) & 7);
u32 src, dst;
// can't read byte from Ax registers !
- m68kcontext.execinfo |= M68K_FAULTED;
- m68kcontext.io_cycle_counter = 0;
+ ctx->execinfo |= M68K_FAULTED;
+ ctx->io_cycle_counter = 0;
/*
goto famec_Exec_End;
dst = DREGu8((Opcode >> 9) & 7);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = (s32)DREGs8((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = (s32)DREGs16((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = (s32)DREGs32((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
flag_N = flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
flag_N = flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_N = flag_V = 0;
flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 0;
res = (src >> sft) | (src << (9 - sft));
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 8;
res = (src >> sft) | (src << (17 - sft));
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
if (sft == 1) res = (src >> 1) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1)));
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
if (sft < 8)
{
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
flag_X = flag_C = src >> (8 - sft);
res = src << sft;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_X = flag_C = src >> (24 - sft);
res = src << sft;
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src << (0 + sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src >> (8 - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_V = 0;
flag_X = flag_C = src >> (24 - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 0;
res = (src << sft) | (src >> (9 - sft));
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
src |= (flag_X & M68K_SR_X) << 8;
res = (src << sft) | (src >> (17 - sft));
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_C = src >> ((32 - M68K_SR_C_SFT) - sft);
if (sft == 1) res = (src << 1) | ((flag_X & M68K_SR_X) >> ((M68K_SR_X_SFT + 1) - 1));
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu8((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src << (0 + sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu16((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src >> (8 - sft);
u32 sft;
sft = (((Opcode >> 9) - 1) & 7) + 1;
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
src = DREGu32((Opcode >> 0) & 7);
flag_V = 0;
flag_C = src >> (24 - sft);
src = (s32)DREGs8((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft < 8)
{
flag_V = 0;
src = (s32)DREGs16((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft < 16)
{
flag_V = 0;
src = (s32)DREGs32((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft < 32)
{
flag_V = 0;
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft <= 8)
{
flag_N = flag_V = 0;
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft <= 16)
{
flag_N = flag_V = 0;
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft < 32)
{
flag_N = flag_V = 0;
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
sft %= 9;
src |= (flag_X & M68K_SR_X) << 0;
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
sft %= 17;
src |= (flag_X & M68K_SR_X) << 8;
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
sft %= 33;
if (sft != 0)
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
sft &= 0x07;
flag_C = src << (M68K_SR_C_SFT - ((sft - 1) & 7));
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
sft &= 0x0F;
flag_C = (src >> ((sft - 1) & 15)) << M68K_SR_C_SFT;
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
sft &= 0x1F;
flag_C = (src >> ((sft - 1) & 31)) << M68K_SR_C_SFT;
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft < 8)
{
flag_X = flag_C = (src << sft) >> 0;
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft < 16)
{
flag_X = flag_C = (src << sft) >> 8;
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft < 32)
{
flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft <= 8)
{
flag_X = flag_C = (src << sft) >> 0;
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft <= 16)
{
flag_X = flag_C = (src << sft) >> 8;
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft < 32)
{
flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
sft %= 9;
src |= (flag_X & M68K_SR_X) << 0;
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
sft %= 17;
src |= (flag_X & M68K_SR_X) << 8;
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
sft %= 33;
if (sft != 0)
src = DREGu8((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft &= 0x07)
{
flag_C = (src << sft) >> 0;
src = DREGu16((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft &= 0x0F)
{
flag_C = (src << sft) >> 8;
src = DREGu32((Opcode >> 0) & 7);
if (sft)
{
- m68kcontext.io_cycle_counter -= sft * 2;
+ ctx->io_cycle_counter -= sft * 2;
if (sft &= 0x1F)
{
flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
if ( Opcode & 0x0100) newop |= 0x400; // beq
if (!(Opcode & 0x0f00)) newop |= 0xc00; // bra
- ret = SekRegisterIdlePatch(GET_PC - 2, Opcode, newop, &m68kcontext);
+ ret = SekRegisterIdlePatch(GET_PC - 2, Opcode, newop, ctx);
switch (ret)
{
case 0: PC[-1] = newop; break;
if (cond_true)
{
PC = dest_pc;
- m68kcontext.io_cycle_counter -= 2;
+ ctx->io_cycle_counter -= 2;
}
RET(8)
}