AREG(7) = ASP;
ASP = res;
}
+ CHECK_BRANCH_EXCEPTION(res)
POST_IO
ctx->execinfo &= ~(FM68K_EMULATE_GROUP_0|FM68K_EMULATE_TRACE|FM68K_DO_TRACE);
CHECK_INT_TO_JUMP(20)
addq 8 . d 0101...000000... .......... U U U U 4 4 2 2\r
addq 8 . . 0101...000...... A+-DXWL... U U U U 8 8 4 4\r
addq 16 . d 0101...001000... .......... U U U U 4 4 2 2\r
-addq 16 . a 0101...001001... .......... U U U U 4 4 2 2\r
+addq 16 . a 0101...001001... .......... U U U U 8 8 2 2\r
addq 16 . . 0101...001...... A+-DXWL... U U U U 8 8 4 4\r
addq 32 . d 0101...010000... .......... U U U U 8 8 2 2\r
addq 32 . a 0101...010001... .......... U U U U 8 8 2 2\r
/* ================================= DATA ================================= */\r
/* ======================================================================== */\r
\r
-int m68ki_initial_cycles;\r
+//int m68ki_initial_cycles;\r
//int m68ki_remaining_cycles = 0; /* Number of clocks remaining */\r
uint m68ki_tracing = 0;\r
uint m68ki_address_space;\r
m68ki_instruction_jump_table[REG_IR]();\r
USE_CYCLES(CYC_INSTRUCTION[REG_IR]); // moving this up may cause a deadlock\r
\r
+ /* ASG: update cycles */\r
+ USE_CYCLES(CPU_INT_CYCLES);\r
+ CPU_INT_CYCLES = 0;\r
+\r
/* Trace m68k_exception, if necessary */\r
m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */\r
\r
/* set previous PC to current PC for the next entry into the loop */\r
REG_PPC = REG_PC;\r
\r
- /* ASG: update cycles */\r
- USE_CYCLES(CPU_INT_CYCLES);\r
- CPU_INT_CYCLES = 0;\r
-\r
/* return how many clocks we used */\r
return m68ki_initial_cycles - GET_CYCLES();\r
}\r
void (*instr_hook_callback)(void); /* Called every instruction cycle prior to execution */\r
\r
// notaz\r
+ sint cyc_initial_cycles;\r
sint cyc_remaining_cycles;\r
sint not_polling;\r
} m68ki_cpu_core;\r
// notaz\r
extern m68ki_cpu_core *m68ki_cpu_p;\r
#define m68ki_cpu (*m68ki_cpu_p)\r
+#define m68ki_initial_cycles m68ki_cpu_p->cyc_initial_cycles\r
#define m68ki_remaining_cycles m68ki_cpu_p->cyc_remaining_cycles\r
\r
\r
strcmp(op->name, "suba") == 0))\r
return op->cycles[cpu_type] + g_ea_cycle_table[ea_mode][cpu_type][size] + 2;\r
\r
+ if(cpu_type == CPU_TYPE_000 && ea_mode == EA_MODE_I && op->size == 8 && strcmp(op->name, "btst") == 0)\r
+ return op->cycles[cpu_type] + g_ea_cycle_table[ea_mode][cpu_type][size] + 2;\r
+\r
if(strcmp(op->name, "jmp") == 0)\r
return op->cycles[cpu_type] + g_jmp_cycle_table[ea_mode];\r
if(strcmp(op->name, "jsr") == 0)\r
#define SekSr m68k_get_reg(&PicoCpuMM68k, M68K_REG_SR)\r
#define SekSrS68k m68k_get_reg(&PicoCpuMS68k, M68K_REG_SR)\r
#define SekSetStop(x) { \\r
- if(x) { SET_CYCLES(0); PicoCpuMM68k.stopped=STOP_LEVEL_STOP; } \\r
+ if(x) { PicoCpuMM68k.cyc_remaining_cycles = 0; PicoCpuMM68k.stopped=STOP_LEVEL_STOP; } \\r
else PicoCpuMM68k.stopped=0; \\r
}\r
#define SekSetStopS68k(x) { \\r
- if(x) { SET_CYCLES(0); PicoCpuMS68k.stopped=STOP_LEVEL_STOP; } \\r
+ if(x) { PicoCpuMS68k.cyc_remaining_cycles = 0; PicoCpuMS68k.stopped=STOP_LEVEL_STOP; } \\r
else PicoCpuMS68k.stopped=0; \\r
}\r
#define SekIsStoppedM68k() (PicoCpuMM68k.stopped==STOP_LEVEL_STOP)\r
#define SekIsStoppedS68k() (PicoCpuMS68k.stopped==STOP_LEVEL_STOP)\r
-#define SekShouldInterrupt() (CPU_INT_LEVEL > FLAG_INT_MASK)\r
+#define SekShouldInterrupt() (PicoCpuMM68k.int_level > PicoCpuMM68k.int_mask)\r
\r
#define SekNotPolling PicoCpuMM68k.not_polling\r
#define SekNotPollingS68k PicoCpuMS68k.not_polling\r