diff options
author | 2008-11-06 18:42:37 +0000 | |
---|---|---|
committer | 2008-11-06 18:42:37 +0000 | |
commit | b44da3b748d0ef6fa95e1c39f556e5e3cff5169b (patch) | |
tree | 2a7acc4cfab418620bfc99ec6f460f32475bb934 /src/emu/cpu/mc68hc11 | |
parent | 1228d0ad9ea3fa2fb7a3b88357ba286247fc8826 (diff) |
WARNING: This is a significant change. If you are risk-averse and
working on something, hold off syncing.
Defined macros for core CPU functions: CPU_INIT, CPU_RESET, CPU_EXIT,
CPU_EXECUTE, along with macros for the name and for calling, in the
spirit of the devintrf.h macros. More will come later.
Changed init, reset, exit, and execute interfaces to be passed a
const device_config * object. This is a fake object for the moment,
but encapsulates the machine pointer and token. Eventually this will
be a real device.
Changed the CPU IRQ callbacks to a proper type, and added a device
parameter to them.
Updated all CPU cores to the new macros and parameters.
Note that this changes the way we "pointer"-ify cores. I'll send an
update shortly.
Diffstat (limited to 'src/emu/cpu/mc68hc11')
-rw-r--r-- | src/emu/cpu/mc68hc11/mc68hc11.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/emu/cpu/mc68hc11/mc68hc11.c b/src/emu/cpu/mc68hc11/mc68hc11.c index 66f1f61a9ea..6376b651a9f 100644 --- a/src/emu/cpu/mc68hc11/mc68hc11.c +++ b/src/emu/cpu/mc68hc11/mc68hc11.c @@ -52,7 +52,8 @@ typedef struct UINT8 adctl; int ad_channel; - int (*irq_callback)(int irqline); + cpu_irq_callback irq_callback; + const device_config *device; int icount; int ram_position; int reg_position; @@ -313,7 +314,7 @@ static void (*hc11_optable_page4[256])(void); #include "hc11ops.c" #include "hc11ops.h" -static void hc11_init(int index, int clock, const void *config, int (*irqcallback)(int)) +static CPU_INIT( hc11 ) { int i; @@ -350,14 +351,15 @@ static void hc11_init(int index, int clock, const void *config, int (*irqcallbac hc11.reg_position = 0; hc11.ram_position = 0x100; hc11.irq_callback = irqcallback; + hc11.device = device; } -static void hc11_reset(void) +static CPU_RESET( hc11 ) { hc11.pc = READ16(0xfffe); } -static void hc11_exit(void) +static CPU_EXIT( hc11 ) { } @@ -377,7 +379,7 @@ static void hc11_set_context(void *src) change_pc(hc11.pc); } -static int hc11_execute(int cycles) +static CPU_EXECUTE( hc11 ) { hc11.icount = cycles; @@ -454,10 +456,10 @@ void mc68hc11_get_info(UINT32 state, cpuinfo *info) case CPUINFO_PTR_SET_INFO: info->setinfo = mc68hc11_set_info; break; case CPUINFO_PTR_GET_CONTEXT: info->getcontext = hc11_get_context; break; case CPUINFO_PTR_SET_CONTEXT: info->setcontext = hc11_set_context; break; - case CPUINFO_PTR_INIT: info->init = hc11_init; break; - case CPUINFO_PTR_RESET: info->reset = hc11_reset; break; - case CPUINFO_PTR_EXIT: info->exit = hc11_exit; break; - case CPUINFO_PTR_EXECUTE: info->execute = hc11_execute; break; + case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(hc11); break; + case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(hc11); break; + case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(hc11); break; + case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(hc11); break; case CPUINFO_PTR_BURN: info->burn = NULL; break; case CPUINFO_PTR_DISASSEMBLE: info->disassemble = hc11_disasm; break; case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &hc11.icount; break; |