diff options
Diffstat (limited to 'src/emu')
123 files changed, 549 insertions, 540 deletions
diff --git a/src/emu/cpu/adsp2100/adsp2100.c b/src/emu/cpu/adsp2100/adsp2100.c index c1ff81cf89f..f361362e57f 100644 --- a/src/emu/cpu/adsp2100/adsp2100.c +++ b/src/emu/cpu/adsp2100/adsp2100.c @@ -242,7 +242,7 @@ typedef struct UINT8 irq_state[9]; UINT8 irq_latch[9]; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; /* other internal states */ int icount; @@ -563,7 +563,7 @@ static void set_irq_line(adsp2100_state *adsp, int irqline, int state) INITIALIZATION AND SHUTDOWN ***************************************************************************/ -static adsp2100_state *adsp21xx_init(running_device *device, device_irq_callback irqcallback, int chiptype) +static adsp2100_state *adsp21xx_init(cpu_device *device, device_irq_callback irqcallback, int chiptype) { const adsp21xx_config *config = (const adsp21xx_config *)device->baseconfig().static_config(); adsp2100_state *adsp = get_safe_token(device); @@ -578,9 +578,9 @@ static adsp2100_state *adsp21xx_init(running_device *device, device_irq_callback /* fetch device parameters */ adsp->device = device; - adsp->program = device_memory(device)->space(AS_PROGRAM); - adsp->data = device_memory(device)->space(AS_DATA); - adsp->io = device_memory(device)->space(AS_IO); + adsp->program = device->space(AS_PROGRAM); + adsp->data = device->space(AS_DATA); + adsp->io = device->space(AS_IO); /* copy function pointers from the config */ if (config != NULL) @@ -1861,7 +1861,7 @@ static CPU_SET_INFO( adsp21xx ) static CPU_GET_INFO( adsp21xx ) { - adsp2100_state *adsp = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + adsp2100_state *adsp = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/alph8201/alph8201.c b/src/emu/cpu/alph8201/alph8201.c index a68eb843226..6195c78e564 100644 --- a/src/emu/cpu/alph8201/alph8201.c +++ b/src/emu/cpu/alph8201/alph8201.c @@ -197,7 +197,7 @@ struct _alpha8201_state UINT8 halt; /* halt input line */ #endif - running_device *device; + cpu_device *device; const address_space *program; int icount; int inst_cycles; @@ -669,7 +669,7 @@ static CPU_INIT( alpha8201 ) alpha8201_state *cpustate = get_safe_token(device); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); state_save_register_device_item_array(device, 0, cpustate->RAM); state_save_register_device_item(device, 0, cpustate->PREVPC); @@ -878,7 +878,7 @@ static CPU_SET_INFO( alpha8201 ) /* 8201 and 8301 */ static CPU_GET_INFO( alpha8xxx ) { - alpha8201_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + alpha8201_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/am29000/am29000.c b/src/emu/cpu/am29000/am29000.c index 6c896ae7de8..3620d68ad65 100644 --- a/src/emu/cpu/am29000/am29000.c +++ b/src/emu/cpu/am29000/am29000.c @@ -153,9 +153,9 @@ static CPU_INIT( am29000 ) { am29000_state *am29000 = get_safe_token(device); - am29000->program = device_memory(device)->space(AS_PROGRAM); - am29000->data = device_memory(device)->space(AS_DATA); - am29000->io = device_memory(device)->space(AS_IO); + am29000->program = device->space(AS_PROGRAM); + am29000->data = device->space(AS_DATA); + am29000->io = device->space(AS_IO); am29000->cfg = (PRL_AM29000 | PRL_REV_D) << CFG_PRL_SHIFT; /* Register state for saving */ @@ -712,7 +712,7 @@ static CPU_SET_INFO( am29000 ) CPU_GET_INFO( am29000 ) { - am29000_state *am29000 = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + am29000_state *am29000 = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/apexc/apexc.c b/src/emu/cpu/apexc/apexc.c index 5a66f04c5b1..f03b747242b 100644 --- a/src/emu/cpu/apexc/apexc.c +++ b/src/emu/cpu/apexc/apexc.c @@ -358,7 +358,7 @@ struct _apexc_state /* running: flag implied by the existence of the stop instruction */ UINT32 pc; /* address of next instruction for the disassembler */ - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -802,8 +802,8 @@ static CPU_INIT( apexc ) apexc_state *cpustate = get_safe_token(device); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); state_save_register_device_item(device, 0, cpustate->a); state_save_register_device_item(device, 0, cpustate->r); @@ -889,7 +889,7 @@ static CPU_SET_INFO( apexc ) CPU_GET_INFO( apexc ) { - apexc_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + apexc_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/arm/arm.c b/src/emu/cpu/arm/arm.c index 40bfcea293d..84f3c2832be 100644 --- a/src/emu/cpu/arm/arm.c +++ b/src/emu/cpu/arm/arm.c @@ -234,7 +234,7 @@ typedef struct UINT8 pendingIrq; UINT8 pendingFiq; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; } ARM_REGS; @@ -315,7 +315,7 @@ static CPU_RESET( arm ) memset(cpustate, 0, sizeof(ARM_REGS)); cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); /* start up in SVC mode with interrupts disabled. */ R15 = eARM_MODE_SVC|I_MASK|F_MASK; @@ -500,7 +500,7 @@ static CPU_INIT( arm ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); state_save_register_device_item_array(device, 0, cpustate->sArmRegister); state_save_register_device_item_array(device, 0, cpustate->coproRegister); @@ -1435,7 +1435,7 @@ static CPU_SET_INFO( arm ) CPU_GET_INFO( arm ) { - ARM_REGS *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + ARM_REGS *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/arm7/arm7.c b/src/emu/cpu/arm7/arm7.c index 278b9a6606d..365d2afa0ec 100644 --- a/src/emu/cpu/arm7/arm7.c +++ b/src/emu/cpu/arm7/arm7.c @@ -190,7 +190,7 @@ INLINE UINT32 arm7_tlb_translate(arm_state *cpustate, UINT32 vaddr) static CPU_TRANSLATE( arm7 ) { - arm_state *cpustate = (device != NULL) ? (arm_state *)downcast<cpu_device *>(device)->token() : NULL; + arm_state *cpustate = (device != NULL) ? (arm_state *)device->token() : NULL; /* only applies to the program address space and only does something if the MMU's enabled */ if( space == ADDRESS_SPACE_PROGRAM && ( COPRO_CTRL & COPRO_CTRL_MMU_EN ) ) @@ -216,7 +216,7 @@ static CPU_INIT( arm7 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); // setup co-proc callbacks arm7_coproc_do_callback = arm7_do_callback; @@ -384,7 +384,7 @@ static CPU_SET_INFO( arm7 ) CPU_GET_INFO( arm7 ) { - arm_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + arm_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/arm7/arm7core.c b/src/emu/cpu/arm7/arm7core.c index ab73095cefc..cfa44714ee2 100644 --- a/src/emu/cpu/arm7/arm7core.c +++ b/src/emu/cpu/arm7/arm7core.c @@ -543,7 +543,7 @@ static void arm7_core_init(running_device *device, const char *cpuname) } // CPU RESET -static void arm7_core_reset(running_device *device) +static void arm7_core_reset(cpu_device *device) { arm_state *cpustate = get_safe_token(device); @@ -552,7 +552,7 @@ static void arm7_core_reset(running_device *device) memset(cpustate, 0, sizeof(arm_state)); cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); /* start up in SVC mode with interrupts disabled. */ SwitchMode(cpustate, eARM7_MODE_SVC); diff --git a/src/emu/cpu/arm7/arm7core.h b/src/emu/cpu/arm7/arm7core.h index 8e0764f0944..c96db086c27 100644 --- a/src/emu/cpu/arm7/arm7core.h +++ b/src/emu/cpu/arm7/arm7core.h @@ -161,7 +161,7 @@ enum UINT8 pendingSwi; \ INT32 iCount; \ device_irq_callback irq_callback; \ - running_device *device; \ + cpu_device *device; \ const address_space *program; diff --git a/src/emu/cpu/asap/asap.c b/src/emu/cpu/asap/asap.c index 4875d3d30d1..5cd094703b4 100644 --- a/src/emu/cpu/asap/asap.c +++ b/src/emu/cpu/asap/asap.c @@ -87,7 +87,7 @@ struct _asap_state int icount; device_irq_callback irq_callback; const address_space *program; - running_device *device; + cpu_device *device; /* src2val table, registers are at the end */ UINT32 src2val[65536]; @@ -446,7 +446,7 @@ static CPU_INIT( asap ) asap->src2val[i] = i; asap->irq_callback = irqcallback; asap->device = device; - asap->program = device_memory(device)->space(AS_PROGRAM); + asap->program = device->space(AS_PROGRAM); state_save_register_device_item(device, 0, asap->pc); @@ -1727,7 +1727,7 @@ static CPU_SET_INFO( asap ) CPU_GET_INFO( asap ) { - asap_state *asap = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + asap_state *asap = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/avr8/avr8.c b/src/emu/cpu/avr8/avr8.c index 649b62c48ea..f06a9ab389c 100644 --- a/src/emu/cpu/avr8/avr8.c +++ b/src/emu/cpu/avr8/avr8.c @@ -26,7 +26,7 @@ struct _avr8_state { UINT32 pc; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -189,8 +189,8 @@ static CPU_INIT( avr8 ) cpustate->pc = 0; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); WRITE_IO_8(cpustate, AVR8_IO_SREG, 0); @@ -1073,7 +1073,7 @@ static CPU_SET_INFO( avr8 ) CPU_GET_INFO( avr8 ) { - avr8_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + avr8_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/ccpu/ccpu.c b/src/emu/cpu/ccpu/ccpu.c index a0a57c88ace..3a9c43385dd 100644 --- a/src/emu/cpu/ccpu/ccpu.c +++ b/src/emu/cpu/ccpu/ccpu.c @@ -43,7 +43,7 @@ struct _ccpu_state int icount; - running_device *device; + cpu_device *device; const address_space *program; const address_space *data; const address_space *io; @@ -131,9 +131,9 @@ static CPU_INIT( ccpu ) cpustate->external_input = configdata->external_input ? configdata->external_input : read_jmi; cpustate->vector_callback = configdata->vector_callback; cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); state_save_register_device_item(device, 0, cpustate->PC); state_save_register_device_item(device, 0, cpustate->A); @@ -730,7 +730,7 @@ static CPU_SET_INFO( ccpu ) CPU_GET_INFO( ccpu ) { - ccpu_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + ccpu_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/cdp1802/cdp1802.c b/src/emu/cpu/cdp1802/cdp1802.c index 46b247d4d39..da4c9d8b311 100644 --- a/src/emu/cpu/cdp1802/cdp1802.c +++ b/src/emu/cpu/cdp1802/cdp1802.c @@ -992,8 +992,8 @@ static CPU_INIT( cdp1802 ) } /* find address spaces */ - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); /* set initial values */ cpustate->p = mame_rand(device->machine) & 0x0f; @@ -1058,7 +1058,7 @@ static CPU_SET_INFO( cdp1802 ) CPU_GET_INFO( cdp1802 ) { - cdp1802_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + cdp1802_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/cop400/cop400.c b/src/emu/cpu/cop400/cop400.c index 1ee6d92e953..defc024f648 100644 --- a/src/emu/cpu/cop400/cop400.c +++ b/src/emu/cpu/cop400/cop400.c @@ -865,7 +865,7 @@ static void define_state_table(running_device *device) state->state_add(COP400_T, "T", cpustate->t); } -static void cop400_init(running_device *device, UINT8 g_mask, UINT8 d_mask, UINT8 in_mask, int has_counter, int has_inil) +static void cop400_init(cpu_device *device, UINT8 g_mask, UINT8 d_mask, UINT8 in_mask, int has_counter, int has_inil) { cop400_state *cpustate = get_safe_token(device); @@ -873,9 +873,9 @@ static void cop400_init(running_device *device, UINT8 g_mask, UINT8 d_mask, UINT /* find address spaces */ - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); /* set output pin masks */ @@ -1380,7 +1380,7 @@ static CPU_SET_INFO( cop400 ) static CPU_GET_INFO( cop400 ) { - cop400_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + cop400_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; cop400_interface *intf = (devconfig->static_config() != NULL) ? (cop400_interface *)devconfig->static_config() : NULL; switch (state) @@ -1494,7 +1494,7 @@ CPU_GET_INFO( cop401 ) CPU_GET_INFO( cop420 ) { - cop400_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + cop400_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { @@ -1575,7 +1575,7 @@ CPU_GET_INFO( cop402 ) CPU_GET_INFO( cop444 ) { - cop400_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + cop400_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/cp1610/cp1610.c b/src/emu/cpu/cp1610/cp1610.c index d74afc947ee..4a9708c9496 100644 --- a/src/emu/cpu/cp1610/cp1610.c +++ b/src/emu/cpu/cp1610/cp1610.c @@ -46,7 +46,7 @@ struct _cp1610_state int intr_pending; int intrm_pending; int mask_interrupts; - running_device *device; + cpu_device *device; const address_space *program; int icount; }; @@ -3394,7 +3394,7 @@ static CPU_INIT( cp1610 ) cpustate->intrm_pending = 0; cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); state_save_register_device_item_array(device, 0, cpustate->r); state_save_register_device_item(device, 0, cpustate->flags); @@ -3459,7 +3459,7 @@ static CPU_SET_INFO( cp1610 ) CPU_GET_INFO( cp1610 ) { - cp1610_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + cp1610_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.c b/src/emu/cpu/cubeqcpu/cubeqcpu.c index ac3d21d14ea..52c56d1c30e 100644 --- a/src/emu/cpu/cubeqcpu/cubeqcpu.c +++ b/src/emu/cpu/cubeqcpu/cubeqcpu.c @@ -97,7 +97,7 @@ typedef struct cubeqst_dac_w_func dac_w; UINT16 *sound_data; - running_device *device; + cpu_device *device; const address_space *program; int icount; } cquestsnd_state; @@ -137,8 +137,8 @@ typedef struct UINT8 rc; UINT8 clkcnt; - running_device *device; - running_device *lindevice; + cpu_device *device; + cpu_device *lindevice; const address_space *program; int icount; } cquestrot_state; @@ -183,8 +183,8 @@ typedef struct UINT32 *e_stack; UINT32 *o_stack; - running_device *device; - running_device *rotdevice; + cpu_device *device; + cpu_device *rotdevice; const address_space *program; int icount; } cquestlin_state; @@ -289,7 +289,7 @@ static CPU_INIT( cquestsnd ) cpustate->sound_data = (UINT16*)memory_region(device->machine, _config->sound_data_region); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); /* Allocate RAM shared with 68000 */ cpustate->sram = auto_alloc_array(device->machine, UINT16, 4096/2); @@ -362,8 +362,8 @@ static CPU_INIT( cquestrot ) cpustate->sram = auto_alloc_array(device->machine, UINT16, 2048); /* Private */ cpustate->device = device; - cpustate->lindevice = device->machine->device(rotconfig->lin_cpu_tag); - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->lindevice = device->machine->device<cpu_device>(rotconfig->lin_cpu_tag); + cpustate->program = device->space(AS_PROGRAM); cquestrot_state_register(device); } @@ -447,8 +447,8 @@ static CPU_INIT( cquestlin ) cpustate->o_stack = auto_alloc_array(device->machine, UINT32, 32768); /* Stack DRAM: 32kx20 */ cpustate->device = device; - cpustate->rotdevice = device->machine->device(linconfig->rot_cpu_tag); - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->rotdevice = device->machine->device<cpu_device>(linconfig->rot_cpu_tag); + cpustate->program = device->space(AS_PROGRAM); cquestlin_state_register(device); } @@ -1597,7 +1597,7 @@ static CPU_SET_INFO( cquestsnd ) CPU_GET_INFO( cquestsnd ) { - cquestsnd_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token_snd(device) : NULL; + cquestsnd_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token_snd(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ @@ -1715,7 +1715,7 @@ static CPU_SET_INFO( cquestrot ) CPU_GET_INFO( cquestrot ) { - cquestrot_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token_rot(device) : NULL; + cquestrot_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token_rot(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ @@ -1833,7 +1833,7 @@ static CPU_SET_INFO( cquestlin ) CPU_GET_INFO( cquestlin ) { - cquestlin_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token_lin(device) : NULL; + cquestlin_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token_lin(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/drcbec.c b/src/emu/cpu/drcbec.c index f8d43a354bf..4e1d48c8c47 100644 --- a/src/emu/cpu/drcbec.c +++ b/src/emu/cpu/drcbec.c @@ -353,7 +353,7 @@ static drcbe_state *drcbec_alloc(drcuml_state *drcuml, drccache *cache, running_ /* remember our pointers */ drcbe->device = device; for (spacenum = 0; spacenum < ARRAY_LENGTH(drcbe->space); spacenum++) - drcbe->space[spacenum] = device_memory(device)->space(spacenum); + drcbe->space[spacenum] = downcast<cpu_device *>(device)->space(spacenum); drcbe->drcuml = drcuml; drcbe->cache = cache; diff --git a/src/emu/cpu/drcbex64.c b/src/emu/cpu/drcbex64.c index 9753c7d8080..cd9c97524a4 100644 --- a/src/emu/cpu/drcbex64.c +++ b/src/emu/cpu/drcbex64.c @@ -714,7 +714,7 @@ static drcbe_state *drcbex64_alloc(drcuml_state *drcuml, drccache *cache, runnin /* get address spaces and accessors */ for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) { - drcbe->space[spacenum] = device_memory(device)->space(spacenum); + drcbe->space[spacenum] = device->space(spacenum); if (drcbe->space[spacenum] != NULL) drcbe->accessors[spacenum] = drcbe->space[spacenum]->accessors; } diff --git a/src/emu/cpu/drcbex86.c b/src/emu/cpu/drcbex86.c index 61b3e74ac92..5012d524694 100644 --- a/src/emu/cpu/drcbex86.c +++ b/src/emu/cpu/drcbex86.c @@ -631,7 +631,7 @@ static drcbe_state *drcbex86_alloc(drcuml_state *drcuml, drccache *cache, runnin /* get address spaces */ for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) - drcbe->space[spacenum] = device_memory(device)->space(spacenum); + drcbe->space[spacenum] = downcast<cpu_device *>(device)->space(spacenum); /* allocate hash tables */ drcbe->hash = drchash_alloc(cache, modes, addrbits, ignorebits); diff --git a/src/emu/cpu/drcfe.c b/src/emu/cpu/drcfe.c index 43b73f089c6..6796444a871 100644 --- a/src/emu/cpu/drcfe.c +++ b/src/emu/cpu/drcfe.c @@ -139,8 +139,8 @@ drcfe_state *drcfe_init(running_device *cpu, const drcfe_config *config, void *p /* initialize the state */ drcfe->cpudevice = downcast<cpu_device *>(cpu); - drcfe->program = device_memory(cpu)->space(AS_PROGRAM); - drcfe->pageshift = device_memory(cpu)->space_config(AS_PROGRAM)->m_page_shift; + drcfe->program = drcfe->cpudevice->space(AS_PROGRAM); + drcfe->pageshift = drcfe->cpudevice->space_config(AS_PROGRAM)->m_page_shift; return drcfe; } diff --git a/src/emu/cpu/dsp32/dsp32.c b/src/emu/cpu/dsp32/dsp32.c index bef89c8b92e..884f9ccd73d 100644 --- a/src/emu/cpu/dsp32/dsp32.c +++ b/src/emu/cpu/dsp32/dsp32.c @@ -184,7 +184,7 @@ struct _dsp32_state UINT8 lastpins; UINT32 ppc; void (*output_pins_changed)(running_device *device, UINT32 pins); - running_device *device; + cpu_device * device; const address_space *program; }; @@ -359,7 +359,7 @@ static CPU_INIT( dsp32c ) cpustate->output_pins_changed = configdata->output_pins_changed; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); dsp32_register_save(device); } @@ -765,7 +765,7 @@ static CPU_SET_INFO( dsp32c ) CPU_GET_INFO( dsp32c ) { - dsp32_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + dsp32_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/dsp56k/dsp56k.c b/src/emu/cpu/dsp56k/dsp56k.c index 15215a1b464..909f8b08a43 100644 --- a/src/emu/cpu/dsp56k/dsp56k.c +++ b/src/emu/cpu/dsp56k/dsp56k.c @@ -235,8 +235,8 @@ static CPU_INIT( dsp56k ) //cpustate->config = device->baseconfig().static_config(); //cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->data = device_memory(device)->space(AS_DATA); + cpustate->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); /* Setup the direct memory handler for this CPU */ /* NOTE: Be sure to grab this guy and call him if you ever install another direct_update_hander in a driver! */ @@ -436,7 +436,7 @@ static CPU_SET_INFO( dsp56k ) CPU_GET_INFO( dsp56k ) { - dsp56k_core* cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + dsp56k_core* cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/dsp56k/dsp56k.h b/src/emu/cpu/dsp56k/dsp56k.h index 3a7ed889caa..e0717024b45 100644 --- a/src/emu/cpu/dsp56k/dsp56k.h +++ b/src/emu/cpu/dsp56k/dsp56k.h @@ -232,7 +232,7 @@ typedef struct UINT32 op; int interrupt_cycles; void (*output_pins_changed)(UINT32 pins); - running_device *device; + cpu_device *device; const address_space *program; const address_space *data; } dsp56k_core; diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c index b6292c81caf..90f54319566 100644 --- a/src/emu/cpu/e132xs/e132xs.c +++ b/src/emu/cpu/e132xs/e132xs.c @@ -319,7 +319,7 @@ struct _hyperstone_state struct _delay delay; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; UINT32 opcodexor; @@ -637,7 +637,7 @@ static void adjust_timer_interrupt(hyperstone_state *cpustate) static TIMER_CALLBACK( e132xs_timer_callback ) { - running_device *device = (running_device *)ptr; + cpu_device *device = (cpu_device *)ptr; hyperstone_state *cpustate = get_safe_token(device); int update = param; @@ -1527,7 +1527,7 @@ static void set_irq_line(hyperstone_state *cpustate, int irqline, int state) ISR &= ~(1 << irqline); } -static void hyperstone_init(running_device *device, device_irq_callback irqcallback, int scale_mask) +static void hyperstone_init(cpu_device *device, device_irq_callback irqcallback, int scale_mask) { hyperstone_state *cpustate = get_safe_token(device); @@ -1543,13 +1543,13 @@ static void hyperstone_init(running_device *device, device_irq_callback irqcallb cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->timer = timer_alloc(device->machine, e132xs_timer_callback, (void *)device); cpustate->clock_scale_mask = scale_mask; } -static void e116_init(running_device *device, device_irq_callback irqcallback, int scale_mask) +static void e116_init(cpu_device *device, device_irq_callback irqcallback, int scale_mask) { hyperstone_state *cpustate = get_safe_token(device); hyperstone_init(device, irqcallback, scale_mask); @@ -1586,7 +1586,7 @@ static CPU_INIT( gms30c2216 ) e116_init(device, irqcallback, 0); } -static void e132_init(running_device *device, device_irq_callback irqcallback, int scale_mask) +static void e132_init(cpu_device *device, device_irq_callback irqcallback, int scale_mask) { hyperstone_state *cpustate = get_safe_token(device); hyperstone_init(device, irqcallback, scale_mask); @@ -1650,8 +1650,8 @@ static CPU_RESET( hyperstone ) cpustate->irq_callback = save_irqcallback; cpustate->opcodexor = save_opcodexor; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->timer = save_timer; cpustate->tr_clocks_per_tick = 2; @@ -4843,7 +4843,7 @@ static CPU_SET_INFO( hyperstone ) static CPU_GET_INFO( hyperstone ) { - hyperstone_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + hyperstone_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c index b3c78476098..fc207028c80 100644 --- a/src/emu/cpu/esrip/esrip.c +++ b/src/emu/cpu/esrip/esrip.c @@ -109,7 +109,7 @@ typedef struct UINT16 *ipt_ram; UINT8 *lbrm; - running_device *device; + cpu_device *device; const address_space *program; int icount; @@ -264,7 +264,7 @@ static CPU_INIT( esrip ) cpustate->ipt_ram = auto_alloc_array(device->machine, UINT16, IPT_RAM_SIZE/2); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); /* Create the instruction decode lookup table */ cpustate->optable = auto_alloc_array(device->machine, UINT8, 65536); @@ -1890,7 +1890,7 @@ static CPU_SET_INFO( esrip ) CPU_GET_INFO( esrip ) { - esrip_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + esrip_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/f8/f8.c b/src/emu/cpu/f8/f8.c index c6ff2362bfa..99ff03569a7 100644 --- a/src/emu/cpu/f8/f8.c +++ b/src/emu/cpu/f8/f8.c @@ -53,7 +53,7 @@ struct _f8_Regs UINT16 io; /* last I/O address */ UINT16 irq_vector; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *iospace; int icount; @@ -1551,8 +1551,8 @@ static CPU_RESET( f8 ) memset(cpustate, 0, sizeof(f8_Regs)); cpustate->irq_callback = save_callback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->iospace = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->iospace = device->space(AS_IO); cpustate->w&=~I; /* save PC0 to PC1 and reset PC0 */ @@ -1901,8 +1901,8 @@ static CPU_INIT( f8 ) f8_Regs *cpustate = get_safe_token(device); cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->iospace = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->iospace = device->space(AS_IO); state_save_register_device_item(device, 0, cpustate->pc0); state_save_register_device_item(device, 0, cpustate->pc1); @@ -2019,7 +2019,7 @@ static CPU_SET_INFO( f8 ) CPU_GET_INFO( f8 ) { - f8_Regs *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + f8_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/g65816/g65816.c b/src/emu/cpu/g65816/g65816.c index b238aa92ac3..6a3f7e9cbaf 100644 --- a/src/emu/cpu/g65816/g65816.c +++ b/src/emu/cpu/g65816/g65816.c @@ -337,7 +337,7 @@ static CPU_INIT( g65816 ) g65816_set_irq_callback(cpustate, irqcallback); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); cpustate->cpu_type = CPU_TYPE_G65816; state_save_register_device_item(device, 0, cpustate->a); @@ -418,7 +418,7 @@ void g65816_set_read_vector_callback(running_device *device, read8_space_func re CPU_GET_INFO( g65816 ) { - g65816i_cpu_struct *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + g65816i_cpu_struct *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/g65816/g65816cm.h b/src/emu/cpu/g65816/g65816cm.h index c463a3c6002..c20624ae661 100644 --- a/src/emu/cpu/g65816/g65816cm.h +++ b/src/emu/cpu/g65816/g65816cm.h @@ -94,7 +94,7 @@ struct _g65816i_cpu_struct uint ir; /* Instruction Register */ uint irq_delay; /* delay 1 instruction before checking irq */ device_irq_callback int_ack; /* Interrupt Acknowledge */ - running_device *device; + cpu_device *device; const address_space *program; read8_space_func read_vector; /* Read vector override */ uint stopped; /* Sets how the CPU is stopped */ diff --git a/src/emu/cpu/h6280/h6280.c b/src/emu/cpu/h6280/h6280.c index 03077fb098d..c8cbb119bee 100644 --- a/src/emu/cpu/h6280/h6280.c +++ b/src/emu/cpu/h6280/h6280.c @@ -162,8 +162,8 @@ static CPU_INIT( h6280 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); } static CPU_RESET( h6280 ) @@ -178,8 +178,8 @@ static CPU_RESET( h6280 ) memset(cpustate, 0, sizeof(h6280_Regs)); cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); /* set I and B flags */ P = _fI | _fB; @@ -425,7 +425,7 @@ static CPU_SET_INFO( h6280 ) CPU_GET_INFO( h6280 ) { - h6280_Regs* cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + h6280_Regs* cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/h6280/h6280.h b/src/emu/cpu/h6280/h6280.h index fc652f94289..0d6b5416707 100644 --- a/src/emu/cpu/h6280/h6280.h +++ b/src/emu/cpu/h6280/h6280.h @@ -61,7 +61,7 @@ typedef struct UINT8 irq_state[3]; UINT8 irq_pending; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; diff --git a/src/emu/cpu/h83002/h8_16.c b/src/emu/cpu/h83002/h8_16.c index c637afccf3c..a959c52398f 100644 --- a/src/emu/cpu/h83002/h8_16.c +++ b/src/emu/cpu/h83002/h8_16.c @@ -220,8 +220,8 @@ static CPU_INIT(h8) h8->mode_8bit = 0; - h8->program = device_memory(device)->space(AS_PROGRAM); - h8->io = device_memory(device)->space(AS_IO); + h8->program = device->space(AS_PROGRAM); + h8->io = device->space(AS_IO); state_save_register_device_item(device, 0, h8->h8err); state_save_register_device_item_array(device, 0, h8->regs); @@ -570,7 +570,7 @@ ADDRESS_MAP_END CPU_GET_INFO( h8_3002 ) { - h83xx_state *h8 = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + h83xx_state *h8 = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { // Interface functions and variables diff --git a/src/emu/cpu/h83002/h8_8.c b/src/emu/cpu/h83002/h8_8.c index da8618fc0e9..c601c4de3f4 100644 --- a/src/emu/cpu/h83002/h8_8.c +++ b/src/emu/cpu/h83002/h8_8.c @@ -237,8 +237,8 @@ static CPU_INIT(h8bit) h8->mode_8bit = 1; - h8->program = device_memory(device)->space(AS_PROGRAM); - h8->io = device_memory(device)->space(AS_IO); + h8->program = device->space(AS_PROGRAM); + h8->io = device->space(AS_IO); h8->timer[0] = timer_alloc(h8->device->machine, h8_timer_0_cb, h8); h8->timer[1] = timer_alloc(h8->device->machine, h8_timer_1_cb, h8); @@ -751,7 +751,7 @@ ADDRESS_MAP_END CPU_GET_INFO( h8_3334 ) { - h83xx_state *h8 = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + h83xx_state *h8 = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { // Interface functions and variables diff --git a/src/emu/cpu/h83002/h8priv.h b/src/emu/cpu/h83002/h8priv.h index 5f9091b3555..8b8f39d4846 100644 --- a/src/emu/cpu/h83002/h8priv.h +++ b/src/emu/cpu/h83002/h8priv.h @@ -26,7 +26,7 @@ struct _h83xx_state UINT8 incheckirqs; device_irq_callback irq_cb; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; diff --git a/src/emu/cpu/hd6309/hd6309.c b/src/emu/cpu/hd6309/hd6309.c index 7ac0dc1cfe1..146ab5ac3f5 100644 --- a/src/emu/cpu/hd6309/hd6309.c +++ b/src/emu/cpu/hd6309/hd6309.c @@ -132,7 +132,7 @@ struct _m68_state_t int extra_cycles; /* cycles used up by interrupts */ device_irq_callback irq_callback; - running_device *device; + cpu_device *device; int icount; PAIR ea; /* effective address */ @@ -505,7 +505,7 @@ static void check_irq_lines( m68_state_t *m68_state ) static STATE_POSTLOAD( hd6309_postload ) { - running_device *device = (running_device *)param; + running_device *device = (cpu_device *)param; m68_state_t *m68_state = get_safe_token(device); UpdateState(m68_state); @@ -522,7 +522,7 @@ static CPU_INIT( hd6309 ) m68_state->irq_callback = irqcallback; m68_state->device = device; - m68_state->program = device_memory(device)->space(AS_PROGRAM); + m68_state->program = device->space(AS_PROGRAM); /* setup regtable */ @@ -1258,7 +1258,7 @@ static CPU_SET_INFO( hd6309 ) CPU_GET_INFO( hd6309 ) { - m68_state_t *m68_state = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m68_state_t *m68_state = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/i386/i386.c b/src/emu/cpu/i386/i386.c index 0b5686e1485..d20d592b6bc 100644 --- a/src/emu/cpu/i386/i386.c +++ b/src/emu/cpu/i386/i386.c @@ -463,7 +463,7 @@ static void I386OP(decode_two_byte)(i386_state *cpustate) static UINT64 i386_debug_segbase(void *globalref, void *ref, UINT32 params, const UINT64 *param) { - running_device *device = (running_device *)ref; + cpu_device *device = (cpu_device *)ref; i386_state *cpustate = get_safe_token(device); UINT32 result; I386_SREG seg; @@ -484,7 +484,7 @@ static UINT64 i386_debug_segbase(void *globalref, void *ref, UINT32 params, cons static UINT64 i386_debug_seglimit(void *globalref, void *ref, UINT32 params, const UINT64 *param) { - running_device *device = (running_device *)ref; + cpu_device *device = (cpu_device *)ref; i386_state *cpustate = get_safe_token(device); UINT32 result = 0; I386_SREG seg; @@ -509,7 +509,7 @@ static CPU_DEBUG_INIT( i386 ) static STATE_POSTLOAD( i386_postload ) { - running_device *device = (running_device *)param; + cpu_device *device = (cpu_device *)param; i386_state *cpustate = get_safe_token(device); int i; for (i = 0; i < 6; i++) @@ -548,8 +548,8 @@ static CPU_INIT( i386 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); state_save_register_device_item_array(device, 0, cpustate->reg.d); state_save_register_device_item(device, 0, cpustate->sreg[ES].selector); @@ -647,8 +647,8 @@ static CPU_RESET( i386 ) memset( cpustate, 0, sizeof(*cpustate) ); cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->sreg[CS].selector = 0xf000; cpustate->sreg[CS].base = 0xffff0000; @@ -870,7 +870,7 @@ static CPU_SET_INFO( i386 ) CPU_GET_INFO( i386 ) { - i386_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + i386_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { @@ -1103,8 +1103,8 @@ static CPU_RESET( i486 ) memset( cpustate, 0, sizeof(*cpustate) ); cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->sreg[CS].selector = 0xf000; cpustate->sreg[CS].base = 0xffff0000; @@ -1165,7 +1165,7 @@ static CPU_SET_INFO( i486 ) CPU_GET_INFO( i486 ) { - i386_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + i386_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(i486);break; @@ -1219,8 +1219,8 @@ static CPU_RESET( pentium ) memset( cpustate, 0, sizeof(*cpustate) ); cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->sreg[CS].selector = 0xf000; cpustate->sreg[CS].base = 0xffff0000; @@ -1296,7 +1296,7 @@ static CPU_SET_INFO( pentium ) CPU_GET_INFO( pentium ) { - i386_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + i386_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(pentium); break; @@ -1350,8 +1350,8 @@ static CPU_RESET( mediagx ) memset( cpustate, 0, sizeof(*cpustate) ); cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->sreg[CS].selector = 0xf000; cpustate->sreg[CS].base = 0xffff0000; @@ -1422,7 +1422,7 @@ static CPU_SET_INFO( mediagx ) CPU_GET_INFO( mediagx ) { - i386_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + i386_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(mediagx); break; diff --git a/src/emu/cpu/i386/i386priv.h b/src/emu/cpu/i386/i386priv.h index 48c27d0a9ed..03ded7858b2 100644 --- a/src/emu/cpu/i386/i386priv.h +++ b/src/emu/cpu/i386/i386priv.h @@ -227,7 +227,7 @@ struct _i386_state UINT8 irq_state; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; UINT32 a20_mask; diff --git a/src/emu/cpu/i4004/i4004.c b/src/emu/cpu/i4004/i4004.c index 8d74e4ecef8..1f3b201d29c 100644 --- a/src/emu/cpu/i4004/i4004.c +++ b/src/emu/cpu/i4004/i4004.c @@ -33,7 +33,7 @@ struct _i4004_state PAIR PC; // It is in fact one of ADDR regs UINT8 flags; // used for I/O only - running_device *device; + cpu_device *device; const address_space *program; const address_space *data; const address_space *io; @@ -468,9 +468,9 @@ static CPU_INIT( i4004 ) cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); state_save_register_device_item(device, 0, cpustate->PC); state_save_register_device_item(device, 0, cpustate->A); @@ -574,7 +574,7 @@ static CPU_SET_INFO( i4004 ) CPU_GET_INFO( i4004 ) { - i4004_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + i4004_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/i8008/i8008.c b/src/emu/cpu/i8008/i8008.c index 4eddffe9034..dfa53934eae 100644 --- a/src/emu/cpu/i8008/i8008.c +++ b/src/emu/cpu/i8008/i8008.c @@ -33,7 +33,7 @@ struct _i8008_state UINT8 PF; // Parity flag UINT8 HALT; UINT8 flags; // temporary I/O only - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -547,8 +547,8 @@ static CPU_INIT( i8008 ) cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->irq_callback = irqcallback; @@ -676,7 +676,7 @@ static CPU_SET_INFO( i8008 ) CPU_GET_INFO( i8008 ) { - i8008_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + i8008_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/i8085/i8085.c b/src/emu/cpu/i8085/i8085.c index e36aa7c7662..3fd37669ca1 100644 --- a/src/emu/cpu/i8085/i8085.c +++ b/src/emu/cpu/i8085/i8085.c @@ -183,7 +183,7 @@ struct _i8085_state UINT8 ietemp; /* import/export temp space */ device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -971,7 +971,7 @@ static void init_tables (int type) } -static void init_808x_common(running_device *device, device_irq_callback irqcallback, int type) +static void init_808x_common(cpu_device *device, device_irq_callback irqcallback, int type) { i8085_state *cpustate = get_safe_token(device); @@ -1010,8 +1010,8 @@ static void init_808x_common(running_device *device, device_irq_callback irqcall cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); /* resolve callbacks */ devcb_resolve_write8(&cpustate->out_status_func, &cpustate->config.out_status_func, device); @@ -1202,7 +1202,7 @@ static CPU_SET_INFO( i808x ) CPU_GET_INFO( i8085 ) { - i8085_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + i8085_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/i86/i286.c b/src/emu/cpu/i86/i286.c index 0ff4ed2593b..05c40ce5fbe 100644 --- a/src/emu/cpu/i86/i286.c +++ b/src/emu/cpu/i86/i286.c @@ -58,7 +58,7 @@ struct _i80286_state UINT8 rights; } ldtr, tr; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; INT32 AuxVal, OverVal, SignVal, ZeroVal, CarryVal, DirVal; /* 0 or non-0 valued flags */ @@ -293,8 +293,8 @@ static CPU_INIT( i80286 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); /* If a reset parameter is given, take it as pointer to an address mask */ if( device->baseconfig().static_config() ) @@ -388,7 +388,7 @@ static CPU_SET_INFO( i80286 ) CPU_GET_INFO( i80286 ) { - i80286_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + i80286_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/i86/i86.c b/src/emu/cpu/i86/i86.c index 08fc3b90986..2e0d8703196 100644 --- a/src/emu/cpu/i86/i86.c +++ b/src/emu/cpu/i86/i86.c @@ -59,7 +59,7 @@ struct _i8086_state memory_interface mem; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -167,8 +167,8 @@ static CPU_INIT( i8086 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); /* set up the state table */ { @@ -224,8 +224,8 @@ static CPU_RESET( i8086 ) cpustate->irq_callback = save_irqcallback; cpustate->mem = save_mem; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->sregs[CS] = 0xf000; cpustate->base[CS] = SegBase(CS); @@ -523,7 +523,7 @@ static CPU_SET_INFO( i8086 ) CPU_GET_INFO( i8086 ) { - i8086_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + i8086_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/i860/i860.c b/src/emu/cpu/i860/i860.c index 75e0f475850..ee765d46444 100644 --- a/src/emu/cpu/i860/i860.c +++ b/src/emu/cpu/i860/i860.c @@ -30,7 +30,7 @@ static CPU_INIT( i860 ) { i860_state_t *cpustate = get_safe_token(device); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); reset_i860(cpustate); i860_set_pin(device, DEC_PIN_BUS_HOLD, 0); i860_set_pin(device, DEC_PIN_RESET, 0); @@ -176,7 +176,7 @@ static CPU_SET_INFO( i860 ) CPU_GET_INFO( i860 ) { - i860_state_t *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + i860_state_t *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/i860/i860.h b/src/emu/cpu/i860/i860.h index f9149a6d99e..5643430ee62 100644 --- a/src/emu/cpu/i860/i860.h +++ b/src/emu/cpu/i860/i860.h @@ -169,7 +169,7 @@ typedef struct { /* * MAME-specific stuff. */ - running_device *device; + cpu_device *device; const address_space *program; UINT32 ppc; int icount; diff --git a/src/emu/cpu/i960/i960.c b/src/emu/cpu/i960/i960.c index 43878fe6535..3b67664f519 100644 --- a/src/emu/cpu/i960/i960.c +++ b/src/emu/cpu/i960/i960.c @@ -34,7 +34,7 @@ struct _i960_state_t { int immediate_irq, immediate_vector, immediate_pri; device_irq_callback irq_cb; - running_device *device; + cpu_device *device; const address_space *program; int icount; @@ -2070,7 +2070,7 @@ static CPU_INIT( i960 ) i960->irq_cb = irqcallback; i960->device = device; - i960->program = device_memory(device)->space(AS_PROGRAM); + i960->program = device->space(AS_PROGRAM); state_save_register_device_item(device, 0, i960->PIP); state_save_register_device_item(device, 0, i960->SAT); @@ -2107,7 +2107,7 @@ static CPU_RESET( i960 ) CPU_GET_INFO( i960 ) { - i960_state_t *i960 = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + i960_state_t *i960 = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; if(state >= CPUINFO_INT_REGISTER+I960_R0 && state <= CPUINFO_INT_REGISTER + I960_G15) { info->i = i960->r[state - (CPUINFO_INT_REGISTER + I960_R0)]; diff --git a/src/emu/cpu/jaguar/jaguar.c b/src/emu/cpu/jaguar/jaguar.c index 874642ed0c9..97502b73bb1 100644 --- a/src/emu/cpu/jaguar/jaguar.c +++ b/src/emu/cpu/jaguar/jaguar.c @@ -100,7 +100,7 @@ struct _jaguar_state void (*const *table)(jaguar_state *jaguar, UINT16 op); device_irq_callback irq_callback; jaguar_int_func cpu_interrupt; - running_device *device; + cpu_device *device; const address_space *program; }; @@ -401,7 +401,7 @@ static void init_tables(void) static STATE_POSTLOAD( jaguar_postload ) { - running_device *device = (running_device *)param; + cpu_device *device = (cpu_device *)param; jaguar_state *jaguar = get_safe_token(device); update_register_banks(jaguar); @@ -409,7 +409,7 @@ static STATE_POSTLOAD( jaguar_postload ) } -static void init_common(int isdsp, running_device *device, device_irq_callback irqcallback) +static void init_common(int isdsp, cpu_device *device, device_irq_callback irqcallback) { const jaguar_cpu_config *configdata = (const jaguar_cpu_config *)device->baseconfig().static_config(); jaguar_state *jaguar = get_safe_token(device); @@ -421,7 +421,7 @@ static void init_common(int isdsp, running_device *device, device_irq_callback i jaguar->irq_callback = irqcallback; jaguar->device = device; - jaguar->program = device_memory(device)->space(AS_PROGRAM); + jaguar->program = device->space(AS_PROGRAM); if (configdata != NULL) jaguar->cpu_interrupt = configdata->cpu_int_callback; @@ -1495,7 +1495,7 @@ static CPU_SET_INFO( jaguargpu ) CPU_GET_INFO( jaguargpu ) { - jaguar_state *jaguar = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + jaguar_state *jaguar = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ @@ -1648,7 +1648,7 @@ static CPU_SET_INFO( jaguardsp ) CPU_GET_INFO( jaguardsp ) { - jaguar_state *jaguar = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + jaguar_state *jaguar = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/konami/konami.c b/src/emu/cpu/konami/konami.c index cabd2a9f52b..a6791144c17 100644 --- a/src/emu/cpu/konami/konami.c +++ b/src/emu/cpu/konami/konami.c @@ -61,7 +61,7 @@ struct _konami_state UINT8 nmi_state; UINT8 nmi_pending; int icount; - running_device *device; + cpu_device *device; const address_space *program; konami_set_lines_func setlines_callback; }; @@ -404,7 +404,7 @@ static CPU_INIT( konami ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); state_save_register_device_item(device, 0, PC); state_save_register_device_item(device, 0, U); @@ -547,7 +547,7 @@ static CPU_SET_INFO( konami ) CPU_GET_INFO( konami ) { - konami_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + konami_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/lh5801/lh5801.c b/src/emu/cpu/lh5801/lh5801.c index 0d8385d9b53..2f6417ee70a 100644 --- a/src/emu/cpu/lh5801/lh5801.c +++ b/src/emu/cpu/lh5801/lh5801.c @@ -50,7 +50,7 @@ typedef struct _lh5810_state lh5801_state; struct _lh5810_state { const lh5801_cpu_core *config; - running_device *device; + cpu_device *device; const address_space *program; PAIR s, p, u, x, y; @@ -106,7 +106,7 @@ static CPU_INIT( lh5801 ) memset(cpustate, 0, sizeof(*cpustate)); cpustate->config = (const lh5801_cpu_core *) device->baseconfig().static_config(); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); } static CPU_RESET( lh5801 ) @@ -183,7 +183,7 @@ static CPU_SET_INFO( lh5801 ) CPU_GET_INFO( lh5801 ) { - lh5801_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + lh5801_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/lr35902/lr35902.c b/src/emu/cpu/lr35902/lr35902.c index 90250e91507..90cd7901625 100644 --- a/src/emu/cpu/lr35902/lr35902.c +++ b/src/emu/cpu/lr35902/lr35902.c @@ -65,7 +65,7 @@ typedef struct { int irq_state; int ei_delay; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; int icount; /* Timer stuff */ @@ -193,7 +193,7 @@ static CPU_INIT( lr35902 ) cpustate->w.config = (const lr35902_cpu_core *) device->baseconfig().static_config(); cpustate->w.irq_callback = irqcallback; cpustate->w.device = device; - cpustate->w.program = device_memory(device)->space(AS_PROGRAM); + cpustate->w.program = device->space(AS_PROGRAM); } /*** Reset lr353902 registers: ******************************/ @@ -410,7 +410,7 @@ static CPU_SET_INFO( lr35902 ) CPU_GET_INFO( lr35902 ) { - lr35902_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + lr35902_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c index 3fc6d67c7dd..d3007268e34 100644 --- a/src/emu/cpu/m37710/m37710.c +++ b/src/emu/cpu/m37710/m37710.c @@ -896,8 +896,8 @@ static CPU_INIT( m37710 ) INT_ACK = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->ICount = 0; @@ -1014,7 +1014,7 @@ ADDRESS_MAP_END CPU_GET_INFO( m37710 ) { - m37710i_cpu_struct *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m37710i_cpu_struct *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/m37710/m37710cm.h b/src/emu/cpu/m37710/m37710cm.h index 95b4631bf6a..af631ef4073 100644 --- a/src/emu/cpu/m37710/m37710cm.h +++ b/src/emu/cpu/m37710/m37710cm.h @@ -109,7 +109,7 @@ struct _m37710i_cpu_struct uint source; /* temp register */ uint destination; /* temp register */ device_irq_callback int_ack; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; uint stopped; /* Sets how the CPU is stopped */ diff --git a/src/emu/cpu/m6502/m4510.c b/src/emu/cpu/m6502/m4510.c index 6a3da6e51db..dc7a432c4ae 100644 --- a/src/emu/cpu/m6502/m4510.c +++ b/src/emu/cpu/m6502/m4510.c @@ -143,7 +143,7 @@ struct _m4510_Regs { UINT32 mem[8]; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *space; int icount; @@ -206,7 +206,7 @@ static CPU_INIT( m4510 ) cpustate->port_write = NULL; cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->space = device_memory(device)->space(AS_PROGRAM); + cpustate->space = device->space(AS_PROGRAM); if ( intf ) { @@ -455,7 +455,7 @@ static CPU_SET_INFO( m4510 ) CPU_GET_INFO( m4510 ) { - m4510_Regs *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m4510_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c index b28ae872fc6..2f7cdcf032c 100644 --- a/src/emu/cpu/m6502/m6502.c +++ b/src/emu/cpu/m6502/m6502.c @@ -69,7 +69,7 @@ struct _m6502_Regs UINT8 so_state; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *space; const address_space *io; int int_occured; @@ -128,14 +128,14 @@ static void default_wdmem_id(const address_space *space, offs_t offset, UINT8 da * *****************************************************************************/ -static void m6502_common_init(running_device *device, device_irq_callback irqcallback, UINT8 subtype, void (*const *insn)(m6502_Regs *cpustate), const char *type) +static void m6502_common_init(cpu_device *device, device_irq_callback irqcallback, UINT8 subtype, void (*const *insn)(m6502_Regs *cpustate), const char *type) { m6502_Regs *cpustate = get_safe_token(device); const m6502_interface *intf = (const m6502_interface *)device->baseconfig().static_config(); cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->space = device_memory(device)->space(AS_PROGRAM); + cpustate->space = device->space(AS_PROGRAM); cpustate->subtype = subtype; cpustate->insn = insn; cpustate->rdmem_id = default_rdmem_id; @@ -528,7 +528,7 @@ static CPU_INIT( deco16 ) { m6502_Regs *cpustate = get_safe_token(device); m6502_common_init(device, irqcallback, SUBTYPE_DECO16, insndeco16, "deco16"); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->io = device->space(AS_IO); } @@ -691,7 +691,7 @@ static CPU_SET_INFO( m6502 ) CPU_GET_INFO( m6502 ) { - m6502_Regs *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m6502_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { @@ -809,7 +809,7 @@ static CPU_SET_INFO( m6510 ) CPU_GET_INFO( m6510 ) { - m6502_Regs *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m6502_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/m6502/m6509.c b/src/emu/cpu/m6502/m6509.c index 0e6977ef869..a557e255a03 100644 --- a/src/emu/cpu/m6502/m6509.c +++ b/src/emu/cpu/m6502/m6509.c @@ -78,7 +78,7 @@ struct _m6509_Regs { UINT8 irq_state; UINT8 so_state; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *space; int icount; @@ -147,7 +147,7 @@ static CPU_INIT( m6509 ) cpustate->wrmem_id = default_wdmem_id; cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->space = device_memory(device)->space(AS_PROGRAM); + cpustate->space = device->space(AS_PROGRAM); if ( intf ) { @@ -330,7 +330,7 @@ static CPU_SET_INFO( m6509 ) CPU_GET_INFO( m6509 ) { - m6509_Regs *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m6509_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/m6502/m65ce02.c b/src/emu/cpu/m6502/m65ce02.c index bdc0179ae73..28763d08561 100644 --- a/src/emu/cpu/m6502/m65ce02.c +++ b/src/emu/cpu/m6502/m65ce02.c @@ -75,7 +75,7 @@ struct _m65ce02_Regs { UINT8 irq_state; int icount; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *space; read8_space_func rdmem_id; /* readmem callback for indexed instructions */ write8_space_func wrmem_id; /* writemem callback for indexed instructions */ @@ -107,7 +107,7 @@ static CPU_INIT( m65ce02 ) cpustate->wrmem_id = default_wdmem_id; cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->space = device_memory(device)->space(AS_PROGRAM); + cpustate->space = device->space(AS_PROGRAM); if ( intf ) { @@ -275,7 +275,7 @@ static CPU_SET_INFO( m65ce02 ) CPU_GET_INFO( m65ce02 ) { - m65ce02_Regs *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m65ce02_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch( state ) { diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c index 28e3664c17b..afec742ce22 100644 --- a/src/emu/cpu/m6800/m6800.c +++ b/src/emu/cpu/m6800/m6800.c @@ -113,7 +113,7 @@ struct _m6800_state UINT8 ic_eddge; /* InputCapture eddge , b.0=fall,b.1=raise */ device_irq_callback irq_callback; - running_device *device; + cpu_device *device; /* Memory spaces */ const address_space *program; @@ -897,9 +897,9 @@ static CPU_INIT( m6800 ) { m6800_state *cpustate = get_safe_token(device); - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); // cpustate->subtype = SUBTYPE_M6800; cpustate->insn = m6800_insn; @@ -1293,9 +1293,9 @@ static CPU_INIT( m6801 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); cpustate->clock = device->clock() / 4; cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate); @@ -1316,9 +1316,9 @@ static CPU_INIT( m6802 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); state_register(cpustate, "m6802"); } @@ -1335,9 +1335,9 @@ static CPU_INIT( m6803 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); cpustate->clock = device->clock() / 4; cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate); @@ -1669,9 +1669,9 @@ static CPU_INIT( m6808 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); state_register(cpustate, "m6808"); } @@ -1689,9 +1689,9 @@ static CPU_INIT( hd63701 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); cpustate->clock = device->clock() / 4; cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate); @@ -2037,9 +2037,9 @@ static CPU_INIT( nsc8105 ) // cpustate->subtype = SUBTYPE_NSC8105; cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); cpustate->insn = nsc8105_insn; cpustate->cycles = cycles_nsc8105; @@ -2671,7 +2671,7 @@ static CPU_SET_INFO( m6800 ) CPU_GET_INFO( m6800 ) { - m6800_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m6800_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c index f07eed4531f..a879a7e94b2 100644 --- a/src/emu/cpu/m68000/m68kcpu.c +++ b/src/emu/cpu/m68000/m68kcpu.c @@ -637,7 +637,7 @@ static CPU_INIT( m68k ) m68ki_cpu_core *m68k = get_safe_token(device); m68k->device = device; - m68k->program = device_memory(device)->space(AS_PROGRAM); + m68k->program = device->space(AS_PROGRAM); m68k->int_ack_callback = irqcallback; /* The first call to this function initializes the opcode handler jump table */ @@ -885,7 +885,7 @@ static CPU_EXPORT_STRING( m68k ) static CPU_GET_INFO( m68k ) { - m68ki_cpu_core *m68k = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m68ki_cpu_core *m68k = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/m68000/m68kcpu.h b/src/emu/cpu/m68000/m68kcpu.h index 65b6eb3d3fd..a5eb5b32be3 100644 --- a/src/emu/cpu/m68000/m68kcpu.h +++ b/src/emu/cpu/m68000/m68kcpu.h @@ -627,7 +627,7 @@ struct _m68ki_cpu_core m68k_rte_func rte_instr_callback; /* Called when a RTE instruction is encountered */ m68k_tas_func tas_instr_callback; /* Called when a TAS instruction is encountered, allows / disallows writeback */ - running_device *device; + cpu_device *device; const address_space *program; m68k_memory_interface memory; offs_t encrypted_start; diff --git a/src/emu/cpu/m6805/m6805.c b/src/emu/cpu/m6805/m6805.c index bca36f885bb..1655cab7042 100644 --- a/src/emu/cpu/m6805/m6805.c +++ b/src/emu/cpu/m6805/m6805.c @@ -61,7 +61,7 @@ typedef struct UINT16 pending_interrupts; /* MB */ device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; int irq_state[9]; /* KW Additional lines for HD63705 */ int nmi_state; @@ -441,7 +441,7 @@ static void Interrupt( m6805_Regs *cpustate ) } } -static void state_register(m6805_Regs *cpustate, const char *type, running_device *device) +static void state_register(m6805_Regs *cpustate, const char *type, cpu_device *device) { state_save_register_device_item(device, 0, A); state_save_register_device_item(device, 0, PC); @@ -459,7 +459,7 @@ static CPU_INIT( m6805 ) state_register(cpustate, "m6805", device); cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); } static CPU_RESET( m6805 ) @@ -472,7 +472,7 @@ static CPU_RESET( m6805 ) cpustate->iCount=50000; /* Used to be global */ cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); /* Force CPU sub-type and relevant masks */ cpustate->subtype = SUBTYPE_M6805; @@ -907,7 +907,7 @@ static CPU_SET_INFO( m6805 ) CPU_GET_INFO( m6805 ) { - m6805_Regs *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m6805_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { @@ -1001,7 +1001,7 @@ static CPU_SET_INFO( m68705 ) CPU_GET_INFO( m68705 ) { - m6805_Regs *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m6805_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { @@ -1048,7 +1048,7 @@ static CPU_SET_INFO( hd63705 ) CPU_GET_INFO( hd63705 ) { - m6805_Regs *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m6805_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/m6809/m6809.c b/src/emu/cpu/m6809/m6809.c index 65debfcf7fd..70cd799ca6b 100644 --- a/src/emu/cpu/m6809/m6809.c +++ b/src/emu/cpu/m6809/m6809.c @@ -99,7 +99,7 @@ struct _m68_state_t int extra_cycles; /* cycles used up by interrupts */ device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const m6809_config *config; int icount; PAIR ea; /* effective address */ @@ -383,7 +383,7 @@ static CPU_INIT( m6809 ) m68_state->irq_callback = irqcallback; m68_state->device = device; - m68_state->program = device_memory(device)->space(AS_PROGRAM); + m68_state->program = device->space(AS_PROGRAM); /* setup regtable */ @@ -1101,7 +1101,7 @@ static CPU_SET_INFO( m6809 ) CPU_GET_INFO( m6809 ) { - m68_state_t *m68_state = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + m68_state_t *m68_state = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/mb86233/mb86233.c b/src/emu/cpu/mb86233/mb86233.c index c5fb8016f9a..fff1fdb5a35 100644 --- a/src/emu/cpu/mb86233/mb86233.c +++ b/src/emu/cpu/mb86233/mb86233.c @@ -50,7 +50,7 @@ struct _mb86233_state UINT32 gpr[16]; UINT32 extport[0x30]; - running_device *device; + cpu_device *device; const address_space *program; int icount; @@ -112,7 +112,7 @@ static CPU_INIT( mb86233 ) memset(cpustate, 0, sizeof( *cpustate ) ); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); if ( _config ) { @@ -1606,7 +1606,7 @@ static CPU_SET_INFO( mb86233 ) CPU_GET_INFO( mb86233 ) { - mb86233_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + mb86233_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/mb88xx/mb88xx.c b/src/emu/cpu/mb88xx/mb88xx.c index f21dde9f633..5c2d3e6519f 100644 --- a/src/emu/cpu/mb88xx/mb88xx.c +++ b/src/emu/cpu/mb88xx/mb88xx.c @@ -74,7 +74,7 @@ struct _mb88_state /* IRQ handling */ UINT8 pending_interrupt; device_irq_callback irqcallback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *data; const address_space *io; @@ -144,9 +144,9 @@ static CPU_INIT( mb88 ) cpustate->irqcallback = irqcallback; cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); cpustate->serial = timer_alloc(device->machine, serial_timer, (void *)device); @@ -209,7 +209,7 @@ static CPU_RESET( mb88 ) static TIMER_CALLBACK( serial_timer ) { - mb88_state *cpustate = get_safe_token((running_device *)ptr); + mb88_state *cpustate = get_safe_token((cpu_device *)ptr); cpustate->SBcount++; @@ -926,7 +926,7 @@ static CPU_SET_INFO( mb88 ) CPU_GET_INFO( mb88 ) { - mb88_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + mb88_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/mc68hc11/mc68hc11.c b/src/emu/cpu/mc68hc11/mc68hc11.c index c701e911d16..864afd21056 100644 --- a/src/emu/cpu/mc68hc11/mc68hc11.c +++ b/src/emu/cpu/mc68hc11/mc68hc11.c @@ -61,7 +61,7 @@ struct _hc11_state device_irq_callback irq_callback; UINT8 irq_state[2]; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -416,8 +416,8 @@ static CPU_INIT( hc11 ) cpustate->ram_position = 0x100; cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); } static CPU_RESET( hc11 ) @@ -537,7 +537,7 @@ static CPU_SET_INFO( mc68hc11 ) CPU_GET_INFO( mc68hc11 ) { - hc11_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + hc11_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/mcs48/mcs48.c b/src/emu/cpu/mcs48/mcs48.c index 44aa706e9e6..6d32a32a926 100644 --- a/src/emu/cpu/mcs48/mcs48.c +++ b/src/emu/cpu/mcs48/mcs48.c @@ -150,7 +150,7 @@ struct _mcs48_state UINT16 a11; /* A11 value, either 0x000 or 0x800 */ device_irq_callback irq_callback; - running_device *device; + cpu_device *device; int icount; /* Memory spaces */ @@ -840,7 +840,7 @@ static const mcs48_ophandler opcode_table[256]= mcs48_init - generic MCS-48 initialization -------------------------------------------------*/ -static void mcs48_init(running_device *device, device_irq_callback irqcallback, UINT8 feature_mask, UINT16 romsize) +static void mcs48_init(cpu_device *device, device_irq_callback irqcallback, UINT8 feature_mask, UINT16 romsize) { mcs48_state *cpustate = get_safe_token(device); @@ -857,9 +857,9 @@ static void mcs48_init(running_device *device, device_irq_callback irqcallback, cpustate->int_rom_size = romsize; cpustate->feature_mask = feature_mask; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); /* set up the state table */ { @@ -1190,7 +1190,7 @@ UINT8 upi41_master_r(running_device *device, UINT8 a0) static TIMER_CALLBACK( master_callback ) { - running_device *device = (running_device *)ptr; + cpu_device *device = (cpu_device *)ptr; mcs48_state *cpustate = get_safe_token(device); UINT8 a0 = (param >> 8) & 1; UINT8 data = param; @@ -1213,8 +1213,9 @@ static TIMER_CALLBACK( master_callback ) cpustate->sts |= STS_F1; } -void upi41_master_w(running_device *device, UINT8 a0, UINT8 data) +void upi41_master_w(running_device *_device, UINT8 a0, UINT8 data) { + cpu_device *device = downcast<cpu_device *>(_device); timer_call_after_resynch(device->machine, (void *)device, (a0 << 8) | data, master_callback); } @@ -1359,7 +1360,7 @@ static CPU_SET_INFO( mcs48 ) static CPU_GET_INFO( mcs48 ) { - mcs48_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + mcs48_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { @@ -1418,7 +1419,7 @@ static CPU_GET_INFO( mcs48 ) CPU-SPECIFIC CONTEXT ACCESS ***************************************************************************/ -static void mcs48_generic_get_info(const device_config *devconfig, running_device *device, UINT32 state, cpuinfo *info, UINT8 features, int romsize, int ramsize, const char *name) +static void mcs48_generic_get_info(const device_config *devconfig, cpu_device *device, UINT32 state, cpuinfo *info, UINT8 features, int romsize, int ramsize, const char *name) { switch (state) { diff --git a/src/emu/cpu/mcs51/mcs51.c b/src/emu/cpu/mcs51/mcs51.c index e42eb551331..cff33b1457f 100644 --- a/src/emu/cpu/mcs51/mcs51.c +++ b/src/emu/cpu/mcs51/mcs51.c @@ -282,7 +282,7 @@ struct _mcs51_state_t /* Interrupt Callback */ device_irq_callback irq_callback; - running_device *device; + cpu_device *device; /* Memory spaces */ const address_space *program; @@ -2079,9 +2079,9 @@ static CPU_INIT( mcs51 ) mcs51_state->irq_callback = irqcallback; mcs51_state->device = device; - mcs51_state->program = device_memory(device)->space(AS_PROGRAM); - mcs51_state->data = device_memory(device)->space(AS_DATA); - mcs51_state->io = device_memory(device)->space(AS_IO); + mcs51_state->program = device->space(AS_PROGRAM); + mcs51_state->data = device->space(AS_DATA); + mcs51_state->io = device->space(AS_IO); mcs51_state->features = FEATURE_NONE; mcs51_state->ram_mask = 0x7F; /* 128 bytes of ram */ @@ -2475,7 +2475,7 @@ static CPU_SET_INFO( mcs51 ) static CPU_GET_INFO( mcs51 ) { - mcs51_state_t *mcs51_state = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + mcs51_state_t *mcs51_state = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/minx/minx.c b/src/emu/cpu/minx/minx.c index 202b9a21da2..e2007891588 100644 --- a/src/emu/cpu/minx/minx.c +++ b/src/emu/cpu/minx/minx.c @@ -84,7 +84,7 @@ typedef struct { UINT8 halted; UINT8 interrupt_pending; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; int icount; } minx_state; @@ -120,7 +120,7 @@ static CPU_INIT( minx ) minx_state *minx = get_safe_token(device); minx->irq_callback = irqcallback; minx->device = device; - minx->program = device_memory(device)->space(AS_PROGRAM); + minx->program = device->space(AS_PROGRAM); if ( device->baseconfig().static_config() != NULL ) { } @@ -312,7 +312,7 @@ static CPU_SET_INFO( minx ) CPU_GET_INFO( minx ) { - minx_state *minx = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + minx_state *minx = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch( state ) { case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(minx_state); break; diff --git a/src/emu/cpu/mips/mips3com.c b/src/emu/cpu/mips/mips3com.c index 221f8318791..73cc775078a 100644 --- a/src/emu/cpu/mips/mips3com.c +++ b/src/emu/cpu/mips/mips3com.c @@ -69,7 +69,7 @@ INLINE int tlb_entry_is_global(const mips3_tlb_entry *entry) structure based on the configured type -------------------------------------------------*/ -void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, running_device *device, device_irq_callback irqcallback) +void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, cpu_device *device, device_irq_callback irqcallback) { const mips3_config *config = (const mips3_config *)device->baseconfig().static_config(); int tlbindex; @@ -81,7 +81,7 @@ void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, runnin mips->cpu_clock = device->clock(); mips->irq_callback = irqcallback; mips->device = device; - mips->program = device_memory(device)->space(AS_PROGRAM); + mips->program = device->space(AS_PROGRAM); mips->icache_size = config->icache; mips->dcache_size = config->dcache; mips->system_clock = config->system_clock; @@ -751,7 +751,7 @@ void mips3com_get_info(mips3_state *mips, UINT32 state, cpuinfo *info) static TIMER_CALLBACK( compare_int_callback ) { - running_device *device = (running_device *)ptr; + cpu_device *device = (cpu_device *)ptr; cpu_set_input_line(device, MIPS3_IRQ5, ASSERT_LINE); } diff --git a/src/emu/cpu/mips/mips3com.h b/src/emu/cpu/mips/mips3com.h index 282d208d002..40affea6712 100644 --- a/src/emu/cpu/mips/mips3com.h +++ b/src/emu/cpu/mips/mips3com.h @@ -195,7 +195,7 @@ struct _mips3_state /* internal stuff */ mips3_flavor flavor; device_irq_callback irq_callback; - running_device *device; + cpu_device * device; const address_space *program; UINT32 system_clock; UINT32 cpu_clock; @@ -229,7 +229,7 @@ struct _mips3_state FUNCTION PROTOTYPES ***************************************************************************/ -void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, running_device *device, device_irq_callback irqcallback); +void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, cpu_device *device, device_irq_callback irqcallback); void mips3com_exit(mips3_state *mips); void mips3com_reset(mips3_state *mips); diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c index 0b2a72df334..8ac134630a5 100644 --- a/src/emu/cpu/mips/mips3drc.c +++ b/src/emu/cpu/mips/mips3drc.c @@ -359,7 +359,7 @@ INLINE void save_fast_iregs(mips3_state *mips3, drcuml_block *block) mips3_init - initialize the processor -------------------------------------------------*/ -static void mips3_init(mips3_flavor flavor, int bigendian, running_device *device, device_irq_callback irqcallback) +static void mips3_init(mips3_flavor flavor, int bigendian, cpu_device *device, device_irq_callback irqcallback) { drcfe_config feconfig = { @@ -380,7 +380,7 @@ static void mips3_init(mips3_flavor flavor, int bigendian, running_device *devic fatalerror("Unable to allocate cache of size %d", (UINT32)(CACHE_SIZE + sizeof(*mips3))); /* allocate the core memory */ - *(mips3_state **)downcast<cpu_device *>(device)->token() = mips3 = (mips3_state *)drccache_memory_alloc_near(cache, sizeof(*mips3)); + *(mips3_state **)device->token() = mips3 = (mips3_state *)drccache_memory_alloc_near(cache, sizeof(*mips3)); memset(mips3, 0, sizeof(*mips3)); /* initialize the core */ @@ -601,7 +601,7 @@ static CPU_SET_INFO( mips3 ) static CPU_GET_INFO( mips3 ) { - mips3_state *mips3 = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + mips3_state *mips3 = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/mips/psx.c b/src/emu/cpu/mips/psx.c index e4ce31d14e0..5bd20f45f6d 100644 --- a/src/emu/cpu/mips/psx.c +++ b/src/emu/cpu/mips/psx.c @@ -185,7 +185,7 @@ struct _psxcpu_state UINT32 multiplier_operand1; UINT32 multiplier_operand2; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; int bus_attached; UINT32 bad_byte_address_mask; @@ -1605,7 +1605,7 @@ static STATE_POSTLOAD( mips_postload ) mips_update_scratchpad( psxcpu->program ); } -static void mips_state_register( const char *type, running_device *device ) +static void mips_state_register( const char *type, cpu_device *device ) { psxcpu_state *psxcpu = get_safe_token(device); @@ -1636,7 +1636,7 @@ static CPU_INIT( psxcpu ) psxcpu->irq_callback = irqcallback; psxcpu->device = device; - psxcpu->program = device_memory(device)->space(AS_PROGRAM); + psxcpu->program = device->space(AS_PROGRAM); mips_state_register( "psxcpu", device ); } @@ -6110,7 +6110,7 @@ static CPU_SET_INFO( psxcpu ) CPU_GET_INFO( psxcpu ) { - psxcpu_state *psxcpu = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + psxcpu_state *psxcpu = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/mips/r3000.c b/src/emu/cpu/mips/r3000.c index 94a08d52af3..d3536a4e9d1 100644 --- a/src/emu/cpu/mips/r3000.c +++ b/src/emu/cpu/mips/r3000.c @@ -138,7 +138,7 @@ struct _r3000_state int interrupt_cycles; int hasfpu; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; /* endian-dependent load/store */ @@ -312,7 +312,7 @@ static CPU_INIT( r3000 ) r3000->irq_callback = irqcallback; r3000->device = device; - r3000->program = device_memory(device)->space(AS_PROGRAM); + r3000->program = device->space(AS_PROGRAM); } @@ -1163,7 +1163,7 @@ static CPU_SET_INFO( r3000 ) static CPU_GET_INFO( r3000 ) { - r3000_state *r3000 = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + r3000_state *r3000 = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/mn10200/mn10200.c b/src/emu/cpu/mn10200/mn10200.c index 1c66ae76d45..1ade08214f4 100644 --- a/src/emu/cpu/mn10200/mn10200.c +++ b/src/emu/cpu/mn10200/mn10200.c @@ -64,7 +64,7 @@ struct _mn102_info int cycles; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; }; @@ -276,8 +276,8 @@ static CPU_INIT(mn10200) memset(cpustate, 0, sizeof(mn102_info)); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); state_save_register_device_item(device, 0, cpustate->pc); state_save_register_device_item_array(device, 0, cpustate->d); @@ -2335,7 +2335,7 @@ static UINT32 mn10200_r(mn102_info *mn102, UINT32 adr, int type) static CPU_SET_INFO(mn10200) { - mn102_info *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + mn102_info *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { @@ -2364,7 +2364,7 @@ static CPU_SET_INFO(mn10200) CPU_GET_INFO( mn10200 ) { - mn102_info *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + mn102_info *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/nec/nec.c b/src/emu/cpu/nec/nec.c index b705963df27..b7fb4c26476 100644 --- a/src/emu/cpu/nec/nec.c +++ b/src/emu/cpu/nec/nec.c @@ -161,7 +161,7 @@ struct _nec_state_t UINT8 no_interrupt; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -1100,7 +1100,7 @@ static CPU_DISASSEMBLE( nec ) return necv_dasm_one(buffer, pc, oprom, nec_state->config); } -static void nec_init(running_device *device, device_irq_callback irqcallback, int type) +static void nec_init(cpu_device *device, device_irq_callback irqcallback, int type) { const nec_config *config = device->baseconfig().static_config() ? (const nec_config *)device->baseconfig().static_config() : &default_config; nec_state_t *nec_state = get_safe_token(device); @@ -1130,8 +1130,8 @@ static void nec_init(running_device *device, device_irq_callback irqcallback, in nec_state->irq_callback = irqcallback; nec_state->device = device; - nec_state->program = device_memory(device)->space(AS_PROGRAM); - nec_state->io = device_memory(device)->space(AS_IO); + nec_state->program = device->space(AS_PROGRAM); + nec_state->io = device->space(AS_IO); } @@ -1320,7 +1320,7 @@ static CPU_SET_INFO( nec ) static CPU_GET_INFO( nec ) { - nec_state_t *nec_state = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + nec_state_t *nec_state = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; int flags; switch (state) diff --git a/src/emu/cpu/pdp1/pdp1.c b/src/emu/cpu/pdp1/pdp1.c index 82ee77aa82b..90e5c57038d 100644 --- a/src/emu/cpu/pdp1/pdp1.c +++ b/src/emu/cpu/pdp1/pdp1.c @@ -417,7 +417,7 @@ struct _pdp1_state /* 1 for 16-line sequence break system, 0 for default break system */ int type_20_sbs; - running_device *device; + cpu_device *device; const address_space *program; int icount; }; @@ -545,7 +545,7 @@ static CPU_INIT( pdp1 ) /* clean-up */ memset (cpustate, 0, sizeof (*cpustate)); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); /* set up params and callbacks */ for (i=0; i<64; i++) @@ -936,7 +936,7 @@ static CPU_SET_INFO( pdp1 ) CPU_GET_INFO( pdp1 ) { - pdp1_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + pdp1_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/pdp1/tx0.c b/src/emu/cpu/pdp1/tx0.c index 29f925f5e74..4325a03e057 100644 --- a/src/emu/cpu/pdp1/tx0.c +++ b/src/emu/cpu/pdp1/tx0.c @@ -64,7 +64,7 @@ struct _tx0_state int icount; - running_device *device; + cpu_device *device; const address_space *program; }; @@ -126,7 +126,7 @@ static void tx0_write(tx0_state *cpustate, offs_t address, int data) ; } -static void tx0_init_common(running_device *device, device_irq_callback irqcallback, int is_64kw) +static void tx0_init_common(cpu_device *device, device_irq_callback irqcallback, int is_64kw) { tx0_state *cpustate = get_safe_token(device); @@ -137,7 +137,7 @@ static void tx0_init_common(running_device *device, device_irq_callback irqcallb cpustate->ir_mask = is_64kw ? 03 : 037; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); } static CPU_INIT( tx0_64kw ) @@ -434,7 +434,7 @@ static CPU_SET_INFO( tx0 ) CPU_GET_INFO( tx0_64kw ) { - tx0_state *cpustate = ( device != NULL && downcast<cpu_device *>(device)->token() != NULL ) ? get_safe_token(device) : NULL; + tx0_state *cpustate = ( device != NULL && device->token() != NULL ) ? get_safe_token(device) : NULL; switch (state) { @@ -560,7 +560,7 @@ CPU_GET_INFO( tx0_64kw ) CPU_GET_INFO( tx0_8kw ) { - tx0_state *cpustate = ( device != NULL && downcast<cpu_device *>(device)->token() != NULL ) ? get_safe_token(device) : NULL; + tx0_state *cpustate = ( device != NULL && device->token() != NULL ) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/pic16c5x/pic16c5x.c b/src/emu/cpu/pic16c5x/pic16c5x.c index d10bfe0911f..93fe404672c 100644 --- a/src/emu/cpu/pic16c5x/pic16c5x.c +++ b/src/emu/cpu/pic16c5x/pic16c5x.c @@ -97,7 +97,7 @@ struct _pic16c5x_state int inst_cycles; - running_device *device; + cpu_device *device; const address_space *program; const address_space *data; const address_space *io; @@ -729,9 +729,9 @@ static CPU_INIT( pic16c5x ) pic16c5x_state *cpustate = get_safe_token(device); cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); /* ensure the internal ram pointers are set before get_info is called */ update_internalram_ptr(cpustate); @@ -996,7 +996,7 @@ static CPU_SET_INFO( pic16c5x ) static CPU_GET_INFO( pic16c5x ) { - pic16c5x_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + pic16c5x_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/pic16c62x/pic16c62x.c b/src/emu/cpu/pic16c62x/pic16c62x.c index 98c97b162ed..ca92a055e85 100644 --- a/src/emu/cpu/pic16c62x/pic16c62x.c +++ b/src/emu/cpu/pic16c62x/pic16c62x.c @@ -87,7 +87,7 @@ struct _pic16c62x_state int inst_cycles; - running_device *device; + cpu_device *device; const address_space *program; const address_space *data; const address_space *io; @@ -837,9 +837,9 @@ static CPU_INIT( pic16c62x ) pic16c62x_state *cpustate = get_safe_token(device); cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); cpustate->CONFIG = 0x3fff; @@ -1114,7 +1114,7 @@ static CPU_SET_INFO( pic16c62x ) static CPU_GET_INFO( pic16c62x ) { - pic16c62x_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + pic16c62x_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/powerpc/ppc.c b/src/emu/cpu/powerpc/ppc.c index 41d71c75007..8f7468eeef3 100644 --- a/src/emu/cpu/powerpc/ppc.c +++ b/src/emu/cpu/powerpc/ppc.c @@ -306,7 +306,7 @@ typedef struct { UINT64 tb; /* 56-bit timebase register */ device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; // STUFF added for the 6xx series @@ -963,7 +963,7 @@ static CPU_INIT( ppc403 ) ppc.irq_callback = irqcallback; ppc.device = device; - ppc.program = device_memory(device)->space(AS_PROGRAM); + ppc.program = device->space(AS_PROGRAM); ppc.pvr = configdata->pvr; } @@ -1088,7 +1088,7 @@ static CPU_INIT( ppc603 ) ppc.irq_callback = irqcallback; ppc.device = device; - ppc.program = device_memory(device)->space(AS_PROGRAM); + ppc.program = device->space(AS_PROGRAM); ppc.pvr = configdata->pvr; @@ -1236,7 +1236,7 @@ static CPU_INIT( ppc602 ) ppc.irq_callback = irqcallback; ppc.device = device; - ppc.program = device_memory(device)->space(AS_PROGRAM); + ppc.program = device->space(AS_PROGRAM); ppc.pvr = configdata->pvr; @@ -1377,7 +1377,7 @@ static CPU_INIT( mpc8240 ) ppc.irq_callback = irqcallback; ppc.device = device; - ppc.program = device_memory(device)->space(AS_PROGRAM); + ppc.program = device->space(AS_PROGRAM); ppc.pvr = configdata->pvr; @@ -1503,7 +1503,7 @@ static CPU_INIT( ppc601 ) ppc.irq_callback = irqcallback; ppc.device = device; - ppc.program = device_memory(device)->space(AS_PROGRAM); + ppc.program = device->space(AS_PROGRAM); ppc.pvr = configdata->pvr; @@ -1633,7 +1633,7 @@ static CPU_INIT( ppc604 ) ppc.irq_callback = irqcallback; ppc.device = device; - ppc.program = device_memory(device)->space(AS_PROGRAM); + ppc.program = device->space(AS_PROGRAM); ppc.pvr = configdata->pvr; diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c index 66cd194eb4a..88f50d4e136 100644 --- a/src/emu/cpu/powerpc/ppccom.c +++ b/src/emu/cpu/powerpc/ppccom.c @@ -286,7 +286,7 @@ INLINE int sign_double(double x) structure based on the configured type -------------------------------------------------*/ -void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, running_device *device, device_irq_callback irqcallback) +void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, cpu_device *device, device_irq_callback irqcallback) { const powerpc_config *config = (const powerpc_config *)device->baseconfig().static_config(); @@ -299,11 +299,11 @@ void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_di ppc->cpu_clock = device->clock(); ppc->irq_callback = irqcallback; ppc->device = device; - ppc->program = device_memory(device)->space(AS_PROGRAM); + ppc->program = device->space(AS_PROGRAM); ppc->system_clock = (config != NULL) ? config->bus_frequency : device->clock(); ppc->tb_divisor = (ppc->tb_divisor * device->clock() + ppc->system_clock / 2 - 1) / ppc->system_clock; ppc->codexor = 0; - if (!(cap & PPCCAP_4XX) && device_memory(device)->space_config()->m_endianness != ENDIANNESS_NATIVE) + if (!(cap & PPCCAP_4XX) && device->space_config()->m_endianness != ENDIANNESS_NATIVE) ppc->codexor = 4; /* allocate the virtual TLB */ diff --git a/src/emu/cpu/powerpc/ppccom.h b/src/emu/cpu/powerpc/ppccom.h index 698dd1f228b..c54b4439df2 100644 --- a/src/emu/cpu/powerpc/ppccom.h +++ b/src/emu/cpu/powerpc/ppccom.h @@ -551,7 +551,7 @@ struct _powerpc_state /* internal stuff */ device_irq_callback irq_callback; - running_device *device; + cpu_device * device; const address_space *program; offs_t codexor; UINT32 irq_pending; @@ -571,7 +571,7 @@ struct _powerpc_state FUNCTION PROTOTYPES ***************************************************************************/ -void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, running_device *device, device_irq_callback irqcallback); +void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, cpu_device *device, device_irq_callback irqcallback); void ppccom_exit(powerpc_state *ppc); void ppccom_reset(powerpc_state *ppc); diff --git a/src/emu/cpu/powerpc/ppcdrc.c b/src/emu/cpu/powerpc/ppcdrc.c index 0da960f9bea..60e97f82c1f 100644 --- a/src/emu/cpu/powerpc/ppcdrc.c +++ b/src/emu/cpu/powerpc/ppcdrc.c @@ -547,7 +547,7 @@ INLINE UINT32 compute_spr(UINT32 spr) ppcdrc_init - initialize the processor -------------------------------------------------*/ -static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, running_device *device, device_irq_callback irqcallback) +static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, cpu_device *device, device_irq_callback irqcallback) { drcfe_config feconfig = { @@ -568,7 +568,7 @@ static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, runnin fatalerror("Unable to allocate cache of size %d", (UINT32)(CACHE_SIZE + sizeof(*ppc))); /* allocate the core from the near cache */ - *(powerpc_state **)downcast<cpu_device *>(device)->token() = ppc = (powerpc_state *)drccache_memory_alloc_near(cache, sizeof(*ppc)); + *(powerpc_state **)device->token() = ppc = (powerpc_state *)drccache_memory_alloc_near(cache, sizeof(*ppc)); memset(ppc, 0, sizeof(*ppc)); /* initialize the core */ @@ -793,7 +793,7 @@ static CPU_SET_INFO( ppcdrc ) static CPU_GET_INFO( ppcdrc ) { - powerpc_state *ppc = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + powerpc_state *ppc = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ @@ -1478,7 +1478,7 @@ static void static_generate_memory_accessor(powerpc_state *ppc, int mode, int si /* on exit, read result is in I0 */ /* routine trashes I0-I3 */ drcuml_state *drcuml = ppc->impstate->drcuml; - int fastxor = BYTE8_XOR_BE(0) >> (int)(device_memory(ppc->device)->space_config(AS_PROGRAM)->m_databus_width < 64); + int fastxor = BYTE8_XOR_BE(0) >> (int)(ppc->device->space_config(AS_PROGRAM)->m_databus_width < 64); drcuml_block *block; jmp_buf errorbuf; int translate_type; @@ -4290,7 +4290,7 @@ static void log_opcode_desc(drcuml_state *drcuml, const opcode_desc *desclist, i static CPU_GET_INFO( ppcdrc4xx ) { - powerpc_state *ppc = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + powerpc_state *ppc = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; CPU_GET_INFO_CALL(ppcdrc); ppc4xx_get_info(ppc, state, info); } diff --git a/src/emu/cpu/rsp/rsp.c b/src/emu/cpu/rsp/rsp.c index 721a8ff0aaa..edeee379749 100644 --- a/src/emu/cpu/rsp/rsp.c +++ b/src/emu/cpu/rsp/rsp.c @@ -308,7 +308,7 @@ static CPU_INIT( rsp ) rsp->irq_callback = irqcallback; rsp->device = device; - rsp->program = device_memory(device)->space(AS_PROGRAM); + rsp->program = device->space(AS_PROGRAM); #if 1 // Inaccurate. RSP registers power on to a random state... @@ -2865,7 +2865,7 @@ static CPU_SET_INFO( rsp ) CPU_GET_INFO( rsp ) { - rsp_state *rsp = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + rsp_state *rsp = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/rsp/rsp.h b/src/emu/cpu/rsp/rsp.h index 02baab1f4f6..65b7f7ae245 100644 --- a/src/emu/cpu/rsp/rsp.h +++ b/src/emu/cpu/rsp/rsp.h @@ -209,7 +209,7 @@ struct _rsp_state UINT32 nextpc; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; int icount; diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c index 4bee6959240..878120a60d0 100644 --- a/src/emu/cpu/rsp/rspdrc.c +++ b/src/emu/cpu/rsp/rspdrc.c @@ -684,7 +684,7 @@ static const int vector_elements_2[16][8] = { 7, 7, 7, 7, 7, 7, 7, 7 }, // 7 }; -static void rspcom_init(rsp_state *rsp, running_device *device, device_irq_callback irqcallback) +static void rspcom_init(rsp_state *rsp, cpu_device *device, device_irq_callback irqcallback) { int regIdx = 0; int accumIdx; @@ -694,7 +694,7 @@ static void rspcom_init(rsp_state *rsp, running_device *device, device_irq_callb rsp->config = (const rsp_config *)device->baseconfig().static_config(); rsp->irq_callback = irqcallback; rsp->device = device; - rsp->program = device_memory(device)->space(AS_PROGRAM); + rsp->program = device->space(AS_PROGRAM); #if 1 // Inaccurate. RSP registers power on to a random state... @@ -747,7 +747,7 @@ static CPU_INIT( rsp ) } /* allocate the core memory */ - *(rsp_state **)downcast<cpu_device *>(device)->token() = rsp = (rsp_state *)drccache_memory_alloc_near(cache, sizeof(*rsp)); + *(rsp_state **)device->token() = rsp = (rsp_state *)drccache_memory_alloc_near(cache, sizeof(*rsp)); memset(rsp, 0, sizeof(*rsp)); rspcom_init(rsp, device, irqcallback); @@ -8594,7 +8594,7 @@ static CPU_SET_INFO( rsp ) CPU_GET_INFO( rsp ) { - rsp_state *rsp = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + rsp_state *rsp = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/s2650/s2650.c b/src/emu/cpu/s2650/s2650.c index 325b8bcb589..4b73f2da0f8 100644 --- a/src/emu/cpu/s2650/s2650.c +++ b/src/emu/cpu/s2650/s2650.c @@ -42,7 +42,7 @@ struct _s2650_regs { int icount; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; }; @@ -796,8 +796,8 @@ static CPU_INIT( s2650 ) s2650c->irq_callback = irqcallback; s2650c->device = device; - s2650c->program = device_memory(device)->space(AS_PROGRAM); - s2650c->io = device_memory(device)->space(AS_IO); + s2650c->program = device->space(AS_PROGRAM); + s2650c->io = device->space(AS_IO); state_save_register_device_item(device, 0, s2650c->ppc); state_save_register_device_item(device, 0, s2650c->page); @@ -828,8 +828,8 @@ static CPU_RESET( s2650 ) memset(s2650c->ras, 0, sizeof(s2650c->ras)); s2650c->device = device; - s2650c->program = device_memory(device)->space(AS_PROGRAM); - s2650c->io = device_memory(device)->space(AS_IO); + s2650c->program = device->space(AS_PROGRAM); + s2650c->io = device->space(AS_IO); s2650c->psl = COM | WC; /* force write */ s2650c->psu = 0xff; @@ -1545,7 +1545,7 @@ static CPU_SET_INFO( s2650 ) CPU_GET_INFO( s2650 ) { - s2650_regs *s2650c = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + s2650_regs *s2650c = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/saturn/saturn.c b/src/emu/cpu/saturn/saturn.c index 17920054d54..248e839d2d0 100644 --- a/src/emu/cpu/saturn/saturn.c +++ b/src/emu/cpu/saturn/saturn.c @@ -82,7 +82,7 @@ struct _saturn_state int monitor_id; int monitor_in; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; int icount; }; @@ -115,7 +115,7 @@ static CPU_INIT( saturn ) cpustate->config = (saturn_cpu_core *) device->baseconfig().static_config(); cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); state_save_register_device_item_array(device, 0,cpustate->reg[R0]); state_save_register_device_item_array(device, 0,cpustate->reg[R1]); @@ -304,7 +304,7 @@ static INT64 Reg64Int(Saturn64 r) CPU_GET_INFO( saturn ) { - saturn_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + saturn_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/sc61860/sc61860.c b/src/emu/cpu/sc61860/sc61860.c index 629c0ccfb9a..d977df89aae 100644 --- a/src/emu/cpu/sc61860/sc61860.c +++ b/src/emu/cpu/sc61860/sc61860.c @@ -55,7 +55,7 @@ struct _sc61860_state struct { int t2ms, t512ms; int count;} timer; - running_device *device; + cpu_device *device; const address_space *program; int icount; }; @@ -106,7 +106,7 @@ static CPU_INIT( sc61860 ) cpustate->config = (sc61860_cpu_core *) device->baseconfig().static_config(); timer_pulse(device->machine, ATTOTIME_IN_HZ(500), cpustate, 0, sc61860_2ms_tick); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); } static CPU_EXECUTE( sc61860 ) @@ -173,7 +173,7 @@ static CPU_SET_INFO( sc61860 ) CPU_GET_INFO( sc61860 ) { - sc61860_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + sc61860_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/scmp/scmp.c b/src/emu/cpu/scmp/scmp.c index fbb965c55d0..6822dc0f71a 100644 --- a/src/emu/cpu/scmp/scmp.c +++ b/src/emu/cpu/scmp/scmp.c @@ -32,7 +32,7 @@ struct _scmp_state UINT8 ER; UINT8 SR; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -518,7 +518,7 @@ static CPU_INIT( scmp ) cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); /* resolve callbacks */ devcb_resolve_write8(&cpustate->flag_out_func, &cpustate->config.flag_out_func, device); @@ -603,7 +603,7 @@ static CPU_SET_INFO( scmp ) CPU_GET_INFO( scmp ) { - scmp_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + scmp_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/se3208/se3208.c b/src/emu/cpu/se3208/se3208.c index 52abbf7152d..c9b7bc8a2c7 100644 --- a/src/emu/cpu/se3208/se3208.c +++ b/src/emu/cpu/se3208/se3208.c @@ -23,7 +23,7 @@ struct _se3208_state_t UINT32 PPC; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; UINT8 IRQ; UINT8 NMI; @@ -1718,7 +1718,7 @@ static CPU_RESET( se3208 ) memset(se3208_state,0,sizeof(se3208_state_t)); se3208_state->irq_callback = save_irqcallback; se3208_state->device = device; - se3208_state->program = device_memory(device)->space(AS_PROGRAM); + se3208_state->program = device->space(AS_PROGRAM); se3208_state->PC=SE3208_Read32(se3208_state, 0); se3208_state->SR=0; se3208_state->IRQ=CLEAR_LINE; @@ -1791,7 +1791,7 @@ static CPU_INIT( se3208 ) se3208_state->irq_callback = irqcallback; se3208_state->device = device; - se3208_state->program = device_memory(device)->space(AS_PROGRAM); + se3208_state->program = device->space(AS_PROGRAM); } static CPU_EXIT( se3208 ) @@ -1842,7 +1842,7 @@ static CPU_SET_INFO( se3208 ) CPU_GET_INFO( se3208 ) { - se3208_state_t *se3208_state = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + se3208_state_t *se3208_state = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c index b31528fafb0..0b3b42bf4c8 100644 --- a/src/emu/cpu/sh2/sh2comn.c +++ b/src/emu/cpu/sh2/sh2comn.c @@ -699,7 +699,7 @@ void sh2_exception(SH2 *sh2, const char *message, int irqline) #endif } -void sh2_common_init(SH2 *sh2, running_device *device, device_irq_callback irqcallback) +void sh2_common_init(SH2 *sh2, cpu_device *device, device_irq_callback irqcallback) { const sh2_cpu_core *conf = (const sh2_cpu_core *)device->baseconfig().static_config(); @@ -727,8 +727,8 @@ void sh2_common_init(SH2 *sh2, running_device *device, device_irq_callback irqca } sh2->irq_callback = irqcallback; sh2->device = device; - sh2->program = device_memory(device)->space(AS_PROGRAM); - sh2->internal = device_memory(device)->space(AS_PROGRAM); + sh2->program = device->space(AS_PROGRAM); + sh2->internal = device->space(AS_PROGRAM); state_save_register_device_item(device, 0, sh2->pc); state_save_register_device_item(device, 0, sh2->r[15]); diff --git a/src/emu/cpu/sh2/sh2comn.h b/src/emu/cpu/sh2/sh2comn.h index c9055133a08..bfec001a435 100644 --- a/src/emu/cpu/sh2/sh2comn.h +++ b/src/emu/cpu/sh2/sh2comn.h @@ -115,7 +115,7 @@ typedef struct INT8 irq_line_state[17]; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *internal; UINT32 *m; @@ -172,7 +172,7 @@ typedef struct #endif } SH2; -void sh2_common_init(SH2 *sh2, running_device *device, device_irq_callback irqcallback); +void sh2_common_init(SH2 *sh2, cpu_device *device, device_irq_callback irqcallback); void sh2_recalc_irq(SH2 *sh2); void sh2_set_irq_line(SH2 *sh2, int irqline, int state); void sh2_exception(SH2 *sh2, const char *message, int irqline); diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c index d0f98a19095..22473a91ec5 100644 --- a/src/emu/cpu/sh2/sh2drc.c +++ b/src/emu/cpu/sh2/sh2drc.c @@ -693,7 +693,7 @@ static CPU_INIT( sh2 ) fatalerror("Unable to allocate cache of size %d", (UINT32)(CACHE_SIZE + sizeof(SH2))); /* allocate the core memory */ - *(SH2 **)downcast<cpu_device *>(device)->token() = sh2 = (SH2 *)drccache_memory_alloc_near(cache, sizeof(SH2)); + *(SH2 **)device->token() = sh2 = (SH2 *)drccache_memory_alloc_near(cache, sizeof(SH2)); memset(sh2, 0, sizeof(SH2)); /* initialize the common core parts */ @@ -3262,7 +3262,7 @@ static CPU_SET_INFO( sh2 ) CPU_GET_INFO( sh2 ) { - SH2 *sh2 = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + SH2 *sh2 = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c index 27f9b5f44f6..aabf390f236 100644 --- a/src/emu/cpu/sh4/sh4.c +++ b/src/emu/cpu/sh4/sh4.c @@ -3281,9 +3281,9 @@ static CPU_RESET( sh4 ) sh4->ftcsr_read_callback = f; sh4->irq_callback = save_irqcallback; sh4->device = device; - sh4->internal = device_memory(device)->space(AS_PROGRAM); - sh4->program = device_memory(device)->space(AS_PROGRAM); - sh4->io = device_memory(device)->space(AS_IO); + sh4->internal = device->space(AS_PROGRAM); + sh4->program = device->space(AS_PROGRAM); + sh4->io = device->space(AS_IO); sh4->dma_timer[0] = tsaved[0]; sh4->dma_timer[1] = tsaved[1]; @@ -3392,9 +3392,9 @@ static CPU_INIT( sh4 ) sh4->irq_callback = irqcallback; sh4->device = device; - sh4->internal = device_memory(device)->space(AS_PROGRAM); - sh4->program = device_memory(device)->space(AS_PROGRAM); - sh4->io = device_memory(device)->space(AS_IO); + sh4->internal = device->space(AS_PROGRAM); + sh4->program = device->space(AS_PROGRAM); + sh4->io = device->space(AS_IO); sh4_default_exception_priorities(sh4); sh4->irln = 15; sh4->test_irq = 0; @@ -3674,7 +3674,7 @@ ADDRESS_MAP_END CPU_GET_INFO( sh4 ) { - SH4 *sh4 = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + SH4 *sh4 = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/sh4/sh4comn.h b/src/emu/cpu/sh4/sh4comn.h index 16a14f9a09c..97019604138 100644 --- a/src/emu/cpu/sh4/sh4comn.h +++ b/src/emu/cpu/sh4/sh4comn.h @@ -62,7 +62,7 @@ typedef struct INT8 irq_line_state[17]; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *internal; const address_space *program; const address_space *io; diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c index 1667b4064e8..00866dac10c 100644 --- a/src/emu/cpu/sharc/sharc.c +++ b/src/emu/cpu/sharc/sharc.c @@ -125,7 +125,7 @@ struct _SHARC_REGS UINT16 *internal_ram_block0, *internal_ram_block1; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *data; void (*opcode_handler)(SHARC_REGS *cpustate); @@ -426,8 +426,8 @@ static CPU_INIT( sharc ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->data = device_memory(device)->space(AS_DATA); + cpustate->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); build_opcode_table(); @@ -1058,7 +1058,7 @@ ADDRESS_MAP_END static CPU_GET_INFO( sharc ) { - SHARC_REGS *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + SHARC_REGS *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/sm8500/sm8500.c b/src/emu/cpu/sm8500/sm8500.c index b53c17035e8..17762d12cd0 100644 --- a/src/emu/cpu/sm8500/sm8500.c +++ b/src/emu/cpu/sm8500/sm8500.c @@ -51,7 +51,7 @@ struct _sm8500_state int halted; int icount; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; UINT8 internal_ram[0x500]; }; @@ -99,7 +99,7 @@ static CPU_INIT( sm8500 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); if ( device->baseconfig().static_config() != NULL ) { cpustate->config.handle_dma = ((SM8500_CONFIG *)device->baseconfig().static_config())->handle_dma; cpustate->config.handle_timers = ((SM8500_CONFIG *)device->baseconfig().static_config())->handle_timers; @@ -444,7 +444,7 @@ static CPU_SET_INFO( sm8500 ) CPU_GET_INFO( sm8500 ) { - sm8500_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + sm8500_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/spc700/spc700.c b/src/emu/cpu/spc700/spc700.c index 42ab36dc1f3..bbfb1aab35b 100644 --- a/src/emu/cpu/spc700/spc700.c +++ b/src/emu/cpu/spc700/spc700.c @@ -87,7 +87,7 @@ typedef struct uint line_rst; /* Status of the RESET line */ uint ir; /* Instruction Register */ device_irq_callback int_ack; - running_device *device; + cpu_device *device; const address_space *program; uint stopped; /* stopped status */ int ICount; @@ -1246,7 +1246,7 @@ INLINE void SET_FLAG_I(spc700i_cpu *cpustate, uint value) /* ================================= API ================================== */ /* ======================================================================== */ -static void state_register( running_device *device ) +static void state_register( cpu_device *device ) { spc700i_cpu *cpustate = get_safe_token(device); @@ -1287,7 +1287,7 @@ static CPU_INIT( spc700 ) INT_ACK = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); } @@ -1657,7 +1657,7 @@ static CPU_SET_INFO( spc700 ) CPU_GET_INFO( spc700 ) { - spc700i_cpu *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + spc700i_cpu *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; uint p = 0; if (cpustate != NULL) diff --git a/src/emu/cpu/ssem/ssem.c b/src/emu/cpu/ssem/ssem.c index b18c91c8096..447d9317b63 100644 --- a/src/emu/cpu/ssem/ssem.c +++ b/src/emu/cpu/ssem/ssem.c @@ -21,7 +21,7 @@ struct _ssem_state UINT32 a; UINT32 halt; - running_device *device; + cpu_device *device; const address_space *program; int icount; }; @@ -151,7 +151,7 @@ static CPU_INIT( ssem ) cpustate->halt = 0; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); } static CPU_EXIT( ssem ) @@ -255,7 +255,7 @@ static CPU_SET_INFO( ssem ) CPU_GET_INFO( ssem ) { - ssem_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + ssem_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/ssp1601/ssp1601.c b/src/emu/cpu/ssp1601/ssp1601.c index a65561bb56b..863d45c37c3 100644 --- a/src/emu/cpu/ssp1601/ssp1601.c +++ b/src/emu/cpu/ssp1601/ssp1601.c @@ -52,7 +52,7 @@ struct _ssp1601_state_t int g_cycles; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; }; @@ -529,8 +529,8 @@ static CPU_INIT( ssp1601 ) memset(ssp1601_state, 0, sizeof(ssp1601_state_t)); ssp1601_state->gr[0].w.h = 0xffff; // constant reg ssp1601_state->device = device; - ssp1601_state->program = device_memory(device)->space(AS_PROGRAM); - ssp1601_state->io = device_memory(device)->space(AS_IO); + ssp1601_state->program = device->space(AS_PROGRAM); + ssp1601_state->io = device->space(AS_IO); } @@ -808,7 +808,7 @@ static CPU_SET_INFO( ssp1601 ) CPU_GET_INFO( ssp1601 ) { - ssp1601_state_t *ssp1601_state = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + ssp1601_state_t *ssp1601_state = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/superfx/superfx.c b/src/emu/cpu/superfx/superfx.c index b6eb305d0ea..64430d186f3 100644 --- a/src/emu/cpu/superfx/superfx.c +++ b/src/emu/cpu/superfx/superfx.c @@ -61,7 +61,7 @@ struct _superfx_state cache_t cache; pixelcache_t pixelcache[2]; - running_device *device; + cpu_device *device; const address_space *program; int icount; }; @@ -669,7 +669,7 @@ void superfx_add_clocks(running_device *cpu, INT32 clocks) /*****************************************************************************/ -static void superfx_register_save( running_device *device ) +static void superfx_register_save( cpu_device *device ) { superfx_state *cpustate = get_safe_token(device); int i; @@ -753,7 +753,7 @@ static CPU_INIT( superfx ) superfx_update_speed(cpustate); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); if (device->baseconfig().static_config() != NULL) { @@ -1556,7 +1556,7 @@ static CPU_SET_INFO( superfx ) CPU_GET_INFO( superfx ) { - superfx_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + superfx_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/t11/t11.c b/src/emu/cpu/t11/t11.c index 64d341d4256..c8789186701 100644 --- a/src/emu/cpu/t11/t11.c +++ b/src/emu/cpu/t11/t11.c @@ -33,7 +33,7 @@ struct _t11_state UINT8 irq_state; int icount; device_irq_callback irq_callback; - running_device *device; + cpu_device * device; const address_space *program; }; @@ -264,7 +264,7 @@ static CPU_INIT( t11 ) cpustate->initial_pc = initial_pc[setup->mode >> 13]; cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); + cpustate->program = device->space(AS_PROGRAM); state_save_register_device_item(device, 0, cpustate->ppc.w.l); state_save_register_device_item(device, 0, cpustate->reg[0].w.l); @@ -412,7 +412,7 @@ static CPU_SET_INFO( t11 ) CPU_GET_INFO( t11 ) { - t11_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + t11_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c index e871367f5fb..b021c5b493e 100644 --- a/src/emu/cpu/tlcs90/tlcs90.c +++ b/src/emu/cpu/tlcs90/tlcs90.c @@ -31,7 +31,7 @@ typedef struct UINT8 halt, after_EI; UINT16 irq_state, irq_mask; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -2635,7 +2635,7 @@ static WRITE8_HANDLER( t90_internal_registers_w ) cpustate->internal_registers[offset] = data; } -static void state_register( running_device *device ) +static void state_register( cpu_device *device ) { t90_Regs *cpustate = get_safe_token(device); @@ -2715,8 +2715,8 @@ static CPU_INIT( t90 ) memset(cpustate, 0, sizeof(t90_Regs)); cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->timer_period = attotime_mul(ATTOTIME_IN_HZ(cpu_get_clock(device)), 8); @@ -2790,7 +2790,7 @@ static CPU_SET_INFO( t90 ) CPU_GET_INFO( tmp90840 ) { - t90_Regs *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + t90_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/tlcs900/tlcs900.c b/src/emu/cpu/tlcs900/tlcs900.c index 49ba68f5540..7193dfb5c82 100644 --- a/src/emu/cpu/tlcs900/tlcs900.c +++ b/src/emu/cpu/tlcs900/tlcs900.c @@ -72,7 +72,7 @@ struct _tlcs900_state int icount; int regbank; device_irq_callback irqcallback; - running_device *device; + cpu_device *device; const address_space *program; }; @@ -221,7 +221,7 @@ static CPU_INIT( tlcs900 ) cpustate->intf = (const tlcs900_interface *)device->baseconfig().static_config(); cpustate->irqcallback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space( AS_PROGRAM ); + cpustate->program = device->space( AS_PROGRAM ); devcb_resolve_write8( &cpustate->to1, &cpustate->intf->to1, device ); devcb_resolve_write8( &cpustate->to3, &cpustate->intf->to3, device ); @@ -1125,7 +1125,7 @@ static CPU_SET_INFO( tlcs900 ) CPU_GET_INFO( tlcs900h ) { - tlcs900_state *cpustate = ( device != NULL && downcast<cpu_device *>(device)->token() != NULL ) ? get_safe_token(device) : NULL; + tlcs900_state *cpustate = ( device != NULL && device->token() != NULL ) ? get_safe_token(device) : NULL; switch( state ) { diff --git a/src/emu/cpu/tms0980/tms0980.c b/src/emu/cpu/tms0980/tms0980.c index dab45d007da..7b29c52b036 100644 --- a/src/emu/cpu/tms0980/tms0980.c +++ b/src/emu/cpu/tms0980/tms0980.c @@ -491,7 +491,7 @@ static ADDRESS_MAP_START(data_7bit, ADDRESS_SPACE_DATA, 8) ADDRESS_MAP_END -static void cpu_init_tms_common( running_device *device, const UINT32* decode_table, UINT16 o_mask, UINT16 r_mask, UINT8 pc_size, UINT8 byte_size ) +static void cpu_init_tms_common( cpu_device *device, const UINT32* decode_table, UINT16 o_mask, UINT16 r_mask, UINT8 pc_size, UINT8 byte_size ) { tms0980_state *cpustate = get_safe_token( device ); @@ -505,8 +505,8 @@ static void cpu_init_tms_common( running_device *device, const UINT32* decode_ta cpustate->pc_size = pc_size; cpustate->byte_size = byte_size; - cpustate->program = device_memory(device)->space( AS_PROGRAM ); - cpustate->data = device_memory(device)->space( AS_PROGRAM ); + cpustate->program = device->space( AS_PROGRAM ); + cpustate->data = device->space( AS_PROGRAM ); state_save_register_device_item( device, 0, cpustate->prev_pc ); state_save_register_device_item( device, 0, cpustate->prev_pa ); @@ -1114,7 +1114,7 @@ static CPU_SET_INFO( tms0980 ) static CPU_GET_INFO( tms_generic ) { - tms0980_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms0980_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { @@ -1170,7 +1170,7 @@ static CPU_GET_INFO( tms_generic ) CPU_GET_INFO( tms0980 ) { - tms0980_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms0980_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { @@ -1193,7 +1193,7 @@ CPU_GET_INFO( tms0980 ) CPU_GET_INFO( tms1000 ) { - tms0980_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms0980_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { @@ -1250,7 +1250,7 @@ CPU_GET_INFO( tms1270 ) CPU_GET_INFO( tms1100 ) { - tms0980_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms0980_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/tms32010/tms32010.c b/src/emu/cpu/tms32010/tms32010.c index 145dc5d5fb2..a003abba462 100644 --- a/src/emu/cpu/tms32010/tms32010.c +++ b/src/emu/cpu/tms32010/tms32010.c @@ -91,7 +91,7 @@ struct _tms32010_state UINT16 memaccess; int addr_mask; - running_device *device; + cpu_device *device; const address_space *program; const address_space *data; const address_space *io; @@ -800,9 +800,9 @@ static CPU_INIT( tms32010 ) state_save_register_device_item(device, 0, cpustate->addr_mask); cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); } @@ -943,7 +943,7 @@ static CPU_SET_INFO( tms32010 ) CPU_GET_INFO( tms32010 ) { - tms32010_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms32010_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/tms32025/tms32025.c b/src/emu/cpu/tms32025/tms32025.c index c682ec0ebd5..6fad5766ff6 100644 --- a/src/emu/cpu/tms32025/tms32025.c +++ b/src/emu/cpu/tms32025/tms32025.c @@ -173,7 +173,7 @@ struct _tms32025_state int mHackIgnoreARP; /* special handling for lst, lst1 instructions */ int waiting_for_serial_frame; - running_device *device; + cpu_device *device; const address_space *program; const address_space *data; const address_space *io; @@ -1722,9 +1722,9 @@ static CPU_INIT( tms32025 ) cpustate->intRAM = auto_alloc_array(device->machine, UINT16, 0x800); cpustate->irq_callback = irqcallback; cpustate->device = device; - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); state_save_register_device_item(device, 0, cpustate->PC); state_save_register_device_item(device, 0, cpustate->STR0); @@ -2310,7 +2310,7 @@ static CPU_SET_INFO( tms32025 ) CPU_GET_INFO( tms32025 ) { - tms32025_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms32025_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/tms32031/tms32031.c b/src/emu/cpu/tms32031/tms32031.c index 26cd86a78f9..c817498227c 100644 --- a/src/emu/cpu/tms32031/tms32031.c +++ b/src/emu/cpu/tms32031/tms32031.c @@ -119,7 +119,7 @@ struct _tms32031_state tms32031_xf_func xf1_w; tms32031_iack_func iack_w; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; }; @@ -374,7 +374,7 @@ static CPU_INIT( tms32031 ) tms->irq_callback = irqcallback; tms->device = device; - tms->program = device_memory(device)->space(AS_PROGRAM); + tms->program = device->space(AS_PROGRAM); /* copy in the xf write routines */ tms->bootoffset = (configdata != NULL) ? configdata->bootoffset : 0; @@ -688,7 +688,7 @@ ADDRESS_MAP_END CPU_GET_INFO( tms32031 ) { - tms32031_state *tms = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms32031_state *tms = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; float ftemp; switch (state) diff --git a/src/emu/cpu/tms32051/tms32051.c b/src/emu/cpu/tms32051/tms32051.c index 1183e27a223..cc5cc5fe6ec 100644 --- a/src/emu/cpu/tms32051/tms32051.c +++ b/src/emu/cpu/tms32051/tms32051.c @@ -143,7 +143,7 @@ struct _tms32051_state } shadow; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *data; int icount; @@ -224,8 +224,8 @@ static CPU_INIT( tms ) tms32051_state *cpustate = get_safe_token(device); cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->data = device_memory(device)->space(AS_DATA); + cpustate->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); } static CPU_RESET( tms ) @@ -575,7 +575,7 @@ static CPU_READ( tms ) static CPU_GET_INFO( tms ) { - tms32051_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms32051_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index 9fb75e6f71a..13892fec4c3 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -62,7 +62,7 @@ struct _tms34010_state UINT8 external_host_access; UINT8 executing; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const tms34010_config *config; screen_device *screen; @@ -628,7 +628,7 @@ static CPU_INIT( tms34010 ) tms->config = configdata; tms->irq_callback = irqcallback; tms->device = device; - tms->program = device_memory(device)->space(AS_PROGRAM); + tms->program = device->space(AS_PROGRAM); tms->screen = downcast<screen_device *>(device->machine->device(configdata->screen_tag)); /* set up the state table */ @@ -689,7 +689,7 @@ static CPU_RESET( tms34010 ) tms->irq_callback = save_irqcallback; tms->scantimer = save_scantimer; tms->device = device; - tms->program = device_memory(device)->space(AS_PROGRAM); + tms->program = device->space(AS_PROGRAM); /* fetch the initial PC and reset the state */ tms->pc = RLONG(tms, 0xffffffe0) & 0xfffffff0; @@ -699,7 +699,7 @@ static CPU_RESET( tms34010 ) /* the first time we are run */ tms->reset_deferred = tms->config->halt_on_reset; if (tms->config->halt_on_reset) - tms34010_io_register_w(device_memory(device)->space(AS_PROGRAM), REG_HSTCTLH, 0x8000, 0xffff); + tms34010_io_register_w(device->space(AS_PROGRAM), REG_HSTCTLH, 0x8000, 0xffff); } @@ -1594,7 +1594,7 @@ void tms34010_host_w(running_device *cpu, int reg, int data) /* control register */ case TMS34010_HOST_CONTROL: tms->external_host_access = TRUE; - space = device_memory(tms->device)->space(AS_PROGRAM); + space = tms->device->space(AS_PROGRAM); tms34010_io_register_w(space, REG_HSTCTLH, data & 0xff00, 0xffff); tms34010_io_register_w(space, REG_HSTCTLL, data & 0x00ff, 0xffff); tms->external_host_access = FALSE; @@ -1720,7 +1720,7 @@ CPU_EXPORT_STRING( tms34010 ) CPU_GET_INFO( tms34010 ) { - tms34010_state *tms = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms34010_state *tms = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/tms57002/tms57002.c b/src/emu/cpu/tms57002/tms57002.c index 1f782b1e3e2..305fffbeacf 100644 --- a/src/emu/cpu/tms57002/tms57002.c +++ b/src/emu/cpu/tms57002/tms57002.c @@ -1342,8 +1342,8 @@ static CPU_INIT(tms57002) tms57002_t *s = get_safe_token(device); tms57002_cache_flush(s); s->sti = S_IDLE; - s->program = device_memory(device)->space(AS_PROGRAM); - s->data = device_memory(device)->space(AS_DATA); + s->program = device->space(AS_PROGRAM); + s->data = device->space(AS_DATA); } @@ -1357,7 +1357,7 @@ ADDRESS_MAP_END CPU_GET_INFO(tms57002) { - tms57002_t *s = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms57002_t *s = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(tms57002_t); break; diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c index a27e22afbb8..220ecc8d839 100644 --- a/src/emu/cpu/tms7000/tms7000.c +++ b/src/emu/cpu/tms7000/tms7000.c @@ -73,7 +73,7 @@ struct _tms7000_state UINT8 rf[0x80]; /* Register file (SJE) */ UINT8 pf[0x100]; /* Perpherial file */ device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -165,8 +165,8 @@ static CPU_INIT( tms7000 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); memset(cpustate->pf, 0, 0x100); memset(cpustate->rf, 0, 0x80); @@ -264,7 +264,7 @@ static CPU_SET_INFO( tms7000 ) CPU_GET_INFO( tms7000 ) { - tms7000_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms7000_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch( state ) { diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h index d2be6c05de9..7a8981c6fe0 100644 --- a/src/emu/cpu/tms9900/99xxcore.h +++ b/src/emu/cpu/tms9900/99xxcore.h @@ -436,7 +436,7 @@ struct _tms99xx_state /* note that this callback is used by tms9900_set_irq_line(cpustate) and tms9980a_set_irq_line(cpustate) to retreive the value on IC0-IC3 (non-standard behaviour) */ device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -1295,8 +1295,8 @@ static CPU_INIT( tms99xx ) cpustate->irq_level = 16; cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); #if (TMS99XX_MODEL == TMS9995_ID) cpustate->timer = timer_alloc(device->machine, decrementer_callback, cpustate); @@ -4634,9 +4634,9 @@ static CPU_SET_INFO( tms99xx ) * Generic get_info **************************************************************************/ -void TMS99XX_GET_INFO(const device_config *devconfig, running_device *device, UINT32 state, cpuinfo *info) +void TMS99XX_GET_INFO(const device_config *devconfig, cpu_device *device, UINT32 state, cpuinfo *info) { - tms99xx_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + tms99xx_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/unsp/unsp.c b/src/emu/cpu/unsp/unsp.c index 8e4d5624210..c7f88e108c9 100644 --- a/src/emu/cpu/unsp/unsp.c +++ b/src/emu/cpu/unsp/unsp.c @@ -115,7 +115,7 @@ static CPU_INIT( unsp ) memset(unsp->r, 0, sizeof(UINT16) * UNSP_GPR_COUNT); unsp->device = device; - unsp->program = device_memory(device)->space(AS_PROGRAM); + unsp->program = device->space(AS_PROGRAM); unsp->irq = 0; unsp->fiq = 0; } @@ -856,7 +856,7 @@ static CPU_SET_INFO( unsp ) CPU_GET_INFO( unsp ) { - unsp_state *unsp = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + unsp_state *unsp = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch(state) { diff --git a/src/emu/cpu/unsp/unsp.h b/src/emu/cpu/unsp/unsp.h index a7acc04b273..11ddd4ea90e 100644 --- a/src/emu/cpu/unsp/unsp.h +++ b/src/emu/cpu/unsp/unsp.h @@ -23,7 +23,7 @@ struct _unsp_state UINT8 sb; UINT8 saved_sb; - running_device *device; + cpu_device *device; const address_space *program; int icount; diff --git a/src/emu/cpu/upd7810/upd7810.c b/src/emu/cpu/upd7810/upd7810.c index 0d2742b277c..061d84a0e54 100644 --- a/src/emu/cpu/upd7810/upd7810.c +++ b/src/emu/cpu/upd7810/upd7810.c @@ -499,7 +499,7 @@ struct _upd7810_state void (*handle_timers)(upd7810_state *cpustate, int cycles); UPD7810_CONFIG config; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -1703,8 +1703,8 @@ static CPU_INIT( upd7810 ) cpustate->config = *(const UPD7810_CONFIG*) device->baseconfig().static_config(); cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); state_save_register_device_item(device, 0, cpustate->ppc.w.l); state_save_register_device_item(device, 0, cpustate->pc.w.l); @@ -1787,8 +1787,8 @@ static CPU_RESET( upd7810 ) cpustate->config = save_config; cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->opXX = opXX_7810; cpustate->op48 = op48; @@ -2129,7 +2129,7 @@ static CPU_SET_INFO( upd7810 ) CPU_GET_INFO( upd7810 ) { - upd7810_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + upd7810_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/v30mz/v30mz.c b/src/emu/cpu/v30mz/v30mz.c index e1d9afcff94..a797fde77ee 100644 --- a/src/emu/cpu/v30mz/v30mz.c +++ b/src/emu/cpu/v30mz/v30mz.c @@ -84,7 +84,7 @@ struct _v30mz_state UINT8 no_interrupt; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -139,8 +139,8 @@ static CPU_RESET( nec ) memset( cpustate, 0, sizeof(*cpustate) ); cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->sregs[CS] = 0xffff; @@ -932,7 +932,7 @@ static CPU_DISASSEMBLE( nec ) return necv_dasm_one(buffer, pc, oprom, cpustate->config); } -static void nec_init(running_device *device, device_irq_callback irqcallback, int type) +static void nec_init(cpu_device *device, device_irq_callback irqcallback, int type) { v30mz_state *cpustate = get_safe_token(device); @@ -960,8 +960,8 @@ static void nec_init(running_device *device, device_irq_callback irqcallback, in cpustate->config = config; cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); } static CPU_INIT( v30mz ) { nec_init(device, irqcallback, 3); } @@ -1055,7 +1055,7 @@ static CPU_SET_INFO( nec ) CPU_GET_INFO( v30mz ) { - v30mz_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + v30mz_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; int flags; switch (state) diff --git a/src/emu/cpu/v60/v60.c b/src/emu/cpu/v60/v60.c index 3429f3bb6a1..19d5c34e252 100644 --- a/src/emu/cpu/v60/v60.c +++ b/src/emu/cpu/v60/v60.c @@ -78,7 +78,7 @@ struct _v60_state UINT8 irq_line; UINT8 nmi_line; device_irq_callback irq_cb; - running_device *device; + cpu_device * device; const address_space *program; const address_space *io; UINT32 PPC; @@ -311,7 +311,7 @@ static UINT32 opUNHANDLED(v60_state *cpustate) // Opcode jump table #include "optable.c" -static void base_init(running_device *device, device_irq_callback irqcallback) +static void base_init(cpu_device *device, device_irq_callback irqcallback) { v60_state *cpustate = get_safe_token(device); @@ -341,8 +341,8 @@ static CPU_INIT( v60 ) cpustate->PIR = 0x00006000; cpustate->info = v60_i; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); } static CPU_INIT( v70 ) @@ -355,8 +355,8 @@ static CPU_INIT( v70 ) cpustate->PIR = 0x00007000; cpustate->info = v70_i; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); } static CPU_RESET( v60 ) @@ -551,7 +551,7 @@ static CPU_SET_INFO( v60 ) CPU_GET_INFO( v60 ) { - v60_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + v60_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/v810/v810.c b/src/emu/cpu/v810/v810.c index 89b56aac340..3208d64ab85 100644 --- a/src/emu/cpu/v810/v810.c +++ b/src/emu/cpu/v810/v810.c @@ -30,7 +30,7 @@ struct _v810_state UINT8 irq_line; UINT8 nmi_line; device_irq_callback irq_cb; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; UINT32 PPC; @@ -1002,8 +1002,8 @@ static CPU_INIT( v810 ) cpustate->nmi_line = CLEAR_LINE; cpustate->irq_cb = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); state_save_register_device_item_array(device, 0, cpustate->reg); state_save_register_device_item(device, 0, cpustate->irq_line); @@ -1134,7 +1134,7 @@ static CPU_SET_INFO( v810 ) CPU_GET_INFO( v810 ) { - v810_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + v810_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/z180/z180.c b/src/emu/cpu/z180/z180.c index 940e6491a27..349f7fd878a 100644 --- a/src/emu/cpu/z180/z180.c +++ b/src/emu/cpu/z180/z180.c @@ -139,7 +139,7 @@ struct _z180_state UINT8 dma1_cnt; /* dma1 counter / divide by 20 */ z80_daisy_chain daisy; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *iospace; UINT8 rtemp; @@ -2212,8 +2212,8 @@ static CPU_RESET( z180 ) cpustate->irq_state[2] = CLEAR_LINE; cpustate->after_EI = 0; cpustate->ea = 0; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->iospace = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->iospace = device->space(AS_IO); cpustate->device = device; memcpy(cpustate->cc, (UINT8 *)cc_default, sizeof(cpustate->cc)); @@ -2678,7 +2678,7 @@ static CPU_SET_INFO( z180 ) CPU_GET_INFO( z180 ) { - z180_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + z180_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ diff --git a/src/emu/cpu/z8/z8.c b/src/emu/cpu/z8/z8.c index 3e2b1c4127b..800c97a3eb1 100644 --- a/src/emu/cpu/z8/z8.c +++ b/src/emu/cpu/z8/z8.c @@ -663,9 +663,9 @@ static CPU_INIT( z8 ) cpustate->clock = device->clock(); /* find address spaces */ - 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->program = device->space(AS_PROGRAM); + cpustate->data = device->space(AS_DATA); + cpustate->io = device->space(AS_IO); /* allocate timers */ cpustate->t0_timer = timer_alloc(device->machine, t0_tick, cpustate); @@ -827,7 +827,7 @@ static CPU_SET_INFO( z8 ) static CPU_GET_INFO( z8 ) { - z8_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + z8_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/cpu/z80/z80.c b/src/emu/cpu/z80/z80.c index c06c6bab865..b90c4cc6ccb 100644 --- a/src/emu/cpu/z80/z80.c +++ b/src/emu/cpu/z80/z80.c @@ -149,7 +149,7 @@ struct _z80_state UINT8 after_ei; /* are we in the EI shadow? */ UINT32 ea; device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -3470,8 +3470,8 @@ static CPU_INIT( z80 ) z80->daisy.init(device, (const z80_daisy_config *)device->baseconfig().static_config()); z80->irq_callback = irqcallback; z80->device = device; - z80->program = device_memory(device)->space(AS_PROGRAM); - z80->io = device_memory(device)->space(AS_IO); + z80->program = device->space(AS_PROGRAM); + z80->io = device->space(AS_IO); z80->IX = z80->IY = 0xffff; /* IX and IY are FFFF after a reset! */ z80->F = ZF; /* Zero flag is set */ @@ -3825,7 +3825,7 @@ void z80_set_cycle_tables(running_device *device, const UINT8 *op, const UINT8 * CPU_GET_INFO( z80 ) { - z80_state *z80 = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + z80_state *z80 = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ @@ -3875,7 +3875,7 @@ CPU_GET_INFO( z80 ) CPU_GET_INFO( nsc800 ) { - z80_state *z80 = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + z80_state *z80 = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { case CPUINFO_INT_INPUT_LINES: info->i = 4; break; diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c index 6eed70a3411..a75ea7fc66d 100644 --- a/src/emu/cpu/z8000/z8000.c +++ b/src/emu/cpu/z8000/z8000.c @@ -82,7 +82,7 @@ struct _z8000_state int nmi_state; /* NMI line state */ int irq_state[2]; /* IRQ line states (NVI, VI) */ device_irq_callback irq_callback; - running_device *device; + cpu_device *device; const address_space *program; const address_space *io; int icount; @@ -365,8 +365,8 @@ static CPU_INIT( z8001 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); /* already initialized? */ if(z8000_exec == NULL) @@ -379,8 +379,8 @@ static CPU_INIT( z8002 ) cpustate->irq_callback = irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); /* already initialized? */ if(z8000_exec == NULL) @@ -395,8 +395,8 @@ static CPU_RESET( z8001 ) memset(cpustate, 0, sizeof(*cpustate)); cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->fcw = RDMEM_W(cpustate, 2); /* get reset cpustate->fcw */ if(cpustate->fcw & F_SEG) { @@ -416,8 +416,8 @@ static CPU_RESET( z8002 ) memset(cpustate, 0, sizeof(*cpustate)); cpustate->irq_callback = save_irqcallback; cpustate->device = device; - cpustate->program = device_memory(device)->space(AS_PROGRAM); - cpustate->io = device_memory(device)->space(AS_IO); + cpustate->program = device->space(AS_PROGRAM); + cpustate->io = device->space(AS_IO); cpustate->fcw = RDMEM_W(cpustate, 2); /* get reset cpustate->fcw */ cpustate->pc = RDMEM_W(cpustate, 4); /* get reset cpustate->pc */ } @@ -568,7 +568,7 @@ static CPU_SET_INFO( z8002 ) CPU_GET_INFO( z8002 ) { - z8000_state *cpustate = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL; + z8000_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL; switch (state) { diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c index 0622cd55bfc..40be8c38b09 100644 --- a/src/emu/debug/debugcpu.c +++ b/src/emu/debug/debugcpu.c @@ -359,7 +359,7 @@ offs_t debug_cpu_disassemble(device_t *device, char *buffer, offs_t pc, const UI /* check for disassembler override */ if (cpudebug->dasm_override != NULL) - result = (*cpudebug->dasm_override)(device, buffer, pc, oprom, opram, 0); + result = (*cpudebug->dasm_override)(cpudebug->cpudevice, buffer, pc, oprom, opram, 0); /* if we have a disassembler, run it */ if (result == 0) diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h index 51f70643f60..4dd5cff31e7 100644 --- a/src/emu/devcpu.h +++ b/src/emu/devcpu.h @@ -111,22 +111,22 @@ enum CPUINFO_FCT_FIRST = DEVINFO_FCT_FIRST, // CPU-specific additions - CPUINFO_FCT_SET_INFO = DEVINFO_FCT_CLASS_SPECIFIC, // R/O: void (*set_info)(device_t *device, UINT32 state, INT64 data, void *ptr) - CPUINFO_FCT_INIT, // R/O: void (*init)(device_t *device, int index, int clock, int (*irqcallback)(device_t *device, int)) - CPUINFO_FCT_RESET, // R/O: void (*reset)(device_t *device) - CPUINFO_FCT_EXIT, // R/O: void (*exit)(device_t *device) - CPUINFO_FCT_EXECUTE, // R/O: int (*execute)(device_t *device, int cycles) - CPUINFO_FCT_BURN, // R/O: void (*burn)(device_t *device, int cycles) - CPUINFO_FCT_DISASSEMBLE, // R/O: offs_t (*disassemble)(device_t *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) - CPUINFO_FCT_TRANSLATE, // R/O: int (*translate)(device_t *device, int space, int intention, offs_t *address) - CPUINFO_FCT_READ, // R/O: int (*read)(device_t *device, int space, UINT32 offset, int size, UINT64 *value) - CPUINFO_FCT_WRITE, // R/O: int (*write)(device_t *device, int space, UINT32 offset, int size, UINT64 value) - CPUINFO_FCT_READOP, // R/O: int (*readop)(device_t *device, UINT32 offset, int size, UINT64 *value) - CPUINFO_FCT_DEBUG_INIT, // R/O: void (*debug_init)(device_t *device) - CPUINFO_FCT_IMPORT_STATE, // R/O: void (*import_state)(device_t *device, void *baseptr, const cpu_state_entry *entry) - CPUINFO_FCT_EXPORT_STATE, // R/O: void (*export_state)(device_t *device, void *baseptr, const cpu_state_entry *entry) - CPUINFO_FCT_IMPORT_STRING, // R/O: void (*import_string)(device_t *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string) - CPUINFO_FCT_EXPORT_STRING, // R/O: void (*export_string)(device_t *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string) + CPUINFO_FCT_SET_INFO = DEVINFO_FCT_CLASS_SPECIFIC, // R/O: void (*set_info)(cpu_device *device, UINT32 state, INT64 data, void *ptr) + CPUINFO_FCT_INIT, // R/O: void (*init)(cpu_device *device, int index, int clock, int (*irqcallback)(cpu_device *device, int)) + CPUINFO_FCT_RESET, // R/O: void (*reset)(cpu_device *device) + CPUINFO_FCT_EXIT, // R/O: void (*exit)(cpu_device *device) + CPUINFO_FCT_EXECUTE, // R/O: int (*execute)(cpu_device *device, int cycles) + CPUINFO_FCT_BURN, // R/O: void (*burn)(cpu_device *device, int cycles) + CPUINFO_FCT_DISASSEMBLE, // R/O: offs_t (*disassemble)(cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) + CPUINFO_FCT_TRANSLATE, // R/O: int (*translate)(cpu_device *device, int space, int intention, offs_t *address) + CPUINFO_FCT_READ, // R/O: int (*read)(cpu_device *device, int space, UINT32 offset, int size, UINT64 *value) + CPUINFO_FCT_WRITE, // R/O: int (*write)(cpu_device *device, int space, UINT32 offset, int size, UINT64 value) + CPUINFO_FCT_READOP, // R/O: int (*readop)(cpu_device *device, UINT32 offset, int size, UINT64 *value) + CPUINFO_FCT_DEBUG_INIT, // R/O: void (*debug_init)(cpu_device *device) + CPUINFO_FCT_IMPORT_STATE, // R/O: void (*import_state)(cpu_device *device, void *baseptr, const cpu_state_entry *entry) + CPUINFO_FCT_EXPORT_STATE, // R/O: void (*export_state)(cpu_device *device, void *baseptr, const cpu_state_entry *entry) + CPUINFO_FCT_IMPORT_STRING, // R/O: void (*import_string)(cpu_device *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string) + CPUINFO_FCT_EXPORT_STRING, // R/O: void (*export_string)(cpu_device *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string) CPUINFO_FCT_CPU_SPECIFIC = DEVINFO_FCT_DEVICE_SPECIFIC, // R/W: CPU-specific values start here @@ -187,67 +187,67 @@ enum // CPU interface functions #define CPU_GET_INFO_NAME(name) cpu_get_info_##name -#define CPU_GET_INFO(name) void CPU_GET_INFO_NAME(name)(const device_config *devconfig, device_t *device, UINT32 state, cpuinfo *info) +#define CPU_GET_INFO(name) void CPU_GET_INFO_NAME(name)(const device_config *devconfig, cpu_device *device, UINT32 state, cpuinfo *info) #define CPU_GET_INFO_CALL(name) CPU_GET_INFO_NAME(name)(devconfig, device, state, info) #define CPU_SET_INFO_NAME(name) cpu_set_info_##name -#define CPU_SET_INFO(name) void CPU_SET_INFO_NAME(name)(device_t *device, UINT32 state, cpuinfo *info) +#define CPU_SET_INFO(name) void CPU_SET_INFO_NAME(name)(cpu_device *device, UINT32 state, cpuinfo *info) #define CPU_SET_INFO_CALL(name) CPU_SET_INFO_NAME(name)(device, state, info) #define CPU_INIT_NAME(name) cpu_init_##name -#define CPU_INIT(name) void CPU_INIT_NAME(name)(device_t *device, device_irq_callback irqcallback) +#define CPU_INIT(name) void CPU_INIT_NAME(name)(cpu_device *device, device_irq_callback irqcallback) #define CPU_INIT_CALL(name) CPU_INIT_NAME(name)(device, irqcallback) #define CPU_RESET_NAME(name) cpu_reset_##name -#define CPU_RESET(name) void CPU_RESET_NAME(name)(device_t *device) +#define CPU_RESET(name) void CPU_RESET_NAME(name)(cpu_device *device) #define CPU_RESET_CALL(name) CPU_RESET_NAME(name)(device) #define CPU_EXIT_NAME(name) cpu_exit_##name -#define CPU_EXIT(name) void CPU_EXIT_NAME(name)(device_t *device) +#define CPU_EXIT(name) void CPU_EXIT_NAME(name)(cpu_device *device) #define CPU_EXIT_CALL(name) CPU_EXIT_NAME(name)(device) #define CPU_EXECUTE_NAME(name) cpu_execute_##name -#define CPU_EXECUTE(name) int CPU_EXECUTE_NAME(name)(device_t *device, int cycles) +#define CPU_EXECUTE(name) int CPU_EXECUTE_NAME(name)(cpu_device *device, int cycles) #define CPU_EXECUTE_CALL(name) CPU_EXECUTE_NAME(name)(device, cycles) #define CPU_BURN_NAME(name) cpu_burn_##name -#define CPU_BURN(name) void CPU_BURN_NAME(name)(device_t *device, int cycles) +#define CPU_BURN(name) void CPU_BURN_NAME(name)(cpu_device *device, int cycles) #define CPU_BURN_CALL(name) CPU_BURN_NAME(name)(device, cycles) #define CPU_TRANSLATE_NAME(name) cpu_translate_##name -#define CPU_TRANSLATE(name) int CPU_TRANSLATE_NAME(name)(device_t *device, int space, int intention, offs_t *address) +#define CPU_TRANSLATE(name) int CPU_TRANSLATE_NAME(name)(cpu_device *device, int space, int intention, offs_t *address) #define CPU_TRANSLATE_CALL(name) CPU_TRANSLATE_NAME(name)(device, space, intention, address) #define CPU_READ_NAME(name) cpu_read_##name -#define CPU_READ(name) int CPU_READ_NAME(name)(device_t *device, int space, UINT32 offset, int size, UINT64 *value) +#define CPU_READ(name) int CPU_READ_NAME(name)(cpu_device *device, int space, UINT32 offset, int size, UINT64 *value) #define CPU_READ_CALL(name) CPU_READ_NAME(name)(device, space, offset, size, value) #define CPU_WRITE_NAME(name) cpu_write_##name -#define CPU_WRITE(name) int CPU_WRITE_NAME(name)(device_t *device, int space, UINT32 offset, int size, UINT64 value) +#define CPU_WRITE(name) int CPU_WRITE_NAME(name)(cpu_device *device, int space, UINT32 offset, int size, UINT64 value) #define CPU_WRITE_CALL(name) CPU_WRITE_NAME(name)(device, space, offset, size, value) #define CPU_READOP_NAME(name) cpu_readop_##name -#define CPU_READOP(name) int CPU_READOP_NAME(name)(device_t *device, UINT32 offset, int size, UINT64 *value) +#define CPU_READOP(name) int CPU_READOP_NAME(name)(cpu_device *device, UINT32 offset, int size, UINT64 *value) #define CPU_READOP_CALL(name) CPU_READOP_NAME(name)(device, offset, size, value) #define CPU_DEBUG_INIT_NAME(name) cpu_debug_init_##name -#define CPU_DEBUG_INIT(name) void CPU_DEBUG_INIT_NAME(name)(device_t *device) +#define CPU_DEBUG_INIT(name) void CPU_DEBUG_INIT_NAME(name)(cpu_device *device) #define CPU_DEBUG_INIT_CALL(name) CPU_DEBUG_INIT_NAME(name)(device) #define CPU_DISASSEMBLE_NAME(name) cpu_disassemble_##name -#define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(device_t *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) +#define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) #define CPU_DISASSEMBLE_CALL(name) CPU_DISASSEMBLE_NAME(name)(device, buffer, pc, oprom, opram, options) #define CPU_IMPORT_STATE_NAME(name) cpu_state_import_##name -#define CPU_IMPORT_STATE(name) void CPU_IMPORT_STATE_NAME(name)(device_t *device, const device_state_entry &entry) +#define CPU_IMPORT_STATE(name) void CPU_IMPORT_STATE_NAME(name)(cpu_device *device, const device_state_entry &entry) #define CPU_IMPORT_STATE_CALL(name) CPU_IMPORT_STATE_NAME(name)(device, entry) #define CPU_EXPORT_STATE_NAME(name) cpu_state_export_##name -#define CPU_EXPORT_STATE(name) void CPU_EXPORT_STATE_NAME(name)(device_t *device, const device_state_entry &entry) +#define CPU_EXPORT_STATE(name) void CPU_EXPORT_STATE_NAME(name)(cpu_device *device, const device_state_entry &entry) #define CPU_EXPORT_STATE_CALL(name) CPU_EXPORT_STATE_NAME(name)(device, entry) #define CPU_EXPORT_STRING_NAME(name) cpu_string_export_##name -#define CPU_EXPORT_STRING(name) void CPU_EXPORT_STRING_NAME(name)(device_t *device, const device_state_entry &entry, astring &string) +#define CPU_EXPORT_STRING(name) void CPU_EXPORT_STRING_NAME(name)(cpu_device *device, const device_state_entry &entry, astring &string) #define CPU_EXPORT_STRING_CALL(name) CPU_EXPORT_STRING_NAME(name)(device, entry, string) @@ -322,26 +322,27 @@ enum // forward declaration of types union cpuinfo; +class cpu_device; struct cpu_state_entry; class cpu_debug_data; // CPU interface functions -typedef void (*cpu_get_info_func)(const device_config *devconfig, device_t *device, UINT32 state, cpuinfo *info); -typedef void (*cpu_set_info_func)(device_t *device, UINT32 state, cpuinfo *info); -typedef void (*cpu_init_func)(device_t *device, device_irq_callback irqcallback); -typedef void (*cpu_reset_func)(device_t *device); -typedef void (*cpu_exit_func)(device_t *device); -typedef int (*cpu_execute_func)(device_t *device, int cycles); -typedef void (*cpu_burn_func)(device_t *device, int cycles); -typedef int (*cpu_translate_func)(device_t *device, int space, int intention, offs_t *address); -typedef int (*cpu_read_func)(device_t *device, int space, UINT32 offset, int size, UINT64 *value); -typedef int (*cpu_write_func)(device_t *device, int space, UINT32 offset, int size, UINT64 value); -typedef int (*cpu_readop_func)(device_t *device, UINT32 offset, int size, UINT64 *value); -typedef void (*cpu_debug_init_func)(device_t *device); -typedef offs_t (*cpu_disassemble_func)(device_t *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); -typedef void (*cpu_state_io_func)(device_t *device, const device_state_entry &entry); -typedef void (*cpu_string_io_func)(device_t *device, const device_state_entry &entry, astring &string); +typedef void (*cpu_get_info_func)(const device_config *devconfig, cpu_device *device, UINT32 state, cpuinfo *info); +typedef void (*cpu_set_info_func)(cpu_device *device, UINT32 state, cpuinfo *info); +typedef void (*cpu_init_func)(cpu_device *device, device_irq_callback irqcallback); +typedef void (*cpu_reset_func)(cpu_device *device); +typedef void (*cpu_exit_func)(cpu_device *device); +typedef int (*cpu_execute_func)(cpu_device *device, int cycles); +typedef void (*cpu_burn_func)(cpu_device *device, int cycles); +typedef int (*cpu_translate_func)(cpu_device *device, int space, int intention, offs_t *address); +typedef int (*cpu_read_func)(cpu_device *device, int space, UINT32 offset, int size, UINT64 *value); +typedef int (*cpu_write_func)(cpu_device *device, int space, UINT32 offset, int size, UINT64 value); +typedef int (*cpu_readop_func)(cpu_device *device, UINT32 offset, int size, UINT64 *value); +typedef void (*cpu_debug_init_func)(cpu_device *device); +typedef offs_t (*cpu_disassemble_func)(cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); +typedef void (*cpu_state_io_func)(cpu_device *device, const device_state_entry &entry); +typedef void (*cpu_string_io_func)(cpu_device *device, const device_state_entry &entry, astring &string); // a cpu_type is just a pointer to the CPU's get_info function diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c index d2927eb8107..811297bc7b7 100644 --- a/src/emu/machine/idectrl.c +++ b/src/emu/machine/idectrl.c @@ -1810,8 +1810,15 @@ static DEVICE_START( ide_controller ) /* find the bus master space */ if (config->bmcpu != NULL) { - ide->dma_space = device_memory(device->machine->device(config->bmcpu))->space(config->bmspace); - assert_always(ide->dma_space != NULL, "IDE controller bus master space not found!"); + device_t *bmtarget = device->machine->device(config->bmcpu); + if (bmtarget == NULL) + throw emu_fatalerror("IDE controller '%s' bus master target '%s' doesn't exist!", device->tag(), config->bmcpu); + device_memory_interface *memory; + if (!bmtarget->interface(memory)) + throw emu_fatalerror("IDE controller '%s' bus master target '%s' has no memory!", device->tag(), config->bmcpu); + ide->dma_space = memory->space(config->bmspace); + if (ide->dma_space == NULL) + throw emu_fatalerror("IDE controller '%s' bus master target '%s' does not have specified space %d!", device->tag(), config->bmcpu, config->bmspace); ide->dma_address_xor = (ide->dma_space->endianness == ENDIANNESS_LITTLE) ? 0 : 3; } |