"\n"\r
"This code may be freely used for non-commercial purpooses as long as this\n"\r
"copyright notice remains unaltered in the source code and any binary files\n"\r
"\n"\r
"This code may be freely used for non-commercial purpooses as long as this\n"\r
"copyright notice remains unaltered in the source code and any binary files\n"\r
/* ================================ INCLUDES ============================== */\r
/* ======================================================================== */\r
\r
/* ================================ INCLUDES ============================== */\r
/* ======================================================================== */\r
\r
\r
/* ======================================================================== */\r
/* ================================= DATA ================================= */\r
/* ======================================================================== */\r
\r
\r
/* ======================================================================== */\r
/* ================================= DATA ================================= */\r
/* ======================================================================== */\r
\r
-// int m68ki_initial_cycles; // moved to m68k_execute() stack\r
-// int m68ki_remaining_cycles = 0; /* Number of clocks remaining */\r
+int m68ki_initial_cycles;\r
+//int m68ki_remaining_cycles = 0; /* Number of clocks remaining */\r
/* Called when the program counter changed by a large value */\r
static unsigned int default_pc_changed_callback_data;\r
static void default_pc_changed_callback(unsigned int new_pc)\r
/* Called when the program counter changed by a large value */\r
static unsigned int default_pc_changed_callback_data;\r
static void default_pc_changed_callback(unsigned int new_pc)\r
void m68k_set_pc_changed_callback(void (*callback)(unsigned int new_pc))\r
{\r
CALLBACK_PC_CHANGED = callback ? callback : default_pc_changed_callback;\r
void m68k_set_pc_changed_callback(void (*callback)(unsigned int new_pc))\r
{\r
CALLBACK_PC_CHANGED = callback ? callback : default_pc_changed_callback;\r
/* Set our pool of clock cycles available */\r
SET_CYCLES(num_cycles);\r
m68ki_initial_cycles = num_cycles;\r
/* Set our pool of clock cycles available */\r
SET_CYCLES(num_cycles);\r
m68ki_initial_cycles = num_cycles;\r
m68ki_set_address_error_trap(); /* auto-disable (see m68kcpu.h) */\r
\r
/* Main loop. Keep going until we run out of clock cycles */\r
m68ki_set_address_error_trap(); /* auto-disable (see m68kcpu.h) */\r
\r
/* Main loop. Keep going until we run out of clock cycles */\r
/* Read an instruction and call its handler */\r
REG_IR = m68ki_read_imm_16();\r
m68ki_instruction_jump_table[REG_IR]();\r
/* Read an instruction and call its handler */\r
REG_IR = m68ki_read_imm_16();\r
m68ki_instruction_jump_table[REG_IR]();\r
\r
/* Trace m68k_exception, if necessary */\r
m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */\r
\r
/* Trace m68k_exception, if necessary */\r
m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */\r
\r
/* ASG: rewrote so that the int_level is a mask of the IPL0/IPL1/IPL2 bits */\r
/* KS: Modified so that IPL* bits match with mask positions in the SR\r
\r
/* ASG: rewrote so that the int_level is a mask of the IPL0/IPL1/IPL2 bits */\r
/* KS: Modified so that IPL* bits match with mask positions in the SR\r
m68k_set_reset_instr_callback(NULL);\r
m68k_set_cmpild_instr_callback(NULL);\r
m68k_set_rte_instr_callback(NULL);\r
m68k_set_reset_instr_callback(NULL);\r
m68k_set_cmpild_instr_callback(NULL);\r
m68k_set_rte_instr_callback(NULL);\r
m68k_set_pc_changed_callback(NULL);\r
m68k_set_fc_callback(NULL);\r
m68k_set_instr_hook_callback(NULL);\r
m68k_set_pc_changed_callback(NULL);\r
m68k_set_fc_callback(NULL);\r
m68k_set_instr_hook_callback(NULL);\r
unsigned int m68k_get_context(void* dst)\r
{\r
if(dst) *(m68ki_cpu_core*)dst = m68ki_cpu;\r
return sizeof(m68ki_cpu_core);\r
}\r
unsigned int m68k_get_context(void* dst)\r
{\r
if(dst) *(m68ki_cpu_core*)dst = m68ki_cpu;\r
return sizeof(m68ki_cpu_core);\r
}\r