summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/z8000/z8000.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/cpu/z8000/z8000.c')
-rw-r--r--src/emu/cpu/z8000/z8000.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c
index 0aeffe20358..6eed70a3411 100644
--- a/src/emu/cpu/z8000/z8000.c
+++ b/src/emu/cpu/z8000/z8000.c
@@ -81,7 +81,7 @@ struct _z8000_state
z8000_reg_file regs;/* registers */
int nmi_state; /* NMI line state */
int irq_state[2]; /* IRQ line states (NVI, VI) */
- cpu_irq_callback irq_callback;
+ device_irq_callback irq_callback;
running_device *device;
const address_space *program;
const address_space *io;
@@ -93,10 +93,9 @@ struct _z8000_state
INLINE z8000_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_Z8001 || cpu_get_type(device) == CPU_Z8002);
- return (z8000_state *)device->token;
+ return (z8000_state *)downcast<cpu_device *>(device)->token();
}
/* opcode execution table */
@@ -366,8 +365,8 @@ static CPU_INIT( z8001 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
- cpustate->io = device->space(AS_IO);
+ cpustate->program = device_memory(device)->space(AS_PROGRAM);
+ cpustate->io = device_memory(device)->space(AS_IO);
/* already initialized? */
if(z8000_exec == NULL)
@@ -380,8 +379,8 @@ static CPU_INIT( z8002 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
- cpustate->io = device->space(AS_IO);
+ cpustate->program = device_memory(device)->space(AS_PROGRAM);
+ cpustate->io = device_memory(device)->space(AS_IO);
/* already initialized? */
if(z8000_exec == NULL)
@@ -392,12 +391,12 @@ static CPU_RESET( z8001 )
{
z8000_state *cpustate = get_safe_token(device);
- cpu_irq_callback save_irqcallback = cpustate->irq_callback;
+ device_irq_callback save_irqcallback = cpustate->irq_callback;
memset(cpustate, 0, sizeof(*cpustate));
cpustate->irq_callback = save_irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
- cpustate->io = device->space(AS_IO);
+ cpustate->program = device_memory(device)->space(AS_PROGRAM);
+ cpustate->io = device_memory(device)->space(AS_IO);
cpustate->fcw = RDMEM_W(cpustate, 2); /* get reset cpustate->fcw */
if(cpustate->fcw & F_SEG)
{
@@ -413,12 +412,12 @@ static CPU_RESET( z8002 )
{
z8000_state *cpustate = get_safe_token(device);
- cpu_irq_callback save_irqcallback = cpustate->irq_callback;
+ device_irq_callback save_irqcallback = cpustate->irq_callback;
memset(cpustate, 0, sizeof(*cpustate));
cpustate->irq_callback = save_irqcallback;
cpustate->device = device;
- cpustate->program = device->space(AS_PROGRAM);
- cpustate->io = device->space(AS_IO);
+ cpustate->program = device_memory(device)->space(AS_PROGRAM);
+ cpustate->io = device_memory(device)->space(AS_IO);
cpustate->fcw = RDMEM_W(cpustate, 2); /* get reset cpustate->fcw */
cpustate->pc = RDMEM_W(cpustate, 4); /* get reset cpustate->pc */
}
@@ -569,7 +568,7 @@ static CPU_SET_INFO( z8002 )
CPU_GET_INFO( z8002 )
{
- z8000_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
+ z8000_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL;
switch (state)
{