summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/m6800/m6800.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/cpu/m6800/m6800.c')
-rw-r--r--src/emu/cpu/m6800/m6800.c57
1 files changed, 28 insertions, 29 deletions
diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c
index d8e1820619e..28e3664c17b 100644
--- a/src/emu/cpu/m6800/m6800.c
+++ b/src/emu/cpu/m6800/m6800.c
@@ -112,7 +112,7 @@ struct _m6800_state
UINT8 irq_state[2]; /* IRQ line state [IRQ1,TIN] */
UINT8 ic_eddge; /* InputCapture eddge , b.0=fall,b.1=raise */
- cpu_irq_callback irq_callback;
+ device_irq_callback irq_callback;
running_device *device;
/* Memory spaces */
@@ -156,8 +156,7 @@ struct _m6800_state
INLINE m6800_state *get_safe_token(running_device *device)
{
assert(device != NULL);
- assert(device->token != NULL);
- assert(device->type == CPU);
+ assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_M6800 ||
cpu_get_type(device) == CPU_M6801 ||
cpu_get_type(device) == CPU_M6802 ||
@@ -165,7 +164,7 @@ INLINE m6800_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_M6808 ||
cpu_get_type(device) == CPU_HD63701 ||
cpu_get_type(device) == CPU_NSC8105);
- return (m6800_state *)device->token;
+ return (m6800_state *)downcast<cpu_device *>(device)->token();
}
#if 0
@@ -898,9 +897,9 @@ static CPU_INIT( m6800 )
{
m6800_state *cpustate = get_safe_token(device);
- cpustate->program = device->space(AS_PROGRAM);
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->program = device_memory(device)->space(AS_PROGRAM);
+ cpustate->data = device_memory(device)->space(AS_DATA);
+ cpustate->io = device_memory(device)->space(AS_IO);
// cpustate->subtype = SUBTYPE_M6800;
cpustate->insn = m6800_insn;
@@ -1294,11 +1293,11 @@ static CPU_INIT( m6801 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->program = device_memory(device)->space(AS_PROGRAM);
+ cpustate->data = device_memory(device)->space(AS_DATA);
+ cpustate->io = device_memory(device)->space(AS_IO);
- cpustate->clock = device->clock / 4;
+ cpustate->clock = device->clock() / 4;
cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate);
cpustate->m6800_tx_timer = timer_alloc(device->machine, m6800_tx_tick, cpustate);
@@ -1317,9 +1316,9 @@ static CPU_INIT( m6802 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->program = device_memory(device)->space(AS_PROGRAM);
+ cpustate->data = device_memory(device)->space(AS_DATA);
+ cpustate->io = device_memory(device)->space(AS_IO);
state_register(cpustate, "m6802");
}
@@ -1336,11 +1335,11 @@ static CPU_INIT( m6803 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->program = device_memory(device)->space(AS_PROGRAM);
+ cpustate->data = device_memory(device)->space(AS_DATA);
+ cpustate->io = device_memory(device)->space(AS_IO);
- cpustate->clock = device->clock / 4;
+ cpustate->clock = device->clock() / 4;
cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate);
cpustate->m6800_tx_timer = timer_alloc(device->machine, m6800_tx_tick, cpustate);
@@ -1670,9 +1669,9 @@ static CPU_INIT( m6808 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->program = device_memory(device)->space(AS_PROGRAM);
+ cpustate->data = device_memory(device)->space(AS_DATA);
+ cpustate->io = device_memory(device)->space(AS_IO);
state_register(cpustate, "m6808");
}
@@ -1690,11 +1689,11 @@ static CPU_INIT( hd63701 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->program = device_memory(device)->space(AS_PROGRAM);
+ cpustate->data = device_memory(device)->space(AS_DATA);
+ cpustate->io = device_memory(device)->space(AS_IO);
- cpustate->clock = device->clock / 4;
+ cpustate->clock = device->clock() / 4;
cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate);
cpustate->m6800_tx_timer = timer_alloc(device->machine, m6800_tx_tick, cpustate);
@@ -2038,9 +2037,9 @@ static CPU_INIT( nsc8105 )
// cpustate->subtype = SUBTYPE_NSC8105;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
- cpustate->data = device->space(AS_DATA);
- cpustate->io = device->space(AS_IO);
+ cpustate->program = device_memory(device)->space(AS_PROGRAM);
+ cpustate->data = device_memory(device)->space(AS_DATA);
+ cpustate->io = device_memory(device)->space(AS_IO);
cpustate->insn = nsc8105_insn;
cpustate->cycles = cycles_nsc8105;
@@ -2672,7 +2671,7 @@ static CPU_SET_INFO( m6800 )
CPU_GET_INFO( m6800 )
{
- m6800_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
+ m6800_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL;
switch (state)
{
/* --- the following bits of info are returned as 64-bit signed integers --- */