diff options
1334 files changed, 5874 insertions, 5878 deletions
diff --git a/src/emu/audit.c b/src/emu/audit.c index afe11173ac2..eb6863b0e6e 100644 --- a/src/emu/audit.c +++ b/src/emu/audit.c @@ -147,16 +147,16 @@ int audit_images(core_options *options, const game_driver *gamedrv, UINT32 valid int audit_samples(core_options *options, const game_driver *gamedrv, audit_record **audit) { machine_config *config = machine_config_alloc(gamedrv->machine_config); - const device_config *device; + const device_config *devconfig; audit_record *record; int records = 0; int sampnum; /* count the number of sample records attached to this driver */ - for (device = sound_first(config); device != NULL; device = sound_next(device)) - if (sound_get_type(device) == SOUND_SAMPLES) + for (devconfig = sound_first(config); devconfig != NULL; devconfig = sound_next(devconfig)) + if (sound_get_type(devconfig) == SOUND_SAMPLES) { - const samples_interface *intf = (const samples_interface *)device->static_config; + const samples_interface *intf = (const samples_interface *)devconfig->static_config; if (intf->samplenames != NULL) { @@ -176,10 +176,10 @@ int audit_samples(core_options *options, const game_driver *gamedrv, audit_recor record = *audit; /* now iterate over sample entries */ - for (device = sound_first(config); device != NULL; device = sound_next(device)) - if (sound_get_type(device) == SOUND_SAMPLES) + for (devconfig = sound_first(config); devconfig != NULL; devconfig = sound_next(devconfig)) + if (sound_get_type(devconfig) == SOUND_SAMPLES) { - const samples_interface *intf = (const samples_interface *)device->static_config; + const samples_interface *intf = (const samples_interface *)devconfig->static_config; const char *sharedname = NULL; if (intf->samplenames != NULL) diff --git a/src/emu/clifront.c b/src/emu/clifront.c index c86b39010b1..38b1f4bdf1f 100644 --- a/src/emu/clifront.c +++ b/src/emu/clifront.c @@ -613,13 +613,13 @@ int cli_info_listsamples(core_options *options, const char *gamename) if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0) { machine_config *config = machine_config_alloc(drivers[drvindex]->machine_config); - const device_config *device; + const device_config *devconfig; /* find samples interfaces */ - for (device = sound_first(config); device != NULL; device = sound_next(device)) - if (sound_get_type(device) == SOUND_SAMPLES) + for (devconfig = sound_first(config); devconfig != NULL; devconfig = sound_next(devconfig)) + if (sound_get_type(devconfig) == SOUND_SAMPLES) { - const char *const *samplenames = ((const samples_interface *)device->static_config)->samplenames; + const char *const *samplenames = ((const samples_interface *)devconfig->static_config)->samplenames; int sampnum; /* if the list is legit, walk it and print the sample info */ @@ -652,16 +652,16 @@ int cli_info_listdevices(core_options *options, const char *gamename) if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0) { machine_config *config = machine_config_alloc(drivers[drvindex]->machine_config); - const device_config *device; + const device_config *devconfig; if (count != 0) printf("\n"); printf("Driver %s (%s):\n", drivers[drvindex]->name, drivers[drvindex]->description); /* iterate through devices */ - for (device = config->devicelist.first(); device != NULL; device = device->next) + for (devconfig = config->devicelist.first(); devconfig != NULL; devconfig = devconfig->next) { - switch (device->devclass) + switch (devconfig->devclass) { case DEVICE_CLASS_AUDIO: printf(" Audio: "); break; case DEVICE_CLASS_VIDEO: printf(" Video: "); break; @@ -670,15 +670,15 @@ int cli_info_listdevices(core_options *options, const char *gamename) case DEVICE_CLASS_TIMER: printf(" Timer: "); break; default: printf(" Other: "); break; } - printf("%s ('%s')", device_get_name(device), device->tag.cstr()); - if (device->clock >= 1000000000) - printf(" @ %d.%02d GHz\n", device->clock / 1000000000, (device->clock / 10000000) % 100); - else if (device->clock >= 1000000) - printf(" @ %d.%02d MHz\n", device->clock / 1000000, (device->clock / 10000) % 100); - else if (device->clock >= 1000) - printf(" @ %d.%02d kHz\n", device->clock / 1000, (device->clock / 10) % 100); - else if (device->clock > 0) - printf(" @ %d Hz\n", device->clock); + printf("%s ('%s')", device_get_name(devconfig), devconfig->tag.cstr()); + if (devconfig->clock >= 1000000000) + printf(" @ %d.%02d GHz\n", devconfig->clock / 1000000000, (devconfig->clock / 10000000) % 100); + else if (devconfig->clock >= 1000000) + printf(" @ %d.%02d MHz\n", devconfig->clock / 1000000, (devconfig->clock / 10000) % 100); + else if (devconfig->clock >= 1000) + printf(" @ %d.%02d kHz\n", devconfig->clock / 1000, (devconfig->clock / 10) % 100); + else if (devconfig->clock > 0) + printf(" @ %d Hz\n", devconfig->clock); else printf("\n"); } diff --git a/src/emu/cpu/adsp2100/adsp2100.c b/src/emu/cpu/adsp2100/adsp2100.c index 48f7ad0e0fd..b20adf021d4 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]; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; /* other internal states */ int icount; @@ -425,7 +425,7 @@ static void check_irqs(adsp2100_state *adsp); STATE ACCESSORS ***************************************************************************/ -INLINE adsp2100_state *get_safe_token(const device_config *device) +INLINE adsp2100_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -691,9 +691,9 @@ static void set_irq_line(adsp2100_state *adsp, int irqline, int state) INITIALIZATION AND SHUTDOWN ***************************************************************************/ -static adsp2100_state *adsp21xx_init(const device_config *device, cpu_irq_callback irqcallback, int chiptype) +static adsp2100_state *adsp21xx_init(running_device *device, cpu_irq_callback irqcallback, int chiptype) { - const adsp21xx_config *config = (const adsp21xx_config *)device->static_config; + const adsp21xx_config *config = (const adsp21xx_config *)device->baseconfig().static_config; adsp2100_state *adsp = get_safe_token(device); /* create the tables */ @@ -2171,20 +2171,20 @@ CPU_GET_INFO( adsp2181 ) } } -void adsp2181_idma_addr_w(const device_config *device, UINT16 data) +void adsp2181_idma_addr_w(running_device *device, UINT16 data) { adsp2100_state *adsp = get_safe_token(device); adsp->idma_addr = data; adsp->idma_offs = 0; } -UINT16 adsp2181_idma_addr_r(const device_config *device) +UINT16 adsp2181_idma_addr_r(running_device *device) { adsp2100_state *adsp = get_safe_token(device); return adsp->idma_addr; } -void adsp2181_idma_data_w(const device_config *device, UINT16 data) +void adsp2181_idma_data_w(running_device *device, UINT16 data) { adsp2100_state *adsp = get_safe_token(device); @@ -2211,7 +2211,7 @@ void adsp2181_idma_data_w(const device_config *device, UINT16 data) WWORD_DATA(adsp, adsp->idma_addr++ & 0x3fff, data); } -UINT16 adsp2181_idma_data_r(const device_config *device) +UINT16 adsp2181_idma_data_r(running_device *device) { adsp2100_state *adsp = get_safe_token(device); UINT16 result = 0xffff; diff --git a/src/emu/cpu/adsp2100/adsp2100.h b/src/emu/cpu/adsp2100/adsp2100.h index b45a1b6fc73..1d6d279d26d 100644 --- a/src/emu/cpu/adsp2100/adsp2100.h +++ b/src/emu/cpu/adsp2100/adsp2100.h @@ -17,9 +17,9 @@ ***************************************************************************/ /* transmit and receive data callbacks types */ -typedef INT32 (*adsp21xx_rx_func)(const device_config *device, int port); -typedef void (*adsp21xx_tx_func)(const device_config *device, int port, INT32 data); -typedef void (*adsp21xx_timer_func)(const device_config *device, int enable); +typedef INT32 (*adsp21xx_rx_func)(running_device *device, int port); +typedef void (*adsp21xx_tx_func)(running_device *device, int port, INT32 data); +typedef void (*adsp21xx_timer_func)(running_device *device, int enable); typedef struct _adsp21xx_config adsp21xx_config; struct _adsp21xx_config @@ -166,10 +166,10 @@ CPU_GET_INFO( adsp2181 ); #define CPU_ADSP2181 CPU_GET_INFO_NAME( adsp2181 ) void adsp2181_load_boot_data(UINT8 *srcdata, UINT32 *dstdata); -void adsp2181_idma_addr_w(const device_config *device, UINT16 data); -UINT16 adsp2181_idma_addr_r(const device_config *device); -void adsp2181_idma_data_w(const device_config *device, UINT16 data); -UINT16 adsp2181_idma_data_r(const device_config *device); +void adsp2181_idma_addr_w(running_device *device, UINT16 data); +UINT16 adsp2181_idma_addr_r(running_device *device); +void adsp2181_idma_data_w(running_device *device, UINT16 data); +UINT16 adsp2181_idma_data_r(running_device *device); #endif /* __ADSP2100_H__ */ diff --git a/src/emu/cpu/alph8201/alph8201.c b/src/emu/cpu/alph8201/alph8201.c index 9afa1f1a299..897f1a4c837 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 - const device_config *device; + running_device *device; const address_space *program; int icount; int inst_cycles; @@ -224,7 +224,7 @@ typedef struct { #define LP1 lp1 #define LP2 lp2 -INLINE alpha8201_state *get_safe_token(const device_config *device) +INLINE alpha8201_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -730,7 +730,7 @@ static CPU_EXIT( alpha8201 ) * Execute cycles CPU cycles. Return number of cycles really executed ****************************************************************************/ -static int alpha8xxx_execute(const device_config *device,const s_opcode *op_map,int cycles) +static int alpha8xxx_execute(running_device *device,const s_opcode *op_map,int cycles) { alpha8201_state *cpustate = get_safe_token(device); unsigned opcode; diff --git a/src/emu/cpu/am29000/am29000.c b/src/emu/cpu/am29000/am29000.c index b2425736f34..680e0a6ef99 100644 --- a/src/emu/cpu/am29000/am29000.c +++ b/src/emu/cpu/am29000/am29000.c @@ -141,7 +141,7 @@ typedef struct _am29000_state STATE ACCESSORS ***************************************************************************/ -INLINE am29000_state *get_safe_token(const device_config *device) +INLINE am29000_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -154,9 +154,9 @@ static CPU_INIT( am29000 ) { am29000_state *am29000 = get_safe_token(device); - am29000->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); - am29000->data = memory_find_address_space(device, ADDRESS_SPACE_DATA); - am29000->io = memory_find_address_space(device, ADDRESS_SPACE_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 */ diff --git a/src/emu/cpu/apexc/apexc.c b/src/emu/cpu/apexc/apexc.c index 539ba1746c0..02f7b708c6b 100644 --- a/src/emu/cpu/apexc/apexc.c +++ b/src/emu/cpu/apexc/apexc.c @@ -357,7 +357,7 @@ struct _apexc_state int running; /* 1 flag: */ /* running: flag implied by the existence of the stop instruction */ - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; @@ -367,7 +367,7 @@ struct _apexc_state #define DELAY(n) {cpustate->icount -= (n); cpustate->current_word = (cpustate->current_word + (n)) & 0x1f;} -INLINE apexc_state *get_safe_token(const device_config *device) +INLINE apexc_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/arm/arm.c b/src/emu/cpu/arm/arm.c index 7e3d84373ab..1d5ecf3b324 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; } ARM_REGS; @@ -250,7 +250,7 @@ static void arm_check_irq_state(ARM_REGS* cpustate); /***************************************************************************/ -INLINE ARM_REGS *get_safe_token(const device_config *device) +INLINE ARM_REGS *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/arm7/arm7.c b/src/emu/cpu/arm7/arm7.c index 118159ba11e..b8bab8b1ee0 100644 --- a/src/emu/cpu/arm7/arm7.c +++ b/src/emu/cpu/arm7/arm7.c @@ -68,7 +68,7 @@ void arm7_dt_w_callback(arm_state *cpustate, UINT32 insn, UINT32 *prn, void (*wr #define ARM7REG(reg) cpustate->sArmRegister[reg] #define ARM7_ICOUNT cpustate->iCount -INLINE arm_state *get_safe_token(const device_config *device) +INLINE arm_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/arm7/arm7core.c b/src/emu/cpu/arm7/arm7core.c index dcb3ae7deae..953e56a1668 100644 --- a/src/emu/cpu/arm7/arm7core.c +++ b/src/emu/cpu/arm7/arm7core.c @@ -529,7 +529,7 @@ static int storeDec(arm_state *cpustate, UINT32 pat, UINT32 rbv) ***************************************************************************/ // CPU INIT -static void arm7_core_init(const device_config *device, const char *cpuname) +static void arm7_core_init(running_device *device, const char *cpuname) { arm_state *cpustate = get_safe_token(device); @@ -543,7 +543,7 @@ static void arm7_core_init(const device_config *device, const char *cpuname) } // CPU RESET -static void arm7_core_reset(const device_config *device) +static void arm7_core_reset(running_device *device) { arm_state *cpustate = get_safe_token(device); diff --git a/src/emu/cpu/arm7/arm7core.h b/src/emu/cpu/arm7/arm7core.h index 1af9e0060cf..67e9b918eed 100644 --- a/src/emu/cpu/arm7/arm7core.h +++ b/src/emu/cpu/arm7/arm7core.h @@ -161,7 +161,7 @@ enum UINT8 pendingSwi; \ INT32 iCount; \ cpu_irq_callback irq_callback; \ - const device_config *device; \ + running_device *device; \ const address_space *program; diff --git a/src/emu/cpu/asap/asap.c b/src/emu/cpu/asap/asap.c index 06901083f78..6c5db4e551f 100644 --- a/src/emu/cpu/asap/asap.c +++ b/src/emu/cpu/asap/asap.c @@ -87,7 +87,7 @@ struct _asap_state int icount; cpu_irq_callback irq_callback; const address_space *program; - const device_config *device; + running_device *device; /* src2val table, registers are at the end */ UINT32 src2val[65536]; @@ -268,7 +268,7 @@ static void (*const conditiontable[16])(asap_state *) = STATE ACCESSORS ***************************************************************************/ -INLINE asap_state *get_safe_token(const device_config *device) +INLINE asap_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/avr8/avr8.c b/src/emu/cpu/avr8/avr8.c index 125fb4e8b22..41bbc47c001 100644 --- a/src/emu/cpu/avr8/avr8.c +++ b/src/emu/cpu/avr8/avr8.c @@ -26,7 +26,7 @@ struct _avr8_state { UINT32 pc; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; @@ -75,7 +75,7 @@ enum #define ZREG ((READ_IO_8(cpustate, 31) << 8) | READ_IO_8(cpustate, 30)) #define SPREG ((READ_IO_8(cpustate, AVR8_IO_SPH) << 8) | READ_IO_8(cpustate, AVR8_IO_SPL)) -INLINE avr8_state *get_safe_token(const device_config *device) +INLINE avr8_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/ccpu/ccpu.c b/src/emu/cpu/ccpu/ccpu.c index eba6927ea82..06dd58dcc5e 100644 --- a/src/emu/cpu/ccpu/ccpu.c +++ b/src/emu/cpu/ccpu/ccpu.c @@ -43,14 +43,14 @@ struct _ccpu_state int icount; - const device_config *device; + running_device *device; const address_space *program; const address_space *data; const address_space *io; }; -INLINE ccpu_state *get_safe_token(const device_config *device) +INLINE ccpu_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -104,7 +104,7 @@ do { \ INITIALIZATION AND SHUTDOWN ***************************************************************************/ -static UINT8 read_jmi(const device_config *device) +static UINT8 read_jmi(running_device *device) { /* this routine is called when there is no external input */ /* and the JMI jumper is present */ @@ -113,7 +113,7 @@ static UINT8 read_jmi(const device_config *device) } -void ccpu_wdt_timer_trigger(const device_config *device) +void ccpu_wdt_timer_trigger(running_device *device) { ccpu_state *cpustate = get_safe_token(device); cpustate->waiting = FALSE; @@ -125,7 +125,7 @@ void ccpu_wdt_timer_trigger(const device_config *device) static CPU_INIT( ccpu ) { - const ccpu_config *configdata = (const ccpu_config *)device->static_config; + const ccpu_config *configdata = (const ccpu_config *)device->baseconfig().static_config; ccpu_state *cpustate = get_safe_token(device); /* copy input params */ diff --git a/src/emu/cpu/ccpu/ccpu.h b/src/emu/cpu/ccpu/ccpu.h index 820347b874c..9ac96a48784 100644 --- a/src/emu/cpu/ccpu/ccpu.h +++ b/src/emu/cpu/ccpu/ccpu.h @@ -38,8 +38,8 @@ enum CONFIG STRUCTURE ***************************************************************************/ -typedef UINT8 (*ccpu_input_func)(const device_config *device); -typedef void (*ccpu_vector_func)(const device_config *device, INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift); +typedef UINT8 (*ccpu_input_func)(running_device *device); +typedef void (*ccpu_vector_func)(running_device *device, INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift); typedef struct _ccpu_config ccpu_config; struct _ccpu_config @@ -57,7 +57,7 @@ struct _ccpu_config CPU_GET_INFO( ccpu ); #define CPU_CCPU CPU_GET_INFO_NAME( ccpu ) -void ccpu_wdt_timer_trigger(const device_config *device); +void ccpu_wdt_timer_trigger(running_device *device); CPU_DISASSEMBLE( ccpu ); diff --git a/src/emu/cpu/cdp1802/cdp1802.c b/src/emu/cpu/cdp1802/cdp1802.c index a02c3853a9c..6ef36478eb3 100644 --- a/src/emu/cpu/cdp1802/cdp1802.c +++ b/src/emu/cpu/cdp1802/cdp1802.c @@ -116,7 +116,7 @@ static const cpu_state_table state_table_template = state_array /* array of entries */ }; -INLINE cdp1802_state *get_safe_token(const device_config *device) +INLINE cdp1802_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -224,7 +224,7 @@ INLINE void cdp1802_long_skip(cdp1802_state *cpustate, int taken) } } -static void cdp1802_sample_ef(const device_config *device) +static void cdp1802_sample_ef(running_device *device) { cdp1802_state *cpustate = get_safe_token(device); @@ -238,7 +238,7 @@ static void cdp1802_sample_ef(const device_config *device) } } -static void cdp1802_output_state_code(const device_config *device) +static void cdp1802_output_state_code(running_device *device) { cdp1802_state *cpustate = get_safe_token(device); @@ -276,7 +276,7 @@ static void cdp1802_output_state_code(const device_config *device) } } -static void cdp1802_run(const device_config *device) +static void cdp1802_run(running_device *device) { cdp1802_state *cpustate = get_safe_token(device); @@ -965,7 +965,7 @@ static CPU_INIT( cdp1802 ) cdp1802_state *cpustate = get_safe_token(device); int i; - cpustate->intf = (cdp1802_interface *) device->static_config; + cpustate->intf = (cdp1802_interface *) device->baseconfig().static_config; /* resolve callbacks */ devcb_resolve_write_line(&cpustate->out_q_func, &cpustate->intf->out_q_func, device); diff --git a/src/emu/cpu/cdp1802/cdp1802.h b/src/emu/cpu/cdp1802/cdp1802.h index 58237556799..133191e75d7 100644 --- a/src/emu/cpu/cdp1802/cdp1802.h +++ b/src/emu/cpu/cdp1802/cdp1802.h @@ -59,14 +59,14 @@ enum CDP1802_GENPC = REG_GENPC }; -typedef cdp1802_control_mode (*cdp1802_mode_read_func)(const device_config *device); -#define CDP1802_MODE_READ(name) cdp1802_control_mode name(const device_config *device) +typedef cdp1802_control_mode (*cdp1802_mode_read_func)(running_device *device); +#define CDP1802_MODE_READ(name) cdp1802_control_mode name(running_device *device) -typedef UINT8 (*cdp1802_ef_read_func)(const device_config *device); -#define CDP1802_EF_READ(name) UINT8 name(const device_config *device) +typedef UINT8 (*cdp1802_ef_read_func)(running_device *device); +#define CDP1802_EF_READ(name) UINT8 name(running_device *device) -typedef void (*cdp1802_sc_write_func)(const device_config *device, cdp1802_state_code state, int sc0, int sc1); -#define CDP1802_SC_WRITE(name) void name(const device_config *device, cdp1802_state_code state, int sc0, int sc1) +typedef void (*cdp1802_sc_write_func)(running_device *device, cdp1802_state_code state, int sc0, int sc1); +#define CDP1802_SC_WRITE(name) void name(running_device *device, cdp1802_state_code state, int sc0, int sc1) /* interface */ typedef struct _cdp1802_interface cdp1802_interface; diff --git a/src/emu/cpu/cop400/cop400.c b/src/emu/cpu/cop400/cop400.c index 96088d2d2fd..51c900fac61 100644 --- a/src/emu/cpu/cop400/cop400.c +++ b/src/emu/cpu/cop400/cop400.c @@ -253,7 +253,7 @@ static const cpu_state_table state_table_template = INLINE FUNCTIONS ***************************************************************************/ -INLINE cop400_state *get_safe_token(const device_config *device) +INLINE cop400_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -878,11 +878,11 @@ static TIMER_CALLBACK( microbus_tick ) INITIALIZATION ***************************************************************************/ -static void cop400_init(const device_config *device, UINT8 g_mask, UINT8 d_mask, UINT8 in_mask, int has_counter, int has_inil) +static void cop400_init(running_device *device, UINT8 g_mask, UINT8 d_mask, UINT8 in_mask, int has_counter, int has_inil) { cop400_state *cpustate = get_safe_token(device); - cpustate->intf = (cop400_interface *) device->static_config; + cpustate->intf = (cop400_interface *) device->baseconfig().static_config; /* find address spaces */ @@ -955,7 +955,7 @@ static void cop400_init(const device_config *device, UINT8 g_mask, UINT8 d_mask, state_save_register_device_item(device, 0, cpustate->idle); } -static void cop410_init_opcodes(const device_config *device) +static void cop410_init_opcodes(running_device *device) { cop400_state *cpustate = get_safe_token(device); int i; @@ -986,7 +986,7 @@ static void cop410_init_opcodes(const device_config *device) cpustate->opcode_map = COP410_OPCODE_MAP; } -static void cop420_init_opcodes(const device_config *device) +static void cop420_init_opcodes(running_device *device) { cop400_state *cpustate = get_safe_token(device); int i; @@ -1021,7 +1021,7 @@ static void cop420_init_opcodes(const device_config *device) cpustate->opcode_map = COP420_OPCODE_MAP; } -static void cop444_init_opcodes(const device_config *device) +static void cop444_init_opcodes(running_device *device) { cop400_state *cpustate = get_safe_token(device); int i; @@ -1355,7 +1355,7 @@ static CPU_SET_INFO( cop400 ) static CPU_GET_INFO( cop400 ) { cop400_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL; - cop400_interface *intf = (device != NULL && device->static_config != NULL) ? (cop400_interface *)device->static_config : NULL; + cop400_interface *intf = (devconfig->static_config != NULL) ? (cop400_interface *)devconfig->static_config : NULL; switch (state) { diff --git a/src/emu/cpu/cp1610/cp1610.c b/src/emu/cpu/cp1610/cp1610.c index 3ccf5634886..bcb2b9906e0 100644 --- a/src/emu/cpu/cp1610/cp1610.c +++ b/src/emu/cpu/cp1610/cp1610.c @@ -46,12 +46,12 @@ struct _cp1610_state int intr_pending; int intrm_pending; int mask_interrupts; - const device_config *device; + running_device *device; const address_space *program; int icount; }; -INLINE cp1610_state *get_safe_token(const device_config *device) +INLINE cp1610_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.c b/src/emu/cpu/cubeqcpu/cubeqcpu.c index 7a1776ca73e..688880d7a3a 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; - const device_config *device; + running_device *device; const address_space *program; int icount; } cquestsnd_state; @@ -137,8 +137,8 @@ typedef struct UINT8 rc; UINT8 clkcnt; - const device_config *device; - const device_config *lindevice; + running_device *device; + running_device *lindevice; const address_space *program; int icount; } cquestrot_state; @@ -183,8 +183,8 @@ typedef struct UINT32 *e_stack; UINT32 *o_stack; - const device_config *device; - const device_config *rotdevice; + running_device *device; + running_device *rotdevice; const address_space *program; int icount; } cquestlin_state; @@ -193,7 +193,7 @@ typedef struct STATE ACCESSORS ***************************************************************************/ -INLINE cquestsnd_state *get_safe_token_snd(const device_config *device) +INLINE cquestsnd_state *get_safe_token_snd(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -202,7 +202,7 @@ INLINE cquestsnd_state *get_safe_token_snd(const device_config *device) return (cquestsnd_state *)device->token; } -INLINE cquestrot_state *get_safe_token_rot(const device_config *device) +INLINE cquestrot_state *get_safe_token_rot(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -211,7 +211,7 @@ INLINE cquestrot_state *get_safe_token_rot(const device_config *device) return (cquestrot_state *)device->token; } -INLINE cquestlin_state *get_safe_token_lin(const device_config *device) +INLINE cquestlin_state *get_safe_token_lin(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -258,7 +258,7 @@ static STATE_POSTLOAD( cquestsnd_postload ) } -static void cquestsnd_state_register(const device_config *device) +static void cquestsnd_state_register(running_device *device) { cquestsnd_state *cpustate = get_safe_token_snd(device); state_save_register_device_item_array(device, 0, cpustate->ram); @@ -284,7 +284,7 @@ static void cquestsnd_state_register(const device_config *device) static CPU_INIT( cquestsnd ) { cquestsnd_state *cpustate = get_safe_token_snd(device); - cubeqst_snd_config* _config = (cubeqst_snd_config*)device->static_config; + cubeqst_snd_config* _config = (cubeqst_snd_config*)device->baseconfig().static_config; memset(cpustate, 0, sizeof(*cpustate)); @@ -322,7 +322,7 @@ static STATE_POSTLOAD( cquestrot_postload ) } -static void cquestrot_state_register(const device_config *device) +static void cquestrot_state_register(running_device *device) { cquestrot_state *cpustate = get_safe_token_rot(device); state_save_register_device_item_array(device, 0, cpustate->ram); @@ -356,7 +356,7 @@ static void cquestrot_state_register(const device_config *device) static CPU_INIT( cquestrot ) { - const cubeqst_rot_config *rotconfig = (const cubeqst_rot_config *)device->static_config; + const cubeqst_rot_config *rotconfig = (const cubeqst_rot_config *)device->baseconfig().static_config; cquestrot_state *cpustate = get_safe_token_rot(device); memset(cpustate, 0, sizeof(*cpustate)); @@ -400,7 +400,7 @@ static STATE_POSTLOAD( cquestlin_postload ) } -static void cquestlin_state_register(const device_config *device) +static void cquestlin_state_register(running_device *device) { cquestlin_state *cpustate = get_safe_token_lin(device); @@ -439,7 +439,7 @@ static void cquestlin_state_register(const device_config *device) static CPU_INIT( cquestlin ) { - const cubeqst_lin_config *linconfig = (const cubeqst_lin_config *)device->static_config; + const cubeqst_lin_config *linconfig = (const cubeqst_lin_config *)device->baseconfig().static_config; cquestlin_state *cpustate = get_safe_token_lin(device); memset(cpustate, 0, sizeof(*cpustate)); @@ -1150,26 +1150,26 @@ INLINE int do_linjmp(cquestlin_state *cpustate, int jmp) -void cubeqcpu_swap_line_banks(const device_config *device) +void cubeqcpu_swap_line_banks(running_device *device) { cquestlin_state *cpustate = get_safe_token_lin(device); cpustate->field = cpustate->field ^ 1; } -void cubeqcpu_clear_stack(const device_config *device) +void cubeqcpu_clear_stack(running_device *device) { cquestlin_state *cpustate = get_safe_token_lin(device); memset(&cpustate->ptr_ram[cpustate->field * 256], 0, 256); } -UINT8 cubeqcpu_get_ptr_ram_val(const device_config *device, int i) +UINT8 cubeqcpu_get_ptr_ram_val(running_device *device, int i) { cquestlin_state *cpustate = get_safe_token_lin(device); return cpustate->ptr_ram[(VISIBLE_FIELD * 256) + i]; } -UINT32* cubeqcpu_get_stack_ram(const device_config *device) +UINT32* cubeqcpu_get_stack_ram(running_device *device) { cquestlin_state *cpustate = get_safe_token_lin(device); if (VISIBLE_FIELD == ODD_FIELD) diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.h b/src/emu/cpu/cubeqcpu/cubeqcpu.h index 0aec41a4edc..328d2f7a665 100644 --- a/src/emu/cpu/cubeqcpu/cubeqcpu.h +++ b/src/emu/cpu/cubeqcpu/cubeqcpu.h @@ -116,7 +116,7 @@ enum CONFIGURATION STRUCTURE ***************************************************************************/ -typedef void (*cubeqst_dac_w_func)(const device_config *, UINT16); +typedef void (*cubeqst_dac_w_func)(running_device *, UINT16); typedef struct _cubeqst_snd_config cubeqst_snd_config; struct _cubeqst_snd_config @@ -148,11 +148,11 @@ extern WRITE16_DEVICE_HANDLER( cubeqcpu_sndram_w ); extern READ16_DEVICE_HANDLER( cubeqcpu_rotram_r ); extern WRITE16_DEVICE_HANDLER( cubeqcpu_rotram_w ); -void cubeqcpu_swap_line_banks(const device_config *device); +void cubeqcpu_swap_line_banks(running_device *device); -void cubeqcpu_clear_stack(const device_config *device); -UINT8 cubeqcpu_get_ptr_ram_val(const device_config *device, int i); -UINT32* cubeqcpu_get_stack_ram(const device_config *device); +void cubeqcpu_clear_stack(running_device *device); +UINT8 cubeqcpu_get_ptr_ram_val(running_device *device, int i); +UINT32* cubeqcpu_get_stack_ram(running_device *device); CPU_GET_INFO( cquestsnd ); CPU_GET_INFO( cquestrot ); diff --git a/src/emu/cpu/drcbec.c b/src/emu/cpu/drcbec.c index 99fd03bea48..cfae7a70918 100644 --- a/src/emu/cpu/drcbec.c +++ b/src/emu/cpu/drcbec.c @@ -212,7 +212,7 @@ enum /* internal backend-specific state */ struct _drcbe_state { - const device_config * device; /* CPU device we are associated with */ + running_device * device; /* CPU device we are associated with */ const address_space * space[ADDRESS_SPACES]; /* pointers to CPU's address space */ drcuml_state * drcuml; /* pointer back to our owner */ drccache * cache; /* pointer to the cache */ @@ -254,7 +254,7 @@ union _drcbec_instruction ***************************************************************************/ /* primary back-end callbacks */ -static drcbe_state *drcbec_alloc(drcuml_state *drcuml, drccache *cache, const device_config *device, UINT32 flags, int modes, int addrbits, int ignorebits); +static drcbe_state *drcbec_alloc(drcuml_state *drcuml, drccache *cache, running_device *device, UINT32 flags, int modes, int addrbits, int ignorebits); static void drcbec_free(drcbe_state *drcbe); static void drcbec_reset(drcbe_state *drcbe); static int drcbec_execute(drcbe_state *state, drcuml_codehandle *entry); @@ -340,7 +340,7 @@ extern const drcbe_interface drcbe_c_be_interface = state -------------------------------------------------*/ -static drcbe_state *drcbec_alloc(drcuml_state *drcuml, drccache *cache, const device_config *device, UINT32 flags, int modes, int addrbits, int ignorebits) +static drcbe_state *drcbec_alloc(drcuml_state *drcuml, drccache *cache, running_device *device, UINT32 flags, int modes, int addrbits, int ignorebits) { int spacenum; diff --git a/src/emu/cpu/drcbex64.c b/src/emu/cpu/drcbex64.c index c301d2d8651..cd9c97524a4 100644 --- a/src/emu/cpu/drcbex64.c +++ b/src/emu/cpu/drcbex64.c @@ -262,7 +262,7 @@ struct _opcode_table_entry /* internal backend-specific state */ struct _drcbe_state { - const device_config * device; /* CPU device we are associated with */ + running_device * device; /* CPU device we are associated with */ drcuml_state * drcuml; /* pointer back to our owner */ drccache * cache; /* pointer to the cache */ drcuml_machine_state state; /* state of the machine */ @@ -306,7 +306,7 @@ struct _drcbe_state ***************************************************************************/ /* primary back-end callbacks */ -static drcbe_state *drcbex64_alloc(drcuml_state *drcuml, drccache *cache, const device_config *device, UINT32 flags, int modes, int addrbits, int ignorebits); +static drcbe_state *drcbex64_alloc(drcuml_state *drcuml, drccache *cache, running_device *device, UINT32 flags, int modes, int addrbits, int ignorebits); static void drcbex64_free(drcbe_state *drcbe); static void drcbex64_reset(drcbe_state *drcbe); static int drcbex64_execute(drcbe_state *drcbe, drcuml_codehandle *entry); @@ -685,7 +685,7 @@ INLINE void emit_smart_call_m64(drcbe_state *drcbe, x86code **dst, x86code **tar state -------------------------------------------------*/ -static drcbe_state *drcbex64_alloc(drcuml_state *drcuml, drccache *cache, const device_config *device, UINT32 flags, int modes, int addrbits, int ignorebits) +static drcbe_state *drcbex64_alloc(drcuml_state *drcuml, drccache *cache, running_device *device, UINT32 flags, int modes, int addrbits, int ignorebits) { /* SSE control register mapping */ static const UINT32 sse_control[4] = diff --git a/src/emu/cpu/drcbex86.c b/src/emu/cpu/drcbex86.c index b815b3a038f..ebc75a6282b 100644 --- a/src/emu/cpu/drcbex86.c +++ b/src/emu/cpu/drcbex86.c @@ -154,7 +154,7 @@ struct _opcode_table_entry /* internal backend-specific state */ struct _drcbe_state { - const device_config * device; /* CPU device we are associated with */ + running_device * device; /* CPU device we are associated with */ drcuml_state * drcuml; /* pointer back to our owner */ drccache * cache; /* pointer to the cache */ drcuml_machine_state state; /* state of the machine */ @@ -200,7 +200,7 @@ struct _drcbe_state ***************************************************************************/ /* primary back-end callbacks */ -static drcbe_state *drcbex86_alloc(drcuml_state *drcuml, drccache *cache, const device_config *device, UINT32 flags, int modes, int addrbits, int ignorebits); +static drcbe_state *drcbex86_alloc(drcuml_state *drcuml, drccache *cache, running_device *device, UINT32 flags, int modes, int addrbits, int ignorebits); static void drcbex86_free(drcbe_state *drcbe); static void drcbex86_reset(drcbe_state *drcbe); static int drcbex86_execute(drcbe_state *drcbe, drcuml_codehandle *entry); @@ -613,7 +613,7 @@ INLINE void track_resolve_link(drcbe_state *drcbe, x86code **destptr, const emit state -------------------------------------------------*/ -static drcbe_state *drcbex86_alloc(drcuml_state *drcuml, drccache *cache, const device_config *device, UINT32 flags, int modes, int addrbits, int ignorebits) +static drcbe_state *drcbex86_alloc(drcuml_state *drcuml, drccache *cache, running_device *device, UINT32 flags, int modes, int addrbits, int ignorebits) { int opnum, regnum, entry, spacenum; drcbe_state *drcbe; diff --git a/src/emu/cpu/drcfe.c b/src/emu/cpu/drcfe.c index e8e7493f3dd..f1ab974d6bd 100644 --- a/src/emu/cpu/drcfe.c +++ b/src/emu/cpu/drcfe.c @@ -54,7 +54,7 @@ struct _drcfe_state void * param; /* parameter for the callback */ /* CPU parameters */ - const device_config *device; /* CPU device object */ + running_device *device; /* CPU device object */ const address_space *program; /* program address space for this CPU */ offs_t pageshift; /* shift to convert address to a page index */ cpu_translate_func translate; /* pointer to translation function */ @@ -121,7 +121,7 @@ INLINE void desc_free(drcfe_state *drcfe, opcode_desc *desc) drcfe_init - initializate the drcfe state -------------------------------------------------*/ -drcfe_state *drcfe_init(const device_config *cpu, const drcfe_config *config, void *param) +drcfe_state *drcfe_init(running_device *cpu, const drcfe_config *config, void *param) { drcfe_state *drcfe; @@ -142,7 +142,7 @@ drcfe_state *drcfe_init(const device_config *cpu, const drcfe_config *config, vo drcfe->device = cpu; drcfe->program = cpu->space(AS_PROGRAM); drcfe->pageshift = cpu_get_page_shift(cpu, ADDRESS_SPACE_PROGRAM); - drcfe->translate = (cpu_translate_func)device_get_info_fct(cpu, CPUINFO_FCT_TRANSLATE); + drcfe->translate = (cpu_translate_func)cpu->get_config_fct(CPUINFO_FCT_TRANSLATE); return drcfe; } diff --git a/src/emu/cpu/drcfe.h b/src/emu/cpu/drcfe.h index ac7231e6042..6510ebf6675 100644 --- a/src/emu/cpu/drcfe.h +++ b/src/emu/cpu/drcfe.h @@ -149,7 +149,7 @@ struct _drcfe_config ***************************************************************************/ /* initializate the drcfe state */ -drcfe_state *drcfe_init(const device_config *cpu, const drcfe_config *config, void *param); +drcfe_state *drcfe_init(running_device *cpu, const drcfe_config *config, void *param); /* clean up after ourselves */ void drcfe_exit(drcfe_state *drcfe); diff --git a/src/emu/cpu/drcuml.c b/src/emu/cpu/drcuml.c index 9ab8b2870ff..ca466e16371 100644 --- a/src/emu/cpu/drcuml.c +++ b/src/emu/cpu/drcuml.c @@ -135,7 +135,7 @@ struct _drcuml_symbol /* structure describing UML generation state */ struct _drcuml_state { - const device_config * device; /* CPU device we are associated with */ + running_device * device; /* CPU device we are associated with */ drccache * cache; /* pointer to the codegen cache */ drcuml_block * blocklist; /* list of active blocks */ const drcbe_interface * beintf; /* backend interface pointer */ @@ -538,7 +538,7 @@ INLINE void convert_to_mov_param(drcuml_instruction *inst, int pnum) generator and initialize the back-end -------------------------------------------------*/ -drcuml_state *drcuml_alloc(const device_config *device, drccache *cache, UINT32 flags, int modes, int addrbits, int ignorebits) +drcuml_state *drcuml_alloc(running_device *device, drccache *cache, UINT32 flags, int modes, int addrbits, int ignorebits) { drcuml_state *drcuml; int opnum; diff --git a/src/emu/cpu/drcuml.h b/src/emu/cpu/drcuml.h index b0c40727d63..6223d2f1252 100644 --- a/src/emu/cpu/drcuml.h +++ b/src/emu/cpu/drcuml.h @@ -417,7 +417,7 @@ struct _drcbe_info /* typedefs for back-end callback functions */ -typedef drcbe_state *(*drcbe_alloc_func)(drcuml_state *drcuml, drccache *cache, const device_config *device, UINT32 flags, int modes, int addrbits, int ignorebits); +typedef drcbe_state *(*drcbe_alloc_func)(drcuml_state *drcuml, drccache *cache, running_device *device, UINT32 flags, int modes, int addrbits, int ignorebits); typedef void (*drcbe_free_func)(drcbe_state *state); typedef void (*drcbe_reset_func)(drcbe_state *state); typedef int (*drcbe_execute_func)(drcbe_state *state, drcuml_codehandle *entry); @@ -448,7 +448,7 @@ struct _drcbe_interface /* ----- initialization/teardown ----- */ /* allocate state for the code generator and initialize the back-end */ -drcuml_state *drcuml_alloc(const device_config *device, drccache *cache, UINT32 flags, int modes, int addrbits, int ignorebits); +drcuml_state *drcuml_alloc(running_device *device, drccache *cache, UINT32 flags, int modes, int addrbits, int ignorebits); /* return information about the back-end */ void drcuml_get_backend_info(drcuml_state *drcuml, drcbe_info *info); diff --git a/src/emu/cpu/dsp32/dsp32.c b/src/emu/cpu/dsp32/dsp32.c index ba6769e77ab..3bee3b5cdfe 100644 --- a/src/emu/cpu/dsp32/dsp32.c +++ b/src/emu/cpu/dsp32/dsp32.c @@ -183,8 +183,8 @@ struct _dsp32_state int icount; UINT8 lastpins; UINT32 ppc; - void (*output_pins_changed)(const device_config *device, UINT32 pins); - const device_config *device; + void (*output_pins_changed)(running_device *device, UINT32 pins); + running_device *device; const address_space *program; }; @@ -202,7 +202,7 @@ static CPU_RESET( dsp32c ); STATE ACCESSORS ***************************************************************************/ -INLINE dsp32_state *get_safe_token(const device_config *device) +INLINE dsp32_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -313,7 +313,7 @@ static void update_pcr(dsp32_state *cpustate, UINT16 newval) static CPU_INIT( dsp32c ) { - const dsp32_config *configdata = (const dsp32_config *)device->static_config; + const dsp32_config *configdata = (const dsp32_config *)device->baseconfig().static_config; dsp32_state *cpustate = get_safe_token(device); /* copy in config data */ @@ -499,7 +499,7 @@ INLINE void dma_store(dsp32_state *cpustate) } -void dsp32c_pio_w(const device_config *device, int reg, int data) +void dsp32c_pio_w(running_device *device, int reg, int data) { dsp32_state *cpustate = get_safe_token(device); UINT16 mask; @@ -578,7 +578,7 @@ void dsp32c_pio_w(const device_config *device, int reg, int data) PARALLEL INTERFACE READS ***************************************************************************/ -int dsp32c_pio_r(const device_config *device, int reg) +int dsp32c_pio_r(running_device *device, int reg) { dsp32_state *cpustate = get_safe_token(device); UINT16 mask, result = 0xffff; diff --git a/src/emu/cpu/dsp32/dsp32.h b/src/emu/cpu/dsp32/dsp32.h index fe633bb0a68..b3f324123ab 100644 --- a/src/emu/cpu/dsp32/dsp32.h +++ b/src/emu/cpu/dsp32/dsp32.h @@ -67,7 +67,7 @@ enum typedef struct _dsp32_config dsp32_config; struct _dsp32_config { - void (*output_pins_changed)(const device_config *device, UINT32 pins); /* a change has occurred on an output pin */ + void (*output_pins_changed)(running_device *device, UINT32 pins); /* a change has occurred on an output pin */ }; @@ -79,7 +79,7 @@ struct _dsp32_config extern CPU_GET_INFO( dsp32c ); #define CPU_DSP32C CPU_GET_INFO_NAME( dsp32c ) -extern void dsp32c_pio_w(const device_config *device, int reg, int data); -extern int dsp32c_pio_r(const device_config *device, int reg); +extern void dsp32c_pio_w(running_device *device, int reg, int data); +extern int dsp32c_pio_r(running_device *device, int reg); #endif /* __DSP32_H__ */ diff --git a/src/emu/cpu/dsp56k/dsp56def.h b/src/emu/cpu/dsp56k/dsp56def.h index 8090271eab3..899e94d6f5a 100644 --- a/src/emu/cpu/dsp56k/dsp56def.h +++ b/src/emu/cpu/dsp56k/dsp56def.h @@ -412,7 +412,7 @@ static void PCDDR_set(dsp56k_core* cpustate, UINT16 value); static void PCD_set(dsp56k_core* cpustate, UINT16 value); -INLINE dsp56k_core *get_safe_token(const device_config *device) +INLINE dsp56k_core *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/dsp56k/dsp56k.c b/src/emu/cpu/dsp56k/dsp56k.c index f68f9b7bb80..ca60e6ee71c 100644 --- a/src/emu/cpu/dsp56k/dsp56k.c +++ b/src/emu/cpu/dsp56k/dsp56k.c @@ -165,7 +165,7 @@ static void set_irq_line(dsp56k_core* cpustate, int irqline, int state) /*************************************************************************** INITIALIZATION AND SHUTDOWN ***************************************************************************/ -static void agu_init(dsp56k_core* cpustate, const device_config *device) +static void agu_init(dsp56k_core* cpustate, running_device *device) { /* save states - dsp56k_agu members */ state_save_register_device_item(device, 0, cpustate->AGU.r0); @@ -183,7 +183,7 @@ static void agu_init(dsp56k_core* cpustate, const device_config *device) state_save_register_device_item(device, 0, cpustate->AGU.temp); } -static void alu_init(dsp56k_core* cpustate, const device_config *device) +static void alu_init(dsp56k_core* cpustate, running_device *device) { /* save states - dsp56k_alu members */ state_save_register_device_item(device, 0, cpustate->ALU.x); @@ -232,7 +232,7 @@ static CPU_INIT( dsp56k ) state_save_register_device_item(device, 0, cpustate->HI.trxl); state_save_register_device_item(device, 0, cpustate->HI.bootstrap_offset); - //cpustate->config = device->static_config; + //cpustate->config = device->baseconfig().static_config; //cpustate->irq_callback = irqcallback; cpustate->device = device; cpustate->program = device->space(AS_PROGRAM); diff --git a/src/emu/cpu/dsp56k/dsp56k.h b/src/emu/cpu/dsp56k/dsp56k.h index 41d10458ade..3a7ed889caa 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); - const device_config *device; + running_device *device; const address_space *program; const address_space *data; } dsp56k_core; @@ -241,9 +241,9 @@ typedef struct /*************************************************************************** PUBLIC FUNCTIONS - ACCESSIBLE TO DRIVERS ***************************************************************************/ -void dsp56k_host_interface_write(const device_config* device, UINT8 offset, UINT8 data); -UINT8 dsp56k_host_interface_read(const device_config* device, UINT8 offset); +void dsp56k_host_interface_write(running_device* device, UINT8 offset, UINT8 data); +UINT8 dsp56k_host_interface_read(running_device* device, UINT8 offset); -UINT16 dsp56k_get_peripheral_memory(const device_config* device, UINT16 addr); +UINT16 dsp56k_get_peripheral_memory(running_device* device, UINT16 addr); #endif /* __DSP56K_H__ */ diff --git a/src/emu/cpu/dsp56k/dsp56mem.c b/src/emu/cpu/dsp56k/dsp56mem.c index c702ff107c2..a8ef6455611 100644 --- a/src/emu/cpu/dsp56k/dsp56mem.c +++ b/src/emu/cpu/dsp56k/dsp56mem.c @@ -610,7 +610,7 @@ static void dsp56k_host_interface_reset(dsp56k_core* cpustate) /* These two functions are exposed to the outside world */ /* They represent the host side of the dsp56k's host interface */ -void dsp56k_host_interface_write(const device_config* device, UINT8 offset, UINT8 data) +void dsp56k_host_interface_write(running_device* device, UINT8 offset, UINT8 data) { dsp56k_core* cpustate = get_safe_token(device); @@ -706,7 +706,7 @@ void dsp56k_host_interface_write(const device_config* device, UINT8 offset, UINT } } -UINT8 dsp56k_host_interface_read(const device_config* device, UINT8 offset) +UINT8 dsp56k_host_interface_read(running_device* device, UINT8 offset) { dsp56k_core* cpustate = get_safe_token(device); @@ -934,7 +934,7 @@ static void dsp56k_io_reset(dsp56k_core* cpustate) /* MISC*/ -UINT16 dsp56k_get_peripheral_memory(const device_config* device, UINT16 addr) +UINT16 dsp56k_get_peripheral_memory(running_device* device, UINT16 addr) { // TODO // THIS COMES BACK dsp56k_core* cpustate = get_safe_token(device); return dsp56k_peripheral_ram[A2O(addr)]; diff --git a/src/emu/cpu/dsp56k/dsp56pcu.c b/src/emu/cpu/dsp56k/dsp56pcu.c index 99be2e73379..48011b35042 100644 --- a/src/emu/cpu/dsp56k/dsp56pcu.c +++ b/src/emu/cpu/dsp56k/dsp56pcu.c @@ -90,7 +90,7 @@ static UINT8 SE_bit(dsp56k_core* cpustate) { return ((SP & 0x0010) != 0); } /*************************************************************************** INITIALIZATION AND RESET ***************************************************************************/ -static void pcu_init(dsp56k_core* cpustate, const device_config *device) +static void pcu_init(dsp56k_core* cpustate, running_device *device) { /* Init the irq table */ dsp56k_irq_table_init(); diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c index ae8f85029fa..cf774e56719 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; UINT32 opcodexor; @@ -413,7 +413,7 @@ static ADDRESS_MAP_START( e132_16k_iram_map, ADDRESS_SPACE_PROGRAM, 32 ) ADDRESS_MAP_END -INLINE hyperstone_state *get_safe_token(const device_config *device) +INLINE hyperstone_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -638,7 +638,7 @@ static void adjust_timer_interrupt(hyperstone_state *cpustate) static TIMER_CALLBACK( e132xs_timer_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; hyperstone_state *cpustate = get_safe_token(device); int update = param; @@ -1528,7 +1528,7 @@ static void set_irq_line(hyperstone_state *cpustate, int irqline, int state) ISR &= ~(1 << irqline); } -static void hyperstone_init(const device_config *device, cpu_irq_callback irqcallback, int scale_mask) +static void hyperstone_init(running_device *device, cpu_irq_callback irqcallback, int scale_mask) { hyperstone_state *cpustate = get_safe_token(device); @@ -1550,7 +1550,7 @@ static void hyperstone_init(const device_config *device, cpu_irq_callback irqcal cpustate->clock_scale_mask = scale_mask; } -static void e116_init(const device_config *device, cpu_irq_callback irqcallback, int scale_mask) +static void e116_init(running_device *device, cpu_irq_callback irqcallback, int scale_mask) { hyperstone_state *cpustate = get_safe_token(device); hyperstone_init(device, irqcallback, scale_mask); @@ -1587,7 +1587,7 @@ static CPU_INIT( gms30c2216 ) e116_init(device, irqcallback, 0); } -static void e132_init(const device_config *device, cpu_irq_callback irqcallback, int scale_mask) +static void e132_init(running_device *device, cpu_irq_callback irqcallback, int scale_mask) { hyperstone_state *cpustate = get_safe_token(device); hyperstone_init(device, irqcallback, scale_mask); diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c index f542646cb9f..7c1142cef4e 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; - const device_config *device; + running_device *device; const address_space *program; int icount; @@ -120,7 +120,7 @@ typedef struct } esrip_state; -INLINE esrip_state *get_safe_token(const device_config *device) +INLINE esrip_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -134,7 +134,7 @@ INLINE esrip_state *get_safe_token(const device_config *device) PUBLIC FUNCTIONS ***************************************************************************/ -UINT8 get_rip_status(const device_config *cpu) +UINT8 get_rip_status(running_device *cpu) { esrip_state *cpustate = get_safe_token(cpu); return cpustate->status_out; @@ -250,7 +250,7 @@ static void make_ops(esrip_state *cpustate) static CPU_INIT( esrip ) { esrip_state *cpustate = get_safe_token(device); - esrip_config* _config = (esrip_config*)device->static_config; + esrip_config* _config = (esrip_config*)device->baseconfig().static_config; memset(cpustate, 0, sizeof(cpustate)); @@ -1891,7 +1891,7 @@ static CPU_SET_INFO( esrip ) CPU_GET_INFO( esrip ) { - esrip_state *cpustate = (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/esrip/esrip.h b/src/emu/cpu/esrip/esrip.h index 70826681261..b3d16adf9c0 100644 --- a/src/emu/cpu/esrip/esrip.h +++ b/src/emu/cpu/esrip/esrip.h @@ -98,6 +98,6 @@ CPU_GET_INFO( esrip ); #define CPU_ESRIP CPU_GET_INFO_NAME( esrip ) -extern UINT8 get_rip_status(const device_config *cpu); +extern UINT8 get_rip_status(running_device *cpu); #endif /* _ESRIP_H */ diff --git a/src/emu/cpu/f8/f8.c b/src/emu/cpu/f8/f8.c index 93bf5fe0515..552d93e9a3b 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *iospace; int icount; @@ -61,7 +61,7 @@ struct _f8_Regs int irq_request; }; -INLINE f8_Regs *get_safe_token(const device_config *device) +INLINE f8_Regs *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/g65816/g65816.c b/src/emu/cpu/g65816/g65816.c index 63f8eeab742..7076033c8de 100644 --- a/src/emu/cpu/g65816/g65816.c +++ b/src/emu/cpu/g65816/g65816.c @@ -91,7 +91,7 @@ TODO general: #include "emu.h" #include "g65816.h" -INLINE g65816i_cpu_struct *get_safe_token(const device_config *device) +INLINE g65816i_cpu_struct *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -402,7 +402,7 @@ static CPU_SET_INFO( g65816 ) -void g65816_set_read_vector_callback(const device_config *device, read8_space_func read_vector) +void g65816_set_read_vector_callback(running_device *device, read8_space_func read_vector) { g65816i_cpu_struct *cpustate = get_safe_token(device); READ_VECTOR = read_vector; diff --git a/src/emu/cpu/g65816/g65816.h b/src/emu/cpu/g65816/g65816.h index afb34596676..f1fd60acccd 100644 --- a/src/emu/cpu/g65816/g65816.h +++ b/src/emu/cpu/g65816/g65816.h @@ -60,7 +60,7 @@ enum CPU_GET_INFO( g65816 ); #define CPU_G65816 CPU_GET_INFO_NAME( g65816 ) -void g65816_set_read_vector_callback(const device_config *device, read8_space_func read_vector); +void g65816_set_read_vector_callback(running_device *device, read8_space_func read_vector); /* ======================================================================== */ diff --git a/src/emu/cpu/g65816/g65816cm.h b/src/emu/cpu/g65816/g65816cm.h index bf34cf1b20c..ef6cd9e12f9 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 */ cpu_irq_callback int_ack; /* Interrupt Acknowledge */ - const device_config *device; + running_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 76806dbfe64..896bf36a5d5 100644 --- a/src/emu/cpu/h6280/h6280.c +++ b/src/emu/cpu/h6280/h6280.c @@ -117,7 +117,7 @@ static void set_irq_line(h6280_Regs* cpustate, int irqline, int state); /* include the macros */ #include "h6280ops.h" -INLINE h6280_Regs *get_safe_token(const device_config *device) +INLINE h6280_Regs *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -363,12 +363,12 @@ static CPU_TRANSLATE( h6280 ) return TRUE; } -UINT8 h6280io_get_buffer(const device_config *device) +UINT8 h6280io_get_buffer(running_device *device) { h6280_Regs* cpustate = get_safe_token(device); return cpustate->io_buffer; } -void h6280io_set_buffer(const device_config *device, UINT8 data) +void h6280io_set_buffer(running_device *device, UINT8 data) { h6280_Regs* cpustate = get_safe_token(device); cpustate->io_buffer=data; diff --git a/src/emu/cpu/h6280/h6280.h b/src/emu/cpu/h6280/h6280.h index 8fc4068ea6f..6f5e57dc23a 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; @@ -83,8 +83,8 @@ READ8_HANDLER( h6280_timer_r ); WRITE8_HANDLER( h6280_timer_w ); /* functions for use by the PSG and joypad port only! */ -UINT8 h6280io_get_buffer(const device_config*); -void h6280io_set_buffer(const device_config*, UINT8); +UINT8 h6280io_get_buffer(running_device*); +void h6280io_set_buffer(running_device*, UINT8); CPU_DISASSEMBLE( h6280 ); diff --git a/src/emu/cpu/h83002/h8priv.h b/src/emu/cpu/h83002/h8priv.h index dfa4aa3ad80..e3fe1c59074 100644 --- a/src/emu/cpu/h83002/h8priv.h +++ b/src/emu/cpu/h83002/h8priv.h @@ -25,7 +25,7 @@ struct _h83xx_state UINT8 h8uflag, h8uiflag; cpu_irq_callback irq_cb; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; @@ -46,7 +46,7 @@ struct _h83xx_state }; extern h83xx_state h8; -INLINE h83xx_state *get_safe_token(const device_config *device) +INLINE h83xx_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/hd6309/hd6309.c b/src/emu/cpu/hd6309/hd6309.c index 15beb58c413..ddd412593e3 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 */ cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; int icount; PAIR ea; /* effective address */ @@ -151,7 +151,7 @@ struct _m68_state_t UINT8 const *index_cycle; }; -INLINE m68_state_t *get_safe_token(const device_config *device) +INLINE m68_state_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -506,7 +506,7 @@ static void check_irq_lines( m68_state_t *m68_state ) static STATE_POSTLOAD( hd6309_postload ) { - const device_config *device = (const device_config *)param; + running_device *device = (running_device *)param; m68_state_t *m68_state = get_safe_token(device); UpdateState(m68_state); diff --git a/src/emu/cpu/i386/i386.c b/src/emu/cpu/i386/i386.c index 63de8854143..28200c2f96e 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) { - const device_config *device = (const device_config *)ref; + running_device *device = (running_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) { - const device_config *device = (const device_config *)ref; + running_device *device = (running_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 ) { - const device_config *device = (const device_config *)param; + running_device *device = (running_device *)param; i386_state *cpustate = get_safe_token(device); int i; for (i = 0; i < 6; i++) diff --git a/src/emu/cpu/i386/i386priv.h b/src/emu/cpu/i386/i386priv.h index 01e024c996c..03bf67eb4f7 100644 --- a/src/emu/cpu/i386/i386priv.h +++ b/src/emu/cpu/i386/i386priv.h @@ -226,7 +226,7 @@ struct _i386_state UINT8 irq_state; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; UINT32 a20_mask; @@ -256,7 +256,7 @@ struct _i386_state UINT8 *cycle_table_rm; }; -INLINE i386_state *get_safe_token(const device_config *device) +INLINE i386_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/i4004/i4004.c b/src/emu/cpu/i4004/i4004.c index cf878b04ef8..7d2669d8ceb 100644 --- a/src/emu/cpu/i4004/i4004.c +++ b/src/emu/cpu/i4004/i4004.c @@ -32,7 +32,7 @@ struct _i4004_state UINT8 TEST; // Test PIN status PAIR PC; // It is in fact one of ADDR regs - const device_config *device; + running_device *device; const address_space *program; const address_space *data; const address_space *io; @@ -86,7 +86,7 @@ static const cpu_state_table state_table_template = INLINE FUNCTIONS ***************************************************************************/ -INLINE i4004_state *get_safe_token(const device_config *device) +INLINE i4004_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -191,7 +191,7 @@ INLINE void POP_STACK(i4004_state *cpustate) cpustate->pc_pos = (cpustate->pc_pos - 1) & cpustate->addr_mask; } -void i4004_set_test(const device_config *device, UINT8 val) +void i4004_set_test(running_device *device, UINT8 val) { i4004_state *cpustate = get_safe_token(device); cpustate->TEST = val; diff --git a/src/emu/cpu/i4004/i4004.h b/src/emu/cpu/i4004/i4004.h index 3c5fba3dfeb..c0a90116823 100644 --- a/src/emu/cpu/i4004/i4004.h +++ b/src/emu/cpu/i4004/i4004.h @@ -31,5 +31,5 @@ CPU_GET_INFO( i4004 ); CPU_DISASSEMBLE( i4004 ); -void i4004_set_test(const device_config *device, UINT8 val); +void i4004_set_test(running_device *device, UINT8 val); #endif diff --git a/src/emu/cpu/i8008/i8008.c b/src/emu/cpu/i8008/i8008.c index be4b511ce85..1cbfd5bae64 100644 --- a/src/emu/cpu/i8008/i8008.c +++ b/src/emu/cpu/i8008/i8008.c @@ -32,7 +32,7 @@ struct _i8008_state UINT8 SF; // Sign flag UINT8 PF; // Parity flag UINT8 HALT; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; cpu_state_table state; @@ -90,7 +90,7 @@ static const cpu_state_table state_table_template = INLINE FUNCTIONS ***************************************************************************/ -INLINE i8008_state *get_safe_token(const device_config *device) +INLINE i8008_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/i8085/i8085.c b/src/emu/cpu/i8085/i8085.c index a48d950c010..dc1dd2c9b5f 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 */ cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; cpu_state_table state; @@ -318,7 +318,7 @@ static void execute_one(i8085_state *cpustate, int opcode); INLINE FUNCTIONS ***************************************************************************/ -INLINE i8085_state *get_safe_token(const device_config *device) +INLINE i8085_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -1018,7 +1018,7 @@ static void init_tables (int type) } -static void init_808x_common(const device_config *device, cpu_irq_callback irqcallback, int type) +static void init_808x_common(running_device *device, cpu_irq_callback irqcallback, int type) { i8085_state *cpustate = get_safe_token(device); @@ -1029,8 +1029,8 @@ static void init_808x_common(const device_config *device, cpu_irq_callback irqca cpustate->state.baseptr = cpustate; cpustate->state.subtypemask = 1 << type; - if (device->static_config != NULL) - cpustate->config = *(i8085_config *)device->static_config; + if (device->baseconfig().static_config != NULL) + cpustate->config = *(i8085_config *)device->baseconfig().static_config; cpustate->cputype = type; cpustate->irq_callback = irqcallback; cpustate->device = device; diff --git a/src/emu/cpu/i86/i286.c b/src/emu/cpu/i86/i286.c index 30756a28094..1bc0634b6fc 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; INT32 AuxVal, OverVal, SignVal, ZeroVal, CarryVal, DirVal; /* 0 or non-0 valued flags */ @@ -81,7 +81,7 @@ struct _i80286_state UINT16 eo; /* HJB 12/13/98 effective offset of the address (before segment is added) */ }; -INLINE i80286_state *get_safe_token(const device_config *device) +INLINE i80286_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -298,8 +298,8 @@ static CPU_INIT( i80286 ) cpustate->io = device->space(AS_IO); /* If a reset parameter is given, take it as pointer to an address mask */ - if( device->static_config ) - cpustate->amask = *(unsigned*)device->static_config; + if( device->baseconfig().static_config ) + cpustate->amask = *(unsigned*)device->baseconfig().static_config; else cpustate->amask = 0x00ffff; diff --git a/src/emu/cpu/i86/i86.c b/src/emu/cpu/i86/i86.c index d3a42bdf242..033d4bdaf89 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; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; @@ -71,7 +71,7 @@ struct _i8086_state UINT16 eo; /* HJB 12/13/98 effective offset of the address (before segment is added) */ }; -INLINE i8086_state *get_safe_token(const device_config *device) +INLINE i8086_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -162,7 +162,7 @@ static UINT8 parity_table[256]; /***************************************************************************/ -static void i8086_state_register(const device_config *device) +static void i8086_state_register(running_device *device) { i8086_state *cpustate = get_safe_token(device); state_save_register_device_item_array(device, 0, cpustate->regs.w); diff --git a/src/emu/cpu/i860/i860.h b/src/emu/cpu/i860/i860.h index a2210188195..0a322a974c3 100644 --- a/src/emu/cpu/i860/i860.h +++ b/src/emu/cpu/i860/i860.h @@ -169,14 +169,14 @@ typedef struct { /* * MAME-specific stuff. */ - const device_config *device; + running_device *device; const address_space *program; UINT32 ppc; int icount; } i860_state_t; -INLINE i860_state_t *get_safe_token(const device_config *device) +INLINE i860_state_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -196,7 +196,7 @@ extern void i860_gen_interrupt(i860_state_t*); /* This is the external interface for asserting/deasserting a pin on the i860. */ -extern void i860_set_pin(const device_config *, int, int); +extern void i860_set_pin(running_device *, int, int); /* Hard or soft reset. */ extern void reset_i860(i860_state_t*); diff --git a/src/emu/cpu/i860/i860dec.c b/src/emu/cpu/i860/i860dec.c index 8533f17377c..95a7b755553 100644 --- a/src/emu/cpu/i860/i860dec.c +++ b/src/emu/cpu/i860/i860dec.c @@ -309,7 +309,7 @@ static int has_delay_slot(UINT32 insn) /* This is the external interface for asserting/deasserting pins on the i860. */ -void i860_set_pin (const device_config *device, int pin, int val) +void i860_set_pin (running_device *device, int pin, int val) { i860s *cpustate = get_safe_token(device); if (pin == DEC_PIN_BUS_HOLD) diff --git a/src/emu/cpu/i960/i960.c b/src/emu/cpu/i960/i960.c index 3213330155f..f56617425c1 100644 --- a/src/emu/cpu/i960/i960.c +++ b/src/emu/cpu/i960/i960.c @@ -34,13 +34,13 @@ struct _i960_state_t { int immediate_irq, immediate_vector, immediate_pri; cpu_irq_callback irq_cb; - const device_config *device; + running_device *device; const address_space *program; int icount; }; -INLINE i960_state_t *get_safe_token(const device_config *device) +INLINE i960_state_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -2219,13 +2219,13 @@ CPU_GET_INFO( i960 ) // call from any read/write handler for a memory area that can't be bursted // on the real hardware (e.g. Model 2's interrupt control registers) -void i960_noburst(const device_config *device) +void i960_noburst(running_device *device) { i960_state_t *i960 = get_safe_token(device); i960->bursting = 0; } -void i960_stall(const device_config *device) +void i960_stall(running_device *device) { i960_state_t *i960 = get_safe_token(device); i960->IP = i960->PIP; diff --git a/src/emu/cpu/i960/i960.h b/src/emu/cpu/i960/i960.h index 7afc616488b..a975d1c5a2b 100644 --- a/src/emu/cpu/i960/i960.h +++ b/src/emu/cpu/i960/i960.h @@ -63,7 +63,7 @@ enum CPU_GET_INFO( i960 ); #define CPU_I960 CPU_GET_INFO_NAME( i960 ) -void i960_noburst(const device_config *device); -void i960_stall(const device_config *device); +void i960_noburst(running_device *device); +void i960_stall(running_device *device); #endif /* __I960_H__ */ diff --git a/src/emu/cpu/jaguar/jaguar.c b/src/emu/cpu/jaguar/jaguar.c index a8185110b54..c94bc504a33 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); cpu_irq_callback irq_callback; jaguar_int_func cpu_interrupt; - const device_config *device; + running_device *device; const address_space *program; }; @@ -248,7 +248,7 @@ static void (*const dsp_op_table[64])(jaguar_state *jaguar, UINT16 op) = INLINE FUNCTIONS ***************************************************************************/ -INLINE jaguar_state *get_safe_token(const device_config *device) +INLINE jaguar_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -402,7 +402,7 @@ static void init_tables(void) static STATE_POSTLOAD( jaguar_postload ) { - const device_config *device = (const device_config *)param; + running_device *device = (running_device *)param; jaguar_state *jaguar = get_safe_token(device); update_register_banks(jaguar); @@ -410,9 +410,9 @@ static STATE_POSTLOAD( jaguar_postload ) } -static void init_common(int isdsp, const device_config *device, cpu_irq_callback irqcallback) +static void init_common(int isdsp, running_device *device, cpu_irq_callback irqcallback) { - const jaguar_cpu_config *configdata = (const jaguar_cpu_config *)device->static_config; + const jaguar_cpu_config *configdata = (const jaguar_cpu_config *)device->baseconfig().static_config; jaguar_state *jaguar = get_safe_token(device); init_tables(); @@ -1241,7 +1241,7 @@ void xor_rn_rn(jaguar_state *jaguar, UINT16 op) I/O HANDLING ***************************************************************************/ -UINT32 jaguargpu_ctrl_r(const device_config *device, offs_t offset) +UINT32 jaguargpu_ctrl_r(running_device *device, offs_t offset) { jaguar_state *jaguar = get_safe_token(device); @@ -1251,7 +1251,7 @@ UINT32 jaguargpu_ctrl_r(const device_config *device, offs_t offset) } -void jaguargpu_ctrl_w(const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) +void jaguargpu_ctrl_w(running_device *device, offs_t offset, UINT32 data, UINT32 mem_mask) { jaguar_state *jaguar = get_safe_token(device); UINT32 oldval, newval; @@ -1337,7 +1337,7 @@ void jaguargpu_ctrl_w(const device_config *device, offs_t offset, UINT32 data, U I/O HANDLING ***************************************************************************/ -UINT32 jaguardsp_ctrl_r(const device_config *device, offs_t offset) +UINT32 jaguardsp_ctrl_r(running_device *device, offs_t offset) { jaguar_state *jaguar = get_safe_token(device); @@ -1349,7 +1349,7 @@ UINT32 jaguardsp_ctrl_r(const device_config *device, offs_t offset) } -void jaguardsp_ctrl_w(const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) +void jaguardsp_ctrl_w(running_device *device, offs_t offset, UINT32 data, UINT32 mem_mask) { jaguar_state *jaguar = get_safe_token(device); UINT32 oldval, newval; diff --git a/src/emu/cpu/jaguar/jaguar.h b/src/emu/cpu/jaguar/jaguar.h index e82d4c57ca5..dfe6057237e 100644 --- a/src/emu/cpu/jaguar/jaguar.h +++ b/src/emu/cpu/jaguar/jaguar.h @@ -71,7 +71,7 @@ enum CONFIGURATION STRUCTURE ***************************************************************************/ -typedef void (*jaguar_int_func)(const device_config *device); +typedef void (*jaguar_int_func)(running_device *device); typedef struct _jaguar_cpu_config jaguar_cpu_config; @@ -101,13 +101,13 @@ struct _jaguar_cpu_config extern CPU_GET_INFO( jaguargpu ); #define CPU_JAGUARGPU CPU_GET_INFO_NAME( jaguargpu ) -extern void jaguargpu_ctrl_w(const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask); -extern UINT32 jaguargpu_ctrl_r(const device_config *device, offs_t offset); +extern void jaguargpu_ctrl_w(running_device *device, offs_t offset, UINT32 data, UINT32 mem_mask); +extern UINT32 jaguargpu_ctrl_r(running_device *device, offs_t offset); extern CPU_GET_INFO( jaguardsp ); #define CPU_JAGUARDSP CPU_GET_INFO_NAME( jaguardsp ) -extern void jaguardsp_ctrl_w(const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask); -extern UINT32 jaguardsp_ctrl_r(const device_config *device, offs_t offset); +extern void jaguardsp_ctrl_w(running_device *device, offs_t offset, UINT32 data, UINT32 mem_mask); +extern UINT32 jaguardsp_ctrl_r(running_device *device, offs_t offset); #endif /* __JAGUAR_H__ */ diff --git a/src/emu/cpu/konami/konami.c b/src/emu/cpu/konami/konami.c index ee4d3e58867..32062ede898 100644 --- a/src/emu/cpu/konami/konami.c +++ b/src/emu/cpu/konami/konami.c @@ -61,12 +61,12 @@ struct _konami_state UINT8 nmi_state; UINT8 nmi_pending; int icount; - const device_config *device; + running_device *device; const address_space *program; konami_set_lines_func setlines_callback; }; -INLINE konami_state *get_safe_token(const device_config *device) +INLINE konami_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -505,7 +505,7 @@ static CPU_EXECUTE( konami ) } -void konami_configure_set_lines(const device_config *device, konami_set_lines_func func) +void konami_configure_set_lines(running_device *device, konami_set_lines_func func) { konami_state *cpustate = get_safe_token(device); cpustate->setlines_callback = func; diff --git a/src/emu/cpu/konami/konami.h b/src/emu/cpu/konami/konami.h index e049c74e38b..27049084c9e 100644 --- a/src/emu/cpu/konami/konami.h +++ b/src/emu/cpu/konami/konami.h @@ -6,7 +6,7 @@ #define __KONAMI_H__ -typedef void (*konami_set_lines_func)(const device_config *device, int lines); +typedef void (*konami_set_lines_func)(running_device *device, int lines); enum { @@ -14,7 +14,7 @@ enum KONAMI_DP }; -#define KONAMI_SETLINES_CALLBACK(name) void name(const device_config *device, int lines) +#define KONAMI_SETLINES_CALLBACK(name) void name(running_device *device, int lines) #define KONAMI_IRQ_LINE 0 /* IRQ line number */ #define KONAMI_FIRQ_LINE 1 /* FIRQ line number */ @@ -25,7 +25,7 @@ CPU_GET_INFO( konami ); CPU_DISASSEMBLE( konami ); -void konami_configure_set_lines(const device_config *device, konami_set_lines_func func); +void konami_configure_set_lines(running_device *device, konami_set_lines_func func); #endif /* __KONAMI_H__ */ diff --git a/src/emu/cpu/lh5801/lh5801.c b/src/emu/cpu/lh5801/lh5801.c index be5bd26d759..541a4d3b02d 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; - const device_config *device; + running_device *device; const address_space *program; PAIR s, p, u, x, y; @@ -68,7 +68,7 @@ struct _lh5810_state int icount; }; -INLINE lh5801_state *get_safe_token(const device_config *device) +INLINE lh5801_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -105,7 +105,7 @@ static CPU_INIT( lh5801 ) lh5801_state *cpustate = get_safe_token(device); memset(cpustate, 0, sizeof(*cpustate)); - cpustate->config = (const lh5801_cpu_core *) device->static_config; + cpustate->config = (const lh5801_cpu_core *) device->baseconfig().static_config; cpustate->device = device; cpustate->program = device->space(AS_PROGRAM); } diff --git a/src/emu/cpu/lh5801/lh5801.h b/src/emu/cpu/lh5801/lh5801.h index cc592d42ab8..b869422c7dc 100644 --- a/src/emu/cpu/lh5801/lh5801.h +++ b/src/emu/cpu/lh5801/lh5801.h @@ -65,7 +65,7 @@ pc 8bit -typedef UINT8 (*lh5801_in_func)(const device_config *device); +typedef UINT8 (*lh5801_in_func)(running_device *device); typedef struct _lh5801_cpu_core lh5801_cpu_core; struct _lh5801_cpu_core diff --git a/src/emu/cpu/lr35902/lr35902.c b/src/emu/cpu/lr35902/lr35902.c index 02df23f7d41..10b4a731d09 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; int icount; /* Timer stuff */ @@ -113,7 +113,7 @@ union _lr35902_state { lr35902_8BitRegs b; }; -INLINE lr35902_state *get_safe_token(const device_config *device) +INLINE lr35902_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -191,7 +191,7 @@ static CPU_INIT( lr35902 ) { lr35902_state *cpustate = get_safe_token(device); - cpustate->w.config = (const lr35902_cpu_core *) device->static_config; + cpustate->w.config = (const lr35902_cpu_core *) device->baseconfig().static_config; cpustate->w.irq_callback = irqcallback; cpustate->w.device = device; cpustate->w.program = device->space(AS_PROGRAM); diff --git a/src/emu/cpu/lr35902/lr35902.h b/src/emu/cpu/lr35902/lr35902.h index 0e538bba41c..412bbc7b6dd 100644 --- a/src/emu/cpu/lr35902/lr35902.h +++ b/src/emu/cpu/lr35902/lr35902.h @@ -4,7 +4,7 @@ #define __LR35902_H__ -typedef void (*lr35902_timer_fired_func)(const device_config *device, int cycles); +typedef void (*lr35902_timer_fired_func)(running_device *device, int cycles); typedef struct _lr35902_cpu_core lr35902_cpu_core; struct _lr35902_cpu_core diff --git a/src/emu/cpu/m37710/m37710cm.h b/src/emu/cpu/m37710/m37710cm.h index 0268dcf9b0b..3a3a0f033fa 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 */ cpu_irq_callback int_ack; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; uint stopped; /* Sets how the CPU is stopped */ @@ -127,7 +127,7 @@ struct _m37710i_cpu_struct emu_timer *timers[8]; }; -INLINE m37710i_cpu_struct *get_safe_token(const device_config *device) +INLINE m37710i_cpu_struct *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/m6502/m4510.c b/src/emu/cpu/m6502/m4510.c index 57380a84156..ec1ac5a940e 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]; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *space; int icount; @@ -156,7 +156,7 @@ struct _m4510_Regs { m6510_port_write_func port_write; }; -INLINE m4510_Regs *get_safe_token(const device_config *device) +INLINE m4510_Regs *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -198,7 +198,7 @@ static void default_wrmem_id(const address_space *space, offs_t address, UINT8 d static CPU_INIT( m4510 ) { m4510_Regs *cpustate = get_safe_token(device); - const m6502_interface *intf = (const m6502_interface *)device->static_config; + const m6502_interface *intf = (const m6502_interface *)device->baseconfig().static_config; cpustate->interrupt_inhibit = 0; cpustate->rdmem_id = default_rdmem_id; diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c index 1efbf812ecb..506170261da 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *space; const address_space *io; int int_occured; @@ -84,7 +84,7 @@ struct _m6502_Regs m6510_port_write_func port_write; }; -INLINE m6502_Regs *get_safe_token(const device_config *device) +INLINE m6502_Regs *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -129,10 +129,10 @@ static void default_wdmem_id(const address_space *space, offs_t offset, UINT8 da * *****************************************************************************/ -static void m6502_common_init(const device_config *device, cpu_irq_callback irqcallback, UINT8 subtype, void (*const *insn)(m6502_Regs *cpustate), const char *type) +static void m6502_common_init(running_device *device, cpu_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->static_config; + const m6502_interface *intf = (const m6502_interface *)device->baseconfig().static_config; cpustate->irq_callback = irqcallback; cpustate->device = device; @@ -334,7 +334,7 @@ static CPU_INIT( n2a03 ) Bit 7 of address $4011 (the PSG's DPCM control register), when set, causes an IRQ to be generated. This function allows the IRQ to be called from the PSG core when such an occasion arises. */ -void n2a03_irq(const device_config *device) +void n2a03_irq(running_device *device) { m6502_Regs *cpustate = get_safe_token(device); diff --git a/src/emu/cpu/m6502/m6502.h b/src/emu/cpu/m6502/m6502.h index dd3a3ef4b7b..8091e86eb07 100644 --- a/src/emu/cpu/m6502/m6502.h +++ b/src/emu/cpu/m6502/m6502.h @@ -51,8 +51,8 @@ enum positiv edge sets overflow flag */ #define M6502_SET_OVERFLOW 1 -typedef UINT8 (*m6510_port_read_func)(const device_config *device, UINT8 direction); -typedef void (*m6510_port_write_func)(const device_config *device, UINT8 direction, UINT8 data); +typedef UINT8 (*m6510_port_read_func)(running_device *device, UINT8 direction); +typedef void (*m6510_port_write_func)(running_device *device, UINT8 direction, UINT8 data); /* Optional interface to set callbacks */ @@ -173,7 +173,7 @@ extern CPU_GET_INFO( n2a03 ); Bit 7 of address $4011 (the PSG's DPCM control register), when set, causes an IRQ to be generated. This function allows the IRQ to be called from the PSG core when such an occasion arises. */ -extern void n2a03_irq(const device_config *device); +extern void n2a03_irq(running_device *device); /**************************************************************************** diff --git a/src/emu/cpu/m6502/m6509.c b/src/emu/cpu/m6502/m6509.c index cdbee4ecadb..44da9f0fc3e 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *space; int icount; @@ -87,7 +87,7 @@ struct _m6509_Regs { write8_space_func wrmem_id; /* writemem callback for indexed instructions */ }; -INLINE m6509_Regs *get_safe_token(const device_config *device) +INLINE m6509_Regs *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -142,7 +142,7 @@ static void default_wdmem_id(const address_space *space, offs_t address, UINT8 d static CPU_INIT( m6509 ) { m6509_Regs *cpustate = get_safe_token(device); - const m6502_interface *intf = (const m6502_interface *)device->static_config; + const m6502_interface *intf = (const m6502_interface *)device->baseconfig().static_config; cpustate->rdmem_id = default_rdmem_id; cpustate->wrmem_id = default_wdmem_id; diff --git a/src/emu/cpu/m6502/m65ce02.c b/src/emu/cpu/m6502/m65ce02.c index 00c6b049b3e..bc9ba2d2f16 100644 --- a/src/emu/cpu/m6502/m65ce02.c +++ b/src/emu/cpu/m6502/m65ce02.c @@ -75,13 +75,13 @@ struct _m65ce02_Regs { UINT8 irq_state; int icount; cpu_irq_callback irq_callback; - const device_config *device; + running_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 */ }; -INLINE m65ce02_Regs *get_safe_token(const device_config *device) +INLINE m65ce02_Regs *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -102,7 +102,7 @@ static void default_wdmem_id(const address_space *space, offs_t address, UINT8 d static CPU_INIT( m65ce02 ) { m65ce02_Regs *cpustate = get_safe_token(device); - const m6502_interface *intf = (const m6502_interface *)device->static_config; + const m6502_interface *intf = (const m6502_interface *)device->baseconfig().static_config; cpustate->rdmem_id = default_rdmem_id; cpustate->wrmem_id = default_wdmem_id; diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c index 03d71cad089..4b22fcee176 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 */ cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; /* Memory spaces */ const address_space *program; @@ -153,7 +153,7 @@ struct _m6800_state }; -INLINE m6800_state *get_safe_token(const device_config *device) +INLINE m6800_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/m68000/m68000.h b/src/emu/cpu/m68000/m68000.h index eb283cf2948..5105468cde4 100644 --- a/src/emu/cpu/m68000/m68000.h +++ b/src/emu/cpu/m68000/m68000.h @@ -64,11 +64,11 @@ enum M68K_GENPCBASE = REG_GENPCBASE }; -typedef void (*m68k_bkpt_ack_func)(const device_config *device, UINT32 data); -typedef void (*m68k_reset_func)(const device_config *device); -typedef void (*m68k_cmpild_func)(const device_config *device, UINT32 data, UINT8 reg); -typedef void (*m68k_rte_func)(const device_config *device); -typedef int (*m68k_tas_func)(const device_config *device); +typedef void (*m68k_bkpt_ack_func)(running_device *device, UINT32 data); +typedef void (*m68k_reset_func)(running_device *device); +typedef void (*m68k_cmpild_func)(running_device *device, UINT32 data, UINT8 reg); +typedef void (*m68k_rte_func)(running_device *device); +typedef int (*m68k_tas_func)(running_device *device); CPU_GET_INFO( m68000 ); @@ -98,13 +98,13 @@ CPU_GET_INFO( scc68070 ); #define CPU_SCC68070 CPU_GET_INFO_NAME( scc68070 ) -void m68k_set_encrypted_opcode_range(const device_config *device, offs_t start, offs_t end); +void m68k_set_encrypted_opcode_range(running_device *device, offs_t start, offs_t end); unsigned int m68k_disassemble_raw(char* str_buff, unsigned int pc, const unsigned char* opdata, const unsigned char* argdata, unsigned int cpu_type); -void m68k_set_reset_callback(const device_config *device, m68k_reset_func callback); -void m68k_set_cmpild_callback(const device_config *device, m68k_cmpild_func callback); -void m68k_set_rte_callback(const device_config *device, m68k_rte_func callback); -void m68k_set_tas_callback(const device_config *device, m68k_tas_func callback); +void m68k_set_reset_callback(running_device *device, m68k_reset_func callback); +void m68k_set_cmpild_callback(running_device *device, m68k_cmpild_func callback); +void m68k_set_rte_callback(running_device *device, m68k_rte_func callback); +void m68k_set_tas_callback(running_device *device, m68k_tas_func callback); #endif /* __M68000_H__ */ diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c index 6f6d1421af1..0fcc25abe61 100644 --- a/src/emu/cpu/m68000/m68kcpu.c +++ b/src/emu/cpu/m68000/m68kcpu.c @@ -552,7 +552,7 @@ static const cpu_state_table state_table_template = -INLINE m68ki_cpu_core *get_safe_token(const device_config *device) +INLINE m68ki_cpu_core *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -952,7 +952,7 @@ static CPU_GET_INFO( m68k ) /* global access */ -void m68k_set_encrypted_opcode_range(const device_config *device, offs_t start, offs_t end) +void m68k_set_encrypted_opcode_range(running_device *device, offs_t start, offs_t end) { m68ki_cpu_core *m68k = get_safe_token(device); m68k->encrypted_start = start; @@ -1221,25 +1221,25 @@ static const m68k_memory_interface interface_d32_mmu = }; -void m68k_set_reset_callback(const device_config *device, m68k_reset_func callback) +void m68k_set_reset_callback(running_device *device, m68k_reset_func callback) { m68ki_cpu_core *m68k = get_safe_token(device); m68k->reset_instr_callback = callback; } -void m68k_set_cmpild_callback(const device_config *device, m68k_cmpild_func callback) +void m68k_set_cmpild_callback(running_device *device, m68k_cmpild_func callback) { m68ki_cpu_core *m68k = get_safe_token(device); m68k->cmpild_instr_callback = callback; } -void m68k_set_rte_callback(const device_config *device, m68k_rte_func callback) +void m68k_set_rte_callback(running_device *device, m68k_rte_func callback) { m68ki_cpu_core *m68k = get_safe_token(device); m68k->rte_instr_callback = callback; } -void m68k_set_tas_callback(const device_config *device, m68k_tas_func callback) +void m68k_set_tas_callback(running_device *device, m68k_tas_func callback) { m68ki_cpu_core *m68k = get_safe_token(device); m68k->tas_instr_callback = callback; diff --git a/src/emu/cpu/m68000/m68kcpu.h b/src/emu/cpu/m68000/m68kcpu.h index fa771f48df8..36875023c6e 100644 --- a/src/emu/cpu/m68000/m68kcpu.h +++ b/src/emu/cpu/m68000/m68kcpu.h @@ -624,7 +624,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 */ - const device_config *device; + running_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 1eb74b3c7fc..42899548c7a 100644 --- a/src/emu/cpu/m6805/m6805.c +++ b/src/emu/cpu/m6805/m6805.c @@ -61,13 +61,13 @@ typedef struct UINT16 pending_interrupts; /* MB */ cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; int irq_state[9]; /* KW Additional lines for HD63705 */ int nmi_state; } m6805_Regs; -INLINE m6805_Regs *get_safe_token(const device_config *device) +INLINE m6805_Regs *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -442,7 +442,7 @@ static void Interrupt( m6805_Regs *cpustate ) } } -static void state_register(m6805_Regs *cpustate, const char *type, const device_config *device) +static void state_register(m6805_Regs *cpustate, const char *type, running_device *device) { state_save_register_device_item(device, 0, A); state_save_register_device_item(device, 0, PC); diff --git a/src/emu/cpu/m6809/6809dasm.c b/src/emu/cpu/m6809/6809dasm.c index c4948c23f5b..41534d1ee2a 100644 --- a/src/emu/cpu/m6809/6809dasm.c +++ b/src/emu/cpu/m6809/6809dasm.c @@ -369,7 +369,7 @@ CPU_DISASSEMBLE( m6809 ) const UINT8 *operandarray; unsigned int ea, flags; int numoperands, offset, indirect; - const m6809_config *configdata = device ? (const m6809_config *)device->static_config : NULL; + const m6809_config *configdata = device ? (const m6809_config *)device->baseconfig().static_config : NULL; int encrypt_only_first_byte = configdata ? configdata->encrypt_only_first_byte : 0; int i, p = 0, page = 0, opcode_found = FALSE; diff --git a/src/emu/cpu/m6809/m6809.c b/src/emu/cpu/m6809/m6809.c index 73fe82bca21..1a6e6b006be 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 */ cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const m6809_config *config; int icount; PAIR ea; /* effective address */ @@ -111,7 +111,7 @@ struct _m68_state_t UINT8 nmi_state; }; -INLINE m68_state_t *get_safe_token(const device_config *device) +INLINE m68_state_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -377,7 +377,7 @@ static CPU_INIT( m6809 ) 0 }; - const m6809_config *configdata = device->static_config ? (const m6809_config *)device->static_config : &default_config; + const m6809_config *configdata = device->baseconfig().static_config ? (const m6809_config *)device->baseconfig().static_config : &default_config; m68_state_t *m68_state = get_safe_token(device); m68_state->config = configdata; diff --git a/src/emu/cpu/mb86233/mb86233.c b/src/emu/cpu/mb86233/mb86233.c index 775c148a331..0725ea430f2 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]; - const device_config *device; + running_device *device; const address_space *program; int icount; @@ -65,7 +65,7 @@ struct _mb86233_state UINT32 *Tables; }; -INLINE mb86233_state *get_safe_token(const device_config *device) +INLINE mb86233_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -108,7 +108,7 @@ INLINE mb86233_state *get_safe_token(const device_config *device) static CPU_INIT( mb86233 ) { mb86233_state *cpustate = get_safe_token(device); - mb86233_cpu_core * _config = (mb86233_cpu_core *)device->static_config; + mb86233_cpu_core * _config = (mb86233_cpu_core *)device->baseconfig().static_config; (void)irqcallback; memset(cpustate, 0, sizeof( *cpustate ) ); diff --git a/src/emu/cpu/mb86233/mb86233.h b/src/emu/cpu/mb86233/mb86233.h index 73dd3d04375..bb008fa4e47 100644 --- a/src/emu/cpu/mb86233/mb86233.h +++ b/src/emu/cpu/mb86233/mb86233.h @@ -42,8 +42,8 @@ enum STRUCTURES ***************************************************************************/ -typedef int (*mb86233_fifo_read_func)(const device_config *device, UINT32 *data); -typedef void (*mb86233_fifo_write_func)(const device_config *device, UINT32 data); +typedef int (*mb86233_fifo_read_func)(running_device *device, UINT32 *data); +typedef void (*mb86233_fifo_write_func)(running_device *device, UINT32 data); typedef struct _mb86233_cpu_core mb86233_cpu_core; struct _mb86233_cpu_core diff --git a/src/emu/cpu/mb88xx/mb88xx.c b/src/emu/cpu/mb88xx/mb88xx.c index a11faf4d7d9..d778e255b50 100644 --- a/src/emu/cpu/mb88xx/mb88xx.c +++ b/src/emu/cpu/mb88xx/mb88xx.c @@ -74,14 +74,14 @@ struct _mb88_state /* IRQ handling */ UINT8 pending_interrupt; cpu_irq_callback irqcallback; - const device_config *device; + running_device *device; const address_space *program; const address_space *data; const address_space *io; int icount; }; -INLINE mb88_state *get_safe_token(const device_config *device) +INLINE mb88_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -137,9 +137,9 @@ static CPU_INIT( mb88 ) { mb88_state *cpustate = get_safe_token(device); - if ( device->static_config ) + if ( device->baseconfig().static_config ) { - const mb88_cpu_core *_config = (const mb88_cpu_core*)device->static_config; + const mb88_cpu_core *_config = (const mb88_cpu_core*)device->baseconfig().static_config; cpustate->PLA = _config->PLA_config; } @@ -210,7 +210,7 @@ static CPU_RESET( mb88 ) static TIMER_CALLBACK( serial_timer ) { - mb88_state *cpustate = get_safe_token((const device_config *)ptr); + mb88_state *cpustate = get_safe_token((running_device *)ptr); cpustate->SBcount++; @@ -322,7 +322,7 @@ static void update_pio( mb88_state *cpustate, int cycles ) } } -void mb88_external_clock_w(const device_config *device, int state) +void mb88_external_clock_w(running_device *device, int state) { mb88_state *cpustate = get_safe_token(device); if (state != cpustate->ctr) diff --git a/src/emu/cpu/mb88xx/mb88xx.h b/src/emu/cpu/mb88xx/mb88xx.h index 9f0d0f15b1a..10041634ed9 100644 --- a/src/emu/cpu/mb88xx/mb88xx.h +++ b/src/emu/cpu/mb88xx/mb88xx.h @@ -78,6 +78,6 @@ CPU_GET_INFO( mb8844 ); CPU_DISASSEMBLE( mb88 ); -void mb88_external_clock_w(const device_config *device, int state); +void mb88_external_clock_w(running_device *device, int state); #endif /* __MB88XX_H__ */ diff --git a/src/emu/cpu/mc68hc11/mc68hc11.c b/src/emu/cpu/mc68hc11/mc68hc11.c index 85fc5c9d703..bc5a01dba85 100644 --- a/src/emu/cpu/mc68hc11/mc68hc11.c +++ b/src/emu/cpu/mc68hc11/mc68hc11.c @@ -61,7 +61,7 @@ struct _hc11_state cpu_irq_callback irq_callback; UINT8 irq_state[2]; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; @@ -78,7 +78,7 @@ struct _hc11_state UINT8 tflg1; }; -INLINE hc11_state *get_safe_token(const device_config *device) +INLINE hc11_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -370,7 +370,7 @@ static CPU_INIT( hc11 ) hc11_state *cpustate = get_safe_token(device); int i; - const hc11_config *conf = (const hc11_config *)device->static_config; + const hc11_config *conf = (const hc11_config *)device->baseconfig().static_config; /* clear the opcode tables */ for(i=0; i < 256; i++) { diff --git a/src/emu/cpu/mcs48/mcs48.c b/src/emu/cpu/mcs48/mcs48.c index 0e843053e50..6cd795330e0 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 */ cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; int icount; /* Memory spaces */ @@ -269,7 +269,7 @@ static int check_irqs(mcs48_state *cpustate); INLINE FUNCTIONS ***************************************************************************/ -INLINE mcs48_state *get_safe_token(const device_config *device) +INLINE mcs48_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -893,7 +893,7 @@ static const mcs48_ophandler opcode_table[256]= mcs48_init - generic MCS-48 initialization -------------------------------------------------*/ -static void mcs48_init(const device_config *device, cpu_irq_callback irqcallback, UINT8 feature_mask, UINT16 romsize) +static void mcs48_init(running_device *device, cpu_irq_callback irqcallback, UINT8 feature_mask, UINT16 romsize) { mcs48_state *cpustate = get_safe_token(device); @@ -1192,7 +1192,7 @@ static CPU_EXECUTE( mcs48 ) read -------------------------------------------------*/ -UINT8 upi41_master_r(const device_config *device, UINT8 a0) +UINT8 upi41_master_r(running_device *device, UINT8 a0) { mcs48_state *cpustate = get_safe_token(device); @@ -1218,7 +1218,7 @@ UINT8 upi41_master_r(const device_config *device, UINT8 a0) static TIMER_CALLBACK( master_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; mcs48_state *cpustate = get_safe_token(device); UINT8 a0 = (param >> 8) & 1; UINT8 data = param; @@ -1241,7 +1241,7 @@ static TIMER_CALLBACK( master_callback ) cpustate->sts |= STS_F1; } -void upi41_master_w(const device_config *device, UINT8 a0, UINT8 data) +void upi41_master_w(running_device *device, UINT8 a0, UINT8 data) { timer_call_after_resynch(device->machine, (void *)device, (a0 << 8) | data, master_callback); } @@ -1439,7 +1439,7 @@ static CPU_GET_INFO( mcs48 ) CPU-SPECIFIC CONTEXT ACCESS ***************************************************************************/ -static void mcs48_generic_get_info(const device_config *device, UINT32 state, cpuinfo *info, UINT8 features, int romsize, int ramsize, const char *name) +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) { switch (state) { @@ -1515,26 +1515,26 @@ static void mcs48_generic_get_info(const device_config *device, UINT32 state, cp /* Official Intel MCS-48 parts */ -CPU_GET_INFO( i8035 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 0, 64, "I8035"); } -CPU_GET_INFO( i8048 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 1024, 64, "I8048"); } -CPU_GET_INFO( i8648 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 1024, 64, "I8648"); } -CPU_GET_INFO( i8748 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 1024, 64, "I8748"); } -CPU_GET_INFO( i8039 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 0, 128, "I8039"); } -CPU_GET_INFO( i8049 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 2048, 128, "I8049"); } -CPU_GET_INFO( i8749 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 2048, 128, "I8749"); } -CPU_GET_INFO( i8040 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 0, 256, "I8040"); } -CPU_GET_INFO( i8050 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 4096, 256, "I8050"); } +CPU_GET_INFO( i8035 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 0, 64, "I8035"); } +CPU_GET_INFO( i8048 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 1024, 64, "I8048"); } +CPU_GET_INFO( i8648 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 1024, 64, "I8648"); } +CPU_GET_INFO( i8748 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 1024, 64, "I8748"); } +CPU_GET_INFO( i8039 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 0, 128, "I8039"); } +CPU_GET_INFO( i8049 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 2048, 128, "I8049"); } +CPU_GET_INFO( i8749 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 2048, 128, "I8749"); } +CPU_GET_INFO( i8040 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 0, 256, "I8040"); } +CPU_GET_INFO( i8050 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 4096, 256, "I8050"); } /* Official Intel UPI-41 parts */ -CPU_GET_INFO( i8041 ) { mcs48_generic_get_info(device, state, info, UPI41_FEATURE, 1024, 128, "I8041"); } -CPU_GET_INFO( i8741 ) { mcs48_generic_get_info(device, state, info, UPI41_FEATURE, 1024, 128, "I8741"); } -CPU_GET_INFO( i8042 ) { mcs48_generic_get_info(device, state, info, UPI41_FEATURE, 2048, 256, "I8042"); } -CPU_GET_INFO( i8242 ) { mcs48_generic_get_info(device, state, info, UPI41_FEATURE, 2048, 256, "I8242"); } -CPU_GET_INFO( i8742 ) { mcs48_generic_get_info(device, state, info, UPI41_FEATURE, 2048, 256, "I8742"); } +CPU_GET_INFO( i8041 ) { mcs48_generic_get_info(devconfig, device, state, info, UPI41_FEATURE, 1024, 128, "I8041"); } +CPU_GET_INFO( i8741 ) { mcs48_generic_get_info(devconfig, device, state, info, UPI41_FEATURE, 1024, 128, "I8741"); } +CPU_GET_INFO( i8042 ) { mcs48_generic_get_info(devconfig, device, state, info, UPI41_FEATURE, 2048, 256, "I8042"); } +CPU_GET_INFO( i8242 ) { mcs48_generic_get_info(devconfig, device, state, info, UPI41_FEATURE, 2048, 256, "I8242"); } +CPU_GET_INFO( i8742 ) { mcs48_generic_get_info(devconfig, device, state, info, UPI41_FEATURE, 2048, 256, "I8742"); } /* Clones */ -CPU_GET_INFO( mb8884 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 0, 64, "MB8884"); } -CPU_GET_INFO( n7751 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 1024, 64, "N7751"); } -CPU_GET_INFO( m58715 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 2048, 128, "M58715"); } +CPU_GET_INFO( mb8884 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 0, 64, "MB8884"); } +CPU_GET_INFO( n7751 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 1024, 64, "N7751"); } +CPU_GET_INFO( m58715 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 2048, 128, "M58715"); } diff --git a/src/emu/cpu/mcs48/mcs48.h b/src/emu/cpu/mcs48/mcs48.h index 2a43834bd17..34e1c253b8e 100644 --- a/src/emu/cpu/mcs48/mcs48.h +++ b/src/emu/cpu/mcs48/mcs48.h @@ -138,8 +138,8 @@ CPU_GET_INFO( m58715 ); /* 8049 clone */ /* functions for talking to the input/output buffers on the UPI41-class chips */ -UINT8 upi41_master_r(const device_config *device, UINT8 a0); -void upi41_master_w(const device_config *device, UINT8 a0, UINT8 data); +UINT8 upi41_master_r(running_device *device, UINT8 a0); +void upi41_master_w(running_device *device, UINT8 a0, UINT8 data); /* disassemblers */ diff --git a/src/emu/cpu/mcs48/mcs48dsm.c b/src/emu/cpu/mcs48/mcs48dsm.c index 1e2e87eda51..5dc76e2a5c6 100644 --- a/src/emu/cpu/mcs48/mcs48dsm.c +++ b/src/emu/cpu/mcs48/mcs48dsm.c @@ -10,7 +10,7 @@ #include "emu.h" -static UINT32 common_dasm(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int upi41) +static UINT32 common_dasm(running_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int upi41) { const UINT8 *startram = opram; UINT32 flags = 0; diff --git a/src/emu/cpu/mcs51/mcs51.c b/src/emu/cpu/mcs51/mcs51.c index ee60a8a8cda..ac5788f2d86 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 */ cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; /* Memory spaces */ const address_space *program; @@ -648,7 +648,7 @@ INLINE void serial_transmit(mcs51_state_t *mcs51_state, UINT8 data); INLINE FUNCTIONS ***************************************************************************/ -INLINE mcs51_state_t *get_safe_token(const device_config *device) +INLINE mcs51_state_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -1283,13 +1283,13 @@ INLINE void update_irq_prio(mcs51_state_t *mcs51_state, UINT8 ipl, UINT8 iph) ***************************************************************************/ -void i8051_set_serial_tx_callback(const device_config *device, mcs51_serial_tx_func tx_func) +void i8051_set_serial_tx_callback(running_device *device, mcs51_serial_tx_func tx_func) { mcs51_state_t *mcs51_state = get_safe_token(device); mcs51_state->serial_tx_callback = tx_func; } -void i8051_set_serial_rx_callback(const device_config *device, mcs51_serial_rx_func rx_func) +void i8051_set_serial_rx_callback(running_device *device, mcs51_serial_rx_func rx_func) { mcs51_state_t *mcs51_state = get_safe_token(device); mcs51_state->serial_rx_callback = rx_func; @@ -2389,7 +2389,7 @@ static CPU_INIT( ds5002fp ) { /* default configuration */ static const ds5002fp_config default_config = { 0x00, 0x00, 0x00 }; - const ds5002fp_config *sconfig = device->static_config ? (const ds5002fp_config *)device->static_config : &default_config; + const ds5002fp_config *sconfig = device->baseconfig().static_config ? (const ds5002fp_config *)device->baseconfig().static_config : &default_config; mcs51_state_t *mcs51_state = get_safe_token(device); CPU_INIT_CALL( mcs51 ); diff --git a/src/emu/cpu/mcs51/mcs51.h b/src/emu/cpu/mcs51/mcs51.h index 55f20738c81..4674ebe8938 100644 --- a/src/emu/cpu/mcs51/mcs51.h +++ b/src/emu/cpu/mcs51/mcs51.h @@ -89,11 +89,11 @@ struct _ds5002fp_config FUNCTION PROTOTYPES ***************************************************************************/ -typedef void (*mcs51_serial_tx_func)(const device_config *device, int data); -typedef int (*mcs51_serial_rx_func)(const device_config *device); +typedef void (*mcs51_serial_tx_func)(running_device *device, int data); +typedef int (*mcs51_serial_rx_func)(running_device *device); -extern void i8051_set_serial_tx_callback(const device_config *device, mcs51_serial_tx_func tx_func); -extern void i8051_set_serial_rx_callback(const device_config *device, mcs51_serial_rx_func rx_func); +extern void i8051_set_serial_tx_callback(running_device *device, mcs51_serial_tx_func tx_func); +extern void i8051_set_serial_rx_callback(running_device *device, mcs51_serial_rx_func rx_func); /* variants with no internal rom and 128 byte internal memory */ CPU_GET_INFO( i8031 ); diff --git a/src/emu/cpu/minx/minx.c b/src/emu/cpu/minx/minx.c index 63f9a04616a..617d40a3bd6 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; int icount; } minx_state; @@ -93,7 +93,7 @@ typedef struct { #define WR(offset,data) memory_write_byte_8be( minx->program, offset, data ) #define GET_MINX_PC ( ( minx->PC & 0x8000 ) ? ( minx->V << 15 ) | (minx->PC & 0x7FFF ) : minx->PC ) -INLINE minx_state *get_safe_token(const device_config *device) +INLINE minx_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -122,7 +122,7 @@ static CPU_INIT( minx ) minx->irq_callback = irqcallback; minx->device = device; minx->program = device->space(AS_PROGRAM); - if ( device->static_config != NULL ) + if ( device->baseconfig().static_config != NULL ) { } else diff --git a/src/emu/cpu/mips/mips3.h b/src/emu/cpu/mips/mips3.h index 0a3666c410d..0e7e1cfc618 100644 --- a/src/emu/cpu/mips/mips3.h +++ b/src/emu/cpu/mips/mips3.h @@ -224,9 +224,9 @@ struct _mips3_config PUBLIC FUNCTIONS ***************************************************************************/ -void mips3drc_set_options(const device_config *device, UINT32 options); -void mips3drc_add_fastram(const device_config *device, offs_t start, offs_t end, UINT8 readonly, void *base); -void mips3drc_add_hotspot(const device_config *device, offs_t pc, UINT32 opcode, UINT32 cycles); +void mips3drc_set_options(running_device *device, UINT32 options); +void mips3drc_add_fastram(running_device *device, offs_t start, offs_t end, UINT8 readonly, void *base); +void mips3drc_add_hotspot(running_device *device, offs_t pc, UINT32 opcode, UINT32 cycles); CPU_GET_INFO( vr4300be ); CPU_GET_INFO( vr4300le ); diff --git a/src/emu/cpu/mips/mips3com.c b/src/emu/cpu/mips/mips3com.c index f5b9f4ce844..12eb5056459 100644 --- a/src/emu/cpu/mips/mips3com.c +++ b/src/emu/cpu/mips/mips3com.c @@ -69,9 +69,9 @@ 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, const device_config *device, cpu_irq_callback irqcallback) +void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, running_device *device, cpu_irq_callback irqcallback) { - const mips3_config *config = (const mips3_config *)device->static_config; + const mips3_config *config = (const mips3_config *)device->baseconfig().static_config; int tlbindex; /* initialize based on the config */ @@ -751,7 +751,7 @@ void mips3com_get_info(mips3_state *mips, UINT32 state, cpuinfo *info) static TIMER_CALLBACK( compare_int_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_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 a2658e8be1f..26462b4b28a 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; cpu_irq_callback irq_callback; - const device_config *device; + running_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, const device_config *device, cpu_irq_callback irqcallback); +void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, running_device *device, cpu_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 5b3ef25fa04..c2ff2b70e40 100644 --- a/src/emu/cpu/mips/mips3drc.c +++ b/src/emu/cpu/mips/mips3drc.c @@ -273,7 +273,7 @@ static const UINT8 fpmode_source[4] = INLINE FUNCTIONS ***************************************************************************/ -INLINE mips3_state *get_safe_token(const device_config *device) +INLINE mips3_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -360,7 +360,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, const device_config *device, cpu_irq_callback irqcallback) +static void mips3_init(mips3_flavor flavor, int bigendian, running_device *device, cpu_irq_callback irqcallback) { drcfe_config feconfig = { @@ -631,7 +631,7 @@ static CPU_GET_INFO( mips3 ) mips3drc_set_options - configure DRC options -------------------------------------------------*/ -void mips3drc_set_options(const device_config *device, UINT32 options) +void mips3drc_set_options(running_device *device, UINT32 options) { mips3_state *mips3 = get_safe_token(device); mips3->impstate->drcoptions = options; @@ -643,7 +643,7 @@ void mips3drc_set_options(const device_config *device, UINT32 options) region -------------------------------------------------*/ -void mips3drc_add_fastram(const device_config *device, offs_t start, offs_t end, UINT8 readonly, void *base) +void mips3drc_add_fastram(running_device *device, offs_t start, offs_t end, UINT8 readonly, void *base) { mips3_state *mips3 = get_safe_token(device); if (mips3->impstate->fastram_select < ARRAY_LENGTH(mips3->impstate->fastram)) @@ -661,7 +661,7 @@ void mips3drc_add_fastram(const device_config *device, offs_t start, offs_t end, mips3drc_add_hotspot - add a new hotspot -------------------------------------------------*/ -void mips3drc_add_hotspot(const device_config *device, offs_t pc, UINT32 opcode, UINT32 cycles) +void mips3drc_add_hotspot(running_device *device, offs_t pc, UINT32 opcode, UINT32 cycles) { mips3_state *mips3 = get_safe_token(device); if (mips3->impstate->hotspot_select < ARRAY_LENGTH(mips3->impstate->hotspot)) diff --git a/src/emu/cpu/mips/psx.c b/src/emu/cpu/mips/psx.c index 9634e1f3e31..66026a9b570 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; int bus_attached; UINT32 bad_byte_address_mask; @@ -193,7 +193,7 @@ struct _psxcpu_state UINT32 bad_word_address_mask; }; -INLINE psxcpu_state *get_safe_token(const device_config *device) +INLINE psxcpu_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -1606,7 +1606,7 @@ static STATE_POSTLOAD( mips_postload ) mips_update_scratchpad( psxcpu->program ); } -static void mips_state_register( const char *type, const device_config *device ) +static void mips_state_register( const char *type, running_device *device ) { psxcpu_state *psxcpu = get_safe_token(device); @@ -1633,7 +1633,7 @@ static void mips_state_register( const char *type, const device_config *device ) static CPU_INIT( psxcpu ) { psxcpu_state *psxcpu = get_safe_token(device); -// psxcpu->intf = (psxcpu_interface *) device->static_config; +// psxcpu->intf = (psxcpu_interface *) device->baseconfig().static_config; psxcpu->irq_callback = irqcallback; psxcpu->device = device; diff --git a/src/emu/cpu/mips/r3000.c b/src/emu/cpu/mips/r3000.c index 2b5e7a54cf2..03f71e7704f 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; /* endian-dependent load/store */ @@ -162,7 +162,7 @@ struct _r3000_state size_t dcache_size; }; -INLINE r3000_state *get_safe_token(const device_config *device) +INLINE r3000_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -300,7 +300,7 @@ static void set_irq_line(r3000_state *r3000, int irqline, int state) static CPU_INIT( r3000 ) { - const r3000_cpu_core *configdata = (const r3000_cpu_core *)device->static_config; + const r3000_cpu_core *configdata = (const r3000_cpu_core *)device->baseconfig().static_config; r3000_state *r3000 = get_safe_token(device); /* allocate memory */ diff --git a/src/emu/cpu/nec/nec.c b/src/emu/cpu/nec/nec.c index 2996650ef04..f0b6635c0b8 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; @@ -181,7 +181,7 @@ struct _nec_state_t }; -INLINE nec_state_t *get_safe_token(const device_config *device) +INLINE nec_state_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -1104,9 +1104,9 @@ static CPU_DISASSEMBLE( nec ) return necv_dasm_one(buffer, pc, oprom, nec_state->config); } -static void nec_init(const device_config *device, cpu_irq_callback irqcallback, int type) +static void nec_init(running_device *device, cpu_irq_callback irqcallback, int type) { - const nec_config *config = device->static_config ? (const nec_config *)device->static_config : &default_config; + 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); nec_state->config = config; diff --git a/src/emu/cpu/pdp1/pdp1.c b/src/emu/cpu/pdp1/pdp1.c index df22fc750c9..2adcded3732 100644 --- a/src/emu/cpu/pdp1/pdp1.c +++ b/src/emu/cpu/pdp1/pdp1.c @@ -417,12 +417,12 @@ struct _pdp1_state /* 1 for 16-line sequence break system, 0 for default break system */ int type_20_sbs; - const device_config *device; + running_device *device; const address_space *program; int icount; }; -INLINE pdp1_state *get_safe_token(const device_config *device) +INLINE pdp1_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -432,10 +432,10 @@ INLINE pdp1_state *get_safe_token(const device_config *device) } static void execute_instruction(pdp1_state *cpustate); -static void null_iot (const device_config *device, int op2, int nac, int mb, int *io, int ac); -static void lem_eem_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac); -static void sbs_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac); -static void type_20_sbs_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac); +static void null_iot (running_device *device, int op2, int nac, int mb, int *io, int ac); +static void lem_eem_iot(running_device *device, int op2, int nac, int mb, int *io, int ac); +static void sbs_iot(running_device *device, int op2, int nac, int mb, int *io, int ac); +static void type_20_sbs_iot(running_device *device, int op2, int nac, int mb, int *io, int ac); static void pulse_start_clear(pdp1_state *cpustate); @@ -539,7 +539,7 @@ static void pdp1_set_irq_line (pdp1_state *cpustate, int irqline, int state) static CPU_INIT( pdp1 ) { - const pdp1_reset_param_t *param = (const pdp1_reset_param_t *)device->static_config; + const pdp1_reset_param_t *param = (const pdp1_reset_param_t *)device->baseconfig().static_config; pdp1_state *cpustate = get_safe_token(device); int i; @@ -1704,7 +1704,7 @@ no_fetch: /* Handle unimplemented IOT */ -static void null_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac) +static void null_iot(running_device *device, int op2, int nac, int mb, int *io, int ac) { pdp1_state *cpustate = get_safe_token(device); /* Note that the dummy IOT 0 is used to wait for the completion pulse @@ -1727,7 +1727,7 @@ static void null_iot(const device_config *device, int op2, int nac, int mb, int IOT 74: LEM/EEM */ -static void lem_eem_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac) +static void lem_eem_iot(running_device *device, int op2, int nac, int mb, int *io, int ac) { pdp1_state *cpustate = get_safe_token(device); if (! cpustate->extend_support) /* extend mode supported? */ @@ -1751,7 +1751,7 @@ static void lem_eem_iot(const device_config *device, int op2, int nac, int mb, i IOT 55: esm IOT 56: cbs */ -static void sbs_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac) +static void sbs_iot(running_device *device, int op2, int nac, int mb, int *io, int ac) { pdp1_state *cpustate = get_safe_token(device); switch (op2) @@ -1795,7 +1795,7 @@ static void sbs_iot(const device_config *device, int op2, int nac, int mb, int * IOT 52: isb IOT 53: cac */ -static void type_20_sbs_iot(const device_config *device, int op2, int nac, int mb, int *io, int ac) +static void type_20_sbs_iot(running_device *device, int op2, int nac, int mb, int *io, int ac) { pdp1_state *cpustate = get_safe_token(device); int channel, mask; diff --git a/src/emu/cpu/pdp1/pdp1.h b/src/emu/cpu/pdp1/pdp1.h index 444f2b49b6e..5bd2af6516d 100644 --- a/src/emu/cpu/pdp1/pdp1.h +++ b/src/emu/cpu/pdp1/pdp1.h @@ -22,9 +22,9 @@ enum #define pdp1_pulse_start_clear(cpudevice) cpu_set_reg(cpudevice, PDP1_START_CLEAR, 0) #define pdp1_pulse_iot_done(cpudevice) cpu_set_reg(cpudevice, PDP1_IO_COMPLETE, 0) -typedef void (*pdp1_extern_iot_func)(const device_config *device, int op2, int nac, int mb, int *io, int ac); -typedef void (*pdp1_read_binary_word_func)(const device_config *device); -typedef void (*pdp1_io_sc_func)(const device_config *device); +typedef void (*pdp1_extern_iot_func)(running_device *device, int op2, int nac, int mb, int *io, int ac); +typedef void (*pdp1_read_binary_word_func)(running_device *device); +typedef void (*pdp1_io_sc_func)(running_device *device); typedef struct _pdp1_reset_param_t pdp1_reset_param_t; diff --git a/src/emu/cpu/pdp1/tx0.c b/src/emu/cpu/pdp1/tx0.c index 34ed81254ba..4f8e884e085 100644 --- a/src/emu/cpu/pdp1/tx0.c +++ b/src/emu/cpu/pdp1/tx0.c @@ -15,9 +15,9 @@ #define LOG 0 #define LOG_EXTRA 0 -static void execute_instruction_64kw(const device_config *device); -static void execute_instruction_8kw(const device_config *device); -static void pulse_reset(const device_config *device); +static void execute_instruction_64kw(running_device *device); +static void execute_instruction_8kw(running_device *device); +static void pulse_reset(running_device *device); /* TX-0 Registers */ @@ -64,11 +64,11 @@ struct _tx0_state int icount; - const device_config *device; + running_device *device; const address_space *program; }; -INLINE tx0_state *get_safe_token(const device_config *device) +INLINE tx0_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -127,12 +127,12 @@ static void tx0_write(tx0_state *cpustate, offs_t address, int data) ; } -static void tx0_init_common(const device_config *device, cpu_irq_callback irqcallback, int is_64kw) +static void tx0_init_common(running_device *device, cpu_irq_callback irqcallback, int is_64kw) { tx0_state *cpustate = get_safe_token(device); /* clean-up */ - cpustate->iface = (const tx0_reset_param_t *)device->static_config; + cpustate->iface = (const tx0_reset_param_t *)device->baseconfig().static_config; cpustate->address_mask = is_64kw ? ADDRESS_MASK_64KW : ADDRESS_MASK_8KW; cpustate->ir_mask = is_64kw ? 03 : 037; @@ -687,7 +687,7 @@ CPU_GET_INFO( tx0_8kw ) /* execute one instruction */ -static void execute_instruction_64kw(const device_config *device) +static void execute_instruction_64kw(running_device *device) { tx0_state *cpustate = get_safe_token(device); @@ -878,7 +878,7 @@ static void indexed_address_eval(tx0_state *cpustate) } /* execute one instruction */ -static void execute_instruction_8kw(const device_config *device) +static void execute_instruction_8kw(running_device *device) { tx0_state *cpustate = get_safe_token(device); @@ -1284,7 +1284,7 @@ static void execute_instruction_8kw(const device_config *device) reset most registers and flip-flops, and initialize a few emulator state variables. */ -static void pulse_reset(const device_config *device) +static void pulse_reset(running_device *device) { tx0_state *cpustate = get_safe_token(device); diff --git a/src/emu/cpu/pdp1/tx0.h b/src/emu/cpu/pdp1/tx0.h index df1c5ed9227..5e2f7a42f15 100644 --- a/src/emu/cpu/pdp1/tx0.h +++ b/src/emu/cpu/pdp1/tx0.h @@ -35,11 +35,11 @@ struct _tx0_reset_param_t 5: reserved (for unimplemented typ instruction?) 6: p6h 7: p7h */ - void (*io_handlers[8])(const device_config *device); + void (*io_handlers[8])(running_device *device); /* select instruction handler */ - void (*sel_handler)(const device_config *device); + void (*sel_handler)(running_device *device); /* callback called when reset line is pulsed: IO devices should reset */ - void (*io_reset_callback)(const device_config *device); + void (*io_reset_callback)(running_device *device); }; /* PUBLIC FUNCTIONS */ diff --git a/src/emu/cpu/pic16c5x/pic16c5x.c b/src/emu/cpu/pic16c5x/pic16c5x.c index 4d9c7a39ff6..703aadb4908 100644 --- a/src/emu/cpu/pic16c5x/pic16c5x.c +++ b/src/emu/cpu/pic16c5x/pic16c5x.c @@ -97,13 +97,13 @@ struct _pic16c5x_state int inst_cycles; - const device_config *device; + running_device *device; const address_space *program; const address_space *data; const address_space *io; }; -INLINE pic16c5x_state *get_safe_token(const device_config *device) +INLINE pic16c5x_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -798,7 +798,7 @@ static void pic16c5x_soft_reset(pic16c5x_state *cpustate) pic16c5x_reset_regs(cpustate); } -void pic16c5x_set_config(const device_config *cpu, int data) +void pic16c5x_set_config(running_device *cpu, int data) { pic16c5x_state *cpustate = get_safe_token(cpu); diff --git a/src/emu/cpu/pic16c5x/pic16c5x.h b/src/emu/cpu/pic16c5x/pic16c5x.h index 83b03061303..08eb44e419a 100644 --- a/src/emu/cpu/pic16c5x/pic16c5x.h +++ b/src/emu/cpu/pic16c5x/pic16c5x.h @@ -43,7 +43,7 @@ enum * the value if known (available in HEX dumps of the ROM). */ -void pic16c5x_set_config(const device_config *cpu, int data); +void pic16c5x_set_config(running_device *cpu, int data); diff --git a/src/emu/cpu/pic16c62x/pic16c62x.c b/src/emu/cpu/pic16c62x/pic16c62x.c index b47a9b6a7ec..cbfae296c8d 100644 --- a/src/emu/cpu/pic16c62x/pic16c62x.c +++ b/src/emu/cpu/pic16c62x/pic16c62x.c @@ -87,13 +87,13 @@ struct _pic16c62x_state int inst_cycles; - const device_config *device; + running_device *device; const address_space *program; const address_space *data; const address_space *io; }; -INLINE pic16c62x_state *get_safe_token(const device_config *device) +INLINE pic16c62x_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -917,7 +917,7 @@ static void pic16c62x_soft_reset(pic16c62x_state *cpustate) pic16c62x_reset_regs(cpustate); } -void pic16c62x_set_config(const device_config *cpu, int data) +void pic16c62x_set_config(running_device *cpu, int data) { pic16c62x_state *cpustate = get_safe_token(cpu); diff --git a/src/emu/cpu/pic16c62x/pic16c62x.h b/src/emu/cpu/pic16c62x/pic16c62x.h index c2012d49b2c..a361a942e69 100644 --- a/src/emu/cpu/pic16c62x/pic16c62x.h +++ b/src/emu/cpu/pic16c62x/pic16c62x.h @@ -46,7 +46,7 @@ enum * the value if known (available in HEX dumps of the ROM). */ -void pic16c62x_set_config(const device_config *cpu, int data); +void pic16c62x_set_config(running_device *cpu, int data); diff --git a/src/emu/cpu/powerpc/ppc.c b/src/emu/cpu/powerpc/ppc.c index e895a06cca9..7561a26c87b 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 */ cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; // STUFF added for the 6xx series @@ -929,7 +929,7 @@ static void ppc_init(void) // !!! probably should move this stuff elsewhere !!! static CPU_INIT( ppc403 ) { - const ppc_config *configdata = device->static_config; + const ppc_config *configdata = device->baseconfig().static_config; ppc_init(); @@ -975,7 +975,7 @@ static CPU_EXIT( ppc403 ) static CPU_INIT( ppc603 ) { - const ppc_config *configdata = device->static_config; + const ppc_config *configdata = device->baseconfig().static_config; int pll_config = 0; float multiplier; int i ; @@ -1120,7 +1120,7 @@ static CPU_EXIT( ppc603 ) static CPU_INIT( ppc602 ) { float multiplier; - const ppc_config *configdata = device->static_config; + const ppc_config *configdata = device->baseconfig().static_config; int i ; @@ -1263,7 +1263,7 @@ static void mpc8240_tlbld(UINT32 op) static CPU_INIT( mpc8240 ) { float multiplier; - const ppc_config *configdata = device->static_config; + const ppc_config *configdata = device->baseconfig().static_config; int i ; @@ -1393,7 +1393,7 @@ static CPU_EXIT( mpc8240 ) static CPU_INIT( ppc601 ) { - const ppc_config *configdata = device->static_config; + const ppc_config *configdata = device->baseconfig().static_config; float multiplier; int i ; @@ -1521,7 +1521,7 @@ static CPU_EXIT( ppc601 ) static CPU_INIT( ppc604 ) { - const ppc_config *configdata = device->static_config; + const ppc_config *configdata = device->baseconfig().static_config; float multiplier; int i ; diff --git a/src/emu/cpu/powerpc/ppc.h b/src/emu/cpu/powerpc/ppc.h index b8c3022cb8f..34b485f4213 100644 --- a/src/emu/cpu/powerpc/ppc.h +++ b/src/emu/cpu/powerpc/ppc.h @@ -145,7 +145,7 @@ enum STRUCTURES AND TYPEDEFS ***************************************************************************/ -typedef void (*ppc4xx_spu_tx_handler)(const device_config *device, UINT8 data); +typedef void (*ppc4xx_spu_tx_handler)(running_device *device, UINT8 data); typedef struct _powerpc_config powerpc_config; struct _powerpc_config @@ -159,12 +159,12 @@ struct _powerpc_config PUBLIC FUNCTIONS ***************************************************************************/ -void ppcdrc_set_options(const device_config *device, UINT32 options); -void ppcdrc_add_fastram(const device_config *device, offs_t start, offs_t end, UINT8 readonly, void *base); -void ppcdrc_add_hotspot(const device_config *device, offs_t pc, UINT32 opcode, UINT32 cycles); +void ppcdrc_set_options(running_device *device, UINT32 options); +void ppcdrc_add_fastram(running_device *device, offs_t start, offs_t end, UINT8 readonly, void *base); +void ppcdrc_add_hotspot(running_device *device, offs_t pc, UINT32 opcode, UINT32 cycles); -void ppc4xx_spu_set_tx_handler(const device_config *device, ppc4xx_spu_tx_handler handler); -void ppc4xx_spu_receive_byte(const device_config *device, UINT8 byteval); +void ppc4xx_spu_set_tx_handler(running_device *device, ppc4xx_spu_tx_handler handler); +void ppc4xx_spu_receive_byte(running_device *device, UINT8 byteval); CPU_GET_INFO( ppc403ga ); diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c index ca457fd9a35..58e1b562242 100644 --- a/src/emu/cpu/powerpc/ppccom.c +++ b/src/emu/cpu/powerpc/ppccom.c @@ -286,9 +286,9 @@ 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, const device_config *device, cpu_irq_callback irqcallback) +void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, running_device *device, cpu_irq_callback irqcallback) { - const powerpc_config *config = (const powerpc_config *)device->static_config; + const powerpc_config *config = (const powerpc_config *)device->baseconfig().static_config; /* initialize based on the config */ memset(ppc, 0, sizeof(*ppc)); @@ -303,7 +303,7 @@ void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_di 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) && cpu_get_endianness(device) != ENDIANNESS_NATIVE) + if (!(cap & PPCCAP_4XX) && device_get_endianness(device) != ENDIANNESS_NATIVE) ppc->codexor = 4; /* allocate the virtual TLB */ @@ -2082,7 +2082,7 @@ ADDRESS_MAP_END specific TX handler configuration -------------------------------------------------*/ -void ppc4xx_spu_set_tx_handler(const device_config *device, ppc4xx_spu_tx_handler handler) +void ppc4xx_spu_set_tx_handler(running_device *device, ppc4xx_spu_tx_handler handler) { powerpc_state *ppc = *(powerpc_state **)device->token; ppc->spu.tx_handler = handler; @@ -2094,7 +2094,7 @@ void ppc4xx_spu_set_tx_handler(const device_config *device, ppc4xx_spu_tx_handle specific serial byte receive -------------------------------------------------*/ -void ppc4xx_spu_receive_byte(const device_config *device, UINT8 byteval) +void ppc4xx_spu_receive_byte(running_device *device, UINT8 byteval) { powerpc_state *ppc = *(powerpc_state **)device->token; ppc4xx_spu_rx_data(ppc, byteval); diff --git a/src/emu/cpu/powerpc/ppccom.h b/src/emu/cpu/powerpc/ppccom.h index 37a36653e38..b9c038acb74 100644 --- a/src/emu/cpu/powerpc/ppccom.h +++ b/src/emu/cpu/powerpc/ppccom.h @@ -551,7 +551,7 @@ struct _powerpc_state /* internal stuff */ cpu_irq_callback irq_callback; - const device_config *device; + running_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, const device_config *device, cpu_irq_callback irqcallback); +void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, running_device *device, cpu_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 8d3264b43ea..f179e97b677 100644 --- a/src/emu/cpu/powerpc/ppcdrc.c +++ b/src/emu/cpu/powerpc/ppcdrc.c @@ -435,7 +435,7 @@ static const UINT8 fcmp_cr_table_source[32] = INLINE FUNCTIONS ***************************************************************************/ -INLINE powerpc_state *get_safe_token(const device_config *device) +INLINE powerpc_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -548,7 +548,7 @@ INLINE UINT32 compute_spr(UINT32 spr) ppcdrc_init - initialize the processor -------------------------------------------------*/ -static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, const device_config *device, cpu_irq_callback irqcallback) +static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, running_device *device, cpu_irq_callback irqcallback) { drcfe_config feconfig = { @@ -823,7 +823,7 @@ static CPU_GET_INFO( ppcdrc ) ppcdrc_set_options - configure DRC options -------------------------------------------------*/ -void ppcdrc_set_options(const device_config *device, UINT32 options) +void ppcdrc_set_options(running_device *device, UINT32 options) { powerpc_state *ppc = get_safe_token(device); ppc->impstate->drcoptions = options; @@ -835,7 +835,7 @@ void ppcdrc_set_options(const device_config *device, UINT32 options) region -------------------------------------------------*/ -void ppcdrc_add_fastram(const device_config *device, offs_t start, offs_t end, UINT8 readonly, void *base) +void ppcdrc_add_fastram(running_device *device, offs_t start, offs_t end, UINT8 readonly, void *base) { powerpc_state *ppc = get_safe_token(device); if (ppc->impstate->fastram_select < ARRAY_LENGTH(ppc->impstate->fastram)) @@ -853,7 +853,7 @@ void ppcdrc_add_fastram(const device_config *device, offs_t start, offs_t end, U ppcdrc_add_hotspot - add a new hotspot -------------------------------------------------*/ -void ppcdrc_add_hotspot(const device_config *device, offs_t pc, UINT32 opcode, UINT32 cycles) +void ppcdrc_add_hotspot(running_device *device, offs_t pc, UINT32 opcode, UINT32 cycles) { powerpc_state *ppc = get_safe_token(device); if (ppc->impstate->hotspot_select < ARRAY_LENGTH(ppc->impstate->hotspot)) @@ -1479,7 +1479,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)(cpu_get_databus_width(ppc->device, ADDRESS_SPACE_PROGRAM) < 64); + int fastxor = BYTE8_XOR_BE(0) >> (int)(device_get_databus_width(ppc->device, ADDRESS_SPACE_PROGRAM) < 64); drcuml_block *block; jmp_buf errorbuf; int translate_type; diff --git a/src/emu/cpu/rsp/rsp.c b/src/emu/cpu/rsp/rsp.c index 59b48deb53f..ae78eab4955 100644 --- a/src/emu/cpu/rsp/rsp.c +++ b/src/emu/cpu/rsp/rsp.c @@ -27,7 +27,7 @@ CPU_DISASSEMBLE( rsp ); extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op); -INLINE rsp_state *get_safe_token(const device_config *device) +INLINE rsp_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -302,7 +302,7 @@ static CPU_INIT( rsp ) rsp_state *rsp = get_safe_token(device); int regIdx; int accumIdx; - rsp->config = (const rsp_config *)device->static_config; + rsp->config = (const rsp_config *)device->baseconfig().static_config; if (LOG_INSTRUCTION_EXECUTION) rsp->exec_output = fopen("rsp_execute.txt", "wt"); diff --git a/src/emu/cpu/rsp/rsp.h b/src/emu/cpu/rsp/rsp.h index 709aa66778e..4a206474401 100644 --- a/src/emu/cpu/rsp/rsp.h +++ b/src/emu/cpu/rsp/rsp.h @@ -68,7 +68,7 @@ enum STRUCTURES ***************************************************************************/ -typedef void (*rsp_set_status_func)(const device_config *device, UINT32 status); +typedef void (*rsp_set_status_func)(running_device *device, UINT32 status); typedef struct _rsp_config rsp_config; struct _rsp_config @@ -86,10 +86,10 @@ struct _rsp_config PUBLIC FUNCTIONS ***************************************************************************/ -void rspdrc_flush_drc_cache(const device_config *device); -void rspdrc_set_options(const device_config *device, UINT32 options); -void rspdrc_add_imem(const device_config *device, void *base); -void rspdrc_add_dmem(const device_config *device, void *base); +void rspdrc_flush_drc_cache(running_device *device); +void rspdrc_set_options(running_device *device, UINT32 options); +void rspdrc_add_imem(running_device *device, void *base); +void rspdrc_add_dmem(running_device *device, void *base); /*************************************************************************** HELPER MACROS @@ -209,7 +209,7 @@ struct _rsp_state UINT32 nextpc; cpu_irq_callback irq_callback; - const device_config *device; + running_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 b4da27c751e..ccb5cee1cd5 100644 --- a/src/emu/cpu/rsp/rspdrc.c +++ b/src/emu/cpu/rsp/rspdrc.c @@ -348,7 +348,7 @@ static void log_add_disasm_comment(rsp_state *rsp, drcuml_block *block, UINT32 p #define SET_ZERO_FLAG(x) { rsp->flag[0] |= (0x100 << (x)); } #define CLEAR_ZERO_FLAG(x) { rsp->flag[0] &= ~(0x100 << (x)); } -INLINE rsp_state *get_safe_token(const device_config *device) +INLINE rsp_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -514,7 +514,7 @@ INLINE void WRITE64(rsp_state *rsp, UINT32 address, UINT64 data) rspdrc_set_options - configure DRC options -------------------------------------------------*/ -void rspdrc_set_options(const device_config *device, UINT32 options) +void rspdrc_set_options(running_device *device, UINT32 options) { rsp_state *rsp = get_safe_token(device); rsp->impstate->drcoptions = options; @@ -525,7 +525,7 @@ void rspdrc_set_options(const device_config *device, UINT32 options) rspdrc_add_imem - register an imem region -------------------------------------------------*/ -void rspdrc_add_imem(const device_config *device, void *base) +void rspdrc_add_imem(running_device *device, void *base) { rsp_state *rsp = get_safe_token(device); rsp->impstate->imem = base; @@ -536,7 +536,7 @@ void rspdrc_add_imem(const device_config *device, void *base) rspdrc_add_dmem - register a dmem region -------------------------------------------------*/ -void rspdrc_add_dmem(const device_config *device, void *base) +void rspdrc_add_dmem(running_device *device, void *base) { rsp_state *rsp = get_safe_token(device); rsp->impstate->dmem = base; @@ -685,14 +685,14 @@ static const int vector_elements_2[16][8] = { 7, 7, 7, 7, 7, 7, 7, 7 }, // 7 }; -static void rspcom_init(rsp_state *rsp, const device_config *device, cpu_irq_callback irqcallback) +static void rspcom_init(rsp_state *rsp, running_device *device, cpu_irq_callback irqcallback) { int regIdx = 0; int accumIdx; memset(rsp, 0, sizeof(*rsp)); - rsp->config = (const rsp_config *)device->static_config; + rsp->config = (const rsp_config *)device->baseconfig().static_config; rsp->irq_callback = irqcallback; rsp->device = device; rsp->program = device->space(AS_PROGRAM); @@ -7161,7 +7161,7 @@ static CPU_EXECUTE( rsp ) accessor to code_flush_cache -------------------------------------------------*/ -void rspdrc_flush_drc_cache(const device_config *device) +void rspdrc_flush_drc_cache(running_device *device) { rsp_state *rsp = get_safe_token(device); rsp->impstate->cache_dirty = TRUE; diff --git a/src/emu/cpu/s2650/s2650.c b/src/emu/cpu/s2650/s2650.c index ea6d7eebfda..7a8d8f436ee 100644 --- a/src/emu/cpu/s2650/s2650.c +++ b/src/emu/cpu/s2650/s2650.c @@ -42,12 +42,12 @@ struct _s2650_regs { int icount; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; }; -INLINE s2650_regs *get_safe_token(const device_config *device) +INLINE s2650_regs *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/saturn/saturn.c b/src/emu/cpu/saturn/saturn.c index cee6b49f404..0a5e8ac587a 100644 --- a/src/emu/cpu/saturn/saturn.c +++ b/src/emu/cpu/saturn/saturn.c @@ -82,12 +82,12 @@ struct _saturn_state int monitor_id; int monitor_in; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; int icount; }; -INLINE saturn_state *get_safe_token(const device_config *device) +INLINE saturn_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -113,7 +113,7 @@ static CPU_INIT( saturn ) { saturn_state *cpustate = get_safe_token(device); - cpustate->config = (saturn_cpu_core *) device->static_config; + cpustate->config = (saturn_cpu_core *) device->baseconfig().static_config; cpustate->irq_callback = irqcallback; cpustate->device = device; cpustate->program = device->space(AS_PROGRAM); diff --git a/src/emu/cpu/saturn/saturn.h b/src/emu/cpu/saturn/saturn.h index 1426faaceec..3ad3bc1fe2a 100644 --- a/src/emu/cpu/saturn/saturn.h +++ b/src/emu/cpu/saturn/saturn.h @@ -53,14 +53,14 @@ HP38G 09/??/95 1LT8 Yorke typedef struct _saturn_cpu_core saturn_cpu_core; struct _saturn_cpu_core { - void (*out)(const device_config*,int); - int (*in)(const device_config*); - void (*reset)(const device_config*); - void (*config)(const device_config*,int v); - void (*unconfig)(const device_config*,int v); - int (*id)(const device_config*); - void (*crc)(const device_config*,int addr, int data); - void (*rsi)(const device_config*); + void (*out)(running_device*,int); + int (*in)(running_device*); + void (*reset)(running_device*); + void (*config)(running_device*,int v); + void (*unconfig)(running_device*,int v); + int (*id)(running_device*); + void (*crc)(running_device*,int addr, int data); + void (*rsi)(running_device*); }; enum diff --git a/src/emu/cpu/sc61860/sc61860.c b/src/emu/cpu/sc61860/sc61860.c index af5563eaefd..bda92d779f1 100644 --- a/src/emu/cpu/sc61860/sc61860.c +++ b/src/emu/cpu/sc61860/sc61860.c @@ -55,12 +55,12 @@ struct _sc61860_state struct { int t2ms, t512ms; int count;} timer; - const device_config *device; + running_device *device; const address_space *program; int icount; }; -INLINE sc61860_state *get_safe_token(const device_config *device) +INLINE sc61860_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -69,7 +69,7 @@ INLINE sc61860_state *get_safe_token(const device_config *device) return (sc61860_state *)device->token; } -UINT8 *sc61860_internal_ram(const device_config *device) +UINT8 *sc61860_internal_ram(running_device *device) { sc61860_state *cpustate = get_safe_token(device); return cpustate->ram; @@ -104,7 +104,7 @@ static CPU_RESET( sc61860 ) static CPU_INIT( sc61860 ) { sc61860_state *cpustate = get_safe_token(device); - cpustate->config = (sc61860_cpu_core *) device->static_config; + 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->space(AS_PROGRAM); diff --git a/src/emu/cpu/sc61860/sc61860.h b/src/emu/cpu/sc61860/sc61860.h index a475afb6e43..cc8dc6b9bbd 100644 --- a/src/emu/cpu/sc61860/sc61860.h +++ b/src/emu/cpu/sc61860/sc61860.h @@ -40,20 +40,20 @@ typedef struct _sc61860_cpu_core sc61860_cpu_core; struct _sc61860_cpu_core { - int (*reset)(const device_config *device); - int (*brk)(const device_config *device); - int (*x)(const device_config *device); - int (*ina)(const device_config *device); - void (*outa)(const device_config *device, int); - int (*inb)(const device_config *device); - void (*outb)(const device_config *device, int); - void (*outc)(const device_config *device, int); + int (*reset)(running_device *device); + int (*brk)(running_device *device); + int (*x)(running_device *device); + int (*ina)(running_device *device); + void (*outa)(running_device *device, int); + int (*inb)(running_device *device); + void (*outb)(running_device *device, int); + void (*outc)(running_device *device, int); }; CPU_DISASSEMBLE( sc61860 ); /* this is though for power on/off of the sharps */ -UINT8 *sc61860_internal_ram(const device_config *device); +UINT8 *sc61860_internal_ram(running_device *device); CPU_GET_INFO( sc61860 ); #define CPU_SC61860 CPU_GET_INFO_NAME( sc61860 ) diff --git a/src/emu/cpu/scmp/scmp.c b/src/emu/cpu/scmp/scmp.c index 90b5786152e..d9482d9bc35 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; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; cpu_state_table state; @@ -82,7 +82,7 @@ static const cpu_state_table state_table_template = INLINE FUNCTIONS ***************************************************************************/ -INLINE scmp_state *get_safe_token(const device_config *device) +INLINE scmp_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -528,8 +528,8 @@ static CPU_INIT( scmp ) { scmp_state *cpustate = get_safe_token(device); - if (device->static_config != NULL) - cpustate->config = *(scmp_config *)device->static_config; + if (device->baseconfig().static_config != NULL) + cpustate->config = *(scmp_config *)device->baseconfig().static_config; /* set up the state table */ cpustate->state = state_table_template; cpustate->state.baseptr = cpustate; diff --git a/src/emu/cpu/se3208/se3208.c b/src/emu/cpu/se3208/se3208.c index 5edcb3f89a2..9350aabee0c 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; UINT8 IRQ; UINT8 NMI; @@ -58,7 +58,7 @@ typedef void (*_OP)(se3208_state_t *se3208_state, UINT16 Opcode); #define INST(a) static void a(se3208_state_t *se3208_state, UINT16 Opcode) static _OP *OpTable=NULL; -INLINE se3208_state_t *get_safe_token(const device_config *device) +INLINE se3208_state_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/sh2/sh2.c b/src/emu/cpu/sh2/sh2.c index 35f162d4865..1c2864764b1 100644 --- a/src/emu/cpu/sh2/sh2.c +++ b/src/emu/cpu/sh2/sh2.c @@ -2455,12 +2455,12 @@ CPU_GET_INFO( sh1 ) } } -void sh2drc_set_options(const device_config *device, UINT32 options) +void sh2drc_set_options(running_device *device, UINT32 options) { /* doesn't apply here */ } -void sh2drc_add_pcflush(const device_config *device, offs_t address) +void sh2drc_add_pcflush(running_device *device, offs_t address) { /* doesn't apply here */ } diff --git a/src/emu/cpu/sh2/sh2.h b/src/emu/cpu/sh2/sh2.h index a89adb60801..792147ddeb2 100644 --- a/src/emu/cpu/sh2/sh2.h +++ b/src/emu/cpu/sh2/sh2.h @@ -73,8 +73,8 @@ extern CPU_GET_INFO( sh2 ); WRITE32_HANDLER( sh2_internal_w ); READ32_HANDLER( sh2_internal_r ); -void sh2_set_ftcsr_read_callback(const device_config *device, void (*callback)(UINT32)); -void sh2_set_frt_input(const device_config *device, int state); +void sh2_set_ftcsr_read_callback(running_device *device, void (*callback)(UINT32)); +void sh2_set_frt_input(running_device *device, int state); /*************************************************************************** COMPILER-SPECIFIC OPTIONS @@ -87,7 +87,7 @@ void sh2_set_frt_input(const device_config *device, int state); #define SH2DRC_COMPATIBLE_OPTIONS (SH2DRC_STRICT_VERIFY | SH2DRC_FLUSH_PC | SH2DRC_STRICT_PCREL) #define SH2DRC_FASTEST_OPTIONS (0) -void sh2drc_set_options(const device_config *device, UINT32 options); -void sh2drc_add_pcflush(const device_config *device, offs_t address); +void sh2drc_set_options(running_device *device, UINT32 options); +void sh2drc_add_pcflush(running_device *device, offs_t address); #endif /* __SH2_H__ */ diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c index f0f4148865c..a27f5cbca04 100644 --- a/src/emu/cpu/sh2/sh2comn.c +++ b/src/emu/cpu/sh2/sh2comn.c @@ -500,13 +500,13 @@ READ32_HANDLER( sh2_internal_r ) return sh2->m[offset]; } -void sh2_set_ftcsr_read_callback(const device_config *device, void (*callback)(UINT32)) +void sh2_set_ftcsr_read_callback(running_device *device, void (*callback)(UINT32)) { SH2 *sh2 = GET_SH2(device); sh2->ftcsr_read_callback = callback; } -void sh2_set_frt_input(const device_config *device, int state) +void sh2_set_frt_input(running_device *device, int state) { SH2 *sh2 = GET_SH2(device); @@ -699,9 +699,9 @@ void sh2_exception(SH2 *sh2, const char *message, int irqline) #endif } -void sh2_common_init(SH2 *sh2, const device_config *device, cpu_irq_callback irqcallback) +void sh2_common_init(SH2 *sh2, running_device *device, cpu_irq_callback irqcallback) { - const sh2_cpu_core *conf = (const sh2_cpu_core *)device->static_config; + const sh2_cpu_core *conf = (const sh2_cpu_core *)device->baseconfig().static_config; sh2->timer = timer_alloc(device->machine, sh2_timer_callback, sh2); timer_adjust_oneshot(sh2->timer, attotime_never, 0); diff --git a/src/emu/cpu/sh2/sh2comn.h b/src/emu/cpu/sh2/sh2comn.h index 2c48eafeacf..f9559d72d0c 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]; cpu_irq_callback irq_callback; - const device_config *device; + running_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, const device_config *device, cpu_irq_callback irqcallback); +void sh2_common_init(SH2 *sh2, running_device *device, cpu_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 0acdb13c448..ed7378e3245 100644 --- a/src/emu/cpu/sh2/sh2drc.c +++ b/src/emu/cpu/sh2/sh2drc.c @@ -137,7 +137,7 @@ static void cfunc_DIV1(void *param); INLINE FUNCTIONS ***************************************************************************/ -INLINE SH2 *get_safe_token(const device_config *device) +INLINE SH2 *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -3156,7 +3156,7 @@ static int generate_group_12(SH2 *sh2, drcuml_block *block, compiler_state *comp sh2drc_set_options - configure DRC options -------------------------------------------------*/ -void sh2drc_set_options(const device_config *device, UINT32 options) +void sh2drc_set_options(running_device *device, UINT32 options) { SH2 *sh2 = get_safe_token(device); sh2->drcoptions = options; @@ -3168,7 +3168,7 @@ void sh2drc_set_options(const device_config *device, UINT32 options) the PC must be flushed for speedups to work -------------------------------------------------*/ -void sh2drc_add_pcflush(const device_config *device, offs_t address) +void sh2drc_add_pcflush(running_device *device, offs_t address) { SH2 *sh2 = get_safe_token(device); diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c index 9d2d4cd2f34..795225a532c 100644 --- a/src/emu/cpu/sh4/sh4.c +++ b/src/emu/cpu/sh4/sh4.c @@ -30,7 +30,7 @@ CPU_DISASSEMBLE( sh4 ); -INLINE SH4 *get_safe_token(const device_config *device) +INLINE SH4 *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -3384,7 +3384,7 @@ static CPU_EXECUTE( sh4 ) static CPU_INIT( sh4 ) { - const struct sh4_config *conf = (const struct sh4_config *)device->static_config; + const struct sh4_config *conf = (const struct sh4_config *)device->baseconfig().static_config; SH4 *sh4 = get_safe_token(device); sh4_common_init(device); @@ -3607,7 +3607,7 @@ static CPU_SET_INFO( sh4 ) } } -void sh4_set_ftcsr_callback(const device_config *device, sh4_ftcsr_callback callback) +void sh4_set_ftcsr_callback(running_device *device, sh4_ftcsr_callback callback) { SH4 *sh4 = get_safe_token(device); sh4->ftcsr_read_callback = callback; diff --git a/src/emu/cpu/sh4/sh4.h b/src/emu/cpu/sh4/sh4.h index 8bc2d370a60..a1ba8368f84 100644 --- a/src/emu/cpu/sh4/sh4.h +++ b/src/emu/cpu/sh4/sh4.h @@ -96,10 +96,10 @@ extern CPU_GET_INFO( sh4 ); WRITE32_HANDLER( sh4_internal_w ); READ32_HANDLER( sh4_internal_r ); -void sh4_set_frt_input(const device_config *device, int state); -void sh4_set_irln_input(const device_config *device, int value); -void sh4_set_ftcsr_callback(const device_config *device, sh4_ftcsr_callback callback); -void sh4_dma_ddt(const device_config *device, struct sh4_ddt_dma *s); +void sh4_set_frt_input(running_device *device, int state); +void sh4_set_irln_input(running_device *device, int value); +void sh4_set_ftcsr_callback(running_device *device, sh4_ftcsr_callback callback); +void sh4_dma_ddt(running_device *device, struct sh4_ddt_dma *s); #endif /* __SH4_H__ */ diff --git a/src/emu/cpu/sh4/sh4comn.c b/src/emu/cpu/sh4/sh4comn.c index 93ee5f542b8..1e31bd9ede5 100644 --- a/src/emu/cpu/sh4/sh4comn.c +++ b/src/emu/cpu/sh4/sh4comn.c @@ -30,7 +30,7 @@ static const UINT16 tcnt[] = { TCNT0, TCNT1, TCNT2 }; static const UINT16 tcor[] = { TCOR0, TCOR1, TCOR2 }; static const UINT16 tcr[] = { TCR0, TCR1, TCR2 }; -INLINE SH4 *get_safe_token(const device_config *device) +INLINE SH4 *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -997,7 +997,7 @@ READ32_HANDLER( sh4_internal_r ) return sh4->m[offset]; } -void sh4_set_frt_input(const device_config *device, int state) +void sh4_set_frt_input(running_device *device, int state) { SH4 *sh4 = get_safe_token(device); @@ -1033,7 +1033,7 @@ void sh4_set_frt_input(const device_config *device, int state) #endif } -void sh4_set_irln_input(const device_config *device, int value) +void sh4_set_irln_input(running_device *device, int value) { SH4 *sh4 = get_safe_token(device); @@ -1162,7 +1162,7 @@ void sh4_parse_configuration(SH4 *sh4, const struct sh4_config *conf) } } -void sh4_common_init(const device_config *device) +void sh4_common_init(running_device *device) { SH4 *sh4 = get_safe_token(device); int i; @@ -1189,7 +1189,7 @@ void sh4_common_init(const device_config *device) sh4->m = auto_alloc_array(device->machine, UINT32, 16384); } -void sh4_dma_ddt(const device_config *device, struct sh4_ddt_dma *s) +void sh4_dma_ddt(running_device *device, struct sh4_ddt_dma *s) { SH4 *sh4 = get_safe_token(device); UINT32 chcr; diff --git a/src/emu/cpu/sh4/sh4comn.h b/src/emu/cpu/sh4/sh4comn.h index ccb726f66a4..c252f67fbf5 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]; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *internal; const address_space *program; const address_space *io; @@ -148,7 +148,7 @@ void sh4_set_irq_line(SH4 *sh4, int irqline, int state); // set state of externa #ifdef LSB_FIRST void sh4_swap_fp_couples(SH4 *sh4); #endif -void sh4_common_init(const device_config *device); +void sh4_common_init(running_device *device); INLINE void sh4_check_pending_irq(SH4 *sh4, const char *message) // look for highest priority active exception and handle it { diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c index e4a7790cb9a..b1610471bcb 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *data; void (*opcode_handler)(SHARC_REGS *cpustate); @@ -184,7 +184,7 @@ static void (* sharc_op[512])(SHARC_REGS *cpustate); ((UINT64)(cpustate->internal_ram[((pc-0x20000) * 3) + 1]) << 16) | \ ((UINT64)(cpustate->internal_ram[((pc-0x20000) * 3) + 2]) << 0) -INLINE SHARC_REGS *get_safe_token(const device_config *device) +INLINE SHARC_REGS *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -371,7 +371,7 @@ static void build_opcode_table(void) /*****************************************************************************/ -void sharc_external_iop_write(const device_config *device, UINT32 address, UINT32 data) +void sharc_external_iop_write(running_device *device, UINT32 address, UINT32 data) { SHARC_REGS *cpustate = get_safe_token(device); if (address == 0x1c) @@ -388,7 +388,7 @@ void sharc_external_iop_write(const device_config *device, UINT32 address, UINT3 } } -void sharc_external_dma_write(const device_config *device, UINT32 address, UINT64 data) +void sharc_external_dma_write(running_device *device, UINT32 address, UINT64 data) { SHARC_REGS *cpustate = get_safe_token(device); switch ((cpustate->dma[6].control >> 6) & 0x3) @@ -420,7 +420,7 @@ void sharc_external_dma_write(const device_config *device, UINT32 address, UINT6 static CPU_INIT( sharc ) { SHARC_REGS *cpustate = get_safe_token(device); - const sharc_config *cfg = (const sharc_config *)device->static_config; + const sharc_config *cfg = (const sharc_config *)device->baseconfig().static_config; int saveindex; cpustate->boot_mode = cfg->boot_mode; @@ -608,7 +608,7 @@ static void sharc_set_irq_line(SHARC_REGS *cpustate, int irqline, int state) } } -void sharc_set_flag_input(const device_config *device, int flag_num, int state) +void sharc_set_flag_input(running_device *device, int flag_num, int state) { SHARC_REGS *cpustate = get_safe_token(device); if (flag_num >= 0 && flag_num < 4) diff --git a/src/emu/cpu/sharc/sharc.h b/src/emu/cpu/sharc/sharc.h index 83ea58ab173..7b011457deb 100644 --- a/src/emu/cpu/sharc/sharc.h +++ b/src/emu/cpu/sharc/sharc.h @@ -21,10 +21,10 @@ typedef struct { SHARC_BOOT_MODE boot_mode; } sharc_config; -extern void sharc_set_flag_input(const device_config *device, int flag_num, int state); +extern void sharc_set_flag_input(running_device *device, int flag_num, int state); -extern void sharc_external_iop_write(const device_config *device, UINT32 address, UINT32 data); -extern void sharc_external_dma_write(const device_config *device, UINT32 address, UINT64 data); +extern void sharc_external_iop_write(running_device *device, UINT32 address, UINT32 data); +extern void sharc_external_dma_write(running_device *device, UINT32 address, UINT64 data); CPU_GET_INFO( adsp21062 ); #define CPU_ADSP21062 CPU_GET_INFO_NAME( adsp21062 ) diff --git a/src/emu/cpu/sm8500/sm8500.c b/src/emu/cpu/sm8500/sm8500.c index 7bd3e2bea89..f73c3129cfa 100644 --- a/src/emu/cpu/sm8500/sm8500.c +++ b/src/emu/cpu/sm8500/sm8500.c @@ -51,12 +51,12 @@ struct _sm8500_state int halted; int icount; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; UINT8 internal_ram[0x500]; }; -INLINE sm8500_state *get_safe_token(const device_config *device) +INLINE sm8500_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -101,9 +101,9 @@ static CPU_INIT( sm8500 ) cpustate->irq_callback = irqcallback; cpustate->device = device; cpustate->program = device->space(AS_PROGRAM); - if ( device->static_config != NULL ) { - cpustate->config.handle_dma = ((SM8500_CONFIG *)device->static_config)->handle_dma; - cpustate->config.handle_timers = ((SM8500_CONFIG *)device->static_config)->handle_timers; + 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; } else { cpustate->config.handle_dma = NULL; cpustate->config.handle_timers = NULL; diff --git a/src/emu/cpu/sm8500/sm8500.h b/src/emu/cpu/sm8500/sm8500.h index b1d0bf4ccc3..f334bcecf7b 100644 --- a/src/emu/cpu/sm8500/sm8500.h +++ b/src/emu/cpu/sm8500/sm8500.h @@ -5,8 +5,8 @@ typedef struct { - void (*handle_dma)(const device_config *device, int cycles); - void (*handle_timers)(const device_config *device, int cycles); + void (*handle_dma)(running_device *device, int cycles); + void (*handle_timers)(running_device *device, int cycles); } SM8500_CONFIG; /* interrupts */ diff --git a/src/emu/cpu/spc700/spc700.c b/src/emu/cpu/spc700/spc700.c index 922c310732d..942e9af4d02 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 */ cpu_irq_callback int_ack; - const device_config *device; + running_device *device; const address_space *program; uint stopped; /* stopped status */ int ICount; @@ -98,7 +98,7 @@ typedef struct int spc_int32; } spc700i_cpu; -INLINE spc700i_cpu *get_safe_token(const device_config *device) +INLINE spc700i_cpu *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/ssem/ssem.c b/src/emu/cpu/ssem/ssem.c index 661cb3d79ef..ae6ba2eb717 100644 --- a/src/emu/cpu/ssem/ssem.c +++ b/src/emu/cpu/ssem/ssem.c @@ -21,12 +21,12 @@ struct _ssem_state UINT32 a; UINT32 halt; - const device_config *device; + running_device *device; const address_space *program; int icount; }; -INLINE ssem_state *get_safe_token(const device_config *device) +INLINE ssem_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/ssp1601/ssp1601.c b/src/emu/cpu/ssp1601/ssp1601.c index d7cec0918dd..8c2dab46922 100644 --- a/src/emu/cpu/ssp1601/ssp1601.c +++ b/src/emu/cpu/ssp1601/ssp1601.c @@ -52,12 +52,12 @@ struct _ssp1601_state_t int g_cycles; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; }; -INLINE ssp1601_state_t *get_safe_token(const device_config *device) +INLINE ssp1601_state_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/superfx/superfx.c b/src/emu/cpu/superfx/superfx.c index f7bfdd61dfe..fc5add9bf52 100644 --- a/src/emu/cpu/superfx/superfx.c +++ b/src/emu/cpu/superfx/superfx.c @@ -61,12 +61,12 @@ struct _superfx_state cache_t cache; pixelcache_t pixelcache[2]; - const device_config *device; + running_device *device; const address_space *program; int icount; }; -INLINE superfx_state *get_safe_token(const device_config *device) +INLINE superfx_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -472,7 +472,7 @@ INLINE UINT8 superfx_pipe(superfx_state *cpustate) /*****************************************************************************/ -UINT8 superfx_mmio_read(const device_config *cpu, UINT32 addr) +UINT8 superfx_mmio_read(running_device *cpu, UINT32 addr) { superfx_state *cpustate = get_safe_token(cpu); @@ -524,7 +524,7 @@ UINT8 superfx_mmio_read(const device_config *cpu, UINT32 addr) return 0; } -void superfx_mmio_write(const device_config *cpu, UINT32 addr, UINT8 data) +void superfx_mmio_write(running_device *cpu, UINT32 addr, UINT8 data) { superfx_state *cpustate = get_safe_token(cpu); @@ -639,7 +639,7 @@ static void superfx_timing_reset(superfx_state *cpustate) cpustate->ramdr = 0; } -void superfx_add_clocks(const device_config *cpu, INT32 clocks) +void superfx_add_clocks(running_device *cpu, INT32 clocks) { superfx_state *cpustate = get_safe_token(cpu); @@ -682,9 +682,9 @@ static CPU_INIT( superfx ) cpustate->device = device; cpustate->program = device->space(AS_PROGRAM); - if (device->static_config != NULL) + if (device->baseconfig().static_config != NULL) { - cpustate->config = *(superfx_config *)device->static_config; + cpustate->config = *(superfx_config *)device->baseconfig().static_config; } devcb_resolve_write_line(&cpustate->out_irq_func, &cpustate->config.out_irq_func, device); diff --git a/src/emu/cpu/superfx/superfx.h b/src/emu/cpu/superfx/superfx.h index 96043a8fde6..b111e323b61 100644 --- a/src/emu/cpu/superfx/superfx.h +++ b/src/emu/cpu/superfx/superfx.h @@ -96,8 +96,8 @@ CPU_GET_INFO( superfx ); CPU_DISASSEMBLE( superfx ); extern offs_t superfx_dasm_one(char *buffer, offs_t pc, UINT8 op, UINT8 param0, UINT8 param1, UINT16 alt); -UINT8 superfx_mmio_read(const device_config *cpu, UINT32 addr); -void superfx_mmio_write(const device_config *cpu, UINT32 addr, UINT8 data); -void superfx_add_clocks(const device_config *cpu, INT32 clocks); +UINT8 superfx_mmio_read(running_device *cpu, UINT32 addr); +void superfx_mmio_write(running_device *cpu, UINT32 addr, UINT8 data); +void superfx_add_clocks(running_device *cpu, INT32 clocks); #endif /* __SUPERFX_H__ */ diff --git a/src/emu/cpu/t11/t11.c b/src/emu/cpu/t11/t11.c index 2368f6ee8bc..d384d22a1a6 100644 --- a/src/emu/cpu/t11/t11.c +++ b/src/emu/cpu/t11/t11.c @@ -33,12 +33,12 @@ struct _t11_state UINT8 irq_state; int icount; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; }; -INLINE t11_state *get_safe_token(const device_config *device) +INLINE t11_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -259,7 +259,7 @@ static CPU_INIT( t11 ) 0xc000, 0x8000, 0x4000, 0x2000, 0x1000, 0x0000, 0xf600, 0xf400 }; - const struct t11_setup *setup = (const struct t11_setup *)device->static_config; + const struct t11_setup *setup = (const struct t11_setup *)device->baseconfig().static_config; t11_state *cpustate = get_safe_token(device); cpustate->initial_pc = initial_pc[setup->mode >> 13]; diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c index ecef3e2979c..d3284610881 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; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; @@ -60,7 +60,7 @@ typedef struct } t90_Regs; -INLINE t90_Regs *get_safe_token(const device_config *device) +INLINE t90_Regs *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/tlcs900/tlcs900.c b/src/emu/cpu/tlcs900/tlcs900.c index 98927db7019..ef8605afc61 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; cpu_irq_callback irqcallback; - const device_config *device; + running_device *device; const address_space *program; }; @@ -204,7 +204,7 @@ struct _tlcs900_state #define WRMEML(addr,data) { UINT32 dl = data; WRMEMW(addr,dl); WRMEMW(addr+2,(dl >> 16)); } -INLINE tlcs900_state *get_safe_token( const device_config *device ) +INLINE tlcs900_state *get_safe_token( running_device *device ) { assert( device != NULL ); assert( device->token != NULL ); @@ -219,7 +219,7 @@ static CPU_INIT( tlcs900 ) { tlcs900_state *cpustate = get_safe_token(device); - cpustate->intf = (const tlcs900_interface *)device->static_config; + cpustate->intf = (const tlcs900_interface *)device->baseconfig().static_config; cpustate->irqcallback = irqcallback; cpustate->device = device; cpustate->program = device->space( AS_PROGRAM ); diff --git a/src/emu/cpu/tms0980/tms0980.c b/src/emu/cpu/tms0980/tms0980.c index 37d96cab152..5d97d35576c 100644 --- a/src/emu/cpu/tms0980/tms0980.c +++ b/src/emu/cpu/tms0980/tms0980.c @@ -446,7 +446,7 @@ static const UINT32 tms1100_default_decode[256] = { }; -INLINE tms0980_state *get_safe_token(const device_config *device) +INLINE tms0980_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -492,11 +492,11 @@ static ADDRESS_MAP_START(data_7bit, ADDRESS_SPACE_DATA, 8) ADDRESS_MAP_END -static void cpu_init_tms_common( const device_config *device, const UINT32* decode_table, UINT16 o_mask, UINT16 r_mask, UINT8 pc_size, UINT8 byte_size ) +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 ) { tms0980_state *cpustate = get_safe_token( device ); - cpustate->config = (const tms0980_config *) device->static_config; + cpustate->config = (const tms0980_config *) device->baseconfig().static_config; assert( cpustate->config != NULL ); @@ -760,7 +760,7 @@ static const UINT8 tms1000_pc_decode[64] = }; -static void tms0980_set_cki_bus( const device_config *device ) +static void tms0980_set_cki_bus( running_device *device ) { tms0980_state *cpustate = get_safe_token( device ); diff --git a/src/emu/cpu/tms32010/tms32010.c b/src/emu/cpu/tms32010/tms32010.c index 5952cbdfa7e..e02d22daf28 100644 --- a/src/emu/cpu/tms32010/tms32010.c +++ b/src/emu/cpu/tms32010/tms32010.c @@ -91,13 +91,13 @@ struct _tms32010_state UINT16 memaccess; int addr_mask; - const device_config *device; + running_device *device; const address_space *program; const address_space *data; const address_space *io; }; -INLINE tms32010_state *get_safe_token(const device_config *device) +INLINE tms32010_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/tms32025/tms32025.c b/src/emu/cpu/tms32025/tms32025.c index 4889038c46a..a6fda6241c4 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; - const device_config *device; + running_device *device; const address_space *program; const address_space *data; const address_space *io; @@ -182,7 +182,7 @@ struct _tms32025_state UINT16 *datamap[0x200]; }; -INLINE tms32025_state *get_safe_token(const device_config *device) +INLINE tms32025_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/tms32031/tms32031.c b/src/emu/cpu/tms32031/tms32031.c index 323dcc1c29e..838c72d4b15 100644 --- a/src/emu/cpu/tms32031/tms32031.c +++ b/src/emu/cpu/tms32031/tms32031.c @@ -119,11 +119,11 @@ struct _tms32031_state tms32031_xf_func xf1_w; tms32031_iack_func iack_w; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; }; -INLINE tms32031_state *get_safe_token(const device_config *device) +INLINE tms32031_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -369,7 +369,7 @@ static void set_irq_line(tms32031_state *tms, int irqline, int state) static CPU_INIT( tms32031 ) { - const tms32031_config *configdata = (const tms32031_config *)device->static_config; + const tms32031_config *configdata = (const tms32031_config *)device->baseconfig().static_config; tms32031_state *tms = get_safe_token(device); int i; diff --git a/src/emu/cpu/tms32031/tms32031.h b/src/emu/cpu/tms32031/tms32031.h index abb852ddb1a..2dbd6fe73ec 100644 --- a/src/emu/cpu/tms32031/tms32031.h +++ b/src/emu/cpu/tms32031/tms32031.h @@ -16,8 +16,8 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef void (*tms32031_xf_func)(const device_config *device, UINT8 val); -typedef void (*tms32031_iack_func)(const device_config *device, UINT8 val, offs_t address); +typedef void (*tms32031_xf_func)(running_device *device, UINT8 val); +typedef void (*tms32031_iack_func)(running_device *device, UINT8 val, offs_t address); typedef struct _tms32031_config tms32031_config; diff --git a/src/emu/cpu/tms32051/tms32051.c b/src/emu/cpu/tms32051/tms32051.c index fc280411836..4c6579e410b 100644 --- a/src/emu/cpu/tms32051/tms32051.c +++ b/src/emu/cpu/tms32051/tms32051.c @@ -143,13 +143,13 @@ struct _tms32051_state } shadow; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *data; int icount; }; -INLINE tms32051_state *get_safe_token(const device_config *device) +INLINE tms32051_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c index 0aed131d99a..f6105abd317 100644 --- a/src/emu/cpu/tms34010/tms34010.c +++ b/src/emu/cpu/tms34010/tms34010.c @@ -62,10 +62,10 @@ struct _tms34010_state UINT8 external_host_access; UINT8 executing; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const tms34010_config *config; - const device_config *screen; + running_device *screen; emu_timer * scantimer; int icount; @@ -82,7 +82,7 @@ struct _tms34010_state cpu_state_table state; }; -INLINE tms34010_state *get_safe_token(const device_config *device) +INLINE tms34010_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -683,7 +683,7 @@ static void check_interrupt(tms34010_state *tms) static CPU_INIT( tms34010 ) { - const tms34010_config *configdata = device->static_config ? (const tms34010_config *)device->static_config : &default_config; + const tms34010_config *configdata = device->baseconfig().static_config ? (const tms34010_config *)device->baseconfig().static_config : &default_config; tms34010_state *tms = get_safe_token(device); tms->external_host_access = FALSE; @@ -725,7 +725,7 @@ static CPU_RESET( tms34010 ) /* zap the state and copy in the config pointer */ tms34010_state *tms = get_safe_token(device); const tms34010_config *config = tms->config; - const device_config *screen = tms->screen; + running_device *screen = tms->screen; UINT16 *shiftreg = tms->shiftreg; cpu_irq_callback save_irqcallback = tms->irq_callback; emu_timer *save_scantimer = tms->scantimer; @@ -1096,7 +1096,7 @@ static TIMER_CALLBACK( scanline_callback ) } -void tms34010_get_display_params(const device_config *cpu, tms34010_display_params *params) +void tms34010_get_display_params(running_device *cpu, tms34010_display_params *params) { tms34010_state *tms = get_safe_token(cpu); @@ -1135,7 +1135,7 @@ VIDEO_UPDATE( tms340x0 ) pen_t blackpen = get_black_pen(screen->machine); tms34010_display_params params; tms34010_state *tms = NULL; - const device_config *cpu; + running_device *cpu; int x; /* find the owning CPU */ @@ -1609,7 +1609,7 @@ static STATE_POSTLOAD( tms34010_state_postload ) HOST INTERFACE WRITES ***************************************************************************/ -void tms34010_host_w(const device_config *cpu, int reg, int data) +void tms34010_host_w(running_device *cpu, int reg, int data) { const address_space *space; tms34010_state *tms = get_safe_token(cpu); @@ -1665,7 +1665,7 @@ void tms34010_host_w(const device_config *cpu, int reg, int data) HOST INTERFACE READS ***************************************************************************/ -int tms34010_host_r(const device_config *cpu, int reg) +int tms34010_host_r(running_device *cpu, int reg) { tms34010_state *tms = get_safe_token(cpu); unsigned int addr; diff --git a/src/emu/cpu/tms34010/tms34010.h b/src/emu/cpu/tms34010/tms34010.h index 4446ea8fc65..62b40d218aa 100644 --- a/src/emu/cpu/tms34010/tms34010.h +++ b/src/emu/cpu/tms34010/tms34010.h @@ -196,8 +196,8 @@ struct _tms34010_config const char *screen_tag; /* the screen operated on */ UINT32 pixclock; /* the pixel clock (0 means don't adjust screen size) */ int pixperclock; /* pixels per clock */ - void (*scanline_callback)(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); - void (*output_int)(const device_config *device, int state); /* output interrupt callback */ + void (*scanline_callback)(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); + void (*output_int)(running_device *device, int state); /* output interrupt callback */ void (*to_shiftreg)(const address_space *space, offs_t, UINT16 *); /* shift register write */ void (*from_shiftreg)(const address_space *space, offs_t, UINT16 *); /* shift register read */ }; @@ -205,7 +205,7 @@ struct _tms34010_config /* PUBLIC FUNCTIONS - 34010 */ VIDEO_UPDATE( tms340x0 ); -void tms34010_get_display_params(const device_config *cpu, tms34010_display_params *params); +void tms34010_get_display_params(running_device *cpu, tms34010_display_params *params); CPU_GET_INFO( tms34010 ); #define CPU_TMS34010 CPU_GET_INFO_NAME( tms34010 ) @@ -221,8 +221,8 @@ CPU_GET_INFO( tms34020 ); #define TMS34010_HOST_DATA 2 #define TMS34010_HOST_CONTROL 3 -void tms34010_host_w(const device_config *cpu, int reg, int data); -int tms34010_host_r(const device_config *cpu, int reg); +void tms34010_host_w(running_device *cpu, int reg, int data); +int tms34010_host_r(running_device *cpu, int reg); /* Reads & writes to the 34010 I/O registers; place at 0xc0000000 */ diff --git a/src/emu/cpu/tms57002/tms57002.c b/src/emu/cpu/tms57002/tms57002.c index b26bb4b3b83..cfbd3de3686 100644 --- a/src/emu/cpu/tms57002/tms57002.c +++ b/src/emu/cpu/tms57002/tms57002.c @@ -109,7 +109,7 @@ typedef struct { int unsupported_inst_warning; } tms57002_t; -INLINE tms57002_t *get_safe_token(const device_config *device) +INLINE tms57002_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -254,7 +254,7 @@ READ8_DEVICE_HANDLER(tms57002_dready_r) return s->sti & S_HOST ? 0 : 1; } -void tms57002_sync(const device_config *device) +void tms57002_sync(running_device *device) { tms57002_t *s = get_safe_token(device); diff --git a/src/emu/cpu/tms57002/tms57002.h b/src/emu/cpu/tms57002/tms57002.h index 36f956363be..5c0a3f37a45 100644 --- a/src/emu/cpu/tms57002/tms57002.h +++ b/src/emu/cpu/tms57002/tms57002.h @@ -19,7 +19,7 @@ WRITE8_DEVICE_HANDLER(tms57002_cload_w); READ8_DEVICE_HANDLER(tms57002_empty_r); READ8_DEVICE_HANDLER(tms57002_dready_r); -void tms57002_sync(const device_config *cpu); +void tms57002_sync(running_device *cpu); #endif diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c index d0bb4b0a24c..2902ccba522 100644 --- a/src/emu/cpu/tms7000/tms7000.c +++ b/src/emu/cpu/tms7000/tms7000.c @@ -45,7 +45,7 @@ static void tms7000_check_IRQ_lines(tms7000_state *cpustate); static void tms7000_do_interrupt( tms7000_state *cpustate, UINT16 address, UINT8 line ); static CPU_EXECUTE( tms7000 ); static CPU_EXECUTE( tms7000_exl ); -static void tms7000_service_timer1( const device_config *device ); +static void tms7000_service_timer1( running_device *device ); static UINT16 bcd_add( UINT16 a, UINT16 b ); static UINT16 bcd_tencomp( UINT16 a ); static UINT16 bcd_sub( UINT16 a, UINT16 b); @@ -73,7 +73,7 @@ struct _tms7000_state UINT8 rf[0x80]; /* Register file (SJE) */ UINT8 pf[0x100]; /* Perpherial file */ cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; @@ -85,7 +85,7 @@ struct _tms7000_state UINT8 idle_state; /* Set after the execution of an idle instruction */ }; -INLINE tms7000_state *get_safe_token(const device_config *device) +INLINE tms7000_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -529,7 +529,7 @@ static CPU_EXECUTE( tms7000_exl ) /**************************************************************************** * Trigger the event counter ****************************************************************************/ -void tms7000_A6EC1( const device_config *device ) +void tms7000_A6EC1( running_device *device ) { tms7000_state *cpustate = get_safe_token(device); if( (cpustate->pf[0x03] & 0x80) == 0x80 ) /* Is timer system active? */ @@ -539,7 +539,7 @@ void tms7000_A6EC1( const device_config *device ) } } -static void tms7000_service_timer1( const device_config *device ) +static void tms7000_service_timer1( running_device *device ) { tms7000_state *cpustate = get_safe_token(device); if( --cpustate->t1_prescaler < 0 ) /* Decrement prescaler and check for underflow */ diff --git a/src/emu/cpu/tms7000/tms7000.h b/src/emu/cpu/tms7000/tms7000.h index 0fcf1430bae..2cd8379d569 100644 --- a/src/emu/cpu/tms7000/tms7000.h +++ b/src/emu/cpu/tms7000/tms7000.h @@ -46,7 +46,7 @@ enum }; /* PUBLIC FUNCTIONS */ -extern void tms7000_A6EC1( const device_config *device ); /* External event counter */ +extern void tms7000_A6EC1( running_device *device ); /* External event counter */ extern CPU_GET_INFO( tms7000 ); extern CPU_GET_INFO( tms7000_exl ); diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h index aa17a921d29..fda462bf4e2 100644 --- a/src/emu/cpu/tms9900/99xxcore.h +++ b/src/emu/cpu/tms9900/99xxcore.h @@ -92,19 +92,19 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX ti990_10 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( ti990_10 ) - #define TMS99XX_cpu_get_name "TI990/10" + #define TMS99XX_device_get_name "TI990/10" #elif (TMS99XX_MODEL == TMS9900_ID) #define TMS99XX_PREFIX tms9900 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9900 ) - #define TMS99XX_cpu_get_name "TMS9900" + #define TMS99XX_device_get_name "TMS9900" #elif (TMS99XX_MODEL == TMS9940_ID) #define TMS99XX_PREFIX tms9940 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9940 ) - #define TMS99XX_cpu_get_name "TMS9940" + #define TMS99XX_device_get_name "TMS9940" #error "tms9940 is not yet supported" @@ -112,13 +112,13 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX tms9980a #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9980a ) - #define TMS99XX_cpu_get_name "TMS9980A/TMS9981" + #define TMS99XX_device_get_name "TMS9980A/TMS9981" #elif (TMS99XX_MODEL == TMS9985_ID) #define TMS99XX_PREFIX tms9985 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9985 ) - #define TMS99XX_cpu_get_name "TMS9985" + #define TMS99XX_device_get_name "TMS9985" #error "tms9985 is not yet supported" @@ -126,7 +126,7 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX tms9989 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9989 ) - #define TMS99XX_cpu_get_name "TMS9989" + #define TMS99XX_device_get_name "TMS9989" #error "tms9989 is not yet supported" @@ -134,13 +134,13 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX tms9995 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms9995 ) - #define TMS99XX_cpu_get_name "TMS9995" + #define TMS99XX_device_get_name "TMS9995" #elif (TMS99XX_MODEL == TMS99000_ID) #define TMS99XX_PREFIX tms99000 #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms99000 ) - #define TMS99XX_cpu_get_name "TMS99000" + #define TMS99XX_device_get_name "TMS99000" #error "tms99000 is not yet supported" @@ -148,7 +148,7 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX tms99105a #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms99105a ) - #define TMS99XX_cpu_get_name "TMS99105A" + #define TMS99XX_device_get_name "TMS99105A" #error "tms99105a is not yet supported" @@ -156,7 +156,7 @@ Other references can be found on spies.com: #define TMS99XX_PREFIX tms99110a #define TMS99XX_GET_INFO CPU_GET_INFO_NAME( tms99110a ) - #define TMS99XX_cpu_get_name "TMS99110A" + #define TMS99XX_device_get_name "TMS99110A" #error "tms99110a is not yet supported" @@ -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) */ cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; @@ -509,7 +509,7 @@ struct _tms99xx_state int extra_byte; /* buffer holding the unused byte in a word read */ }; -INLINE tms99xx_state *get_safe_token(const device_config *device) +INLINE tms99xx_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -1210,7 +1210,7 @@ static void set_flag1(tms99xx_state *cpustate, int val); /**************************************************************************/ -static void register_for_save_state(const device_config *device) +static void register_for_save_state(running_device *device) { tms99xx_state *cpustate = get_safe_token(device); state_save_register_device_item(device, 0, cpustate->WP); @@ -1288,7 +1288,7 @@ static void register_for_save_state(const device_config *device) static CPU_INIT( tms99xx ) { - const TMS99XX_RESET_PARAM *param = (const TMS99XX_RESET_PARAM *) device->static_config; + const TMS99XX_RESET_PARAM *param = (const TMS99XX_RESET_PARAM *) device->baseconfig().static_config; tms99xx_state *cpustate = get_safe_token(device); register_for_save_state(device); @@ -4635,7 +4635,7 @@ static CPU_SET_INFO( tms99xx ) * Generic get_info **************************************************************************/ -void TMS99XX_GET_INFO(const device_config *device, UINT32 state, cpuinfo *info) +void TMS99XX_GET_INFO(const device_config *devconfig, running_device *device, UINT32 state, cpuinfo *info) { tms99xx_state *cpustate = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL; switch (state) @@ -4770,7 +4770,7 @@ void TMS99XX_GET_INFO(const device_config *device, UINT32 state, cpuinfo *info) case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, TMS99XX_cpu_get_name); break; + case DEVINFO_STR_NAME: strcpy(info->s, TMS99XX_device_get_name); break; case DEVINFO_STR_FAMILY: strcpy(info->s, "Texas Instruments 9900"); break; case DEVINFO_STR_VERSION: strcpy(info->s, "2.0"); break; case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; diff --git a/src/emu/cpu/tms9900/tms9900.h b/src/emu/cpu/tms9900/tms9900.h index 3f84ed653b7..ce2ea5c25dc 100644 --- a/src/emu/cpu/tms9900/tms9900.h +++ b/src/emu/cpu/tms9900/tms9900.h @@ -48,11 +48,11 @@ enum TMS9900_R12, TMS9900_R13, TMS9900_R14, TMS9900_R15 }; -typedef void (*ti99xx_idle_func)(const device_config *device, int state); -typedef void (*ti99xx_rset_func)(const device_config *device); -typedef void (*ti99xx_lrex_func)(const device_config *device); -typedef void (*ti99xx_ckon_ckof_func)(const device_config *device, int state); -typedef void (*ti99xx_error_interrupt_func)(const device_config *device, int state); +typedef void (*ti99xx_idle_func)(running_device *device, int state); +typedef void (*ti99xx_rset_func)(running_device *device); +typedef void (*ti99xx_lrex_func)(running_device *device); +typedef void (*ti99xx_ckon_ckof_func)(running_device *device, int state); +typedef void (*ti99xx_error_interrupt_func)(running_device *device, int state); extern CPU_GET_INFO( ti990_10 ); diff --git a/src/emu/cpu/unsp/unsp.c b/src/emu/cpu/unsp/unsp.c index f0dababc283..dc0f87dab80 100644 --- a/src/emu/cpu/unsp/unsp.c +++ b/src/emu/cpu/unsp/unsp.c @@ -10,7 +10,7 @@ #include "debugger.h" #include "unsp.h" -INLINE unsp_state *get_safe_token(const device_config *device) +INLINE unsp_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -116,7 +116,7 @@ static CPU_INIT( unsp ) memset(unsp->r, 0, sizeof(UINT16) * UNSP_GPR_COUNT); unsp->device = device; - unsp->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); + unsp->program = device->space(AS_PROGRAM); unsp->irq = 0; unsp->fiq = 0; } diff --git a/src/emu/cpu/unsp/unsp.h b/src/emu/cpu/unsp/unsp.h index cf0961373eb..a7acc04b273 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; - const device_config *device; + running_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 05bd37ec0ea..8a30f0ec885 100644 --- a/src/emu/cpu/upd7810/upd7810.c +++ b/src/emu/cpu/upd7810/upd7810.c @@ -499,13 +499,13 @@ struct _upd7810_state void (*handle_timers)(upd7810_state *cpustate, int cycles); UPD7810_CONFIG config; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; }; -INLINE upd7810_state *get_safe_token(const device_config *device) +INLINE upd7810_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -1701,7 +1701,7 @@ static CPU_INIT( upd7810 ) { upd7810_state *cpustate = get_safe_token(device); - cpustate->config = *(const UPD7810_CONFIG*) device->static_config; + cpustate->config = *(const UPD7810_CONFIG*) device->baseconfig().static_config; cpustate->irq_callback = irqcallback; cpustate->device = device; cpustate->program = device->space(AS_PROGRAM); diff --git a/src/emu/cpu/upd7810/upd7810.h b/src/emu/cpu/upd7810/upd7810.h index e00a08a6d54..d2748d44914 100644 --- a/src/emu/cpu/upd7810/upd7810.h +++ b/src/emu/cpu/upd7810/upd7810.h @@ -30,7 +30,7 @@ typedef enum * It will be called whenever an output signal changes or a new * input line state is to be sampled. */ -typedef int (*upd7810_io_callback)(const device_config *device, int ioline, int state); +typedef int (*upd7810_io_callback)(running_device *device, int ioline, int state); // use it as reset parameter in the Machine struct typedef struct { diff --git a/src/emu/cpu/v30mz/v30mz.c b/src/emu/cpu/v30mz/v30mz.c index bc9c6fc5034..16f4c90ea68 100644 --- a/src/emu/cpu/v30mz/v30mz.c +++ b/src/emu/cpu/v30mz/v30mz.c @@ -80,7 +80,7 @@ struct _v30mz_state UINT8 no_interrupt; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; @@ -93,7 +93,7 @@ struct _v30mz_state UINT16 e16; }; -INLINE v30mz_state *get_safe_token(const device_config *device) +INLINE v30mz_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -923,7 +923,7 @@ static CPU_DISASSEMBLE( nec ) return necv_dasm_one(buffer, pc, oprom); } -static void nec_init(const device_config *device, cpu_irq_callback irqcallback, int type) +static void nec_init(running_device *device, cpu_irq_callback irqcallback, int type) { v30mz_state *cpustate = get_safe_token(device); diff --git a/src/emu/cpu/v60/v60.c b/src/emu/cpu/v60/v60.c index daeda645bfa..f68c25952aa 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; cpu_irq_callback irq_cb; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; UINT32 PPC; @@ -111,7 +111,7 @@ struct _v60_state UINT8 moddim; }; -INLINE v60_state *get_safe_token(const device_config *device) +INLINE v60_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -312,7 +312,7 @@ static UINT32 opUNHANDLED(v60_state *cpustate) // Opcode jump table #include "optable.c" -static void base_init(const device_config *device, cpu_irq_callback irqcallback) +static void base_init(running_device *device, cpu_irq_callback irqcallback) { v60_state *cpustate = get_safe_token(device); @@ -381,7 +381,7 @@ static CPU_EXIT( v60 ) { } -void v60_stall(const device_config *device) +void v60_stall(running_device *device) { v60_state *cpustate = get_safe_token(device); cpustate->stall_io = 1; diff --git a/src/emu/cpu/v60/v60.h b/src/emu/cpu/v60/v60.h index 2f165bd2856..aa56110905d 100644 --- a/src/emu/cpu/v60/v60.h +++ b/src/emu/cpu/v60/v60.h @@ -77,7 +77,7 @@ enum V60_REGMAX }; -void v60_stall(const device_config *device); +void v60_stall(running_device *device); CPU_GET_INFO( v60 ); #define CPU_V60 CPU_GET_INFO_NAME( v60 ) diff --git a/src/emu/cpu/v810/v810.c b/src/emu/cpu/v810/v810.c index 4cd2d5ae6bf..eea2784160f 100644 --- a/src/emu/cpu/v810/v810.c +++ b/src/emu/cpu/v810/v810.c @@ -30,14 +30,14 @@ struct _v810_state UINT8 irq_line; UINT8 nmi_line; cpu_irq_callback irq_cb; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; UINT32 PPC; int icount; }; -INLINE v810_state *get_safe_token(const device_config *device) +INLINE v810_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/vtlb.c b/src/emu/cpu/vtlb.c index c64e987edb6..68320609d5d 100644 --- a/src/emu/cpu/vtlb.c +++ b/src/emu/cpu/vtlb.c @@ -30,7 +30,7 @@ /* VTLB state */ struct _vtlb_state { - const device_config *device; /* CPU device */ + running_device *device; /* CPU device */ int space; /* address space */ int dynamic; /* number of dynamic entries */ int fixed; /* number of fixed entries */ @@ -55,7 +55,7 @@ struct _vtlb_state given CPU -------------------------------------------------*/ -vtlb_state *vtlb_alloc(const device_config *cpu, int space, int fixed_entries, int dynamic_entries) +vtlb_state *vtlb_alloc(running_device *cpu, int space, int fixed_entries, int dynamic_entries) { vtlb_state *vtlb; @@ -69,7 +69,7 @@ vtlb_state *vtlb_alloc(const device_config *cpu, int space, int fixed_entries, i vtlb->fixed = fixed_entries; vtlb->pageshift = cpu_get_page_shift(cpu, space); vtlb->addrwidth = cpu_get_logaddr_width(cpu, space); - vtlb->translate = (cpu_translate_func)device_get_info_fct(cpu, CPUINFO_FCT_TRANSLATE); + vtlb->translate = (cpu_translate_func)cpu->get_config_fct(CPUINFO_FCT_TRANSLATE); /* validate CPU information */ assert((1 << vtlb->pageshift) > VTLB_FLAGS_MASK); diff --git a/src/emu/cpu/vtlb.h b/src/emu/cpu/vtlb.h index 7068bc77b87..feb8417f597 100644 --- a/src/emu/cpu/vtlb.h +++ b/src/emu/cpu/vtlb.h @@ -55,7 +55,7 @@ typedef struct _vtlb_state vtlb_state; /* ----- initialization/teardown ----- */ /* allocate a new VTLB for the given CPU */ -vtlb_state *vtlb_alloc(const device_config *cpu, int space, int fixed_entries, int dynamic_entries); +vtlb_state *vtlb_alloc(running_device *cpu, int space, int fixed_entries, int dynamic_entries); /* free an allocated VTLB */ void vtlb_free(vtlb_state *vtlb); diff --git a/src/emu/cpu/z180/z180.c b/src/emu/cpu/z180/z180.c index f4481a9fb39..7679b144ed8 100644 --- a/src/emu/cpu/z180/z180.c +++ b/src/emu/cpu/z180/z180.c @@ -115,7 +115,7 @@ struct _z180_state UINT32 ea; z80_daisy_state *daisy; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *iospace; cpu_state_table state; @@ -125,7 +125,7 @@ struct _z180_state UINT8 *cc[6]; }; -INLINE z180_state *get_safe_token(const device_config *device) +INLINE z180_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -2015,8 +2015,8 @@ static CPU_INIT( z180 ) { z180_state *cpustate = get_safe_token(device); cpustate->daisy = NULL; - if (device->static_config) - cpustate->daisy = z80daisy_init(device, (const z80_daisy_chain *)device->static_config); + if (device->baseconfig().static_config) + cpustate->daisy = z80daisy_init(device, (const z80_daisy_chain *)device->baseconfig().static_config); cpustate->irq_callback = irqcallback; SZHVC_add = auto_alloc_array(device->machine, UINT8, 2*256*256); diff --git a/src/emu/cpu/z180/z180.h b/src/emu/cpu/z180/z180.h index 09d379cbd32..8e188ce1676 100644 --- a/src/emu/cpu/z180/z180.h +++ b/src/emu/cpu/z180/z180.h @@ -136,8 +136,8 @@ enum #ifdef UNUSED_DEFINITION /* MMU mapped memory lookup */ -extern UINT8 z180_readmem(const device_config *device, offs_t offset); -extern void z180_writemem(const device_config *device, offs_t offset, UINT8 data); +extern UINT8 z180_readmem(running_device *device, offs_t offset); +extern void z180_writemem(running_device *device, offs_t offset, UINT8 data); #endif extern CPU_GET_INFO( z180 ); diff --git a/src/emu/cpu/z180/z180ops.h b/src/emu/cpu/z180/z180ops.h index 9a977c91d49..87a992a9855 100644 --- a/src/emu/cpu/z180/z180ops.h +++ b/src/emu/cpu/z180/z180ops.h @@ -70,7 +70,7 @@ INLINE void z180_mmu(z180_state *cpustate) ***************************************************************/ #define RM(cs,addr) memory_read_byte_8le((cs)->program, MMU_REMAP_ADDR(cs,addr)) #ifdef UNUSED_FUNCTION -UINT8 z180_readmem(const device_config *device, offs_t offset) +UINT8 z180_readmem(running_device *device, offs_t offset) { z180_state *cpustate = get_safe_token(device); return RM(cpustate, offset); @@ -82,7 +82,7 @@ UINT8 z180_readmem(const device_config *device, offs_t offset) ***************************************************************/ #define WM(cs,addr,value) memory_write_byte_8le((cs)->program, MMU_REMAP_ADDR(cs,addr),value) #ifdef UNUSED_FUNCTION -void z180_writemem(const device_config *device, offs_t offset, UINT8 data) +void z180_writemem(running_device *device, offs_t offset, UINT8 data) { z180_state *cpustate = get_safe_token(device); WM(cpustate, offset, data); diff --git a/src/emu/cpu/z8/z8.c b/src/emu/cpu/z8/z8.c index b272c992aaa..4969d4b3209 100644 --- a/src/emu/cpu/z8/z8.c +++ b/src/emu/cpu/z8/z8.c @@ -236,7 +236,7 @@ static const cpu_state_table state_table_template = INLINE FUNCTIONS ***************************************************************************/ -INLINE z8_state *get_safe_token(const device_config *device) +INLINE z8_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpu/z80/z80.c b/src/emu/cpu/z80/z80.c index 44f9dbfd0f9..7b84300b139 100644 --- a/src/emu/cpu/z80/z80.c +++ b/src/emu/cpu/z80/z80.c @@ -148,7 +148,7 @@ struct _z80_state UINT8 after_ei; /* are we in the EI shadow? */ UINT32 ea; cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; @@ -163,7 +163,7 @@ struct _z80_state const UINT8 * cc_ex; }; -INLINE z80_state *get_safe_token(const device_config *device) +INLINE z80_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -3463,8 +3463,8 @@ static CPU_INIT( z80 ) /* Reset registers to their initial values */ memset(z80, 0, sizeof(*z80)); - if (device->static_config != NULL) - z80->daisy = z80daisy_init(device, (const z80_daisy_chain *)device->static_config); + if (device->baseconfig().static_config != NULL) + z80->daisy = z80daisy_init(device, (const z80_daisy_chain *)device->baseconfig().static_config); z80->irq_callback = irqcallback; z80->device = device; z80->program = device->space(AS_PROGRAM); @@ -3653,7 +3653,7 @@ static CPU_SET_INFO( z80 ) } } -void z80_set_cycle_tables(const device_config *device, const UINT8 *op, const UINT8 *cb, const UINT8 *ed, const UINT8 *xy, const UINT8 *xycb, const UINT8 *ex) +void z80_set_cycle_tables(running_device *device, const UINT8 *op, const UINT8 *cb, const UINT8 *ed, const UINT8 *xy, const UINT8 *xycb, const UINT8 *ex) { z80_state *z80 = get_safe_token(device); diff --git a/src/emu/cpu/z80/z80.h b/src/emu/cpu/z80/z80.h index 0d913c4c7f8..db633ff0eee 100644 --- a/src/emu/cpu/z80/z80.h +++ b/src/emu/cpu/z80/z80.h @@ -23,6 +23,6 @@ CPU_GET_INFO( z80 ); CPU_DISASSEMBLE( z80 ); -void z80_set_cycle_tables(const device_config *device, const UINT8 *op, const UINT8 *cb, const UINT8 *ed, const UINT8 *xy, const UINT8 *xycb, const UINT8 *ex); +void z80_set_cycle_tables(running_device *device, const UINT8 *op, const UINT8 *cb, const UINT8 *ed, const UINT8 *xy, const UINT8 *xycb, const UINT8 *ex); #endif /* __Z80_H__ */ diff --git a/src/emu/cpu/z80/z80daisy.c b/src/emu/cpu/z80/z80daisy.c index b51da9b88a6..915be1dac71 100644 --- a/src/emu/cpu/z80/z80daisy.c +++ b/src/emu/cpu/z80/z80daisy.c @@ -13,14 +13,14 @@ struct _z80_daisy_state { z80_daisy_state * next; /* next device */ - const device_config * device; /* associated device */ + running_device * device; /* associated device */ z80_daisy_irq_state irq_state; /* IRQ state callback */ z80_daisy_irq_ack irq_ack; /* IRQ ack callback */ z80_daisy_irq_reti irq_reti; /* IRQ reti callback */ }; -z80_daisy_state *z80daisy_init(const device_config *cpudevice, const z80_daisy_chain *daisy) +z80_daisy_state *z80daisy_init(running_device *cpudevice, const z80_daisy_chain *daisy) { astring tempstring; z80_daisy_state *head = NULL; @@ -34,9 +34,9 @@ z80_daisy_state *z80daisy_init(const device_config *cpudevice, const z80_daisy_c (*tailptr)->device = cpudevice->machine->device(device_inherit_tag(tempstring, cpudevice->tag, daisy->devname)); if ((*tailptr)->device == NULL) fatalerror("Unable to locate device '%s'", daisy->devname); - (*tailptr)->irq_state = (z80_daisy_irq_state)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_IRQ_STATE); - (*tailptr)->irq_ack = (z80_daisy_irq_ack)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_IRQ_ACK); - (*tailptr)->irq_reti = (z80_daisy_irq_reti)device_get_info_fct((*tailptr)->device, DEVINFO_FCT_IRQ_RETI); + (*tailptr)->irq_state = (z80_daisy_irq_state)(*tailptr)->device->get_config_fct(DEVINFO_FCT_IRQ_STATE); + (*tailptr)->irq_ack = (z80_daisy_irq_ack)(*tailptr)->device->get_config_fct(DEVINFO_FCT_IRQ_ACK); + (*tailptr)->irq_reti = (z80_daisy_irq_reti)(*tailptr)->device->get_config_fct(DEVINFO_FCT_IRQ_RETI); tailptr = &(*tailptr)->next; } diff --git a/src/emu/cpu/z80/z80daisy.h b/src/emu/cpu/z80/z80daisy.h index 4d54e27cbc7..ad3adcfbc0d 100644 --- a/src/emu/cpu/z80/z80daisy.h +++ b/src/emu/cpu/z80/z80daisy.h @@ -36,9 +36,9 @@ enum ***************************************************************************/ /* per-device callback functions */ -typedef int (*z80_daisy_irq_state)(const device_config *device); -typedef int (*z80_daisy_irq_ack)(const device_config *device); -typedef int (*z80_daisy_irq_reti)(const device_config *device); +typedef int (*z80_daisy_irq_state)(running_device *device); +typedef int (*z80_daisy_irq_ack)(running_device *device); +typedef int (*z80_daisy_irq_reti)(running_device *device); /* opaque internal daisy chain state */ @@ -58,7 +58,7 @@ struct _z80_daisy_chain FUNCTION PROTOTYPES ***************************************************************************/ -z80_daisy_state *z80daisy_init(const device_config *cpudevice, const z80_daisy_chain *daisy); +z80_daisy_state *z80daisy_init(running_device *cpudevice, const z80_daisy_chain *daisy); void z80daisy_reset(z80_daisy_state *daisy); int z80daisy_update_irq_state(z80_daisy_state *chain); diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c index bf485a40214..7b4870a575e 100644 --- a/src/emu/cpu/z8000/z8000.c +++ b/src/emu/cpu/z8000/z8000.c @@ -78,7 +78,7 @@ struct _z8000_state int nmi_state; /* NMI line state */ int irq_state[2]; /* IRQ line states (NVI, VI) */ cpu_irq_callback irq_callback; - const device_config *device; + running_device *device; const address_space *program; const address_space *io; int icount; @@ -86,7 +86,7 @@ struct _z8000_state #include "z8000cpu.h" -INLINE z8000_state *get_safe_token(const device_config *device) +INLINE z8000_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/cpuexec.c b/src/emu/cpuexec.c index e355e2195e9..9c5021010ab 100644 --- a/src/emu/cpuexec.c +++ b/src/emu/cpuexec.c @@ -59,7 +59,7 @@ typedef struct _cpu_class_data cpu_class_data; struct _cpu_class_data { /* execution lists */ - const device_config *device; /* pointer back to our device */ + running_device *device; /* pointer back to our device */ cpu_class_data *next; /* pointer to the next CPU to execute, in order */ cpu_execute_func execute; /* execute function pointer */ @@ -107,7 +107,7 @@ struct _cpu_class_data /* In mame.h: typedef struct _cpuexec_private cpuexec_private; */ struct _cpuexec_private { - const device_config *executingcpu; /* pointer to the currently executing CPU */ + running_device *executingcpu; /* pointer to the currently executing CPU */ cpu_class_data *executelist; /* execution list; suspended CPUs are at the back */ char statebuf[256]; /* string buffer containing state description */ }; @@ -118,21 +118,21 @@ struct _cpuexec_private FUNCTION PROTOTYPES ***************************************************************************/ -static void update_clock_information(const device_config *device); +static void update_clock_information(running_device *device); static void compute_perfect_interleave(running_machine *machine); -static void on_vblank(const device_config *device, void *param, int vblank_state); +static void on_vblank(running_device *device, void *param, int vblank_state); static TIMER_CALLBACK( trigger_partial_frame_interrupt ); static TIMER_CALLBACK( trigger_periodic_interrupt ); static TIMER_CALLBACK( triggertime_callback ); static TIMER_CALLBACK( empty_event_queue ); static IRQ_CALLBACK( standard_irq_callback ); -static void register_save_states(const device_config *device); +static void register_save_states(running_device *device); static void rebuild_execute_list(running_machine *machine); -static UINT64 get_register_value(const device_config *device, void *baseptr, const cpu_state_entry *entry); -static void set_register_value(const device_config *device, void *baseptr, const cpu_state_entry *entry, UINT64 value); -static void get_register_string_value(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *dest); +static UINT64 get_register_value(running_device *device, void *baseptr, const cpu_state_entry *entry); +static void set_register_value(running_device *device, void *baseptr, const cpu_state_entry *entry, UINT64 value); +static void get_register_string_value(running_device *device, void *baseptr, const cpu_state_entry *entry, char *dest); #ifdef UNUSED_FUNCTION -static int get_register_string_max_width(const device_config *device, void *baseptr, const cpu_state_entry *entry); +static int get_register_string_max_width(running_device *device, void *baseptr, const cpu_state_entry *entry); #endif @@ -156,7 +156,7 @@ static int get_register_string_max_width(const device_config *device, void *base class data -------------------------------------------------*/ -INLINE cpu_class_data *get_class_data(const device_config *device) +INLINE cpu_class_data *get_class_data(running_device *device) { assert(device != NULL); assert(device->devclass == DEVICE_CLASS_CPU_CHIP); @@ -170,7 +170,7 @@ INLINE cpu_class_data *get_class_data(const device_config *device) quantum required for a given CPU device -------------------------------------------------*/ -INLINE attoseconds_t get_minimum_quantum(const device_config *device) +INLINE attoseconds_t get_minimum_quantum(running_device *device) { attoseconds_t basetick = 0; @@ -195,7 +195,7 @@ INLINE attoseconds_t get_minimum_quantum(const device_config *device) until the given trigger fires -------------------------------------------------*/ -INLINE void suspend_until_trigger(const device_config *device, int trigger, int eatcycles) +INLINE void suspend_until_trigger(running_device *device, int trigger, int eatcycles) { cpu_class_data *classdata = get_class_data(device); @@ -230,7 +230,7 @@ void cpuexec_init(running_machine *machine) min_quantum = ATTOTIME_IN_HZ(60); if (machine->config->perfect_cpu_quantum != NULL) { - const device_config *cpu = machine->device(machine->config->perfect_cpu_quantum); + running_device *cpu = machine->device(machine->config->perfect_cpu_quantum); attotime cpu_quantum; if (cpu == NULL) @@ -402,7 +402,7 @@ void cpuexec_boost_interleave(running_machine *machine, attotime timeslice_time, void cpuexec_abort_timeslice(running_machine *machine) { - const device_config *executingcpu = machine->cpuexec_data->executingcpu; + running_device *executingcpu = machine->cpuexec_data->executingcpu; if (executingcpu != NULL) cpu_abort_timeslice(executingcpu); } @@ -417,7 +417,7 @@ void cpuexec_abort_timeslice(running_machine *machine) const char *cpuexec_describe_context(running_machine *machine) { cpuexec_private *global = machine->cpuexec_data; - const device_config *executingcpu = global->executingcpu; + running_device *executingcpu = global->executingcpu; /* if we have an executing CPU, output data */ if (executingcpu != NULL) @@ -453,18 +453,18 @@ static DEVICE_START( cpu ) /* validate some basic stuff */ assert(device != NULL); - assert(device->inline_config != NULL); + assert(device->baseconfig().inline_config != NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); /* get pointers to our data */ - config = (const cpu_config *)device->inline_config; + config = (const cpu_config *)device->baseconfig().inline_config; header = cpu_get_class_header(device); classdata = get_class_data(device); /* build the header */ header->debug = NULL; - header->set_info = (cpu_set_info_func)device_get_info_fct(device, CPUINFO_FCT_SET_INFO); + header->set_info = (cpu_set_info_func)device->get_config_fct(CPUINFO_FCT_SET_INFO); /* fill in the input states and IRQ callback information */ for (line = 0; line < ARRAY_LENGTH(classdata->input); line++) @@ -477,7 +477,7 @@ static DEVICE_START( cpu ) /* fill in the suspend states */ classdata->device = device; - classdata->execute = (cpu_execute_func)device_get_info_fct(device, CPUINFO_FCT_EXECUTE); + classdata->execute = (cpu_execute_func)device->get_config_fct(CPUINFO_FCT_EXECUTE); classdata->profiler = index + PROFILER_CPU_FIRST; classdata->suspend = SUSPEND_REASON_RESET; classdata->inttrigger = index + TRIGGER_INT; @@ -494,7 +494,7 @@ static DEVICE_START( cpu ) /* initialize this CPU */ num_regs = state_save_get_reg_count(device->machine); - init = (cpu_init_func)device_get_info_fct(device, CPUINFO_FCT_INIT); + init = (cpu_init_func)device->get_config_fct(CPUINFO_FCT_INIT); (*init)(device, standard_irq_callback); num_regs = state_save_get_reg_count(device->machine) - num_regs; @@ -547,7 +547,7 @@ static DEVICE_START( cpu ) static DEVICE_RESET( cpu ) { cpu_class_data *classdata = get_class_data(device); - const cpu_config *config = (const cpu_config *)device->inline_config; + const cpu_config *config = (const cpu_config *)device->baseconfig().inline_config; cpu_reset_func reset; int line; @@ -561,7 +561,7 @@ static DEVICE_RESET( cpu ) classdata->totalcycles = 0; /* then reset the CPU directly */ - reset = (cpu_reset_func)device_get_info_fct(device, CPUINFO_FCT_RESET); + reset = (cpu_reset_func)device->get_config_fct(CPUINFO_FCT_RESET); if (reset != NULL) (*reset)(device); @@ -576,7 +576,7 @@ static DEVICE_RESET( cpu ) /* reconfingure VBLANK interrupts */ if (config->vblank_interrupts_per_frame > 0 || config->vblank_interrupt_screen != NULL) { - const device_config *screen; + running_device *screen; /* get the screen that will trigger the VBLANK */ @@ -586,7 +586,7 @@ static DEVICE_RESET( cpu ) /* old style 'hack' setup - use screen #0 */ else - screen = video_screen_first(device->machine->config); + screen = video_screen_first(device->machine); assert(screen != NULL); video_screen_register_vblank_callback(screen, on_vblank, NULL); @@ -611,7 +611,7 @@ static DEVICE_STOP( cpu ) cpu_exit_func exit; /* call the CPU's exit function if present */ - exit = (cpu_exit_func)device_get_info_fct(device, CPUINFO_FCT_EXIT); + exit = (cpu_exit_func)device->get_config_fct(CPUINFO_FCT_EXIT); if (exit != NULL) (*exit)(device); } @@ -621,7 +621,7 @@ static DEVICE_STOP( cpu ) cpu_set_info - device set info callback -------------------------------------------------*/ -void cpu_set_info(const device_config *device, UINT32 state, UINT64 value) +void cpu_set_info(running_device *device, UINT32 state, UINT64 value) { cpu_class_header *header = cpu_get_class_header(device); cpu_set_info_func set_info; @@ -631,7 +631,7 @@ void cpu_set_info(const device_config *device, UINT32 state, UINT64 value) if (header != NULL) set_info = header->set_info; else - set_info = (cpu_set_info_func)device_get_info_fct(device, CPUINFO_FCT_SET_INFO); + set_info = (cpu_set_info_func)device->get_config_fct(CPUINFO_FCT_SET_INFO); switch (state) { @@ -669,9 +669,59 @@ void cpu_set_info(const device_config *device, UINT32 state, UINT64 value) callback -------------------------------------------------*/ +static DEVICE_GET_RUNTIME_INFO( cpu ) +{ + const cpu_config *config = (device != NULL) ? (const cpu_config *)device->baseconfig().inline_config : NULL; + cpuinfo cinfo = { 0 }; + + /* if we don't have a device pointer, ignore everything else */ + if (device == NULL) + return; + + /* if we have a state pointer, we can handle some stuff for free */ + if (device->token != NULL) + { + const cpu_class_data *classdata = get_class_data(device); + if (classdata->state != NULL) + { + if (state >= CPUINFO_INT_REGISTER && state <= CPUINFO_INT_REGISTER_LAST) + { + info->i = get_register_value(device, classdata->state->baseptr, classdata->regstate[state - CPUINFO_INT_REGISTER]); + return; + } + else if (state >= CPUINFO_STR_REGISTER && state <= CPUINFO_STR_REGISTER_LAST) + { + cinfo.s = info->s; + get_register_string_value(device, classdata->state->baseptr, classdata->regstate[state - CPUINFO_STR_REGISTER], cinfo.s); + info->s = cinfo.s; + return; + } + } + } + + /* integer data */ + if (state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST) + { + cinfo.i = info->i; + (*config->type)(&device->baseconfig(), device, state, &cinfo); + info->i = cinfo.i; + } + + /* pointer data */ + else if ((state >= DEVINFO_PTR_FIRST && state <= DEVINFO_PTR_LAST) || + (state >= DEVINFO_FCT_FIRST && state <= DEVINFO_FCT_LAST) || + (state >= DEVINFO_STR_FIRST && state <= DEVINFO_STR_LAST)) + { + cinfo.p = info->p; + (*config->type)(&device->baseconfig(), device, state, &cinfo); + info->p = cinfo.p; + } +} + + DEVICE_GET_INFO( cpu ) { - const cpu_config *config = (device != NULL) ? (const cpu_config *)device->inline_config : NULL; + const cpu_config *config = (const cpu_config *)device->inline_config; cpuinfo cinfo = { 0 }; switch (state) @@ -679,7 +729,7 @@ DEVICE_GET_INFO( cpu ) /* --- the following bits of info are returned as 64-bit signed integers --- */ case DEVINFO_INT_TOKEN_BYTES: cinfo.i = 0; - (*config->type)(device, CPUINFO_INT_CONTEXT_SIZE, &cinfo); + (*config->type)(device, NULL, CPUINFO_INT_CONTEXT_SIZE, &cinfo); info->i = cinfo.i + sizeof(cpu_class_data) + sizeof(cpu_class_header); break; @@ -690,38 +740,14 @@ DEVICE_GET_INFO( cpu ) case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(cpu); break; case DEVINFO_FCT_STOP: info->stop = DEVICE_STOP_NAME(cpu); break; case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(cpu); break; + case DEVINFO_FCT_GET_RUNTIME_INFO: info->get_runtime_info = DEVICE_GET_RUNTIME_INFO_NAME(cpu); break; default: - /* if we don't have a device pointer, ignore everything else */ - if (device == NULL) - break; - - /* if we have a state pointer, we can handle some stuff for free */ - if (device->token != NULL) - { - const cpu_class_data *classdata = get_class_data(device); - if (classdata->state != NULL) - { - if (state >= CPUINFO_INT_REGISTER && state <= CPUINFO_INT_REGISTER_LAST) - { - info->i = get_register_value(device, classdata->state->baseptr, classdata->regstate[state - CPUINFO_INT_REGISTER]); - return; - } - else if (state >= CPUINFO_STR_REGISTER && state <= CPUINFO_STR_REGISTER_LAST) - { - cinfo.s = info->s; - get_register_string_value(device, classdata->state->baseptr, classdata->regstate[state - CPUINFO_STR_REGISTER], cinfo.s); - info->s = cinfo.s; - return; - } - } - } - /* integer data */ if (state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST) { cinfo.i = info->i; - (*config->type)(device, state, &cinfo); + (*config->type)(device, NULL, state, &cinfo); info->i = cinfo.i; } @@ -731,7 +757,7 @@ DEVICE_GET_INFO( cpu ) (state >= DEVINFO_STR_FIRST && state <= DEVINFO_STR_LAST)) { cinfo.p = info->p; - (*config->type)(device, state, &cinfo); + (*config->type)(device, NULL, state, &cinfo); info->p = cinfo.p; } break; @@ -749,7 +775,7 @@ DEVICE_GET_INFO( cpu ) given CPU -------------------------------------------------*/ -void cpu_suspend(const device_config *device, int reason, int eatcycles) +void cpu_suspend(running_device *device, int reason, int eatcycles) { cpu_class_data *classdata = get_class_data(device); @@ -767,7 +793,7 @@ void cpu_suspend(const device_config *device, int reason, int eatcycles) given CPU -------------------------------------------------*/ -void cpu_resume(const device_config *device, int reason) +void cpu_resume(running_device *device, int reason) { cpu_class_data *classdata = get_class_data(device); @@ -784,7 +810,7 @@ void cpu_resume(const device_config *device, int reason) CPU is within its execute function -------------------------------------------------*/ -int cpu_is_executing(const device_config *device) +int cpu_is_executing(running_device *device) { return (device == device->machine->cpuexec_data->executingcpu); } @@ -796,7 +822,7 @@ int cpu_is_executing(const device_config *device) reasons -------------------------------------------------*/ -int cpu_is_suspended(const device_config *device, int reason) +int cpu_is_suspended(running_device *device, int reason) { cpu_class_data *classdata = get_class_data(device); @@ -815,7 +841,7 @@ int cpu_is_suspended(const device_config *device, int reason) clock speed -------------------------------------------------*/ -int cpu_get_clock(const device_config *device) +int cpu_get_clock(running_device *device) { cpu_class_data *classdata; @@ -834,7 +860,7 @@ int cpu_get_clock(const device_config *device) clock speed -------------------------------------------------*/ -void cpu_set_clock(const device_config *device, int clock) +void cpu_set_clock(running_device *device, int clock) { cpu_class_data *classdata = get_class_data(device); @@ -849,7 +875,7 @@ void cpu_set_clock(const device_config *device, int clock) scaling factor for a CPU's clock speed -------------------------------------------------*/ -double cpu_get_clockscale(const device_config *device) +double cpu_get_clockscale(running_device *device) { cpu_class_data *classdata = get_class_data(device); @@ -863,7 +889,7 @@ double cpu_get_clockscale(const device_config *device) scaling factor for a CPU's clock speed -------------------------------------------------*/ -void cpu_set_clockscale(const device_config *device, double clockscale) +void cpu_set_clockscale(running_device *device, double clockscale) { cpu_class_data *classdata = get_class_data(device); @@ -878,7 +904,7 @@ void cpu_set_clockscale(const device_config *device, double clockscale) clock ticks to an attotime -------------------------------------------------*/ -attotime cpu_clocks_to_attotime(const device_config *device, UINT64 clocks) +attotime cpu_clocks_to_attotime(running_device *device, UINT64 clocks) { cpu_class_data *classdata = get_class_data(device); if (clocks < classdata->cycles_per_second) @@ -897,7 +923,7 @@ attotime cpu_clocks_to_attotime(const device_config *device, UINT64 clocks) as attotime to CPU clock ticks -------------------------------------------------*/ -UINT64 cpu_attotime_to_clocks(const device_config *device, attotime duration) +UINT64 cpu_attotime_to_clocks(running_device *device, attotime duration) { cpu_class_data *classdata = get_class_data(device); return mulu_32x32(duration.seconds, classdata->cycles_per_second) + (UINT64)duration.attoseconds / (UINT64)classdata->attoseconds_per_cycle; @@ -914,7 +940,7 @@ UINT64 cpu_attotime_to_clocks(const device_config *device, attotime duration) local time for a CPU -------------------------------------------------*/ -attotime cpu_get_local_time(const device_config *device) +attotime cpu_get_local_time(running_device *device) { cpu_class_data *classdata = get_class_data(device); attotime result; @@ -951,7 +977,7 @@ attotime cpuexec_override_local_time(running_machine *machine, attotime default_ CPU -------------------------------------------------*/ -UINT64 cpu_get_total_cycles(const device_config *device) +UINT64 cpu_get_total_cycles(running_device *device) { cpu_class_data *classdata = get_class_data(device); @@ -967,7 +993,7 @@ UINT64 cpu_get_total_cycles(const device_config *device) we don't cross a timeslice boundary -------------------------------------------------*/ -void cpu_eat_cycles(const device_config *device, int cycles) +void cpu_eat_cycles(running_device *device, int cycles) { cpu_class_data *classdata = get_class_data(device); @@ -986,7 +1012,7 @@ void cpu_eat_cycles(const device_config *device, int cycles) icount -------------------------------------------------*/ -void cpu_adjust_icount(const device_config *device, int delta) +void cpu_adjust_icount(running_device *device, int delta) { cpu_class_data *classdata = get_class_data(device); @@ -1004,7 +1030,7 @@ void cpu_adjust_icount(const device_config *device, int delta) CPUs to run before we run again -------------------------------------------------*/ -void cpu_abort_timeslice(const device_config *device) +void cpu_abort_timeslice(running_device *device) { cpu_class_data *classdata = get_class_data(device); int delta; @@ -1034,7 +1060,7 @@ void cpu_abort_timeslice(const device_config *device) of the current timeslice -------------------------------------------------*/ -void cpu_yield(const device_config *device) +void cpu_yield(running_device *device) { /* suspend against the timeslice */ cpu_suspend(device, SUSPEND_REASON_TIMESLICE, FALSE); @@ -1046,7 +1072,7 @@ void cpu_yield(const device_config *device) is up -------------------------------------------------*/ -void cpu_spin(const device_config *device) +void cpu_spin(running_device *device) { /* suspend against the timeslice */ cpu_suspend(device, SUSPEND_REASON_TIMESLICE, TRUE); @@ -1058,7 +1084,7 @@ void cpu_spin(const device_config *device) cycles until a timer trigger -------------------------------------------------*/ -void cpu_spinuntil_trigger(const device_config *device, int trigger) +void cpu_spinuntil_trigger(running_device *device, int trigger) { /* suspend until the given trigger fires */ suspend_until_trigger(device, trigger, TRUE); @@ -1070,7 +1096,7 @@ void cpu_spinuntil_trigger(const device_config *device, int trigger) next interrupt -------------------------------------------------*/ -void cpu_spinuntil_int(const device_config *device) +void cpu_spinuntil_int(running_device *device) { cpu_class_data *classdata = get_class_data(device); @@ -1084,7 +1110,7 @@ void cpu_spinuntil_int(const device_config *device) specific period of time -------------------------------------------------*/ -void cpu_spinuntil_time(const device_config *device, attotime duration) +void cpu_spinuntil_time(running_device *device, attotime duration) { static int timetrig = 0; @@ -1108,7 +1134,7 @@ void cpu_spinuntil_time(const device_config *device, attotime duration) void cpuexec_trigger(running_machine *machine, int trigger) { - const device_config *cpu; + running_device *cpu; /* look for suspended CPUs waiting for this trigger and unsuspend them */ for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) @@ -1144,7 +1170,7 @@ void cpuexec_triggertime(running_machine *machine, int trigger, attotime duratio corresponding to an interrupt on the given CPU -------------------------------------------------*/ -void cpu_triggerint(const device_config *device) +void cpu_triggerint(running_device *device) { cpu_class_data *classdata = get_class_data(device); @@ -1164,7 +1190,7 @@ void cpu_triggerint(const device_config *device) on a CPU -------------------------------------------------*/ -void cpu_set_input_line(const device_config *device, int line, int state) +void cpu_set_input_line(running_device *device, int line, int state) { cpu_class_data *classdata = get_class_data(device); int vector = (line >= 0 && line < MAX_INPUT_LINES) ? classdata->input[line].vector : 0xff; @@ -1178,7 +1204,7 @@ void cpu_set_input_line(const device_config *device, int line, int state) acknowledge cycle -------------------------------------------------*/ -void cpu_set_input_line_vector(const device_config *device, int line, int vector) +void cpu_set_input_line_vector(running_device *device, int line, int vector) { cpu_class_data *classdata = get_class_data(device); if (line >= 0 && line < MAX_INPUT_LINES) @@ -1196,7 +1222,7 @@ void cpu_set_input_line_vector(const device_config *device, int line, int vector line on a CPU and its associated vector -------------------------------------------------*/ -void cpu_set_input_line_and_vector(const device_config *device, int line, int state, int vector) +void cpu_set_input_line_and_vector(running_device *device, int line, int state, int vector) { cpu_class_data *classdata = get_class_data(device); @@ -1239,7 +1265,7 @@ void cpu_set_input_line_and_vector(const device_config *device, int line, int st specific callback for IRQ acknowledge -------------------------------------------------*/ -void cpu_set_irq_callback(const device_config *device, cpu_irq_callback callback) +void cpu_set_irq_callback(running_device *device, cpu_irq_callback callback) { cpu_class_data *classdata = get_class_data(device); classdata->driver_irq = callback; @@ -1256,7 +1282,7 @@ void cpu_set_irq_callback(const device_config *device, cpu_irq_callback callback interrupt counter (deprecated) -------------------------------------------------*/ -int cpu_getiloops(const device_config *device) +int cpu_getiloops(running_device *device) { cpu_class_data *classdata = get_class_data(device); return classdata->iloops; @@ -1273,7 +1299,7 @@ int cpu_getiloops(const device_config *device) information for the specified CPU -------------------------------------------------*/ -static void update_clock_information(const device_config *device) +static void update_clock_information(running_device *device) { cpu_class_data *classdata = get_class_data(device); INT64 attos; @@ -1304,12 +1330,12 @@ static void update_clock_information(const device_config *device) static void compute_perfect_interleave(running_machine *machine) { - const device_config *firstcpu = machine->firstcpu; + running_device *firstcpu = machine->firstcpu; if (firstcpu != NULL) { attoseconds_t smallest = get_minimum_quantum(firstcpu); attoseconds_t perfect = ATTOSECONDS_PER_SECOND - 1; - const device_config *cpu; + running_device *cpu; /* start with a huge time factor and find the 2nd smallest cycle time */ for (cpu = cpu_next(firstcpu); cpu != NULL; cpu = cpu_next(cpu)) @@ -1339,17 +1365,17 @@ static void compute_perfect_interleave(running_machine *machine) for this screen -------------------------------------------------*/ -static void on_vblank(const device_config *device, void *param, int vblank_state) +static void on_vblank(running_device *device, void *param, int vblank_state) { /* VBLANK starting */ if (vblank_state) { - const device_config *cpu; + running_device *cpu; /* find any CPUs that have this screen as their VBLANK interrupt source */ for (cpu = device->machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) { - const cpu_config *config = (const cpu_config *)cpu->inline_config; + const cpu_config *config = (const cpu_config *)cpu->baseconfig().inline_config; cpu_class_data *classdata = get_class_data(cpu); int cpu_interested; @@ -1396,8 +1422,8 @@ static void on_vblank(const device_config *device, void *param, int vblank_state static TIMER_CALLBACK( trigger_partial_frame_interrupt ) { - const device_config *device = (const device_config *)ptr; - const cpu_config *config = (const cpu_config *)device->inline_config; + running_device *device = (running_device *)ptr; + const cpu_config *config = (const cpu_config *)device->baseconfig().inline_config; cpu_class_data *classdata = get_class_data(device); if (classdata->iloops == 0) @@ -1422,8 +1448,8 @@ static TIMER_CALLBACK( trigger_partial_frame_interrupt ) static TIMER_CALLBACK( trigger_periodic_interrupt ) { - const device_config *device = (const device_config *)ptr; - const cpu_config *config = (const cpu_config *)device->inline_config; + running_device *device = (running_device *)ptr; + const cpu_config *config = (const cpu_config *)device->baseconfig().inline_config; /* bail if there is no routine */ if (config->timed_interrupt != NULL && !cpu_is_suspended(device, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) @@ -1448,7 +1474,7 @@ static TIMER_CALLBACK( triggertime_callback ) static TIMER_CALLBACK( empty_event_queue ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; cpu_class_data *classdata = get_class_data(device); cpu_input_data *inputline = &classdata->input[param]; int curevent; @@ -1569,7 +1595,7 @@ static IRQ_CALLBACK( standard_irq_callback ) specific save states -------------------------------------------------*/ -static void register_save_states(const device_config *device) +static void register_save_states(running_device *device) { cpu_class_data *classdata = get_class_data(device); int line; @@ -1607,7 +1633,7 @@ static void register_save_states(const device_config *device) static void rebuild_execute_list(running_machine *machine) { cpuexec_private *global = machine->cpuexec_data; - const device_config *curcpu; + running_device *curcpu; cpu_class_data **tailptr; /* start with an empty list */ @@ -1645,7 +1671,7 @@ static void rebuild_execute_list(running_machine *machine) of a CPU using the state table -------------------------------------------------*/ -static UINT64 get_register_value(const device_config *device, void *baseptr, const cpu_state_entry *entry) +static UINT64 get_register_value(running_device *device, void *baseptr, const cpu_state_entry *entry) { void *dataptr; UINT64 result; @@ -1657,7 +1683,7 @@ static UINT64 get_register_value(const device_config *device, void *baseptr, con /* if we have an exporter, call it now */ if ((entry->flags & CPUSTATE_EXPORT) != 0) { - cpu_state_io_func exportcb = (cpu_state_io_func)device_get_info_fct(device, CPUINFO_FCT_EXPORT_STATE); + cpu_state_io_func exportcb = (cpu_state_io_func)device->get_config_fct(CPUINFO_FCT_EXPORT_STATE); assert(exportcb != NULL); (*exportcb)(device, baseptr, entry); } @@ -1681,7 +1707,7 @@ static UINT64 get_register_value(const device_config *device, void *baseptr, con CPU register using the state table -------------------------------------------------*/ -static void set_register_value(const device_config *device, void *baseptr, const cpu_state_entry *entry, UINT64 value) +static void set_register_value(running_device *device, void *baseptr, const cpu_state_entry *entry, UINT64 value) { void *dataptr; @@ -1710,7 +1736,7 @@ static void set_register_value(const device_config *device, void *baseptr, const /* if we have an importer, call it now */ if ((entry->flags & CPUSTATE_IMPORT) != 0) { - cpu_state_io_func importcb = (cpu_state_io_func)device_get_info_fct(device, CPUINFO_FCT_IMPORT_STATE); + cpu_state_io_func importcb = (cpu_state_io_func)device->get_config_fct(CPUINFO_FCT_IMPORT_STATE); assert(importcb != NULL); (*importcb)(device, baseptr, entry); } @@ -1723,7 +1749,7 @@ static void set_register_value(const device_config *device, void *baseptr, const state table -------------------------------------------------*/ -static void get_register_string_value(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *dest) +static void get_register_string_value(running_device *device, void *baseptr, const cpu_state_entry *entry, char *dest) { static const UINT64 decdivisor[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, @@ -1861,7 +1887,7 @@ static void get_register_string_value(const device_config *device, void *baseptr /* s is a custom format */ case 's': { - cpu_string_io_func exportstring = (cpu_string_io_func)device_get_info_fct(device, CPUINFO_FCT_EXPORT_STRING); + cpu_string_io_func exportstring = (cpu_string_io_func)device->get_config_fct(CPUINFO_FCT_EXPORT_STRING); assert(exportstring != NULL); (*exportstring)(device, baseptr, entry, dest); dest += strlen(dest); @@ -1885,7 +1911,7 @@ static void get_register_string_value(const device_config *device, void *baseptr -------------------------------------------------*/ #ifdef UNUSED_FUNCTION -static int get_register_string_max_width(const device_config *device, void *baseptr, const cpu_state_entry *entry) +static int get_register_string_max_width(running_device *device, void *baseptr, const cpu_state_entry *entry) { int leadzero = 0, width = 0, percent = 0, explicitsign = 0, reset; int totalwidth = 0; diff --git a/src/emu/cpuexec.h b/src/emu/cpuexec.h index ce0cc13ee27..4acf3d1e0a9 100644 --- a/src/emu/cpuexec.h +++ b/src/emu/cpuexec.h @@ -55,7 +55,7 @@ typedef struct _cpu_debug_data cpu_debug_data; /* interrupt callback for VBLANK and timed interrupts */ -typedef void (*cpu_interrupt_func)(const device_config *device); +typedef void (*cpu_interrupt_func)(running_device *device); /* CPU description for drivers */ @@ -134,7 +134,7 @@ struct _cpu_class_header MACROS ***************************************************************************/ -#define INTERRUPT_GEN(func) void func(const device_config *device) +#define INTERRUPT_GEN(func) void func(running_device *device) /* helpers for using machine/cputag instead of cpu objects */ #define cputag_get_address_space(mach, tag, spc) (mach)->device(tag)->space(spc) @@ -191,76 +191,76 @@ const char *cpuexec_describe_context(running_machine *machine); /* ----- CPU scheduling----- */ /* suspend the given CPU for a specific reason */ -void cpu_suspend(const device_config *device, int reason, int eatcycles); +void cpu_suspend(running_device *device, int reason, int eatcycles); /* resume the given CPU for a specific reason */ -void cpu_resume(const device_config *device, int reason); +void cpu_resume(running_device *device, int reason); /* return TRUE if the given CPU is within its execute function */ -int cpu_is_executing(const device_config *device); +int cpu_is_executing(running_device *device); /* returns TRUE if the given CPU is suspended for any of the given reasons */ -int cpu_is_suspended(const device_config *device, int reason); +int cpu_is_suspended(running_device *device, int reason); /* ----- CPU clock management ----- */ /* returns the current CPU's unscaled running clock speed */ -int cpu_get_clock(const device_config *device); +int cpu_get_clock(running_device *device); /* sets the current CPU's clock speed and then adjusts for scaling */ -void cpu_set_clock(const device_config *device, int clock); +void cpu_set_clock(running_device *device, int clock); /* returns the current scaling factor for a CPU's clock speed */ -double cpu_get_clockscale(const device_config *device); +double cpu_get_clockscale(running_device *device); /* sets the current scaling factor for a CPU's clock speed */ -void cpu_set_clockscale(const device_config *device, double clockscale); +void cpu_set_clockscale(running_device *device, double clockscale); /* converts a number of clock ticks to an attotime */ -attotime cpu_clocks_to_attotime(const device_config *device, UINT64 clocks); +attotime cpu_clocks_to_attotime(running_device *device, UINT64 clocks); /* converts a duration as attotime to CPU clock ticks */ -UINT64 cpu_attotime_to_clocks(const device_config *device, attotime duration); +UINT64 cpu_attotime_to_clocks(running_device *device, attotime duration); /* ----- CPU timing ----- */ /* returns the current local time for a CPU */ -attotime cpu_get_local_time(const device_config *device); +attotime cpu_get_local_time(running_device *device); /* returns the total number of CPU cycles for a given CPU */ -UINT64 cpu_get_total_cycles(const device_config *device); +UINT64 cpu_get_total_cycles(running_device *device); /* safely eats cycles so we don't cross a timeslice boundary */ -void cpu_eat_cycles(const device_config *device, int cycles); +void cpu_eat_cycles(running_device *device, int cycles); /* apply a +/- to the current icount */ -void cpu_adjust_icount(const device_config *device, int delta); +void cpu_adjust_icount(running_device *device, int delta); /* abort execution for the current timeslice, allowing other CPUs to run before we run again */ -void cpu_abort_timeslice(const device_config *device); +void cpu_abort_timeslice(running_device *device); /* ----- synchronization helpers ----- */ /* yield the given CPU until the end of the current timeslice */ -void cpu_yield(const device_config *device); +void cpu_yield(running_device *device); /* burn CPU cycles until the end of the current timeslice */ -void cpu_spin(const device_config *device); +void cpu_spin(running_device *device); /* burn specified CPU cycles until a trigger */ -void cpu_spinuntil_trigger(const device_config *device, int trigger); +void cpu_spinuntil_trigger(running_device *device, int trigger); /* burn CPU cycles until the next interrupt */ -void cpu_spinuntil_int(const device_config *device); +void cpu_spinuntil_int(running_device *device); /* burn CPU cycles for a specific period of time */ -void cpu_spinuntil_time(const device_config *device, attotime duration); +void cpu_spinuntil_time(running_device *device, attotime duration); @@ -273,23 +273,23 @@ void cpuexec_trigger(running_machine *machine, int trigger); void cpuexec_triggertime(running_machine *machine, int trigger, attotime duration); /* generate a trigger corresponding to an interrupt on the given CPU */ -void cpu_triggerint(const device_config *device); +void cpu_triggerint(running_device *device); /* ----- interrupts ----- */ /* set the logical state (ASSERT_LINE/CLEAR_LINE) of the an input line on a CPU */ -void cpu_set_input_line(const device_config *cpu, int line, int state); +void cpu_set_input_line(running_device *cpu, int line, int state); /* set the vector to be returned during a CPU's interrupt acknowledge cycle */ -void cpu_set_input_line_vector(const device_config *cpu, int irqline, int vector); +void cpu_set_input_line_vector(running_device *cpu, int irqline, int vector); /* set the logical state (ASSERT_LINE/CLEAR_LINE) of the an input line on a CPU and its associated vector */ -void cpu_set_input_line_and_vector(const device_config *cpu, int line, int state, int vector); +void cpu_set_input_line_and_vector(running_device *cpu, int line, int state, int vector); /* install a driver-specific callback for IRQ acknowledge */ -void cpu_set_irq_callback(const device_config *cpu, cpu_irq_callback callback); +void cpu_set_irq_callback(running_device *cpu, cpu_irq_callback callback); @@ -302,9 +302,9 @@ void cpu_set_irq_callback(const device_config *cpu, cpu_irq_callback callback); specified CPU -------------------------------------------------*/ -INLINE cpu_type cpu_get_type(const device_config *device) +INLINE cpu_type cpu_get_type(running_device *device) { - const cpu_config *config = (const cpu_config *)device->inline_config; + const cpu_config *config = (const cpu_config *)device->baseconfig().inline_config; return config->type; } @@ -314,7 +314,7 @@ INLINE cpu_type cpu_get_type(const device_config *device) the class header -------------------------------------------------*/ -INLINE cpu_class_header *cpu_get_class_header(const device_config *device) +INLINE cpu_class_header *cpu_get_class_header(running_device *device) { if (device->token != NULL) return (cpu_class_header *)((UINT8 *)device->token + device->tokenbytes) - 1; @@ -327,7 +327,7 @@ INLINE cpu_class_header *cpu_get_class_header(const device_config *device) the given CPU's debugger data -------------------------------------------------*/ -INLINE cpu_debug_data *cpu_get_debug_data(const device_config *device) +INLINE cpu_debug_data *cpu_get_debug_data(running_device *device) { cpu_class_header *classheader = cpu_get_class_header(device); return classheader->debug; @@ -339,7 +339,7 @@ INLINE cpu_debug_data *cpu_get_debug_data(const device_config *device) the given CPU's address space -------------------------------------------------*/ -INLINE const address_space *cpu_get_address_space(const device_config *device, int spacenum) +INLINE const address_space *cpu_get_address_space(running_device *device, int spacenum) { return device->space(spacenum); } diff --git a/src/emu/cpuintrf.h b/src/emu/cpuintrf.h index 2609c2dfb04..eeaa14e3c44 100644 --- a/src/emu/cpuintrf.h +++ b/src/emu/cpuintrf.h @@ -154,23 +154,23 @@ enum CPUINFO_FCT_FIRST = DEVINFO_FCT_FIRST, /* CPU-specific additions */ - CPUINFO_FCT_SET_INFO = DEVINFO_FCT_CLASS_SPECIFIC, /* R/O: void (*set_info)(const device_config *device, UINT32 state, INT64 data, void *ptr) */ - CPUINFO_FCT_INIT, /* R/O: void (*init)(const device_config *device, int index, int clock, int (*irqcallback)(const device_config *device, int)) */ - CPUINFO_FCT_RESET, /* R/O: void (*reset)(const device_config *device) */ - CPUINFO_FCT_EXIT, /* R/O: void (*exit)(const device_config *device) */ - CPUINFO_FCT_EXECUTE, /* R/O: int (*execute)(const device_config *device, int cycles) */ - CPUINFO_FCT_BURN, /* R/O: void (*burn)(const device_config *device, int cycles) */ - CPUINFO_FCT_DISASSEMBLE, /* R/O: offs_t (*disassemble)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) */ - CPUINFO_FCT_TRANSLATE, /* R/O: int (*translate)(const device_config *device, int space, int intention, offs_t *address) */ - CPUINFO_FCT_READ, /* R/O: int (*read)(const device_config *device, int space, UINT32 offset, int size, UINT64 *value) */ - CPUINFO_FCT_WRITE, /* R/O: int (*write)(const device_config *device, int space, UINT32 offset, int size, UINT64 value) */ - CPUINFO_FCT_READOP, /* R/O: int (*readop)(const device_config *device, UINT32 offset, int size, UINT64 *value) */ - CPUINFO_FCT_DEBUG_INIT, /* R/O: void (*debug_init)(const device_config *device) */ + CPUINFO_FCT_SET_INFO = DEVINFO_FCT_CLASS_SPECIFIC, /* R/O: void (*set_info)(running_device *device, UINT32 state, INT64 data, void *ptr) */ + CPUINFO_FCT_INIT, /* R/O: void (*init)(running_device *device, int index, int clock, int (*irqcallback)(running_device *device, int)) */ + CPUINFO_FCT_RESET, /* R/O: void (*reset)(running_device *device) */ + CPUINFO_FCT_EXIT, /* R/O: void (*exit)(running_device *device) */ + CPUINFO_FCT_EXECUTE, /* R/O: int (*execute)(running_device *device, int cycles) */ + CPUINFO_FCT_BURN, /* R/O: void (*burn)(running_device *device, int cycles) */ + CPUINFO_FCT_DISASSEMBLE, /* R/O: offs_t (*disassemble)(running_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) */ + CPUINFO_FCT_TRANSLATE, /* R/O: int (*translate)(running_device *device, int space, int intention, offs_t *address) */ + CPUINFO_FCT_READ, /* R/O: int (*read)(running_device *device, int space, UINT32 offset, int size, UINT64 *value) */ + CPUINFO_FCT_WRITE, /* R/O: int (*write)(running_device *device, int space, UINT32 offset, int size, UINT64 value) */ + CPUINFO_FCT_READOP, /* R/O: int (*readop)(running_device *device, UINT32 offset, int size, UINT64 *value) */ + CPUINFO_FCT_DEBUG_INIT, /* R/O: void (*debug_init)(running_device *device) */ CPUINFO_FCT_VALIDITY_CHECK, /* R/O: int (*validity_check)(const game_driver *driver, const void *config) */ - CPUINFO_FCT_IMPORT_STATE, /* R/O: void (*import_state)(const device_config *device, void *baseptr, const cpu_state_entry *entry) */ - CPUINFO_FCT_EXPORT_STATE, /* R/O: void (*export_state)(const device_config *device, void *baseptr, const cpu_state_entry *entry) */ - CPUINFO_FCT_IMPORT_STRING, /* R/O: void (*import_string)(const device_config *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string) */ - CPUINFO_FCT_EXPORT_STRING, /* R/O: void (*export_string)(const device_config *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string) */ + CPUINFO_FCT_IMPORT_STATE, /* R/O: void (*import_state)(running_device *device, void *baseptr, const cpu_state_entry *entry) */ + CPUINFO_FCT_EXPORT_STATE, /* R/O: void (*export_state)(running_device *device, void *baseptr, const cpu_state_entry *entry) */ + CPUINFO_FCT_IMPORT_STRING, /* R/O: void (*import_string)(running_device *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string) */ + CPUINFO_FCT_EXPORT_STRING, /* R/O: void (*export_string)(running_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 */ @@ -228,64 +228,64 @@ enum #define cpu_count(config) (config)->devicelist.count(CPU) #define cpu_first(config) (config)->devicelist.first(CPU) #define cpu_next(previous) (previous)->typenext() -#define cpu_get_index(cpu) (cpu)->machine->config->devicelist.index(CPU, (cpu)->tag) +#define cpu_get_index(cpu) (cpu)->machine->devicelist.index(CPU, (cpu)->tag) /* IRQ callback to be called by CPU cores when an IRQ is actually taken */ -#define IRQ_CALLBACK(func) int func(const device_config *device, int irqline) +#define IRQ_CALLBACK(func) int func(running_device *device, int irqline) /* 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 *device, UINT32 state, cpuinfo *info) -#define CPU_GET_INFO_CALL(name) CPU_GET_INFO_NAME(name)(device, state, info) +#define CPU_GET_INFO(name) void CPU_GET_INFO_NAME(name)(const device_config *devconfig, running_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)(const device_config *device, UINT32 state, cpuinfo *info) +#define CPU_SET_INFO(name) void CPU_SET_INFO_NAME(name)(running_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)(const device_config *device, cpu_irq_callback irqcallback) +#define CPU_INIT(name) void CPU_INIT_NAME(name)(running_device *device, cpu_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)(const device_config *device) +#define CPU_RESET(name) void CPU_RESET_NAME(name)(running_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)(const device_config *device) +#define CPU_EXIT(name) void CPU_EXIT_NAME(name)(running_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)(const device_config *device, int cycles) +#define CPU_EXECUTE(name) int CPU_EXECUTE_NAME(name)(running_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)(const device_config *device, int cycles) +#define CPU_BURN(name) void CPU_BURN_NAME(name)(running_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)(const device_config *device, int space, int intention, offs_t *address) +#define CPU_TRANSLATE(name) int CPU_TRANSLATE_NAME(name)(running_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)(const device_config *device, int space, UINT32 offset, int size, UINT64 *value) +#define CPU_READ(name) int CPU_READ_NAME(name)(running_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)(const device_config *device, int space, UINT32 offset, int size, UINT64 value) +#define CPU_WRITE(name) int CPU_WRITE_NAME(name)(running_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)(const device_config *device, UINT32 offset, int size, UINT64 *value) +#define CPU_READOP(name) int CPU_READOP_NAME(name)(running_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)(const device_config *device) +#define CPU_DEBUG_INIT(name) void CPU_DEBUG_INIT_NAME(name)(running_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)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) +#define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(running_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_VALIDITY_CHECK_NAME(name) cpu_validity_check_##name @@ -293,19 +293,19 @@ enum #define CPU_VALIDITY_CHECK_CALL(name) CPU_VALIDITY_CHECK_NAME(name)(driver, config) #define CPU_IMPORT_STATE_NAME(name) cpu_state_import_##name -#define CPU_IMPORT_STATE(name) void CPU_IMPORT_STATE_NAME(name)(const device_config *device, void *baseptr, const cpu_state_entry *entry) +#define CPU_IMPORT_STATE(name) void CPU_IMPORT_STATE_NAME(name)(running_device *device, void *baseptr, const cpu_state_entry *entry) #define CPU_IMPORT_STATE_CALL(name) CPU_IMPORT_STATE_NAME(name)(device, baseptr, entry) #define CPU_EXPORT_STATE_NAME(name) cpu_state_export_##name -#define CPU_EXPORT_STATE(name) void CPU_EXPORT_STATE_NAME(name)(const device_config *device, void *baseptr, const cpu_state_entry *entry) +#define CPU_EXPORT_STATE(name) void CPU_EXPORT_STATE_NAME(name)(running_device *device, void *baseptr, const cpu_state_entry *entry) #define CPU_EXPORT_STATE_CALL(name) CPU_EXPORT_STATE_NAME(name)(device, baseptr, entry) #define CPU_IMPORT_STRING_NAME(name) cpu_string_import_##name -#define CPU_IMPORT_STRING(name) void CPU_IMPORT_STRING_NAME(name)(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *string) +#define CPU_IMPORT_STRING(name) void CPU_IMPORT_STRING_NAME(name)(running_device *device, void *baseptr, const cpu_state_entry *entry, char *string) #define CPU_IMPORT_STRING_CALL(name) CPU_IMPORT_STRING_NAME(name)(device, baseptr, entry, string) #define CPU_EXPORT_STRING_NAME(name) cpu_string_export_##name -#define CPU_EXPORT_STRING(name) void CPU_EXPORT_STRING_NAME(name)(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *string) +#define CPU_EXPORT_STRING(name) void CPU_EXPORT_STRING_NAME(name)(running_device *device, void *baseptr, const cpu_state_entry *entry, char *string) #define CPU_EXPORT_STRING_CALL(name) CPU_EXPORT_STRING_NAME(name)(device, baseptr, entry, string) @@ -315,41 +315,30 @@ enum /* helpers for accessing common CPU state */ -#define cpu_get_context_size(cpu) device_get_info_int(cpu, CPUINFO_INT_CONTEXT_SIZE) -#define cpu_get_input_lines(cpu) device_get_info_int(cpu, CPUINFO_INT_INPUT_LINES) -#define cpu_get_output_lines(cpu) device_get_info_int(cpu, CPUINFO_INT_OUTPUT_LINES) -#define cpu_get_default_irq_vector(cpu) device_get_info_int(cpu, CPUINFO_INT_DEFAULT_IRQ_VECTOR) -#define cpu_get_clock_multiplier(cpu) device_get_info_int(cpu, CPUINFO_INT_CLOCK_MULTIPLIER) -#define cpu_get_clock_divider(cpu) device_get_info_int(cpu, CPUINFO_INT_CLOCK_DIVIDER) -#define cpu_get_min_opcode_bytes(cpu) device_get_info_int(cpu, CPUINFO_INT_MIN_INSTRUCTION_BYTES) -#define cpu_get_max_opcode_bytes(cpu) device_get_info_int(cpu, CPUINFO_INT_MAX_INSTRUCTION_BYTES) -#define cpu_get_min_cycles(cpu) device_get_info_int(cpu, CPUINFO_INT_MIN_CYCLES) -#define cpu_get_max_cycles(cpu) device_get_info_int(cpu, CPUINFO_INT_MAX_CYCLES) -#define cpu_get_logaddr_width(cpu, space) device_get_info_int(cpu, CPUINFO_INT_LOGADDR_WIDTH + (space)) -#define cpu_get_page_shift(cpu, space) device_get_info_int(cpu, CPUINFO_INT_PAGE_SHIFT + (space)) -#define cpu_get_reg(cpu, reg) device_get_info_int(cpu, CPUINFO_INT_REGISTER + (reg)) +#define cpu_get_context_size(cpu) (cpu)->get_config_int(CPUINFO_INT_CONTEXT_SIZE) +#define cpu_get_input_lines(cpu) (cpu)->get_config_int(CPUINFO_INT_INPUT_LINES) +#define cpu_get_output_lines(cpu) (cpu)->get_config_int(CPUINFO_INT_OUTPUT_LINES) +#define cpu_get_default_irq_vector(cpu) (cpu)->get_config_int(CPUINFO_INT_DEFAULT_IRQ_VECTOR) +#define cpu_get_clock_multiplier(cpu) (cpu)->get_config_int(CPUINFO_INT_CLOCK_MULTIPLIER) +#define cpu_get_clock_divider(cpu) (cpu)->get_config_int(CPUINFO_INT_CLOCK_DIVIDER) +#define cpu_get_min_opcode_bytes(cpu) (cpu)->get_config_int(CPUINFO_INT_MIN_INSTRUCTION_BYTES) +#define cpu_get_max_opcode_bytes(cpu) (cpu)->get_config_int(CPUINFO_INT_MAX_INSTRUCTION_BYTES) +#define cpu_get_min_cycles(cpu) (cpu)->get_config_int(CPUINFO_INT_MIN_CYCLES) +#define cpu_get_max_cycles(cpu) (cpu)->get_config_int(CPUINFO_INT_MAX_CYCLES) +#define cpu_get_logaddr_width(cpu, space) (cpu)->get_config_int(CPUINFO_INT_LOGADDR_WIDTH + (space)) +#define cpu_get_page_shift(cpu, space) (cpu)->get_config_int(CPUINFO_INT_PAGE_SHIFT + (space)) +#define cpu_get_reg(cpu, reg) (cpu)->get_runtime_int(CPUINFO_INT_REGISTER + (reg)) #define cpu_get_previouspc(cpu) ((offs_t)cpu_get_reg(cpu, REG_GENPCBASE)) #define cpu_get_pc(cpu) ((offs_t)cpu_get_reg(cpu, REG_GENPC)) #define cpu_get_sp(cpu) cpu_get_reg(cpu, REG_GENSP) -#define cpu_get_icount_ptr(cpu) (int *)device_get_info_ptr(cpu, CPUINFO_PTR_INSTRUCTION_COUNTER) -#define cpu_get_state_table(cpu) (const cpu_state_table *)device_get_info_ptr(cpu, CPUINFO_PTR_STATE_TABLE) -#define cpu_get_flags_string(cpu) device_get_info_string(cpu, CPUINFO_STR_FLAGS) -#define cpu_get_irq_string(cpu, irq) device_get_info_string(cpu, CPUINFO_STR_IRQ_STATE + (irq)) -#define cpu_get_reg_string(cpu, reg) device_get_info_string(cpu, CPUINFO_STR_REGISTER + (reg)) +#define cpu_get_icount_ptr(cpu) (int *)(cpu)->get_runtime_ptr(CPUINFO_PTR_INSTRUCTION_COUNTER) +#define cpu_get_state_table(cpu) (const cpu_state_table *)(cpu)->get_runtime_ptr(CPUINFO_PTR_STATE_TABLE) +#define cpu_get_flags_string(cpu) (cpu)->get_runtime_string(CPUINFO_STR_FLAGS) +#define cpu_get_irq_string(cpu, irq) (cpu)->get_runtime_string(CPUINFO_STR_IRQ_STATE + (irq)) +#define cpu_get_reg_string(cpu, reg) (cpu)->get_runtime_string(CPUINFO_STR_REGISTER + (reg)) #define cpu_set_reg(cpu, reg, val) cpu_set_info(cpu, CPUINFO_INT_REGISTER + (reg), (val)) -/* helpers that map directly to device helpers */ -#define cpu_get_endianness(cpu) device_get_endianness(cpu) -#define cpu_get_databus_width(cpu, space) device_get_databus_width(cpu, space) -#define cpu_get_addrbus_width(cpu, space) device_get_addrbus_width(cpu, space) -#define cpu_get_addrbus_shift(cpu, space) device_get_addrbus_shift(cpu, space) -#define cpu_get_name(cpu) device_get_name(cpu) -#define cpu_get_core_family(cpu) device_get_family(cpu) -#define cpu_get_core_version(cpu) device_get_version(cpu) -#define cpu_get_core_file(cpu) device_get_source_file(cpu) -#define cpu_get_core_credits(cpu) device_get_credits(cpu) - /*************************************************************************** @@ -362,26 +351,26 @@ typedef struct _cpu_state_entry cpu_state_entry; /* IRQ callback to be called by CPU cores when an IRQ is actually taken */ -typedef int (*cpu_irq_callback)(const device_config *device, int irqnum); +typedef int (*cpu_irq_callback)(running_device *device, int irqnum); /* CPU interface functions */ -typedef void (*cpu_get_info_func)(const device_config *device, UINT32 state, cpuinfo *info); -typedef void (*cpu_set_info_func)(const device_config *device, UINT32 state, cpuinfo *info); -typedef void (*cpu_init_func)(const device_config *device, cpu_irq_callback irqcallback); -typedef void (*cpu_reset_func)(const device_config *device); -typedef void (*cpu_exit_func)(const device_config *device); -typedef int (*cpu_execute_func)(const device_config *device, int cycles); -typedef void (*cpu_burn_func)(const device_config *device, int cycles); -typedef int (*cpu_translate_func)(const device_config *device, int space, int intention, offs_t *address); -typedef int (*cpu_read_func)(const device_config *device, int space, UINT32 offset, int size, UINT64 *value); -typedef int (*cpu_write_func)(const device_config *device, int space, UINT32 offset, int size, UINT64 value); -typedef int (*cpu_readop_func)(const device_config *device, UINT32 offset, int size, UINT64 *value); -typedef void (*cpu_debug_init_func)(const device_config *device); -typedef offs_t (*cpu_disassemble_func)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); +typedef void (*cpu_get_info_func)(const device_config *devconfig, running_device *device, UINT32 state, cpuinfo *info); +typedef void (*cpu_set_info_func)(running_device *device, UINT32 state, cpuinfo *info); +typedef void (*cpu_init_func)(running_device *device, cpu_irq_callback irqcallback); +typedef void (*cpu_reset_func)(running_device *device); +typedef void (*cpu_exit_func)(running_device *device); +typedef int (*cpu_execute_func)(running_device *device, int cycles); +typedef void (*cpu_burn_func)(running_device *device, int cycles); +typedef int (*cpu_translate_func)(running_device *device, int space, int intention, offs_t *address); +typedef int (*cpu_read_func)(running_device *device, int space, UINT32 offset, int size, UINT64 *value); +typedef int (*cpu_write_func)(running_device *device, int space, UINT32 offset, int size, UINT64 value); +typedef int (*cpu_readop_func)(running_device *device, UINT32 offset, int size, UINT64 *value); +typedef void (*cpu_debug_init_func)(running_device *device); +typedef offs_t (*cpu_disassemble_func)(running_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); typedef int (*cpu_validity_check_func)(const game_driver *driver, const void *config); -typedef void (*cpu_state_io_func)(const device_config *device, void *baseptr, const cpu_state_entry *entry); -typedef void (*cpu_string_io_func)(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *string); +typedef void (*cpu_state_io_func)(running_device *device, void *baseptr, const cpu_state_entry *entry); +typedef void (*cpu_string_io_func)(running_device *device, void *baseptr, const cpu_state_entry *entry, char *string); /* a cpu_type is just a pointer to the CPU's get_info function */ @@ -451,6 +440,6 @@ union _cpuinfo }; -void cpu_set_info(const device_config *device, UINT32 state, UINT64 value); +void cpu_set_info(running_device *device, UINT32 state, UINT64 value); #endif /* __CPUINTRF_H__ */ diff --git a/src/emu/crsshair.c b/src/emu/crsshair.c index e53384b0884..b81fa72069c 100644 --- a/src/emu/crsshair.c +++ b/src/emu/crsshair.c @@ -39,7 +39,7 @@ struct _crosshair_global UINT8 visible[MAX_PLAYERS]; /* visibility per player */ bitmap_t * bitmap[MAX_PLAYERS]; /* bitmap per player */ render_texture * texture[MAX_PLAYERS]; /* texture per player */ - const device_config *screen[MAX_PLAYERS]; /* the screen on which this player's crosshair is drawn */ + running_device *screen[MAX_PLAYERS]; /* the screen on which this player's crosshair is drawn */ float x[MAX_PLAYERS]; /* current X position */ float y[MAX_PLAYERS]; /* current Y position */ float last_x[MAX_PLAYERS]; /* last X position */ @@ -135,7 +135,7 @@ static void crosshair_exit(running_machine *machine); static void crosshair_load(running_machine *machine, int config_type, xml_data_node *parentnode); static void crosshair_save(running_machine *machine, int config_type, xml_data_node *parentnode); -static void animate(const device_config *device, void *param, int vblank_state); +static void animate(running_device *device, void *param, int vblank_state); /*************************************************************************** @@ -331,7 +331,7 @@ void crosshair_set_user_settings(running_machine *machine, UINT8 player, crossha animate - animates the crosshair once a frame -------------------------------------------------*/ -static void animate(const device_config *device, void *param, int vblank_state) +static void animate(running_device *device, void *param, int vblank_state) { int player; @@ -388,7 +388,7 @@ static void animate(const device_config *device, void *param, int vblank_state) for the given screen -------------------------------------------------*/ -void crosshair_render(const device_config *screen) +void crosshair_render(running_device *screen) { int player; @@ -412,7 +412,7 @@ void crosshair_render(const device_config *screen) given player's crosshair -------------------------------------------------*/ -void crosshair_set_screen(running_machine *machine, int player, const device_config *screen) +void crosshair_set_screen(running_machine *machine, int player, running_device *screen) { global.screen[player] = screen; } diff --git a/src/emu/crsshair.h b/src/emu/crsshair.h index 237a77ad5ee..af6cfa50440 100644 --- a/src/emu/crsshair.h +++ b/src/emu/crsshair.h @@ -19,8 +19,8 @@ CONSTANTS ***************************************************************************/ -#define CROSSHAIR_SCREEN_NONE ((const device_config *) 0) -#define CROSSHAIR_SCREEN_ALL ((const device_config *) ~0) +#define CROSSHAIR_SCREEN_NONE ((running_device *) 0) +#define CROSSHAIR_SCREEN_ALL ((running_device *) ~0) /* user settings for visibility mode */ #define CROSSHAIR_VISIBILITY_OFF 0 @@ -62,10 +62,10 @@ struct _crosshair_user_settings void crosshair_init(running_machine *machine); /* draws crosshair(s) in a given screen, if neccessary */ -void crosshair_render(const device_config *screen); +void crosshair_render(running_device *screen); /* sets the screen(s) for a given player's crosshair */ -void crosshair_set_screen(running_machine *machine, int player, const device_config *screen); +void crosshair_set_screen(running_machine *machine, int player, running_device *screen); /* return TRUE if any crosshairs are used */ int crosshair_get_usage(running_machine *machine); diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c index 4381dbbdf14..82cbc06dbe6 100644 --- a/src/emu/debug/debugcmd.c +++ b/src/emu/debug/debugcmd.c @@ -229,7 +229,7 @@ INLINE UINT64 cheat_read_extended(const cheat_system *cheatsys, const address_sp void debug_command_init(running_machine *machine) { symbol_table *symtable = debug_cpu_get_global_symtable(machine); - const device_config *cpu; + running_device *cpu; const char *name; int itemnum; @@ -370,7 +370,7 @@ void debug_command_init(running_machine *machine) for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) { cpu_debug_init_func debug_init; - debug_init = (cpu_debug_init_func)device_get_info_fct(cpu, CPUINFO_FCT_DEBUG_INIT); + debug_init = (cpu_debug_init_func)cpu->get_config_fct(CPUINFO_FCT_DEBUG_INIT); if (debug_init != NULL) (*debug_init)(cpu); } @@ -390,7 +390,7 @@ void debug_command_init(running_machine *machine) static void debug_command_exit(running_machine *machine) { - const device_config *cpu; + running_device *cpu; /* turn off all traces */ for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) @@ -512,7 +512,7 @@ int debug_command_parameter_number(running_machine *machine, const char *param, parameter as a cpu -------------------------------------------------*/ -int debug_command_parameter_cpu(running_machine *machine, const char *param, const device_config **result) +int debug_command_parameter_cpu(running_machine *machine, const char *param, running_device **result) { UINT64 cpunum; EXPRERR err; @@ -543,7 +543,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, con } /* if we got a valid one, return */ - *result = machine->config->devicelist.find(CPU, cpunum); + *result = machine->devicelist.find(CPU, cpunum); if (*result != NULL) return TRUE; @@ -561,7 +561,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, con int debug_command_parameter_cpu_space(running_machine *machine, const char *param, int spacenum, const address_space **result) { - const device_config *cpu; + running_device *cpu; /* first do the standard CPU thing */ if (!debug_command_parameter_cpu(machine, param, &cpu)) @@ -973,8 +973,8 @@ static void execute_next(running_machine *machine, int ref, int params, const ch static void execute_focus(running_machine *machine, int ref, int params, const char *param[]) { - const device_config *scancpu; - const device_config *cpu; + running_device *scancpu; + running_device *cpu; /* validate params */ if (!debug_command_parameter_cpu(machine, param[0], &cpu)) @@ -997,8 +997,8 @@ static void execute_focus(running_machine *machine, int ref, int params, const c static void execute_ignore(running_machine *machine, int ref, int params, const char *param[]) { - const device_config *cpuwhich[MAX_COMMAND_PARAMS]; - const device_config *cpu; + running_device *cpuwhich[MAX_COMMAND_PARAMS]; + running_device *cpu; int paramnum; char buffer[100]; int buflen = 0; @@ -1061,8 +1061,8 @@ static void execute_ignore(running_machine *machine, int ref, int params, const static void execute_observe(running_machine *machine, int ref, int params, const char *param[]) { - const device_config *cpuwhich[MAX_COMMAND_PARAMS]; - const device_config *cpu; + running_device *cpuwhich[MAX_COMMAND_PARAMS]; + running_device *cpu; int paramnum; char buffer[100]; int buflen = 0; @@ -1115,7 +1115,7 @@ static void execute_observe(running_machine *machine, int ref, int params, const static void execute_comment(running_machine *machine, int ref, int params, const char *param[]) { - const device_config *cpu; + running_device *cpu; UINT64 address; /* param 1 is the address for the comment */ @@ -1145,7 +1145,7 @@ static void execute_comment(running_machine *machine, int ref, int params, const static void execute_comment_del(running_machine *machine, int ref, int params, const char *param[]) { - const device_config *cpu; + running_device *cpu; UINT64 address; /* param 1 can either be a command or the address for the comment */ @@ -1182,7 +1182,7 @@ static void execute_comment_save(running_machine *machine, int ref, int params, static void execute_bpset(running_machine *machine, int ref, int params, const char *param[]) { parsed_expression *condition = NULL; - const device_config *cpu; + running_device *cpu; const char *action = NULL; UINT64 address; int bpnum; @@ -1221,7 +1221,7 @@ static void execute_bpclear(running_machine *machine, int ref, int params, const /* if 0 parameters, clear all */ if (params == 0) { - const device_config *cpu; + running_device *cpu; for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) { @@ -1259,7 +1259,7 @@ static void execute_bpdisenable(running_machine *machine, int ref, int params, c /* if 0 parameters, clear all */ if (params == 0) { - const device_config *cpu; + running_device *cpu; for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) { @@ -1295,7 +1295,7 @@ static void execute_bpdisenable(running_machine *machine, int ref, int params, c static void execute_bplist(running_machine *machine, int ref, int params, const char *param[]) { - const device_config *cpu; + running_device *cpu; int printed = 0; char buffer[256]; @@ -1396,7 +1396,7 @@ static void execute_wpclear(running_machine *machine, int ref, int params, const /* if 0 parameters, clear all */ if (params == 0) { - const device_config *cpu; + running_device *cpu; for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) { @@ -1439,7 +1439,7 @@ static void execute_wpdisenable(running_machine *machine, int ref, int params, c /* if 0 parameters, clear all */ if (params == 0) { - const device_config *cpu; + running_device *cpu; for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) { @@ -1480,7 +1480,7 @@ static void execute_wpdisenable(running_machine *machine, int ref, int params, c static void execute_wplist(running_machine *machine, int ref, int params, const char *param[]) { - const device_config *cpu; + running_device *cpu; int printed = 0; char buffer[256]; @@ -1529,7 +1529,7 @@ static void execute_wplist(running_machine *machine, int ref, int params, const static void execute_hotspot(running_machine *machine, int ref, int params, const char *param[]) { - const device_config *cpu; + running_device *cpu; UINT64 threshhold; UINT64 count; @@ -2055,7 +2055,7 @@ static void execute_cheatlist(running_machine *machine, int ref, int params, con { char spaceletter, sizeletter; const address_space *space; - const device_config *cpu; + running_device *cpu; UINT32 active_cheat = 0; UINT64 cheatindex; UINT64 sizemask; @@ -2362,7 +2362,7 @@ static void execute_dasm(running_machine *machine, int ref, int params, const ch static void execute_trace_internal(running_machine *machine, int ref, int params, const char *param[], int trace_over) { const char *action = NULL, *filename = param[0]; - const device_config *cpu; + running_device *cpu; FILE *f = NULL; const char *mode; @@ -2504,7 +2504,7 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch const char *filename = param[0]; int scrnum = (params > 1) ? atoi(param[1]) : 0; - const device_config *screen = machine->config->devicelist.find(VIDEO_SCREEN, scrnum); + running_device *screen = machine->devicelist.find(VIDEO_SCREEN, scrnum); if ((screen == NULL) || !render_is_live_screen(screen)) { @@ -2610,7 +2610,7 @@ static int CLIB_DECL symbol_sort_compare(const void *item1, const void *item2) static void execute_symlist(running_machine *machine, int ref, int params, const char **param) { - const device_config *cpu = NULL; + running_device *cpu = NULL; const char *namelist[1000]; symbol_table *symtable; int symnum, count = 0; diff --git a/src/emu/debug/debugcmd.h b/src/emu/debug/debugcmd.h index 4700e1804cb..99340fe452a 100644 --- a/src/emu/debug/debugcmd.h +++ b/src/emu/debug/debugcmd.h @@ -30,7 +30,7 @@ void debug_command_init(running_machine *machine); int debug_command_parameter_number(running_machine *machine, const char *param, UINT64 *result); /* validates a parameter as a cpu */ -int debug_command_parameter_cpu(running_machine *machine, const char *param, const device_config **result); +int debug_command_parameter_cpu(running_machine *machine, const char *param, running_device **result); /* validates a parameter as a cpu and retrieves the given address space */ int debug_command_parameter_cpu_space(running_machine *machine, const char *param, int spacenum, const address_space **result); diff --git a/src/emu/debug/debugcmt.c b/src/emu/debug/debugcmt.c index af5c9e6cdd1..ef1ec9a68a7 100644 --- a/src/emu/debug/debugcmt.c +++ b/src/emu/debug/debugcmt.c @@ -93,7 +93,7 @@ static void debug_comment_exit(running_machine *machine); int debug_comment_init(running_machine *machine) { - const device_config *cpu; + running_device *cpu; /* allocate memory for the comments */ for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) @@ -115,7 +115,7 @@ int debug_comment_init(running_machine *machine) the proper crc32 -------------------------------------------------------------------------*/ -int debug_comment_add(const device_config *device, offs_t addr, const char *comment, rgb_t color, UINT32 c_crc) +int debug_comment_add(running_device *device, offs_t addr, const char *comment, rgb_t color, UINT32 c_crc) { debug_cpu_comment_group *comments = cpu_get_debug_data(device)->comments; int insert_point = comments->comment_count; @@ -182,7 +182,7 @@ int debug_comment_add(const device_config *device, offs_t addr, const char *comm the proper crc32 -------------------------------------------------------------------------*/ -int debug_comment_remove(const device_config *device, offs_t addr, UINT32 c_crc) +int debug_comment_remove(running_device *device, offs_t addr, UINT32 c_crc) { debug_cpu_comment_group *comments = cpu_get_debug_data(device)->comments; int remove_index = -1; @@ -219,7 +219,7 @@ int debug_comment_remove(const device_config *device, offs_t addr, UINT32 c_crc) the proper crc32 -------------------------------------------------------------------------*/ -const char *debug_comment_get_text(const device_config *device, offs_t addr, UINT32 c_crc) +const char *debug_comment_get_text(running_device *device, offs_t addr, UINT32 c_crc) { debug_cpu_comment_group *comments = cpu_get_debug_data(device)->comments; int i; @@ -242,7 +242,7 @@ const char *debug_comment_get_text(const device_config *device, offs_t addr, UIN for a given cpu number -------------------------------------------------------------------------*/ -int debug_comment_get_count(const device_config *device) +int debug_comment_get_count(running_device *device) { debug_cpu_comment_group *comments = cpu_get_debug_data(device)->comments; return comments->comment_count; @@ -254,7 +254,7 @@ int debug_comment_get_count(const device_config *device) for a given cpu number -------------------------------------------------------------------------*/ -UINT32 debug_comment_get_change_count(const device_config *device) +UINT32 debug_comment_get_change_count(running_device *device) { debug_cpu_comment_group *comments = cpu_get_debug_data(device)->comments; return comments->change_count; @@ -267,7 +267,7 @@ UINT32 debug_comment_get_change_count(const device_config *device) UINT32 debug_comment_all_change_count(running_machine *machine) { - const device_config *cpu; + running_device *cpu; UINT32 retVal = 0; for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) @@ -285,7 +285,7 @@ UINT32 debug_comment_all_change_count(running_machine *machine) for the opcode at the requested address. -------------------------------------------------------------------------*/ -UINT32 debug_comment_get_opcode_crc32(const device_config *device, offs_t address) +UINT32 debug_comment_get_opcode_crc32(running_device *device, offs_t address) { const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM); int i; @@ -319,7 +319,7 @@ UINT32 debug_comment_get_opcode_crc32(const device_config *device, offs_t addres debug_comment_dump - debugging function to dump junk to the command line -------------------------------------------------------------------------*/ -void debug_comment_dump(const device_config *device, offs_t addr) +void debug_comment_dump(running_device *device, offs_t addr) { debug_cpu_comment_group *comments = cpu_get_debug_data(device)->comments; int i; @@ -367,7 +367,7 @@ int debug_comment_save(running_machine *machine) xml_data_node *root = xml_file_create(); xml_data_node *commentnode, *systemnode; int total_comments = 0; - const device_config *cpu; + running_device *cpu; /* if we don't have a root, bail */ if (root == NULL) @@ -483,7 +483,7 @@ static int debug_comment_load_xml(running_machine *machine, mame_file *fp) for (cpunode = xml_get_sibling(systemnode->child, "cpu"); cpunode; cpunode = xml_get_sibling(cpunode->next, "cpu")) { - const device_config *cpu = machine->device(xml_get_attribute_string(cpunode, "tag", "")); + running_device *cpu = machine->device(xml_get_attribute_string(cpunode, "tag", "")); if (cpu != NULL) { debug_cpu_comment_group *comments = cpu_get_debug_data(cpu)->comments; diff --git a/src/emu/debug/debugcmt.h b/src/emu/debug/debugcmt.h index 8a7144e50ab..c136fdce7a4 100644 --- a/src/emu/debug/debugcmt.h +++ b/src/emu/debug/debugcmt.h @@ -25,16 +25,16 @@ int debug_comment_save(running_machine *machine); int debug_comment_load(running_machine *machine); /* comment interface functions */ -int debug_comment_add(const device_config *device, offs_t addr, const char *comment, rgb_t color, UINT32 c_crc); -int debug_comment_remove(const device_config *device, offs_t addr, UINT32 c_crc); +int debug_comment_add(running_device *device, offs_t addr, const char *comment, rgb_t color, UINT32 c_crc); +int debug_comment_remove(running_device *device, offs_t addr, UINT32 c_crc); -const char *debug_comment_get_text(const device_config *device, offs_t addr, UINT32 c_crc); -int debug_comment_get_count(const device_config *device); -UINT32 debug_comment_get_change_count(const device_config *device); +const char *debug_comment_get_text(running_device *device, offs_t addr, UINT32 c_crc); +int debug_comment_get_count(running_device *device); +UINT32 debug_comment_get_change_count(running_device *device); UINT32 debug_comment_all_change_count(running_machine *machine); /* local functionality */ -UINT32 debug_comment_get_opcode_crc32(const device_config *device, offs_t address); /* pull a crc for the opcode at a given address */ -void debug_comment_dump(const device_config *device, offs_t addr); /* dump all (or a single) comment to the command line */ +UINT32 debug_comment_get_opcode_crc32(running_device *device, offs_t address); /* pull a crc for the opcode at a given address */ +void debug_comment_dump(running_device *device, offs_t addr); /* dump all (or a single) comment to the command line */ #endif diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c index fb55784702f..742b22f49f3 100644 --- a/src/emu/debug/debugcpu.c +++ b/src/emu/debug/debugcpu.c @@ -50,9 +50,9 @@ enum /* in mame.h: typedef struct _debugcpu_private debugcpu_private; */ struct _debugcpu_private { - const device_config *livecpu; - const device_config *visiblecpu; - const device_config *breakcpu; + running_device *livecpu; + running_device *visiblecpu; + running_device *breakcpu; FILE * source_file; /* script source file */ @@ -83,9 +83,9 @@ struct _debugcpu_private /* internal helpers */ static void debug_cpu_exit(running_machine *machine); -static void on_vblank(const device_config *device, void *param, int vblank_state); +static void on_vblank(running_device *device, void *param, int vblank_state); static void reset_transient_flags(running_machine *machine); -static void compute_debug_flags(const device_config *device); +static void compute_debug_flags(running_device *device); static void perform_trace(cpu_debug_data *info); static void prepare_for_step_overout(cpu_debug_data *info); static void process_source_file(running_machine *machine); @@ -94,7 +94,7 @@ static void breakpoint_check(running_machine *machine, cpu_debug_data *info, off static void watchpoint_update_flags(const address_space *space); static void watchpoint_check(const address_space *space, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask); static void check_hotspots(const address_space *space, offs_t address); -static UINT32 dasm_wrapped(const device_config *device, char *buffer, offs_t pc); +static UINT32 dasm_wrapped(running_device *device, char *buffer, offs_t pc); /* expression handlers */ static UINT64 expression_read_memory(void *param, const char *name, int space, UINT32 address, int size); @@ -147,9 +147,9 @@ const express_callbacks debug_expression_callbacks = void debug_cpu_init(running_machine *machine) { - const device_config *first_screen = video_screen_first(machine->config); + running_device *first_screen = video_screen_first(machine); debugcpu_private *global; - const device_config *cpu; + running_device *cpu; int regnum; /* allocate and reset globals */ @@ -193,11 +193,11 @@ void debug_cpu_init(running_machine *machine) info->opwidth = cpu_get_min_opcode_bytes(info->device); /* fetch the memory accessors */ - info->read = (cpu_read_func)device_get_info_fct(info->device, CPUINFO_FCT_READ); - info->write = (cpu_write_func)device_get_info_fct(info->device, CPUINFO_FCT_WRITE); - info->readop = (cpu_readop_func)device_get_info_fct(info->device, CPUINFO_FCT_READOP); - info->translate = (cpu_translate_func)device_get_info_fct(info->device, CPUINFO_FCT_TRANSLATE); - info->disassemble = (cpu_disassemble_func)device_get_info_fct(info->device, CPUINFO_FCT_DISASSEMBLE); + info->read = (cpu_read_func)info->device->get_config_fct(CPUINFO_FCT_READ); + info->write = (cpu_write_func)info->device->get_config_fct(CPUINFO_FCT_WRITE); + info->readop = (cpu_readop_func)info->device->get_config_fct(CPUINFO_FCT_READOP); + info->translate = (cpu_translate_func)info->device->get_config_fct(CPUINFO_FCT_TRANSLATE); + info->disassemble = (cpu_disassemble_func)info->device->get_config_fct(CPUINFO_FCT_DISASSEMBLE); /* allocate a symbol table */ info->symtable = symtable_alloc(global->symtable, (void *)cpu); @@ -262,7 +262,7 @@ void debug_cpu_init(running_machine *machine) void debug_cpu_flush_traces(running_machine *machine) { - const device_config *cpu; + running_device *cpu; for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) { @@ -286,7 +286,7 @@ void debug_cpu_flush_traces(running_machine *machine) device (the one that commands should apply to) -------------------------------------------------*/ -const device_config *debug_cpu_get_visible_cpu(running_machine *machine) +running_device *debug_cpu_get_visible_cpu(running_machine *machine) { return machine->debugcpu_data->visiblecpu; } @@ -347,7 +347,7 @@ symbol_table *debug_cpu_get_visible_symtable(running_machine *machine) CPU's symbol table -------------------------------------------------*/ -symbol_table *debug_cpu_get_symtable(const device_config *device) +symbol_table *debug_cpu_get_symtable(running_device *device) { return cpu_get_debug_data(device)->symtable; } @@ -381,7 +381,7 @@ int debug_cpu_translate(const address_space *space, int intention, offs_t *addre a given PC on a given CPU -------------------------------------------------*/ -offs_t debug_cpu_disassemble(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) +offs_t debug_cpu_disassemble(running_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) { cpu_debug_data *info = cpu_get_debug_data(device); offs_t result = 0; @@ -440,7 +440,7 @@ offs_t debug_cpu_disassemble(const device_config *device, char *buffer, offs_t p handler for disassembly -------------------------------------------------*/ -void debug_cpu_set_dasm_override(const device_config *device, cpu_disassemble_func dasm_override) +void debug_cpu_set_dasm_override(running_device *device, cpu_disassemble_func dasm_override) { cpu_debug_data *info = cpu_get_debug_data(device); if (info != NULL) @@ -459,7 +459,7 @@ void debug_cpu_set_dasm_override(const device_config *device, cpu_disassemble_fu execution for the given CPU -------------------------------------------------*/ -void debug_cpu_start_hook(const device_config *device, attotime endtime) +void debug_cpu_start_hook(running_device *device, attotime endtime) { debugcpu_private *global = device->machine->debugcpu_data; cpu_debug_data *info = cpu_get_debug_data(device); @@ -520,7 +520,7 @@ void debug_cpu_start_hook(const device_config *device, attotime endtime) for the given CPU -------------------------------------------------*/ -void debug_cpu_stop_hook(const device_config *device) +void debug_cpu_stop_hook(running_device *device) { debugcpu_private *global = device->machine->debugcpu_data; cpu_debug_data *info = cpu_get_debug_data(device); @@ -544,7 +544,7 @@ void debug_cpu_stop_hook(const device_config *device) interrupt is acknowledged -------------------------------------------------*/ -void debug_cpu_interrupt_hook(const device_config *device, int irqline) +void debug_cpu_interrupt_hook(running_device *device, int irqline) { debugcpu_private *global = device->machine->debugcpu_data; cpu_debug_data *info = cpu_get_debug_data(device); @@ -564,7 +564,7 @@ void debug_cpu_interrupt_hook(const device_config *device, int irqline) exception is generated -------------------------------------------------*/ -void debug_cpu_exception_hook(const device_config *device, int exception) +void debug_cpu_exception_hook(running_device *device, int exception) { debugcpu_private *global = device->machine->debugcpu_data; cpu_debug_data *info = cpu_get_debug_data(device); @@ -584,7 +584,7 @@ void debug_cpu_exception_hook(const device_config *device, int exception) CPU cores before executing each instruction -------------------------------------------------*/ -void debug_cpu_instruction_hook(const device_config *device, offs_t curpc) +void debug_cpu_instruction_hook(running_device *device, offs_t curpc) { debugcpu_private *global = device->machine->debugcpu_data; cpu_debug_data *info = cpu_get_debug_data(device); @@ -747,7 +747,7 @@ void debug_cpu_memory_write_hook(const address_space *space, offs_t address, UIN the debugger on the next instruction -------------------------------------------------*/ -void debug_cpu_halt_on_next_instruction(const device_config *device, const char *fmt, ...) +void debug_cpu_halt_on_next_instruction(running_device *device, const char *fmt, ...) { debugcpu_private *global = device->machine->debugcpu_data; cpu_debug_data *info = cpu_get_debug_data(device); @@ -779,7 +779,7 @@ void debug_cpu_halt_on_next_instruction(const device_config *device, const char CPU -------------------------------------------------*/ -void debug_cpu_ignore_cpu(const device_config *device, int ignore) +void debug_cpu_ignore_cpu(running_device *device, int ignore) { debugcpu_private *global = device->machine->debugcpu_data; cpu_debug_data *info = cpu_get_debug_data(device); @@ -969,7 +969,7 @@ void debug_cpu_next_cpu(running_machine *machine) breakpoint, returning its index -------------------------------------------------*/ -int debug_cpu_breakpoint_set(const device_config *device, offs_t address, parsed_expression *condition, const char *action) +int debug_cpu_breakpoint_set(running_device *device, offs_t address, parsed_expression *condition, const char *action) { debugcpu_private *global = device->machine->debugcpu_data; cpu_debug_data *info = cpu_get_debug_data(device); @@ -1008,7 +1008,7 @@ int debug_cpu_breakpoint_set(const device_config *device, offs_t address, parsed int debug_cpu_breakpoint_clear(running_machine *machine, int bpnum) { debug_cpu_breakpoint *bp, *pbp; - const device_config *cpu; + running_device *cpu; /* loop over CPUs and find the requested breakpoint */ for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) @@ -1049,7 +1049,7 @@ int debug_cpu_breakpoint_clear(running_machine *machine, int bpnum) int debug_cpu_breakpoint_enable(running_machine *machine, int bpnum, int enable) { debug_cpu_breakpoint *bp; - const device_config *cpu; + running_device *cpu; /* loop over CPUs and find the requested breakpoint */ for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) @@ -1116,7 +1116,7 @@ int debug_cpu_watchpoint_set(const address_space *space, int type, offs_t addres int debug_cpu_watchpoint_clear(running_machine *machine, int wpnum) { debug_cpu_watchpoint *wp, *pwp; - const device_config *cpu; + running_device *cpu; int spacenum; /* loop over CPUs and find the requested watchpoint */ @@ -1159,7 +1159,7 @@ int debug_cpu_watchpoint_clear(running_machine *machine, int wpnum) int debug_cpu_watchpoint_enable(running_machine *machine, int wpnum, int enable) { debug_cpu_watchpoint *wp; - const device_config *cpu; + running_device *cpu; int spacenum; /* loop over CPUs and address spaces and find the requested watchpoint */ @@ -1221,7 +1221,7 @@ void debug_cpu_source_script(running_machine *machine, const char *file) CPU -------------------------------------------------*/ -void debug_cpu_trace(const device_config *device, FILE *file, int trace_over, const char *action) +void debug_cpu_trace(running_device *device, FILE *file, int trace_over, const char *action) { cpu_debug_data *info = cpu_get_debug_data(device); @@ -1257,7 +1257,7 @@ void debug_cpu_trace(const device_config *device, FILE *file, int trace_over, co given CPU's tracefile, if tracing -------------------------------------------------*/ -void debug_cpu_trace_printf(const device_config *device, const char *fmt, ...) +void debug_cpu_trace_printf(running_device *device, const char *fmt, ...) { va_list va; @@ -1277,7 +1277,7 @@ void debug_cpu_trace_printf(const device_config *device, const char *fmt, ...) be called on each instruction for a given CPU -------------------------------------------------*/ -void debug_cpu_set_instruction_hook(const device_config *device, debug_instruction_hook_func hook) +void debug_cpu_set_instruction_hook(running_device *device, debug_instruction_hook_func hook) { cpu_debug_data *info = cpu_get_debug_data(device); @@ -1295,7 +1295,7 @@ void debug_cpu_set_instruction_hook(const device_config *device, debug_instructi tracking of hotspots -------------------------------------------------*/ -int debug_cpu_hotspot_track(const device_config *device, int numspots, int threshhold) +int debug_cpu_hotspot_track(running_device *device, int numspots, int threshhold) { cpu_debug_data *info = cpu_get_debug_data(device); @@ -1925,7 +1925,7 @@ UINT64 debug_read_opcode(const address_space *space, offs_t address, int size, i static void debug_cpu_exit(running_machine *machine) { debugcpu_private *global = machine->debugcpu_data; - const device_config *cpu; + running_device *cpu; int spacenum; /* loop over all watchpoints and breakpoints to free their memory */ @@ -1966,7 +1966,7 @@ static void debug_cpu_exit(running_machine *machine) on_vblank - called when a VBLANK hits -------------------------------------------------*/ -static void on_vblank(const device_config *device, void *param, int vblank_state) +static void on_vblank(running_device *device, void *param, int vblank_state) { /* just set a global flag to be consumed later */ if (vblank_state) @@ -1981,7 +1981,7 @@ static void on_vblank(const device_config *device, void *param, int vblank_state static void reset_transient_flags(running_machine *machine) { - const device_config *cpu; + running_device *cpu; /* loop over CPUs and reset the transient flags */ for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) @@ -1994,7 +1994,7 @@ static void reset_transient_flags(running_machine *machine) debug flags for optimal efficiency -------------------------------------------------*/ -static void compute_debug_flags(const device_config *device) +static void compute_debug_flags(running_device *device) { cpu_debug_data *info = cpu_get_debug_data(device); running_machine *machine = device->machine; @@ -2408,7 +2408,7 @@ static void check_hotspots(const address_space *space, offs_t address) buffer and then disassembling them -------------------------------------------------*/ -static UINT32 dasm_wrapped(const device_config *device, char *buffer, offs_t pc) +static UINT32 dasm_wrapped(running_device *device, char *buffer, offs_t pc) { const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM); int maxbytes = cpu_get_max_opcode_bytes(device); @@ -2438,11 +2438,11 @@ static UINT32 dasm_wrapped(const device_config *device, char *buffer, offs_t pc) based on a case insensitive tag search -------------------------------------------------*/ -static const device_config *expression_get_device(running_machine *machine, const char *tag) +static running_device *expression_get_device(running_machine *machine, const char *tag) { - const device_config *device; + running_device *device; - for (device = machine->config->devicelist.first(); device != NULL; device = device->next) + for (device = machine->devicelist.first(); device != NULL; device = device->next) if (mame_stricmp(device->tag, tag) == 0) return device; @@ -2460,7 +2460,7 @@ static UINT64 expression_read_memory(void *param, const char *name, int spacenum { running_machine *machine = (running_machine *)param; UINT64 result = ~(UINT64)0 >> (64 - 8*size); - const device_config *device = NULL; + running_device *device = NULL; const address_space *space; switch (spacenum) @@ -2630,7 +2630,7 @@ static UINT64 expression_read_memory_region(running_machine *machine, const char static void expression_write_memory(void *param, const char *name, int spacenum, UINT32 address, int size, UINT64 data) { running_machine *machine = (running_machine *)param; - const device_config *device = NULL; + running_device *device = NULL; const address_space *space; switch (spacenum) @@ -2812,7 +2812,7 @@ static void expression_write_memory_region(running_machine *machine, const char static EXPRERR expression_validate(void *param, const char *name, int space) { running_machine *machine = (running_machine *)param; - const device_config *device = NULL; + running_device *device = NULL; switch (space) { @@ -2942,7 +2942,7 @@ static void set_tempvar(void *globalref, void *ref, UINT64 value) static UINT64 get_beamx(void *globalref, void *ref) { - const device_config *screen = (const device_config *)ref; + running_device *screen = (running_device *)ref; return (screen != NULL) ? video_screen_get_hpos(screen) : 0; } @@ -2953,7 +2953,7 @@ static UINT64 get_beamx(void *globalref, void *ref) static UINT64 get_beamy(void *globalref, void *ref) { - const device_config *screen = (const device_config *)ref; + running_device *screen = (running_device *)ref; return (screen != NULL) ? video_screen_get_vpos(screen) : 0; } @@ -2964,7 +2964,7 @@ static UINT64 get_beamy(void *globalref, void *ref) static UINT64 get_frame(void *globalref, void *ref) { - const device_config *screen = (const device_config *)ref; + running_device *screen = (running_device *)ref; return (screen != NULL) ? video_screen_get_frame_number(screen) : 0; } @@ -2976,7 +2976,7 @@ static UINT64 get_frame(void *globalref, void *ref) static UINT64 get_current_pc(void *globalref, void *ref) { - const device_config *device = (const device_config *)globalref; + running_device *device = (running_device *)globalref; return cpu_get_pc(device); } @@ -2988,7 +2988,7 @@ static UINT64 get_current_pc(void *globalref, void *ref) static UINT64 get_cycles(void *globalref, void *ref) { - const device_config *device = (const device_config *)globalref; + running_device *device = (running_device *)globalref; return *cpu_get_icount_ptr(device); } @@ -3025,7 +3025,7 @@ static void set_logunmap(void *globalref, void *ref, UINT64 value) static UINT64 get_cpu_reg(void *globalref, void *ref) { - const device_config *device = (const device_config *)globalref; + running_device *device = (running_device *)globalref; return cpu_get_reg(device, (FPTR)ref); } @@ -3037,6 +3037,6 @@ static UINT64 get_cpu_reg(void *globalref, void *ref) static void set_cpu_reg(void *globalref, void *ref, UINT64 value) { - const device_config *device = (const device_config *)globalref; + running_device *device = (running_device *)globalref; cpu_set_reg(device, (FPTR)ref, value); } diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h index 772f7bea19a..221e1511fbd 100644 --- a/src/emu/debug/debugcpu.h +++ b/src/emu/debug/debugcpu.h @@ -65,7 +65,7 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef int (*debug_instruction_hook_func)(const device_config *device, offs_t curpc); +typedef int (*debug_instruction_hook_func)(running_device *device, offs_t curpc); typedef struct _debug_cpu_breakpoint debug_cpu_breakpoint; @@ -100,7 +100,7 @@ struct _debug_hotspot_entry /* In cpuintrf.h: typedef struct _cpu_debug_data cpu_debug_data; */ struct _cpu_debug_data { - const device_config * device; /* CPU device object */ + running_device * device; /* CPU device object */ symbol_table * symtable; /* symbol table for expression evaluation */ UINT32 flags; /* debugging flags for this CPU */ UINT8 opwidth; /* width of an opcode */ @@ -180,7 +180,7 @@ void debug_cpu_flush_traces(running_machine *machine); /* ----- debugging status & information ----- */ /* return the visible CPU device (the one that commands should apply to) */ -const device_config *debug_cpu_get_visible_cpu(running_machine *machine); +running_device *debug_cpu_get_visible_cpu(running_machine *machine); /* TRUE if the debugger is currently stopped within an instruction hook callback */ int debug_cpu_within_instruction_hook(running_machine *machine); @@ -199,7 +199,7 @@ symbol_table *debug_cpu_get_global_symtable(running_machine *machine); symbol_table *debug_cpu_get_visible_symtable(running_machine *machine); /* return a specific CPU's symbol table */ -symbol_table *debug_cpu_get_symtable(const device_config *device); +symbol_table *debug_cpu_get_symtable(running_device *device); @@ -209,29 +209,29 @@ symbol_table *debug_cpu_get_symtable(const device_config *device); int debug_cpu_translate(const address_space *space, int intention, offs_t *address); /* disassemble a line at a given PC on a given CPU */ -offs_t debug_cpu_disassemble(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); +offs_t debug_cpu_disassemble(running_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); /* set an override handler for disassembly */ -void debug_cpu_set_dasm_override(const device_config *device, cpu_disassemble_func dasm_override); +void debug_cpu_set_dasm_override(running_device *device, cpu_disassemble_func dasm_override); /* ----- core debugger hooks ----- */ /* the CPU execution system calls this hook before beginning execution for the given CPU */ -void debug_cpu_start_hook(const device_config *device, attotime endtime); +void debug_cpu_start_hook(running_device *device, attotime endtime); /* the CPU execution system calls this hook when ending execution for the given CPU */ -void debug_cpu_stop_hook(const device_config *device); +void debug_cpu_stop_hook(running_device *device); /* the CPU execution system calls this hook when an interrupt is acknowledged */ -void debug_cpu_interrupt_hook(const device_config *device, int irqline); +void debug_cpu_interrupt_hook(running_device *device, int irqline); /* called by the CPU cores when an exception is generated */ -void debug_cpu_exception_hook(const device_config *device, int exception); +void debug_cpu_exception_hook(running_device *device, int exception); /* called by the CPU cores before executing each instruction */ -void debug_cpu_instruction_hook(const device_config *device, offs_t curpc); +void debug_cpu_instruction_hook(running_device *device, offs_t curpc); /* the memory system calls this hook when watchpoints are enabled and a memory read happens */ void debug_cpu_memory_read_hook(const address_space *space, offs_t address, UINT64 mem_mask); @@ -244,10 +244,10 @@ void debug_cpu_memory_write_hook(const address_space *space, offs_t address, UIN /* ----- execution control ----- */ /* halt in the debugger on the next instruction */ -void debug_cpu_halt_on_next_instruction(const device_config *device, const char *fmt, ...) ATTR_PRINTF(2,3); +void debug_cpu_halt_on_next_instruction(running_device *device, const char *fmt, ...) ATTR_PRINTF(2,3); /* ignore/observe a given CPU */ -void debug_cpu_ignore_cpu(const device_config *cpu, int ignore); +void debug_cpu_ignore_cpu(running_device *cpu, int ignore); /* single step the visible CPU past the requested number of instructions */ void debug_cpu_single_step(running_machine *machine, int numsteps); @@ -281,7 +281,7 @@ void debug_cpu_next_cpu(running_machine *machine); /* ----- breakpoints ----- */ /* set a new breakpoint, returning its index */ -int debug_cpu_breakpoint_set(const device_config *device, offs_t address, parsed_expression *condition, const char *action); +int debug_cpu_breakpoint_set(running_device *device, offs_t address, parsed_expression *condition, const char *action); /* clear a breakpoint by index */ int debug_cpu_breakpoint_clear(running_machine *machine, int bpnum); @@ -310,16 +310,16 @@ int debug_cpu_watchpoint_enable(running_machine *machine, int wpnum, int enable) void debug_cpu_source_script(running_machine *machine, const char *file); /* trace execution of a given CPU */ -void debug_cpu_trace(const device_config *device, FILE *file, int trace_over, const char *action); +void debug_cpu_trace(running_device *device, FILE *file, int trace_over, const char *action); /* output data into the given CPU's tracefile, if tracing */ -void debug_cpu_trace_printf(const device_config *device, const char *fmt, ...) ATTR_PRINTF(2,3); +void debug_cpu_trace_printf(running_device *device, const char *fmt, ...) ATTR_PRINTF(2,3); /* set a hook to be called on each instruction for a given CPU */ -void debug_cpu_set_instruction_hook(const device_config *device, debug_instruction_hook_func hook); +void debug_cpu_set_instruction_hook(running_device *device, debug_instruction_hook_func hook); /* hotspots */ -int debug_cpu_hotspot_track(const device_config *device, int numspots, int threshhold); +int debug_cpu_hotspot_track(running_device *device, int numspots, int threshhold); diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c index 57bf541bdfc..782dfa3170a 100644 --- a/src/emu/debug/debugvw.c +++ b/src/emu/debug/debugvw.c @@ -134,7 +134,7 @@ struct _debug_view_register typedef struct _debug_view_registers debug_view_registers; struct _debug_view_registers { - const device_config *device; /* CPU device whose registers we are showing */ + running_device *device; /* CPU device whose registers we are showing */ int divider; /* dividing column */ UINT64 last_update; /* execution counter at last update */ debug_view_register reg[MAX_REGS]; /* register data */ @@ -820,7 +820,7 @@ static void debug_view_expression_set(debug_view_expression *expression, const c changed -------------------------------------------------*/ -static int debug_view_expression_changed_value(debug_view *view, debug_view_expression *expression, const device_config *cpu) +static int debug_view_expression_changed_value(debug_view *view, debug_view_expression *expression, running_device *cpu) { int changed = expression->dirty; EXPRERR exprerr; @@ -1027,7 +1027,7 @@ static const registers_subview_item *registers_view_enumerate_subviews(running_m astring tempstring; registers_subview_item *head = NULL; registers_subview_item **tailptr = &head; - const device_config *cpu; + running_device *cpu; int curindex = 0; /* iterate over CPUs with program address spaces */ @@ -1036,7 +1036,7 @@ static const registers_subview_item *registers_view_enumerate_subviews(running_m registers_subview_item *subview; /* determine the string and allocate a subview large enough */ - tempstring.printf("CPU '%s' (%s)", cpu->tag.cstr(), cpu_get_name(cpu)); + tempstring.printf("CPU '%s' (%s)", cpu->tag.cstr(), device_get_name(cpu)); subview = (registers_subview_item *)auto_alloc_array_clear(machine, UINT8, sizeof(*subview) + tempstring.len()); /* populate the subview */ @@ -1285,7 +1285,7 @@ static void registers_view_recompute(debug_view *view) static void registers_view_update(debug_view *view) { - const device_config *screen = view->machine->primary_screen; + running_device *screen = view->machine->primary_screen; debug_view_registers *regdata = (debug_view_registers *)view->extra_data; debug_view_char *dest = view->viewdata; UINT64 total_cycles; @@ -1488,7 +1488,7 @@ static const disasm_subview_item *disasm_view_enumerate_subviews(running_machine astring tempstring; disasm_subview_item *head = NULL; disasm_subview_item **tailptr = &head; - const device_config *cpu; + running_device *cpu; int curindex = 0; /* iterate over CPUs with program address spaces */ @@ -1500,7 +1500,7 @@ static const disasm_subview_item *disasm_view_enumerate_subviews(running_machine disasm_subview_item *subview; /* determine the string and allocate a subview large enough */ - tempstring.printf("CPU '%s' (%s)", cpu->tag.cstr(), cpu_get_name(cpu)); + tempstring.printf("CPU '%s' (%s)", cpu->tag.cstr(), device_get_name(cpu)); subview = (disasm_subview_item *)auto_alloc_array_clear(machine, UINT8, sizeof(*subview) + tempstring.len()); /* populate the subview */ @@ -1528,7 +1528,7 @@ static int disasm_view_alloc(debug_view *view) { debug_view_disasm *dasmdata; int total_comments = 0; - const device_config *cpu; + running_device *cpu; /* fail if no available subviews */ if (view->machine->debugvw_data->disasm_subviews == NULL) @@ -2365,14 +2365,14 @@ static const memory_subview_item *memory_view_enumerate_subviews(running_machine astring tempstring; memory_subview_item *head = NULL; memory_subview_item **tailptr = &head; - const device_config *device; + running_device *device; int spacenum; const char *rgntag; int curindex = 0; int itemnum; /* first add all the device's address spaces */ - for (device = machine->config->devicelist.first(); device != NULL; device = device->next) + for (device = machine->devicelist.first(); device != NULL; device = device->next) for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) { const address_space *space = device->space(spacenum); diff --git a/src/emu/debug/debugvw.h b/src/emu/debug/debugvw.h index 64bea264a60..2d75ba66d97 100644 --- a/src/emu/debug/debugvw.h +++ b/src/emu/debug/debugvw.h @@ -111,7 +111,7 @@ struct _registers_subview_item { registers_subview_item *next; /* link to next item */ int index; /* index of this item */ - const device_config *device; /* CPU to display */ + running_device *device; /* CPU to display */ char name[1]; /* name of the subview item */ }; diff --git a/src/emu/debugger.h b/src/emu/debugger.h index bc2827cddf6..625a3e6c793 100644 --- a/src/emu/debugger.h +++ b/src/emu/debugger.h @@ -43,7 +43,7 @@ void debugger_flush_all_traces_on_abnormal_exit(void); this once per instruction from CPU cores -------------------------------------------------*/ -INLINE void debugger_instruction_hook(const device_config *device, offs_t curpc) +INLINE void debugger_instruction_hook(running_device *device, offs_t curpc) { if ((device->machine->debug_flags & DEBUG_FLAG_CALL_HOOK) != 0) debug_cpu_instruction_hook(device, curpc); @@ -55,7 +55,7 @@ INLINE void debugger_instruction_hook(const device_config *device, offs_t curpc) anytime an exception is generated -------------------------------------------------*/ -INLINE void debugger_exception_hook(const device_config *device, int exception) +INLINE void debugger_exception_hook(running_device *device, int exception) { if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0) debug_cpu_exception_hook(device, exception); @@ -73,7 +73,7 @@ INLINE void debugger_exception_hook(const device_config *device, int exception) execution for the given CPU -------------------------------------------------*/ -INLINE void debugger_start_cpu_hook(const device_config *device, attotime endtime) +INLINE void debugger_start_cpu_hook(running_device *device, attotime endtime) { if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0) debug_cpu_start_hook(device, endtime); @@ -86,7 +86,7 @@ INLINE void debugger_start_cpu_hook(const device_config *device, attotime endtim for the given CPU -------------------------------------------------*/ -INLINE void debugger_stop_cpu_hook(const device_config *device) +INLINE void debugger_stop_cpu_hook(running_device *device) { if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0) debug_cpu_stop_hook(device); @@ -99,7 +99,7 @@ INLINE void debugger_stop_cpu_hook(const device_config *device) acknowledged -------------------------------------------------*/ -INLINE void debugger_interrupt_hook(const device_config *device, int irqline) +INLINE void debugger_interrupt_hook(running_device *device, int irqline) { if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0) debug_cpu_interrupt_hook(device, irqline); diff --git a/src/emu/deprecat.h b/src/emu/deprecat.h index 9417923dd6b..943bc28d848 100644 --- a/src/emu/deprecat.h +++ b/src/emu/deprecat.h @@ -48,7 +48,7 @@ handlers to synchronize their operation. If you call this from outside an interrupt handler, add 1 to the result, i.e. if it returns 0, it means that the interrupt handler will be called once. */ -int cpu_getiloops(const device_config *device); +int cpu_getiloops(running_device *device); diff --git a/src/emu/devcb.c b/src/emu/devcb.c index ac80e63cf36..81f0275fe42 100644 --- a/src/emu/devcb.c +++ b/src/emu/devcb.c @@ -30,10 +30,10 @@ static READ_LINE_DEVICE_HANDLER( trampoline_read_port_to_read_line ) static READ_LINE_DEVICE_HANDLER( trampoline_read8_to_read_line ) { const devcb_resolved_read_line *resolved = (const devcb_resolved_read_line *)device; - return ((*resolved->real.readdevice)((const device_config *)resolved->realtarget, 0) & 1) ? ASSERT_LINE : CLEAR_LINE; + return ((*resolved->real.readdevice)((running_device *)resolved->realtarget, 0) & 1) ? ASSERT_LINE : CLEAR_LINE; } -void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_read_line *config, const device_config *device) +void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_read_line *config, running_device *device) { /* reset the resolved structure */ memset(resolved, 0, sizeof(*resolved)); @@ -51,7 +51,7 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea else if (config->type >= DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM) && config->type < DEVCB_TYPE_MEMORY(ADDRESS_SPACES) && config->readspace != NULL) { FPTR spacenum = (FPTR)config->type - (FPTR)DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM); - const device_config *cpu; + running_device *cpu; if (device->owner != NULL) cpu = device->owner->subdevice(config->tag); @@ -111,17 +111,17 @@ static WRITE_LINE_DEVICE_HANDLER( trampoline_write_port_to_write_line ) static WRITE_LINE_DEVICE_HANDLER( trampoline_write8_to_write_line ) { const devcb_resolved_write_line *resolved = (const devcb_resolved_write_line *)device; - (*resolved->real.writedevice)((const device_config *)resolved->realtarget, 0, state); + (*resolved->real.writedevice)((running_device *)resolved->realtarget, 0, state); } static WRITE_LINE_DEVICE_HANDLER( trampoline_writecpu_to_write_line ) { const devcb_resolved_write_line *resolved = (const devcb_resolved_write_line *)device; - const device_config *cpu = (const device_config *)resolved->realtarget; + running_device *cpu = (running_device *)resolved->realtarget; cpu_set_input_line(cpu, resolved->real.writeline, state ? ASSERT_LINE : CLEAR_LINE); } -void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_write_line *config, const device_config *device) +void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_write_line *config, running_device *device) { /* reset the resolved structure */ memset(resolved, 0, sizeof(*resolved)); @@ -138,7 +138,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w else if (config->type >= DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM) && config->type < DEVCB_TYPE_MEMORY(ADDRESS_SPACES) && config->writespace != NULL) { FPTR spacenum = (FPTR)config->type - (FPTR)DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM); - const device_config *cpu; + running_device *cpu; if (device->owner != NULL) cpu = device->owner->subdevice(config->tag); @@ -159,7 +159,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w else if (config->type >= DEVCB_TYPE_CPU_LINE(0) && config->type < DEVCB_TYPE_CPU_LINE(MAX_INPUT_LINES)) { FPTR line = (FPTR)config->type - (FPTR)DEVCB_TYPE_CPU_LINE(0); - const device_config *cpu; + running_device *cpu; if (device->owner != NULL) cpu = device->owner->subdevice(config->tag); @@ -217,10 +217,10 @@ static READ8_DEVICE_HANDLER( trampoline_read_port_to_read8 ) static READ8_DEVICE_HANDLER( trampoline_read_line_to_read8 ) { const devcb_resolved_read8 *resolved = (const devcb_resolved_read8 *)device; - return (*resolved->real.readline)((const device_config *)resolved->realtarget); + return (*resolved->real.readline)((running_device *)resolved->realtarget); } -void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *config, const device_config *device) +void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *config, running_device *device) { /* reset the resolved structure */ memset(resolved, 0, sizeof(*resolved)); @@ -238,7 +238,7 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf else if (config->type >= DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM) && config->type < DEVCB_TYPE_MEMORY(ADDRESS_SPACES) && config->readspace != NULL) { FPTR spacenum = (FPTR)config->type - (FPTR)DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM); - const device_config *cpu; + running_device *cpu; if (device->owner != NULL) cpu = device->owner->subdevice(config->tag); @@ -289,10 +289,10 @@ static WRITE8_DEVICE_HANDLER( trampoline_write_port_to_write8 ) static WRITE8_DEVICE_HANDLER( trampoline_write_line_to_write8 ) { const devcb_resolved_write8 *resolved = (const devcb_resolved_write8 *)device; - (*resolved->real.writeline)((const device_config *)resolved->realtarget, (data & 1) ? ASSERT_LINE : CLEAR_LINE); + (*resolved->real.writeline)((running_device *)resolved->realtarget, (data & 1) ? ASSERT_LINE : CLEAR_LINE); } -void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *config, const device_config *device) +void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *config, running_device *device) { /* reset the resolved structure */ memset(resolved, 0, sizeof(*resolved)); @@ -309,7 +309,7 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c else if (config->type >= DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM) && config->type < DEVCB_TYPE_MEMORY(ADDRESS_SPACES) && config->writespace != NULL) { FPTR spacenum = (FPTR)config->type - (FPTR)DEVCB_TYPE_MEMORY(ADDRESS_SPACE_PROGRAM); - const device_config *cpu; + running_device *cpu; if (device->owner != NULL) cpu = device->owner->subdevice(config->tag); diff --git a/src/emu/devcb.h b/src/emu/devcb.h index ba6cfe02730..41346ebdd0c 100644 --- a/src/emu/devcb.h +++ b/src/emu/devcb.h @@ -84,8 +84,8 @@ /* macros for defining read_line/write_line functions */ -#define READ_LINE_DEVICE_HANDLER(name) int name(ATTR_UNUSED const device_config *device) -#define WRITE_LINE_DEVICE_HANDLER(name) void name(ATTR_UNUSED const device_config *device, ATTR_UNUSED int state) +#define READ_LINE_DEVICE_HANDLER(name) int name(ATTR_UNUSED running_device *device) +#define WRITE_LINE_DEVICE_HANDLER(name) void name(ATTR_UNUSED running_device *device, ATTR_UNUSED int state) @@ -98,8 +98,8 @@ class device_config; /* read/write types for I/O lines (similar to read/write handlers but no offset) */ -typedef int (*read_line_device_func)(const device_config *device); -typedef void (*write_line_device_func)(const device_config *device, int state); +typedef int (*read_line_device_func)(running_device *device); +typedef void (*write_line_device_func)(running_device *device, int state); /* static structure used for device configuration when the desired callback type is a read_line_device_func */ @@ -214,16 +214,16 @@ struct _devcb_resolved_write8 /* ----- static-to-live conversion ----- */ /* convert a static read line definition to a live definition */ -void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_read_line *config, const device_config *device); +void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_read_line *config, running_device *device); /* convert a static write line definition to a live definition */ -void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_write_line *config, const device_config *device); +void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_write_line *config, running_device *device); /* convert a static 8-bit read definition to a live definition */ -void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *config, const device_config *device); +void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *config, running_device *device); /* convert a static 8-bit write definition to a live definition */ -void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *config, const device_config *device); +void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *config, running_device *device); @@ -238,7 +238,7 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c INLINE int devcb_call_read_line(const devcb_resolved_read_line *resolved) { - return (resolved->read != NULL) ? (*resolved->read)((const device_config *)resolved->target) : 0; + return (resolved->read != NULL) ? (*resolved->read)((running_device *)resolved->target) : 0; } @@ -249,7 +249,7 @@ INLINE int devcb_call_read_line(const devcb_resolved_read_line *resolved) INLINE int devcb_call_read8(const devcb_resolved_read8 *resolved, offs_t offset) { - return (resolved->read != NULL) ? (*resolved->read)((const device_config *)resolved->target, offset) : 0; + return (resolved->read != NULL) ? (*resolved->read)((running_device *)resolved->target, offset) : 0; } @@ -261,7 +261,7 @@ INLINE int devcb_call_read8(const devcb_resolved_read8 *resolved, offs_t offset) INLINE void devcb_call_write_line(const devcb_resolved_write_line *resolved, int state) { if (resolved->write != NULL) - (*resolved->write)((const device_config *)resolved->target, state); + (*resolved->write)((running_device *)resolved->target, state); } @@ -273,7 +273,7 @@ INLINE void devcb_call_write_line(const devcb_resolved_write_line *resolved, int INLINE void devcb_call_write8(const devcb_resolved_write8 *resolved, offs_t offset, UINT8 data) { if (resolved->write != NULL) - (*resolved->write)((const device_config *)resolved->target, offset, data); + (*resolved->write)((running_device *)resolved->target, offset, data); } /*------------------------------------------------- diff --git a/src/emu/devconv.h b/src/emu/devconv.h index 0d67f83c990..3772194c227 100644 --- a/src/emu/devconv.h +++ b/src/emu/devconv.h @@ -85,7 +85,7 @@ * *************************************/ -INLINE UINT16 read16be_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT16 mem_mask) +INLINE UINT16 read16be_with_read8_device_handler(read8_device_func handler, running_device *device, offs_t offset, UINT16 mem_mask) { UINT16 result = 0; if (ACCESSING_BITS_8_15) @@ -96,7 +96,7 @@ INLINE UINT16 read16be_with_read8_device_handler(read8_device_func handler, cons } -INLINE void write16be_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT16 data, UINT16 mem_mask) +INLINE void write16be_with_write8_device_handler(write8_device_func handler, running_device *device, offs_t offset, UINT16 data, UINT16 mem_mask) { if (ACCESSING_BITS_8_15) (*handler)(device, offset * 2 + 0, data >> 8); @@ -111,7 +111,7 @@ INLINE void write16be_with_write8_device_handler(write8_device_func handler, con * *************************************/ -INLINE UINT16 read16le_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT16 mem_mask) +INLINE UINT16 read16le_with_read8_device_handler(read8_device_func handler, running_device *device, offs_t offset, UINT16 mem_mask) { UINT16 result = 0; if (ACCESSING_BITS_0_7) @@ -122,7 +122,7 @@ INLINE UINT16 read16le_with_read8_device_handler(read8_device_func handler, cons } -INLINE void write16le_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT16 data, UINT16 mem_mask) +INLINE void write16le_with_write8_device_handler(write8_device_func handler, running_device *device, offs_t offset, UINT16 data, UINT16 mem_mask) { if (ACCESSING_BITS_0_7) (*handler)(device, offset * 2 + 0, data >> 0); @@ -137,7 +137,7 @@ INLINE void write16le_with_write8_device_handler(write8_device_func handler, con * *************************************/ -INLINE UINT32 read32be_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) +INLINE UINT32 read32be_with_read8_device_handler(read8_device_func handler, running_device *device, offs_t offset, UINT32 mem_mask) { UINT32 result = 0; if (ACCESSING_BITS_16_31) @@ -148,7 +148,7 @@ INLINE UINT32 read32be_with_read8_device_handler(read8_device_func handler, cons } -INLINE void write32be_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) +INLINE void write32be_with_write8_device_handler(write8_device_func handler, running_device *device, offs_t offset, UINT32 data, UINT32 mem_mask) { if (ACCESSING_BITS_16_31) write16be_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 16, mem_mask >> 16); @@ -163,7 +163,7 @@ INLINE void write32be_with_write8_device_handler(write8_device_func handler, con * *************************************/ -INLINE UINT32 read32le_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) +INLINE UINT32 read32le_with_read8_device_handler(read8_device_func handler, running_device *device, offs_t offset, UINT32 mem_mask) { UINT32 result = 0; if (ACCESSING_BITS_0_15) @@ -174,7 +174,7 @@ INLINE UINT32 read32le_with_read8_device_handler(read8_device_func handler, cons } -INLINE void write32le_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) +INLINE void write32le_with_write8_device_handler(write8_device_func handler, running_device *device, offs_t offset, UINT32 data, UINT32 mem_mask) { if (ACCESSING_BITS_0_15) write16le_with_write8_device_handler(handler, device, offset * 2 + 0, data, mem_mask); @@ -189,7 +189,7 @@ INLINE void write32le_with_write8_device_handler(write8_device_func handler, con * *************************************/ -INLINE UINT32 read32be_with_16be_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) +INLINE UINT32 read32be_with_16be_device_handler(read16_device_func handler, running_device *device, offs_t offset, UINT32 mem_mask) { UINT32 result = 0; if (ACCESSING_BITS_16_31) @@ -200,7 +200,7 @@ INLINE UINT32 read32be_with_16be_device_handler(read16_device_func handler, cons } -INLINE void write32be_with_16be_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) +INLINE void write32be_with_16be_device_handler(write16_device_func handler, running_device *device, offs_t offset, UINT32 data, UINT32 mem_mask) { if (ACCESSING_BITS_16_31) (*handler)(device, offset * 2 + 0, data >> 16, mem_mask >> 16); @@ -215,7 +215,7 @@ INLINE void write32be_with_16be_device_handler(write16_device_func handler, cons * *************************************/ -INLINE UINT32 read32le_with_16le_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) +INLINE UINT32 read32le_with_16le_device_handler(read16_device_func handler, running_device *device, offs_t offset, UINT32 mem_mask) { UINT32 result = 0; if (ACCESSING_BITS_0_15) @@ -226,7 +226,7 @@ INLINE UINT32 read32le_with_16le_device_handler(read16_device_func handler, cons } -INLINE void write32le_with_16le_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) +INLINE void write32le_with_16le_device_handler(write16_device_func handler, running_device *device, offs_t offset, UINT32 data, UINT32 mem_mask) { if (ACCESSING_BITS_0_15) (*handler)(device, offset * 2 + 0, data, mem_mask); @@ -241,7 +241,7 @@ INLINE void write32le_with_16le_device_handler(write16_device_func handler, cons * *************************************/ -INLINE UINT32 read32be_with_16le_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) +INLINE UINT32 read32be_with_16le_device_handler(read16_device_func handler, running_device *device, offs_t offset, UINT32 mem_mask) { UINT32 result = 0; mem_mask = FLIPENDIAN_INT32(mem_mask); @@ -250,7 +250,7 @@ INLINE UINT32 read32be_with_16le_device_handler(read16_device_func handler, cons } -INLINE void write32be_with_16le_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) +INLINE void write32be_with_16le_device_handler(write16_device_func handler, running_device *device, offs_t offset, UINT32 data, UINT32 mem_mask) { data = FLIPENDIAN_INT32(data); mem_mask = FLIPENDIAN_INT32(mem_mask); @@ -264,7 +264,7 @@ INLINE void write32be_with_16le_device_handler(write16_device_func handler, cons * *************************************/ -INLINE UINT32 read32le_with_16be_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT32 mem_mask) +INLINE UINT32 read32le_with_16be_device_handler(read16_device_func handler, running_device *device, offs_t offset, UINT32 mem_mask) { UINT32 result = 0; mem_mask = FLIPENDIAN_INT32(mem_mask); @@ -273,7 +273,7 @@ INLINE UINT32 read32le_with_16be_device_handler(read16_device_func handler, cons } -INLINE void write32le_with_16be_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT32 data, UINT32 mem_mask) +INLINE void write32le_with_16be_device_handler(write16_device_func handler, running_device *device, offs_t offset, UINT32 data, UINT32 mem_mask) { data = FLIPENDIAN_INT32(data); mem_mask = FLIPENDIAN_INT32(mem_mask); @@ -287,7 +287,7 @@ INLINE void write32le_with_16be_device_handler(write16_device_func handler, cons * *************************************/ -INLINE UINT64 read64be_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) +INLINE UINT64 read64be_with_read8_device_handler(read8_device_func handler, running_device *device, offs_t offset, UINT64 mem_mask) { UINT64 result = 0; if (ACCESSING_BITS_32_63) @@ -298,7 +298,7 @@ INLINE UINT64 read64be_with_read8_device_handler(read8_device_func handler, cons } -INLINE void write64be_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) +INLINE void write64be_with_write8_device_handler(write8_device_func handler, running_device *device, offs_t offset, UINT64 data, UINT64 mem_mask) { if (ACCESSING_BITS_32_63) write32be_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32); @@ -313,7 +313,7 @@ INLINE void write64be_with_write8_device_handler(write8_device_func handler, con * *************************************/ -INLINE UINT64 read64le_with_read8_device_handler(read8_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) +INLINE UINT64 read64le_with_read8_device_handler(read8_device_func handler, running_device *device, offs_t offset, UINT64 mem_mask) { UINT64 result = 0; if (ACCESSING_BITS_0_31) @@ -324,7 +324,7 @@ INLINE UINT64 read64le_with_read8_device_handler(read8_device_func handler, cons } -INLINE void write64le_with_write8_device_handler(write8_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) +INLINE void write64le_with_write8_device_handler(write8_device_func handler, running_device *device, offs_t offset, UINT64 data, UINT64 mem_mask) { if (ACCESSING_BITS_0_31) write32le_with_write8_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0); @@ -339,7 +339,7 @@ INLINE void write64le_with_write8_device_handler(write8_device_func handler, con * *************************************/ -INLINE UINT32 read64be_with_16be_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) +INLINE UINT32 read64be_with_16be_device_handler(read16_device_func handler, running_device *device, offs_t offset, UINT64 mem_mask) { UINT64 result = 0; if (ACCESSING_BITS_32_63) @@ -350,7 +350,7 @@ INLINE UINT32 read64be_with_16be_device_handler(read16_device_func handler, cons } -INLINE void write64be_with_16be_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) +INLINE void write64be_with_16be_device_handler(write16_device_func handler, running_device *device, offs_t offset, UINT64 data, UINT64 mem_mask) { if (ACCESSING_BITS_32_63) write32be_with_16be_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32); @@ -365,7 +365,7 @@ INLINE void write64be_with_16be_device_handler(write16_device_func handler, cons * *************************************/ -INLINE UINT32 read64le_with_16le_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) +INLINE UINT32 read64le_with_16le_device_handler(read16_device_func handler, running_device *device, offs_t offset, UINT64 mem_mask) { UINT64 result = 0; if (ACCESSING_BITS_0_31) @@ -376,7 +376,7 @@ INLINE UINT32 read64le_with_16le_device_handler(read16_device_func handler, cons } -INLINE void write64le_with_16le_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) +INLINE void write64le_with_16le_device_handler(write16_device_func handler, running_device *device, offs_t offset, UINT64 data, UINT64 mem_mask) { if (ACCESSING_BITS_0_31) write32le_with_16le_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0); @@ -391,7 +391,7 @@ INLINE void write64le_with_16le_device_handler(write16_device_func handler, cons * *************************************/ -INLINE UINT32 read64be_with_16le_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) +INLINE UINT32 read64be_with_16le_device_handler(read16_device_func handler, running_device *device, offs_t offset, UINT64 mem_mask) { UINT64 result = 0; if (ACCESSING_BITS_32_63) @@ -402,7 +402,7 @@ INLINE UINT32 read64be_with_16le_device_handler(read16_device_func handler, cons } -INLINE void write64be_with_16le_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) +INLINE void write64be_with_16le_device_handler(write16_device_func handler, running_device *device, offs_t offset, UINT64 data, UINT64 mem_mask) { if (ACCESSING_BITS_32_63) write32be_with_16le_device_handler(handler, device, offset * 2 + 0, data >> 32, mem_mask >> 32); @@ -417,7 +417,7 @@ INLINE void write64be_with_16le_device_handler(write16_device_func handler, cons * *************************************/ -INLINE UINT32 read64le_with_16be_device_handler(read16_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) +INLINE UINT32 read64le_with_16be_device_handler(read16_device_func handler, running_device *device, offs_t offset, UINT64 mem_mask) { UINT64 result = 0; if (ACCESSING_BITS_0_31) @@ -428,7 +428,7 @@ INLINE UINT32 read64le_with_16be_device_handler(read16_device_func handler, cons } -INLINE void write64le_with_16be_device_handler(write16_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) +INLINE void write64le_with_16be_device_handler(write16_device_func handler, running_device *device, offs_t offset, UINT64 data, UINT64 mem_mask) { if (ACCESSING_BITS_0_31) write32le_with_16be_device_handler(handler, device, offset * 2 + 0, data >> 0, mem_mask >> 0); @@ -443,7 +443,7 @@ INLINE void write64le_with_16be_device_handler(write16_device_func handler, cons * *************************************/ -INLINE UINT64 read64be_with_32be_device_handler(read32_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) +INLINE UINT64 read64be_with_32be_device_handler(read32_device_func handler, running_device *device, offs_t offset, UINT64 mem_mask) { UINT64 result = 0; if (ACCESSING_BITS_32_63) @@ -454,7 +454,7 @@ INLINE UINT64 read64be_with_32be_device_handler(read32_device_func handler, cons } -INLINE void write64be_with_32be_device_handler(write32_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) +INLINE void write64be_with_32be_device_handler(write32_device_func handler, running_device *device, offs_t offset, UINT64 data, UINT64 mem_mask) { if (ACCESSING_BITS_32_63) (*handler)(device, offset * 2 + 0, data >> 32, mem_mask >> 32); @@ -469,7 +469,7 @@ INLINE void write64be_with_32be_device_handler(write32_device_func handler, cons * *************************************/ -INLINE UINT64 read64le_with_32le_device_handler(read32_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) +INLINE UINT64 read64le_with_32le_device_handler(read32_device_func handler, running_device *device, offs_t offset, UINT64 mem_mask) { UINT64 result = 0; if (ACCESSING_BITS_0_31) @@ -480,7 +480,7 @@ INLINE UINT64 read64le_with_32le_device_handler(read32_device_func handler, cons } -INLINE void write64le_with_32le_device_handler(write32_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) +INLINE void write64le_with_32le_device_handler(write32_device_func handler, running_device *device, offs_t offset, UINT64 data, UINT64 mem_mask) { if (ACCESSING_BITS_0_31) (*handler)(device, offset * 2 + 0, data >> 0, mem_mask >> 0); @@ -495,7 +495,7 @@ INLINE void write64le_with_32le_device_handler(write32_device_func handler, cons * *************************************/ -INLINE UINT64 read64be_with_32le_device_handler(read32_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) +INLINE UINT64 read64be_with_32le_device_handler(read32_device_func handler, running_device *device, offs_t offset, UINT64 mem_mask) { UINT64 result; mem_mask = FLIPENDIAN_INT64(mem_mask); @@ -504,7 +504,7 @@ INLINE UINT64 read64be_with_32le_device_handler(read32_device_func handler, cons } -INLINE void write64be_with_32le_device_handler(write32_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) +INLINE void write64be_with_32le_device_handler(write32_device_func handler, running_device *device, offs_t offset, UINT64 data, UINT64 mem_mask) { data = FLIPENDIAN_INT64(data); mem_mask = FLIPENDIAN_INT64(mem_mask); @@ -518,7 +518,7 @@ INLINE void write64be_with_32le_device_handler(write32_device_func handler, cons * *************************************/ -INLINE UINT64 read64le_with_32be_device_handler(read32_device_func handler, const device_config *device, offs_t offset, UINT64 mem_mask) +INLINE UINT64 read64le_with_32be_device_handler(read32_device_func handler, running_device *device, offs_t offset, UINT64 mem_mask) { UINT64 result; mem_mask = FLIPENDIAN_INT64(mem_mask); @@ -527,7 +527,7 @@ INLINE UINT64 read64le_with_32be_device_handler(read32_device_func handler, cons } -INLINE void write64le_with_32be_device_handler(write32_device_func handler, const device_config *device, offs_t offset, UINT64 data, UINT64 mem_mask) +INLINE void write64le_with_32be_device_handler(write32_device_func handler, running_device *device, offs_t offset, UINT64 data, UINT64 mem_mask) { data = FLIPENDIAN_INT64(data); mem_mask = FLIPENDIAN_INT64(mem_mask); diff --git a/src/emu/devintrf.c b/src/emu/devintrf.c index 59925ece500..3000c30f341 100644 --- a/src/emu/devintrf.c +++ b/src/emu/devintrf.c @@ -75,7 +75,7 @@ static char *get_temp_string_buffer(void) effect? -------------------------------------------------*/ -INLINE int device_matches_type(const device_config *device, device_type type) +INLINE int device_matches_type(running_device *device, device_type type) { return (type == DEVICE_TYPE_WILDCARD) ? TRUE : (device->type == type); } @@ -86,7 +86,7 @@ INLINE int device_matches_type(const device_config *device, device_type type) info for a given region -------------------------------------------------*/ -const region_info *device_config::subregion(const char *_tag) const +const region_info *running_device::subregion(const char *_tag) const { // safety first if (this == NULL) @@ -103,7 +103,7 @@ const region_info *device_config::subregion(const char *_tag) const device that is owned by us -------------------------------------------------*/ -const device_config *device_config::subdevice(const char *_tag) const +running_device *running_device::subdevice(const char *_tag) const { // safety first if (this == NULL) @@ -130,19 +130,14 @@ device_config::device_config(const device_config *_owner, device_type _type, con owner(const_cast<device_config *>(_owner)), tag(_tag), type(_type), - devclass(static_cast<device_class>(devtype_get_info_int(_type, DEVINFO_INT_CLASS))), + devclass(DEVICE_CLASS_GENERAL), clock(_clock), static_config(NULL), - inline_config(NULL), - machine(NULL), - started(DEVICE_STOPPED), - token(NULL), - tokenbytes(NULL), - execute(NULL), - region(NULL) + inline_config(NULL) { memset(address_map, 0, sizeof(address_map)); - memset(addrspace, 0, sizeof(addrspace)); + + devclass = (device_class)get_config_int(DEVINFO_INT_CLASS); if ((clock & 0xff000000) == 0xff000000) { @@ -151,7 +146,7 @@ device_config::device_config(const device_config *_owner, device_type _type, con } /* populate device configuration */ - UINT32 configlen = (UINT32)devtype_get_info_int(_type, DEVINFO_INT_INLINE_CONFIG_BYTES); + UINT32 configlen = (UINT32)get_config_int(DEVINFO_INT_INLINE_CONFIG_BYTES); inline_config = (configlen == 0) ? NULL : global_alloc_array_clear(UINT8, configlen); } @@ -159,7 +154,7 @@ device_config::device_config(const device_config *_owner, device_type _type, con device_config::~device_config() { /* call the custom config free function first */ - device_custom_config_func custom = reinterpret_cast<device_custom_config_func>(devtype_get_info_fct(type, DEVINFO_FCT_CUSTOM_CONFIG)); + device_custom_config_func custom = reinterpret_cast<device_custom_config_func>(get_config_fct(DEVINFO_FCT_CUSTOM_CONFIG)); if (custom != NULL) (*custom)(this, MCONFIG_TOKEN_DEVICE_CONFIG_CUSTOM_FREE, NULL); @@ -167,15 +162,59 @@ device_config::~device_config() } +running_device::running_device(running_machine &_machine, const device_config &_config) + : _baseconfig(_config), + machine(&_machine), + next(NULL), + owner((_config.owner != NULL) ? _machine.devicelist.find(_config.owner->tag) : NULL), + tag(_config.tag), + type(_config.type), + devclass(_config.devclass), + clock(_config.clock), + started(DEVICE_STOPPED), + token(NULL), + tokenbytes(_config.get_config_int(DEVINFO_INT_TOKEN_BYTES)), + region(NULL), + execute(NULL), + get_runtime_info(NULL) +{ + /* get the size of the token data; we do it directly because we can't call device_get_config_* with no token */ + if (tokenbytes == 0) + throw emu_fatalerror("Device %s specifies a 0 token length!\n", tag.cstr()); + + /* allocate memory for the token */ + token = auto_alloc_array_clear(machine, UINT8, tokenbytes); + + /* fill in the remaining runtime fields */ + memset(addrspace, 0, sizeof(addrspace)); + + // get function pointers + execute = (device_execute_func)get_config_fct(DEVINFO_FCT_EXECUTE); + get_runtime_info = (device_get_runtime_info_func)get_config_fct(DEVINFO_FCT_GET_RUNTIME_INFO); +} + + +running_device::~running_device() +{ + auto_free(machine, token); +} + + +void running_device::set_address_space(int spacenum, const address_space *space) +{ + addrspace[spacenum] = space; +} + + /*------------------------------------------------- device_build_tag - build a tag that combines the device's name and the given tag -------------------------------------------------*/ -astring &device_build_tag(astring &dest, const device_config *device, const char *tag) +astring &device_build_tag(astring &dest, const device_config *devconfig, const char *tag) { - if (device != NULL) - dest.cpy(device->tag).cat(":").cat(tag); + if (devconfig != NULL) + dest.cpy(devconfig->tag).cat(":").cat(tag); else dest.cpy(tag); return dest; @@ -203,9 +242,9 @@ astring &device_inherit_tag(astring &dest, const char *sourcetag, const char *ta on a device -------------------------------------------------*/ -const device_contract *device_get_contract(const device_config *device, const char *name) +const device_contract *device_get_contract(running_device *device, const char *name) { - const device_contract *contract = (const device_contract *)device_get_info_ptr(device, DEVINFO_PTR_CONTRACT_LIST); + const device_contract *contract = (const device_contract *)device->get_config_ptr(DEVINFO_PTR_CONTRACT_LIST); /* if no contracts, obviously we don't have it */ if (contract == NULL) @@ -222,109 +261,6 @@ const device_contract *device_get_contract(const device_config *device, const ch /*************************************************************************** - TYPE-BASED DEVICE ACCESS -***************************************************************************/ - -device_config *device_list::first(device_type type) const -{ - /* first of a given type */ - for (device_config *curdev = super::first(); curdev != NULL; curdev = curdev->next) - if (curdev->type == type) - return curdev; - return NULL; -} - - -int device_list::count(device_type type) const -{ - int num = 0; - - for (const device_config *curdev = first(type); curdev != NULL; curdev = curdev->typenext()) - num++; - - return num; -} - - -int device_list::index(device_type type, device_config *object) const -{ - int num = 0; - for (device_config *cur = first(type); cur != NULL; cur = cur->typenext()) - if (cur == object) - return num; - else - num++; - return -1; -} - - -int device_list::index(device_type type, const char *tag) const -{ - device_config *object = find(tag); - return (object != NULL && object->type == type) ? index(type, object) : -1; -} - - -device_config *device_list::find(device_type type, int index) const -{ - for (device_config *cur = first(type); cur != NULL; cur = cur->typenext()) - if (index-- == 0) - return cur; - return NULL; -} - - -device_config *device_list::first(device_class devclass) const -{ - /* first of a given devclass */ - for (device_config *curdev = super::first(); curdev != NULL; curdev = curdev->next) - if (curdev->devclass == devclass) - return curdev; - return NULL; -} - - -int device_list::count(device_class devclass) const -{ - int num = 0; - - for (const device_config *curdev = first(devclass); curdev != NULL; curdev = curdev->classnext()) - num++; - - return num; -} - - -int device_list::index(device_class devclass, device_config *object) const -{ - int num = 0; - for (device_config *cur = first(devclass); cur != NULL; cur = cur->classnext()) - if (cur == object) - return num; - else - num++; - return -1; -} - - -int device_list::index(device_class devclass, const char *tag) const -{ - device_config *object = find(tag); - return (object != NULL && object->devclass == devclass) ? index(devclass, object) : -1; -} - - -device_config *device_list::find(device_class devclass, int index) const -{ - for (device_config *cur = first(devclass); cur != NULL; cur = cur->classnext()) - if (index-- == 0) - return cur; - return NULL; -} - - - -/*************************************************************************** LIVE DEVICE MANAGEMENT ***************************************************************************/ @@ -333,15 +269,10 @@ device_config *device_list::find(device_class devclass, int index) const running_machine to its list of devices -------------------------------------------------*/ -void device_list_attach_machine(running_machine *machine) +void device_list::import_config_list(const device_config_list &list, running_machine &machine) { - device_config *device; - - assert(machine != NULL); - - /* iterate over devices and assign the machine to them */ - for (device = machine->config->devicelist.first(); device != NULL; device = device->next) - device->machine = machine; + for (const device_config *devconfig = list.first(); devconfig != NULL; devconfig = devconfig->next) + append(devconfig->tag, new running_device(machine, *devconfig)); } @@ -352,9 +283,9 @@ void device_list_attach_machine(running_machine *machine) void device_list_start(running_machine *machine) { - device_config *device; + running_device *device; int numstarted = 0; - int devcount = 0; + int devcount = machine->devicelist.count(); assert(machine != NULL); @@ -362,46 +293,21 @@ void device_list_start(running_machine *machine) add_reset_callback(machine, device_list_reset); add_exit_callback(machine, device_list_stop); - /* iterate over devices and allocate memory for them */ - for (device = machine->config->devicelist.first(); device != NULL; device = device->next) - { - int spacenum; - - assert(!device->started); - assert(device->machine == machine); - assert(device->token == NULL); - assert(device->type != NULL); - - devcount++; - - /* get the size of the token data; we do it directly because we can't call device_get_info_* with no token */ - device->tokenbytes = device_get_info_int(device, DEVINFO_INT_TOKEN_BYTES); - if (device->tokenbytes == 0) - fatalerror("Device %s specifies a 0 token length!\n", device_get_name(device)); - - /* allocate memory for the token */ - device->token = auto_alloc_array_clear(machine, UINT8, device->tokenbytes); - - /* fill in the remaining runtime fields */ - device->region = machine->region(device->tag); - for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) - device->addrspace[spacenum] = device->space(spacenum); - device->execute = (device_execute_func)device_get_info_fct(device, DEVINFO_FCT_EXECUTE); - } - /* iterate until we've started everything */ while (numstarted < devcount) { int prevstarted = numstarted; /* iterate over devices and start them */ - for (device = machine->config->devicelist.first(); device != NULL; device = device->next) + for (device = machine->devicelist.first(); device != NULL; device = device->next) { - device_start_func start = (device_start_func)device_get_info_fct(device, DEVINFO_FCT_START); + device_start_func start = (device_start_func)device->get_config_fct(DEVINFO_FCT_START); assert(start != NULL); if (!device->started) { + device->region = machine->regionlist.find(device->baseconfig().tag); + device->started = DEVICE_STARTING; (*start)(device); @@ -428,11 +334,11 @@ void device_list_start(running_machine *machine) given device for dependency reasons -------------------------------------------------*/ -void device_delay_init(const device_config *device) +void device_delay_init(running_device *device) { if (device->started != DEVICE_STARTING && device->started != DEVICE_DELAYED) fatalerror("Error: Calling device_delay_init on a device not in the process of starting."); - ((device_config *)device)->started = DEVICE_DELAYED; + device->started = DEVICE_DELAYED; } @@ -443,14 +349,14 @@ void device_delay_init(const device_config *device) static void device_list_stop(running_machine *machine) { - device_config *device; + running_device *device; assert(machine != NULL); /* iterate over devices and stop them */ - for (device = machine->config->devicelist.first(); device != NULL; device = device->next) + for (device = machine->devicelist.first(); device != NULL; device = device->next) { - device_stop_func stop = (device_stop_func)device_get_info_fct(device, DEVINFO_FCT_STOP); + device_stop_func stop = (device_stop_func)device->get_config_fct(DEVINFO_FCT_STOP); assert(device->token != NULL); assert(device->type != NULL); @@ -478,12 +384,12 @@ static void device_list_stop(running_machine *machine) static void device_list_reset(running_machine *machine) { - const device_config *device; + running_device *device; assert(machine != NULL); /* iterate over devices and stop them */ - for (device = machine->config->devicelist.first(); device != NULL; device = device->next) + for (device = machine->devicelist.first(); device != NULL; device = device->next) device_reset(device); } @@ -493,7 +399,7 @@ static void device_list_reset(running_machine *machine) allocated device_config -------------------------------------------------*/ -void device_reset(const device_config *device) +void device_reset(running_device *device) { device_reset_func reset; @@ -502,7 +408,7 @@ void device_reset(const device_config *device) assert(device->type != NULL); /* if we have a reset function, call it */ - reset = (device_reset_func)device_get_info_fct(device, DEVINFO_FCT_RESET); + reset = (device_reset_func)device->get_config_fct(DEVINFO_FCT_RESET); if (reset != NULL) (*reset)(device); } @@ -513,7 +419,7 @@ void device_reset(const device_config *device) device -------------------------------------------------*/ -void device_set_clock(const device_config *device, UINT32 clock) +void device_set_clock(running_device *device, UINT32 clock) { device_config *devicerw = (device_config *)device; @@ -528,81 +434,81 @@ void device_set_clock(const device_config *device, UINT32 clock) ***************************************************************************/ /*------------------------------------------------- - device_get_info_int - return an integer state + device_get_config_int - return an integer state value from an allocated device -------------------------------------------------*/ -INT64 device_get_info_int(const device_config *device, UINT32 state) +INT64 device_config::get_config_int(UINT32 state) const { deviceinfo info; - assert(device != NULL); - assert(device->type != NULL); + assert(this != NULL); + assert(type != NULL); assert(state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST); /* retrieve the value */ info.i = 0; - (*device->type)(device, state, &info); + (*type)(this, state, &info); return info.i; } /*------------------------------------------------- - device_get_info_ptr - return a pointer state + device_get_config_ptr - return a pointer state value from an allocated device -------------------------------------------------*/ -void *device_get_info_ptr(const device_config *device, UINT32 state) +void *device_config::get_config_ptr(UINT32 state) const { deviceinfo info; - assert(device != NULL); - assert(device->type != NULL); + assert(this != NULL); + assert(type != NULL); assert(state >= DEVINFO_PTR_FIRST && state <= DEVINFO_PTR_LAST); /* retrieve the value */ info.p = NULL; - (*device->type)(device, state, &info); + (*type)(this, state, &info); return info.p; } /*------------------------------------------------- - device_get_info_fct - return a function + device_get_config_fct - return a function pointer state value from an allocated device -------------------------------------------------*/ -genf *device_get_info_fct(const device_config *device, UINT32 state) +genf *device_config::get_config_fct(UINT32 state) const { deviceinfo info; - assert(device != NULL); - assert(device->type != NULL); + assert(this != NULL); + assert(type != NULL); assert(state >= DEVINFO_FCT_FIRST && state <= DEVINFO_FCT_LAST); /* retrieve the value */ info.f = 0; - (*device->type)(device, state, &info); + (*type)(this, state, &info); return info.f; } /*------------------------------------------------- - device_get_info_string - return a string value + device_get_config_string - return a string value from an allocated device -------------------------------------------------*/ -const char *device_get_info_string(const device_config *device, UINT32 state) +const char *device_config::get_config_string(UINT32 state) const { deviceinfo info; - assert(device != NULL); - assert(device->type != NULL); + assert(this != NULL); + assert(type != NULL); assert(state >= DEVINFO_STR_FIRST && state <= DEVINFO_STR_LAST); /* retrieve the value */ info.s = get_temp_string_buffer(); - (*device->type)(device, state, &info); + (*type)(this, state, &info); if (info.s[0] == 0) set_default_string(state, info.s); return info.s; @@ -610,66 +516,62 @@ const char *device_get_info_string(const device_config *device, UINT32 state) -/*************************************************************************** - DEVICE TYPE INFORMATION SETTERS -***************************************************************************/ - /*------------------------------------------------- - devtype_get_info_int - return an integer value - from a device type (does not need to be - allocated) + device_get_runtime_int - return an integer state + value from an allocated device -------------------------------------------------*/ -INT64 devtype_get_info_int(device_type type, UINT32 state) +INT64 running_device::get_runtime_int(UINT32 state) { deviceinfo info; - assert(type != NULL); + assert(this != NULL); + assert(get_runtime_info != NULL); assert(state >= DEVINFO_INT_FIRST && state <= DEVINFO_INT_LAST); /* retrieve the value */ info.i = 0; - (*type)(NULL, state, &info); + (*get_runtime_info)(this, state, &info); return info.i; } /*------------------------------------------------- - devtype_get_info_int - return a function - pointer from a device type (does not need to - be allocated) + device_get_runtime_ptr - return a pointer state + value from an allocated device -------------------------------------------------*/ -genf *devtype_get_info_fct(device_type type, UINT32 state) +void *running_device::get_runtime_ptr(UINT32 state) { deviceinfo info; - assert(type != NULL); - assert(state >= DEVINFO_FCT_FIRST && state <= DEVINFO_FCT_LAST); + assert(this != NULL); + assert(get_runtime_info != NULL); + assert(state >= DEVINFO_PTR_FIRST && state <= DEVINFO_PTR_LAST); /* retrieve the value */ - info.f = 0; - (*type)(NULL, state, &info); - return info.f; + info.p = NULL; + (*get_runtime_info)(this, state, &info); + return info.p; } /*------------------------------------------------- - devtype_get_info_string - return a string value - from a device type (does not need to be - allocated) + device_get_runtime_string - return a string value + from an allocated device -------------------------------------------------*/ -const char *devtype_get_info_string(device_type type, UINT32 state) +const char *running_device::get_runtime_string(UINT32 state) { deviceinfo info; - assert(type != NULL); + assert(this != NULL); + assert(get_runtime_info != NULL); assert(state >= DEVINFO_STR_FIRST && state <= DEVINFO_STR_LAST); /* retrieve the value */ info.s = get_temp_string_buffer(); - (*type)(NULL, state, &info); + (*get_runtime_info)(this, state, &info); if (info.s[0] == 0) set_default_string(state, info.s); return info.s; diff --git a/src/emu/devintrf.h b/src/emu/devintrf.h index f74a427fd6a..b82590bccab 100644 --- a/src/emu/devintrf.h +++ b/src/emu/devintrf.h @@ -30,7 +30,7 @@ union machine_config_token; /* device classes */ -enum _device_class +enum device_class { DEVICE_CLASS_GENERAL = 0, /* default class for general devices */ DEVICE_CLASS_PERIPHERAL, /* peripheral devices: PIAs, timers, etc. */ @@ -41,14 +41,13 @@ enum _device_class DEVICE_CLASS_TIMER, /* timer devices */ DEVICE_CLASS_OTHER /* anything else (the list may expand in the future) */ }; -typedef enum _device_class device_class; /* useful in device_list functions for scanning through all devices */ #define DEVICE_TYPE_WILDCARD NULL -/* state constants passed to the device_get_info_func */ +/* state constants passed to the device_get_config_func */ enum { /* --- the following bits of info are returned as 64-bit signed integers --- */ @@ -117,6 +116,7 @@ enum DEVINFO_FCT_VALIDITY_CHECK, /* R/O: device_validity_check_func */ DEVINFO_FCT_NVRAM, /* R/O: device_nvram_func */ DEVINFO_FCT_CUSTOM_CONFIG, /* R/O: device_custom_config_func */ + DEVINFO_FCT_GET_RUNTIME_INFO, /* R/O: device_get_runtime_info_func */ DEVINFO_FCT_CLASS_SPECIFIC = 0x24000, /* R/W: device-specific values start here */ DEVINFO_FCT_DEVICE_SPECIFIC = 0x28000, /* R/W: device-specific values start here */ @@ -142,38 +142,43 @@ enum MACROS ***************************************************************************/ -#define DEVICE_GET_INFO_NAME(name) device_get_info_##name +#define DEVICE_GET_INFO_NAME(name) device_get_config_##name #define DEVICE_GET_INFO(name) void DEVICE_GET_INFO_NAME(name)(const device_config *device, UINT32 state, deviceinfo *info) #define DEVICE_GET_INFO_CALL(name) DEVICE_GET_INFO_NAME(name)(device, state, info) +#define DEVICE_VALIDITY_CHECK_NAME(name) device_validity_check_##name +#define DEVICE_VALIDITY_CHECK(name) int DEVICE_VALIDITY_CHECK_NAME(name)(const game_driver *driver, const device_config *device) +#define DEVICE_VALIDITY_CHECK_CALL(name) DEVICE_VALIDITY_CHECK_NAME(name)(driver, device) + +#define DEVICE_CUSTOM_CONFIG_NAME(name) device_custom_config_##name +#define DEVICE_CUSTOM_CONFIG(name) const machine_config_token *DEVICE_CUSTOM_CONFIG_NAME(name)(const device_config *device, UINT32 entrytype, const machine_config_token *tokens) +#define DEVICE_CUSTOM_CONFIG_CALL(name) DEVICE_CUSTOM_CONFIG_NAME(name)(device, entrytype, tokens) + + +#define DEVICE_GET_RUNTIME_INFO_NAME(name) device_get_runtime_info_##name +#define DEVICE_GET_RUNTIME_INFO(name) void DEVICE_GET_RUNTIME_INFO_NAME(name)(running_device *device, UINT32 state, deviceinfo *info) +#define DEVICE_GET_RUNTIME_INFO_CALL(name) DEVICE_GET_RUNTIME_INFO_NAME(name)(device, state, info) + #define DEVICE_START_NAME(name) device_start_##name -#define DEVICE_START(name) void DEVICE_START_NAME(name)(const device_config *device) +#define DEVICE_START(name) void DEVICE_START_NAME(name)(running_device *device) #define DEVICE_START_CALL(name) DEVICE_START_NAME(name)(device) #define DEVICE_STOP_NAME(name) device_stop_##name -#define DEVICE_STOP(name) void DEVICE_STOP_NAME(name)(const device_config *device) +#define DEVICE_STOP(name) void DEVICE_STOP_NAME(name)(running_device *device) #define DEVICE_STOP_CALL(name) DEVICE_STOP_NAME(name)(device) #define DEVICE_RESET_NAME(name) device_reset_##name -#define DEVICE_RESET(name) void DEVICE_RESET_NAME(name)(const device_config *device) +#define DEVICE_RESET(name) void DEVICE_RESET_NAME(name)(running_device *device) #define DEVICE_RESET_CALL(name) DEVICE_RESET_NAME(name)(device) #define DEVICE_EXECUTE_NAME(name) device_execute_##name -#define DEVICE_EXECUTE(name) INT32 DEVICE_EXECUTE_NAME(name)(const device_config *device, INT32 clocks) +#define DEVICE_EXECUTE(name) INT32 DEVICE_EXECUTE_NAME(name)(running_device *device, INT32 clocks) #define DEVICE_EXECUTE_CALL(name) DEVICE_EXECUTE_NAME(name)(device, clocks) #define DEVICE_NVRAM_NAME(name) device_nvram_##name -#define DEVICE_NVRAM(name) void DEVICE_NVRAM_NAME(name)(const device_config *device, mame_file *file, int read_or_write) +#define DEVICE_NVRAM(name) void DEVICE_NVRAM_NAME(name)(running_device *device, mame_file *file, int read_or_write) #define DEVICE_NVRAM_CALL(name) DEVICE_NVRAM_NAME(name)(device, file, read_or_write) -#define DEVICE_VALIDITY_CHECK_NAME(name) device_validity_check_##name -#define DEVICE_VALIDITY_CHECK(name) int DEVICE_VALIDITY_CHECK_NAME(name)(const game_driver *driver, const device_config *device) -#define DEVICE_VALIDITY_CHECK_CALL(name) DEVICE_VALIDITY_CHECK_NAME(name)(driver, device) - -#define DEVICE_CUSTOM_CONFIG_NAME(name) device_custom_config_##name -#define DEVICE_CUSTOM_CONFIG(name) const machine_config_token *DEVICE_CUSTOM_CONFIG_NAME(name)(const device_config *device, UINT32 entrytype, const machine_config_token *tokens) -#define DEVICE_CUSTOM_CONFIG_CALL(name) DEVICE_CUSTOM_CONFIG_NAME(name)(device, entrytype, tokens) - /* device contract lists */ #define DEVICE_CONTRACT_LIST_NAME(name) device_contract_list_##name @@ -192,46 +197,17 @@ enum #define devtag_reset(mach,tag) device_reset((mach)->device(tag)) -#define devtag_get_info_int(mach,tag,state) device_get_info_int((mach)->device(tag), state) -#define devtag_get_info_ptr(mach,tag,state) device_get_info_ptr((mach)->device(tag), state) -#define devtag_get_info_fct(mach,tag,state) device_get_info_fct((mach)->device(tag), state) -#define devtag_get_info_string(mach,tag,state) device_get_info_string((mach)->device(tag), state) - - -/* shorthand for getting standard data about device types */ -#define devtype_get_endianness(type) devtype_get_info_int(type, DEVINFO_INT_ENDIANNESS) -#define devtype_get_databus_width(type,space) devtype_get_info_int(type, DEVINFO_INT_DATABUS_WIDTH + (space)) -#define devtype_get_addrbus_width(type,space) devtype_get_info_int(type, DEVINFO_INT_ADDRBUS_WIDTH + (space)) -#define devtype_get_addrbus_shift(type,space) devtype_get_info_int(type, DEVINFO_INT_ADDRBUS_SHIFT + (space)) -#define devtype_get_name(type) devtype_get_info_string(type, DEVINFO_STR_NAME) -#define devtype_get_family(type) devtype_get_info_string(type, DEVINFO_STR_FAMILY) -#define devtype_get_version(type) devtype_get_info_string(type, DEVINFO_STR_VERSION) -#define devtype_get_source_file(type) devtype_get_info_string(type, DEVINFO_STR_SOURCE_FILE) -#define devtype_get_credits(type) devtype_get_info_string(type, DEVINFO_STR_CREDITS) - /* shorthand for getting standard data about devices */ -#define device_get_endianness(dev) device_get_info_int(dev, DEVINFO_INT_ENDIANNESS) -#define device_get_databus_width(dev,space) device_get_info_int(dev, DEVINFO_INT_DATABUS_WIDTH + (space)) -#define device_get_addrbus_width(dev,space) device_get_info_int(dev, DEVINFO_INT_ADDRBUS_WIDTH + (space)) -#define device_get_addrbus_shift(dev,space) device_get_info_int(dev, DEVINFO_INT_ADDRBUS_SHIFT + (space)) -#define device_get_name(dev) device_get_info_string(dev, DEVINFO_STR_NAME) -#define device_get_family(dev) device_get_info_string(dev, DEVINFO_STR_FAMILY) -#define device_get_version(dev) device_get_info_string(dev, DEVINFO_STR_VERSION) -#define device_get_source_file(dev) device_get_info_string(dev, DEVINFO_STR_SOURCE_FILE) -#define device_get_credits(dev) device_get_info_string(dev, DEVINFO_STR_CREDITS) - - -/* shorthand for getting standard data about devices by machine/type/tag */ -#define devtag_get_endianness(mach,tag) devtag_get_info_int(mach, tag, DEVINFO_INT_ENDIANNESS) -#define devtag_get_databus_width(mach,tag,space) devtag_get_info_int(mach, tag, DEVINFO_INT_DATABUS_WIDTH + (space)) -#define devtag_get_addrbus_width(mach,tag,space) devtag_get_info_int(mach, tag, DEVINFO_INT_ADDRBUS_WIDTH + (space)) -#define devtag_get_addrbus_shift(mach,tag,space) devtag_get_info_int(mach, tag, DEVINFO_INT_ADDRBUS_SHIFT + (space)) -#define devtag_get_name(mach,tag) devtag_get_info_string(mach, tag, DEVINFO_STR_NAME) -#define devtag_get_family(mach,tag) devtag_get_info_string(mach, tag, DEVINFO_STR_FAMILY) -#define devtag_get_version(mach,tag) devtag_get_info_string(mach, tag, DEVINFO_STR_VERSION) -#define devtag_get_source_file(mach,tag) devtag_get_info_string(mach, tag, DEVINFO_STR_SOURCE_FILE) -#define devtag_get_credits(mach,tag) devtag_get_info_string(mach, tag, DEVINFO_STR_CREDITS) +#define device_get_endianness(dev) (dev)->get_config_int(DEVINFO_INT_ENDIANNESS) +#define device_get_databus_width(dev,space) (dev)->get_config_int(DEVINFO_INT_DATABUS_WIDTH + (space)) +#define device_get_addrbus_width(dev,space) (dev)->get_config_int(DEVINFO_INT_ADDRBUS_WIDTH + (space)) +#define device_get_addrbus_shift(dev,space) (dev)->get_config_int(DEVINFO_INT_ADDRBUS_SHIFT + (space)) +#define device_get_name(dev) (dev)->get_config_string(DEVINFO_STR_NAME) +#define device_get_family(dev) (dev)->get_config_string(DEVINFO_STR_FAMILY) +#define device_get_version(dev) (dev)->get_config_string(DEVINFO_STR_VERSION) +#define device_get_source_file(dev) (dev)->get_config_string(DEVINFO_STR_SOURCE_FILE) +#define device_get_credits(dev) (dev)->get_config_string(DEVINFO_STR_CREDITS) @@ -241,6 +217,7 @@ enum /* forward-declare these types */ class device_config; +class running_device; union deviceinfo; @@ -254,24 +231,26 @@ struct device_contract /* device interface function types */ -typedef void (*device_get_info_func)(const device_config *device, UINT32 state, deviceinfo *info); -typedef void (*device_start_func)(const device_config *device); -typedef void (*device_stop_func)(const device_config *device); -typedef INT32 (*device_execute_func)(const device_config *device, INT32 clocks); -typedef void (*device_reset_func)(const device_config *device); -typedef void (*device_nvram_func)(const device_config *device, mame_file *file, int read_or_write); +typedef void (*device_get_config_func)(const device_config *device, UINT32 state, deviceinfo *info); typedef int (*device_validity_check_func)(const game_driver *driver, const device_config *device); typedef const machine_config_token *(*device_custom_config_func)(const device_config *device, UINT32 entrytype, const machine_config_token *tokens); +typedef void (*device_start_func)(running_device *device); +typedef void (*device_stop_func)(running_device *device); +typedef INT32 (*device_execute_func)(running_device *device, INT32 clocks); +typedef void (*device_reset_func)(running_device *device); +typedef void (*device_nvram_func)(running_device *device, mame_file *file, int read_or_write); +typedef void (*device_get_runtime_info_func)(running_device *device, UINT32 state, deviceinfo *info); + /* a device_type is simply a pointer to its get_info function */ -typedef device_get_info_func device_type; +typedef device_get_config_func device_type; // template specializations -class device_list : public tagged_list<device_config> +template<class T> class tagged_device_list : public tagged_list<T> { - typedef tagged_list<device_config> super; + typedef tagged_list<T> super; public: // pull the generic forms forward @@ -281,18 +260,86 @@ public: using super::find; // provide type-specific overrides - device_config *first(device_type type) const; - int count(device_type type) const; - int index(device_type type, device_config *object) const; - int index(device_type type, const char *tag) const; - device_config *find(device_type type, int index) const; + T *first(device_type type) const + { + T *cur; + for (cur = super::first(); cur != NULL && cur->type != type; cur = cur->next) ; + return cur; + } + + int count(device_type type) const + { + int num = 0; + for (const T *curdev = first(type); curdev != NULL; curdev = curdev->typenext()) num++; + return num; + } + + int index(device_type type, T *object) const + { + int num = 0; + for (T *cur = first(type); cur != NULL; cur = cur->typenext(), num++) + if (cur == object) return num; + return -1; + } + + int index(device_type type, const char *tag) const + { + T *object = find(tag); + return (object != NULL && object->type == type) ? index(type, object) : -1; + } + + T *find(device_type type, int index) const + { + for (T *cur = first(type); cur != NULL; cur = cur->typenext()) + if (index-- == 0) return cur; + return NULL; + } // provide class-specific overrides - device_config *first(device_class devclass) const; - int count(device_class devclass) const; - int index(device_class devclass, device_config *object) const; - int index(device_class devclass, const char *tag) const; - device_config *find(device_class devclass, int index) const; + T *first(device_class devclass) const + { + T *cur; + for (cur = super::first(); cur != NULL && cur->devclass != devclass; cur = cur->next) ; + return cur; + } + + int count(device_class devclass) const + { + int num = 0; + for (const T *curdev = first(devclass); curdev != NULL; curdev = curdev->classnext()) num++; + return num; + } + + int index(device_class devclass, T *object) const + { + int num = 0; + for (T *cur = first(devclass); cur != NULL; cur = cur->classnext(), num++) + if (cur == object) return num; + return -1; + } + + int index(device_class devclass, const char *tag) const + { + T *object = find(tag); + return (object != NULL && object->devclass == devclass) ? index(devclass, object) : -1; + } + + T *find(device_class devclass, int index) const + { + for (T *cur = first(devclass); cur != NULL; cur = cur->classnext()) + if (index-- == 0) return cur; + return NULL; + } +}; + + +// template specializations +typedef tagged_device_list<device_config> device_config_list; + +class device_list : public tagged_device_list<running_device> +{ +public: + void import_config_list(const device_config_list &list, running_machine &machine); }; @@ -311,6 +358,7 @@ union deviceinfo device_validity_check_func validity_check; /* DEVINFO_FCT_VALIDITY_CHECK */ device_custom_config_func custom_config; /* DEVINFO_FCT_CUSTOM_CONFIG */ device_nvram_func nvram; /* DEVINFO_FCT_NVRAM */ + device_get_runtime_info_func get_runtime_info; /* DEVINFO_FCT_GET_RUNTIME_INFO */ const rom_entry * romregion; /* DEVINFO_PTR_ROM_REGION */ const machine_config_token *machine_config; /* DEVINFO_PTR_MACHINE_CONFIG */ const device_contract * contract_list; /* DEVINFO_PTR_CONTRACT_LIST */ @@ -339,59 +387,117 @@ class device_config { DISABLE_COPYING(device_config); -public: // private eventually - const address_space * addrspace[ADDRESS_SPACES]; /* auto-discovered address spaces */ - public: device_config(const device_config *owner, device_type type, const char *tag, UINT32 clock); ~device_config(); - inline const address_space *space(int index = 0) const; - inline const address_space *space(device_space index) const; - - const region_info *subregion(const char *tag) const; - const device_config *subdevice(const char *tag) const; - device_config *typenext() const { - for (device_config *cur = this->next; cur != NULL; cur = cur->next) - if (cur->type == type) - return cur; - return NULL; + device_config *cur; + for (cur = this->next; cur != NULL && cur->type != type; cur = cur->next) ; + return cur; } device_config *classnext() const { - for (device_config *cur = this->next; cur != NULL; cur = cur->next) - if (cur->devclass == devclass) - return cur; - return NULL; + device_config *cur; + for (cur = this->next; cur != NULL && cur->devclass != devclass; cur = cur->next) ; + return cur; } - /* device relationships (always valid) */ + // get state from a device config + INT64 get_config_int(UINT32 state) const; + void *get_config_ptr(UINT32 state) const; + genf *get_config_fct(UINT32 state) const; + const char *get_config_string(UINT32 state) const; + + /* device relationships */ device_config * next; /* next device (of any type/class) */ device_config * owner; /* device that owns us, or NULL if nobody */ - /* device properties (always valid) */ + /* device properties */ astring tag; /* tag for this instance */ device_type type; /* device type */ device_class devclass; /* device class */ - /* device configuration (always valid) */ + /* device configuration */ UINT32 clock; /* device clock */ const addrmap_token * address_map[ADDRESS_SPACES]; /* address maps for each address space */ const void * static_config; /* static device configuration */ void * inline_config; /* inline device configuration */ +}; + + +class running_device +{ + DISABLE_COPYING(running_device); + + const device_config & _baseconfig; + +public: // private eventually + const address_space * addrspace[ADDRESS_SPACES]; /* auto-discovered address spaces */ + +public: + running_device(running_machine &machine, const device_config &config); + ~running_device(); + + const device_config &baseconfig() const { return _baseconfig; } + + inline const address_space *space(int index = 0) const; + inline const address_space *space(device_space index) const; + + const region_info *subregion(const char *tag) const; + running_device *subdevice(const char *tag) const; + + running_device *typenext() const + { + running_device *cur; + for (cur = this->next; cur != NULL && cur->type != type; cur = cur->next) ; + return cur; + } + + running_device *classnext() const + { + running_device *cur; + for (cur = this->next; cur != NULL && cur->devclass != devclass; cur = cur->next) ; + return cur; + } + + // get state from a device config + INT64 get_config_int(UINT32 state) const { return _baseconfig.get_config_int(state); } + void *get_config_ptr(UINT32 state) const { return _baseconfig.get_config_ptr(state); } + genf *get_config_fct(UINT32 state) const { return _baseconfig.get_config_fct(state); } + const char *get_config_string(UINT32 state) const { return _baseconfig.get_config_string(state); } + + INT64 get_runtime_int(UINT32 state); + void *get_runtime_ptr(UINT32 state); + const char *get_runtime_string(UINT32 state); + + void set_address_space(int spacenum, const address_space *space); /* these fields are only valid once the device is attached to a machine */ running_machine * machine; /* machine if device is live */ + /* device relationships */ + running_device * next; /* next device (of any type/class) */ + running_device * owner; /* device that owns us, or NULL if nobody */ + + /* device properties */ + astring tag; /* tag for this instance */ + device_type type; /* device type */ + device_class devclass; /* device class */ + + /* device configuration */ + UINT32 clock; /* device clock */ + /* these fields are only valid if the device is live */ UINT8 started; /* TRUE if the start function has succeeded */ void * token; /* token if device is live */ UINT32 tokenbytes; /* size of the token data allocated */ - device_execute_func execute; /* quick pointer to execute callback */ const region_info * region; /* our device-local region */ + + device_execute_func execute; /* quick pointer to execute callback */ + device_get_runtime_info_func get_runtime_info; }; @@ -404,61 +510,29 @@ public: /* ----- device configuration ----- */ /* build a tag that combines the device's name and the given tag */ -astring &device_build_tag(astring &dest, const device_config *device, const char *tag); +astring &device_build_tag(astring &dest, const device_config *devconfig, const char *tag); /* build a tag with the same device prefix as the source tag*/ astring &device_inherit_tag(astring &dest, const char *sourcetag, const char *tag); /* find a given contract on a device */ -const device_contract *device_get_contract(const device_config *device, const char *name); +const device_contract *device_get_contract(running_device *device, const char *name); /* ----- live device management ----- */ -/* "attach" a running_machine to its list of devices */ -void device_list_attach_machine(running_machine *machine); - /* start the configured list of devices for a machine */ void device_list_start(running_machine *machine); /* reset a device based on an allocated device_config */ -void device_reset(const device_config *device); +void device_reset(running_device *device); /* change the clock on a device */ -void device_set_clock(const device_config *device, UINT32 clock); +void device_set_clock(running_device *device, UINT32 clock); /* allow a device to ask for its initialization to be delayed */ -void device_delay_init(const device_config *device); - - - -/* ----- device information getters ----- */ - -/* return an integer state value from an allocated device */ -INT64 device_get_info_int(const device_config *device, UINT32 state); - -/* return a pointer state value from an allocated device */ -void *device_get_info_ptr(const device_config *device, UINT32 state); - -/* return a function pointer state value from an allocated device */ -genf *device_get_info_fct(const device_config *device, UINT32 state); - -/* return a string value from an allocated device */ -const char *device_get_info_string(const device_config *device, UINT32 state); - - - -/* ----- device type information getters ----- */ - -/* return an integer value from a device type (does not need to be allocated) */ -INT64 devtype_get_info_int(device_type type, UINT32 state); - -/* return a function pointer from a device type (does not need to be allocated) */ -genf *devtype_get_info_fct(device_type type, UINT32 state); - -/* return a string value from a device type (does not need to be allocated) */ -const char *devtype_get_info_string(device_type type, UINT32 state); +void device_delay_init(running_device *device); @@ -471,12 +545,12 @@ const char *devtype_get_info_string(device_type type, UINT32 state); device -------------------------------------------------*/ -inline const address_space *device_config::space(int index) const +inline const address_space *running_device::space(int index) const { - return (addrspace[index] != NULL) ? addrspace[index] : memory_find_address_space(this, index); + return addrspace[index]; } -inline const address_space *device_config::space(device_space index) const +inline const address_space *running_device::space(device_space index) const { return space(static_cast<int>(index)); } diff --git a/src/emu/emupal.c b/src/emu/emupal.c index e01f6061b62..bd5cf686c9e 100644 --- a/src/emu/emupal.c +++ b/src/emu/emupal.c @@ -97,13 +97,13 @@ static void configure_rgb_shadows(running_machine *machine, int mode, float fact void palette_init(running_machine *machine) { palette_private *palette = auto_alloc_clear(machine, palette_private); - const device_config *device = video_screen_first(machine->config); + running_device *device = video_screen_first(machine); bitmap_format format; /* get the format from the first screen, or use BITMAP_FORMAT_INVALID, if screenless */ if (device != NULL) { - screen_config *config = (screen_config *)device->inline_config; + screen_config *config = (screen_config *)device->baseconfig().inline_config; format = config->format; } else diff --git a/src/emu/info.c b/src/emu/info.c index e8dc38c5dd4..f1f5887d101 100644 --- a/src/emu/info.c +++ b/src/emu/info.c @@ -552,12 +552,12 @@ static void print_game_rom(FILE *out, const game_driver *game, const machine_con static void print_game_sampleof(FILE *out, const game_driver *game, const machine_config *config) { - const device_config *device; + const device_config *devconfig; - for (device = sound_first(config); device != NULL; device = sound_next(device)) - if (sound_get_type(device) == SOUND_SAMPLES) + for (devconfig = sound_first(config); devconfig != NULL; devconfig = sound_next(devconfig)) + if (sound_get_type(devconfig) == SOUND_SAMPLES) { - const char *const *samplenames = ((const samples_interface *)device->static_config)->samplenames; + const char *const *samplenames = ((const samples_interface *)devconfig->static_config)->samplenames; if (samplenames != NULL) { int sampnum; @@ -583,13 +583,13 @@ static void print_game_sampleof(FILE *out, const game_driver *game, const machin static void print_game_sample(FILE *out, const game_driver *game, const machine_config *config) { - const device_config *device; + const device_config *devconfig; /* iterate over sound chips looking for samples */ - for (device = sound_first(config); device != NULL; device = sound_next(device)) - if (sound_get_type(device) == SOUND_SAMPLES) + for (devconfig = sound_first(config); devconfig != NULL; devconfig = sound_next(devconfig)) + if (sound_get_type(devconfig) == SOUND_SAMPLES) { - const char *const *samplenames = ((const samples_interface *)device->static_config)->samplenames; + const char *const *samplenames = ((const samples_interface *)devconfig->static_config)->samplenames; if (samplenames != NULL) { int sampnum; @@ -626,28 +626,28 @@ static void print_game_sample(FILE *out, const game_driver *game, const machine_ static void print_game_chips(FILE *out, const game_driver *game, const machine_config *config) { - const device_config *device; + const device_config *devconfig; /* iterate over CPUs */ - for (device = cpu_first(config); device != NULL; device = cpu_next(device)) + for (devconfig = cpu_first(config); devconfig != NULL; devconfig = cpu_next(devconfig)) { fprintf(out, "\t\t<chip"); fprintf(out, " type=\"cpu\""); - fprintf(out, " tag=\"%s\"", xml_normalize_string(device->tag)); - fprintf(out, " name=\"%s\"", xml_normalize_string(device_get_name(device))); - fprintf(out, " clock=\"%d\"", device->clock); + fprintf(out, " tag=\"%s\"", xml_normalize_string(devconfig->tag)); + fprintf(out, " name=\"%s\"", xml_normalize_string(device_get_name(devconfig))); + fprintf(out, " clock=\"%d\"", devconfig->clock); fprintf(out, "/>\n"); } /* iterate over sound chips */ - for (device = sound_first(config); device != NULL; device = sound_next(device)) + for (devconfig = sound_first(config); devconfig != NULL; devconfig = sound_next(devconfig)) { fprintf(out, "\t\t<chip"); fprintf(out, " type=\"audio\""); - fprintf(out, " tag=\"%s\"", xml_normalize_string(device->tag)); - fprintf(out, " name=\"%s\"", xml_normalize_string(device_get_name(device))); - if (device->clock != 0) - fprintf(out, " clock=\"%d\"", device->clock); + fprintf(out, " tag=\"%s\"", xml_normalize_string(devconfig->tag)); + fprintf(out, " name=\"%s\"", xml_normalize_string(device_get_name(devconfig))); + if (devconfig->clock != 0) + fprintf(out, " clock=\"%d\"", devconfig->clock); fprintf(out, "/>\n"); } } @@ -660,12 +660,12 @@ static void print_game_chips(FILE *out, const game_driver *game, const machine_c static void print_game_display(FILE *out, const game_driver *game, const machine_config *config) { - const device_config *screen; + const device_config *devconfig; /* iterate over screens */ - for (screen = video_screen_first(config); screen != NULL; screen = video_screen_next(screen)) + for (devconfig = video_screen_first(config); devconfig != NULL; devconfig = video_screen_next(devconfig)) { - const screen_config *scrconfig = (const screen_config *)screen->inline_config; + const screen_config *scrconfig = (const screen_config *)devconfig->inline_config; fprintf(out, "\t\t<display"); diff --git a/src/emu/inptport.c b/src/emu/inptport.c index 2a4ce6c0512..12235a7d9ca 100644 --- a/src/emu/inptport.c +++ b/src/emu/inptport.c @@ -201,7 +201,7 @@ struct _device_field_info { device_field_info * next; /* linked list of info for this port */ const input_field_config * field; /* pointer to the input field referenced */ - const device_config * device; /* device */ + running_device * device; /* device */ UINT8 shift; /* shift to apply to the final result */ input_port_value oldval; /* last value */ }; @@ -1756,7 +1756,7 @@ static device_field_info *init_field_device_info(const input_field_config *field if (device_name != NULL) info->device = field->port->machine->device(device_name); else - info->device = (const device_config *) info; + info->device = (running_device *) info; info->oldval = field->defvalue >> info->shift; return info; diff --git a/src/emu/machine/6522via.c b/src/emu/machine/6522via.c index abc6db99bd4..e11badef73a 100644 --- a/src/emu/machine/6522via.c +++ b/src/emu/machine/6522via.c @@ -180,7 +180,7 @@ static TIMER_CALLBACK( via_t2_timeout ); INLINE FUNCTIONS ***************************************************************************/ -INLINE via6522_t *get_token(const device_config *device) +INLINE via6522_t *get_token(running_device *device) { assert(device != NULL); assert((device->type == VIA6522)); @@ -188,27 +188,27 @@ INLINE via6522_t *get_token(const device_config *device) } -INLINE const via6522_interface *get_interface(const device_config *device) +INLINE const via6522_interface *get_interface(running_device *device) { assert(device != NULL); assert((device->type == VIA6522)); - return (const via6522_interface *) device->static_config; + return (const via6522_interface *) device->baseconfig().static_config; } -INLINE attotime v_cycles_to_time(const device_config *device, int c) +INLINE attotime v_cycles_to_time(running_device *device, int c) { return attotime_mul(ATTOTIME_IN_HZ(device->clock), c); } -INLINE UINT32 v_time_to_cycles(const device_config *device, attotime t) +INLINE UINT32 v_time_to_cycles(running_device *device, attotime t) { return attotime_to_double(attotime_mul(t, device->clock)); } -INLINE UINT16 v_get_counter1_value(const device_config *device) +INLINE UINT16 v_get_counter1_value(running_device *device) { via6522_t *v = get_token(device); UINT16 val; @@ -300,7 +300,7 @@ static DEVICE_START( via6522 ) via_set_int - external interrupt check -------------------------------------------------*/ -static void via_set_int (const device_config *device, int data) +static void via_set_int (running_device *device, int data) { via6522_t *v = get_token(device); @@ -320,7 +320,7 @@ static void via_set_int (const device_config *device, int data) via_clear_int - external interrupt check -------------------------------------------------*/ -static void via_clear_int (const device_config *device, int data) +static void via_clear_int (running_device *device, int data) { via6522_t *v = get_token(device); @@ -342,7 +342,7 @@ static void via_clear_int (const device_config *device, int data) via_shift -------------------------------------------------*/ -static void via_shift(const device_config *device) +static void via_shift(running_device *device) { via6522_t *v = get_token(device); @@ -410,7 +410,7 @@ static void via_shift(const device_config *device) static TIMER_CALLBACK( via_shift_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; via_shift(device); } @@ -421,7 +421,7 @@ static TIMER_CALLBACK( via_shift_callback ) static TIMER_CALLBACK( via_t1_timeout ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; via6522_t *v = get_token(device); if (T1_CONTINUOUS (v->acr)) @@ -454,7 +454,7 @@ static TIMER_CALLBACK( via_t1_timeout ) static TIMER_CALLBACK( via_t2_timeout ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; via6522_t *v = get_token(device); v->t2_active = 0; diff --git a/src/emu/machine/6526cia.c b/src/emu/machine/6526cia.c index 61deda9d7a7..b84ac260bd1 100644 --- a/src/emu/machine/6526cia.c +++ b/src/emu/machine/6526cia.c @@ -65,7 +65,7 @@ struct _cia_port struct _cia_state { - const device_config *device; + running_device *device; devcb_resolved_write_line irq_func; devcb_resolved_write_line pc_func; @@ -100,7 +100,7 @@ struct _cia_state ***************************************************************************/ static TIMER_CALLBACK( cia_timer_proc ); -static void cia_timer_underflow(const device_config *device, int timer); +static void cia_timer_underflow(running_device *device, int timer); static TIMER_CALLBACK( cia_clock_tod_callback ); @@ -109,7 +109,7 @@ static TIMER_CALLBACK( cia_clock_tod_callback ); INLINE FUNCTIONS ***************************************************************************/ -INLINE cia_state *get_token(const device_config *device) +INLINE cia_state *get_token(running_device *device) { assert(device != NULL); assert((device->type == CIA6526R1) || (device->type == CIA6526R2) || (device->type == CIA8520)); @@ -117,11 +117,11 @@ INLINE cia_state *get_token(const device_config *device) } -INLINE const cia6526_interface *get_interface(const device_config *device) +INLINE const cia6526_interface *get_interface(running_device *device) { assert(device != NULL); assert((device->type == CIA6526R1) || (device->type == CIA6526R2) || (device->type == CIA8520)); - return (cia6526_interface *) device->static_config; + return (cia6526_interface *) device->baseconfig().static_config; } @@ -208,7 +208,7 @@ static DEVICE_START( cia ) cia_set_port_mask_value -------------------------------------------------*/ -void cia_set_port_mask_value(const device_config *device, int port, int data) +void cia_set_port_mask_value(running_device *device, int port, int data) { cia_state *cia = get_token(device); cia->port[port].mask_value = data; @@ -281,7 +281,7 @@ static DEVICE_VALIDITY_CHECK( cia ) cia_update_pc - pulse /pc output -------------------------------------------------*/ -static void cia_update_pc(const device_config *device) +static void cia_update_pc(running_device *device) { cia_state *cia = get_token(device); @@ -295,7 +295,7 @@ static void cia_update_pc(const device_config *device) cia_update_interrupts -------------------------------------------------*/ -static void cia_update_interrupts(const device_config *device) +static void cia_update_interrupts(running_device *device) { UINT8 new_irq; cia_state *cia = get_token(device); @@ -388,7 +388,7 @@ static UINT16 cia_get_timer(cia_timer *timer) cia_timer_bump -------------------------------------------------*/ -static void cia_timer_bump(const device_config *device, int timer) +static void cia_timer_bump(running_device *device, int timer) { cia_state *cia = get_token(device); @@ -405,7 +405,7 @@ static void cia_timer_bump(const device_config *device, int timer) cia_timer_underflow -------------------------------------------------*/ -static void cia_timer_underflow(const device_config *device, int timer) +static void cia_timer_underflow(running_device *device, int timer) { cia_state *cia = get_token(device); @@ -540,7 +540,7 @@ static void cia6526_increment(cia_state *cia) cia_clock_tod - Update TOD on CIA A -------------------------------------------------*/ -void cia_clock_tod(const device_config *device) +void cia_clock_tod(running_device *device) { cia_state *cia; @@ -576,7 +576,7 @@ void cia_clock_tod(const device_config *device) static TIMER_CALLBACK( cia_clock_tod_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; cia_clock_tod(device); } @@ -585,7 +585,7 @@ static TIMER_CALLBACK( cia_clock_tod_callback ) cia_issue_index -------------------------------------------------*/ -void cia_issue_index(const device_config *device) +void cia_issue_index(running_device *device) { cia_state *cia = get_token(device); cia->ics |= 0x10; @@ -597,7 +597,7 @@ void cia_issue_index(const device_config *device) cia_set_input_sp -------------------------------------------------*/ -void cia_set_input_sp(const device_config *device, int data) +void cia_set_input_sp(running_device *device, int data) { cia_state *cia = get_token(device); cia->sp = data; @@ -608,7 +608,7 @@ void cia_set_input_sp(const device_config *device, int data) cia_set_input_cnt -------------------------------------------------*/ -void cia_set_input_cnt(const device_config *device, int data) +void cia_set_input_cnt(running_device *device, int data) { cia_state *cia = get_token(device); @@ -922,9 +922,9 @@ WRITE8_DEVICE_HANDLER( cia_w ) -UINT8 cia_get_output_a(const device_config *device) { return (get_token(device)->port[0].latch | ~get_token(device)->port[0].ddr); } -UINT8 cia_get_output_b(const device_config *device) { return (get_token(device)->port[1].latch | ~get_token(device)->port[1].ddr); } -int cia_get_irq(const device_config *device) { return get_token(device)->irq; } +UINT8 cia_get_output_a(running_device *device) { return (get_token(device)->port[0].latch | ~get_token(device)->port[0].ddr); } +UINT8 cia_get_output_b(running_device *device) { return (get_token(device)->port[1].latch | ~get_token(device)->port[1].ddr); } +int cia_get_irq(running_device *device) { return get_token(device)->irq; } /*------------------------------------------------- diff --git a/src/emu/machine/6526cia.h b/src/emu/machine/6526cia.h index fc7cff2b11f..4b40f2873b4 100644 --- a/src/emu/machine/6526cia.h +++ b/src/emu/machine/6526cia.h @@ -59,15 +59,15 @@ DEVICE_GET_INFO(cia6526r2); DEVICE_GET_INFO(cia8520); /* configuration */ -void cia_set_port_mask_value(const device_config *device, int port, int data); +void cia_set_port_mask_value(running_device *device, int port, int data); /* reading and writing */ READ8_DEVICE_HANDLER( cia_r ); WRITE8_DEVICE_HANDLER( cia_w ); -void cia_clock_tod(const device_config *device); -void cia_issue_index(const device_config *device); -void cia_set_input_cnt(const device_config *device, int data); -void cia_set_input_sp(const device_config *device, int data); +void cia_clock_tod(running_device *device); +void cia_issue_index(running_device *device); +void cia_set_input_cnt(running_device *device, int data); +void cia_set_input_sp(running_device *device, int data); WRITE_LINE_DEVICE_HANDLER( mos6526_tod_w ); WRITE_LINE_DEVICE_HANDLER( mos6526_cnt_w ); @@ -75,8 +75,8 @@ WRITE_LINE_DEVICE_HANDLER( mos6526_sp_w ); WRITE_LINE_DEVICE_HANDLER( mos6526_flag_w ); /* accessors */ -UINT8 cia_get_output_a(const device_config *device); -UINT8 cia_get_output_b(const device_config *device); -int cia_get_irq(const device_config *device); +UINT8 cia_get_output_a(running_device *device); +UINT8 cia_get_output_b(running_device *device); +int cia_get_irq(running_device *device); #endif /* __6526CIA_H__ */ diff --git a/src/emu/machine/6532riot.c b/src/emu/machine/6532riot.c index a91764b8625..b637c991897 100644 --- a/src/emu/machine/6532riot.c +++ b/src/emu/machine/6532riot.c @@ -49,7 +49,7 @@ struct _riot6532_port typedef struct _riot6532_state riot6532_state; struct _riot6532_state { - const device_config *device; + running_device *device; const riot6532_interface *intf; int index; @@ -79,7 +79,7 @@ struct _riot6532_state into a riot6532_state -------------------------------------------------*/ -INLINE riot6532_state *get_safe_token(const device_config *device) +INLINE riot6532_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -93,7 +93,7 @@ INLINE riot6532_state *get_safe_token(const device_config *device) based on interrupt enables -------------------------------------------------*/ -INLINE void update_irqstate(const device_config *device) +INLINE void update_irqstate(running_device *device) { riot6532_state *riot = get_safe_token(device); int state = (riot->irqstate & riot->irqenable); @@ -121,7 +121,7 @@ INLINE UINT8 apply_ddr(const riot6532_port *port) and signal appropriately -------------------------------------------------*/ -INLINE void update_pa7_state(const device_config *device) +INLINE void update_pa7_state(running_device *device) { riot6532_state *riot = get_safe_token(device); UINT8 data = apply_ddr(&riot->port[0]) & 0x80; @@ -168,7 +168,7 @@ INLINE UINT8 get_timer(riot6532_state *riot) static TIMER_CALLBACK( timer_end_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; riot6532_state *riot = get_safe_token(device); assert(riot->timerstate != TIMER_IDLE); @@ -346,7 +346,7 @@ READ8_DEVICE_HANDLER( riot6532_r ) value -------------------------------------------------*/ -void riot6532_porta_in_set(const device_config *device, UINT8 data, UINT8 mask) +void riot6532_porta_in_set(running_device *device, UINT8 data, UINT8 mask) { riot6532_state *riot = get_safe_token(device); riot->port[0].in = (riot->port[0].in & ~mask) | (data & mask); @@ -359,7 +359,7 @@ void riot6532_porta_in_set(const device_config *device, UINT8 data, UINT8 mask) value -------------------------------------------------*/ -void riot6532_portb_in_set(const device_config *device, UINT8 data, UINT8 mask) +void riot6532_portb_in_set(running_device *device, UINT8 data, UINT8 mask) { riot6532_state *riot = get_safe_token(device); riot->port[1].in = (riot->port[1].in & ~mask) | (data & mask); @@ -371,7 +371,7 @@ void riot6532_portb_in_set(const device_config *device, UINT8 data, UINT8 mask) value -------------------------------------------------*/ -UINT8 riot6532_porta_in_get(const device_config *device) +UINT8 riot6532_porta_in_get(running_device *device) { riot6532_state *riot = get_safe_token(device); return riot->port[0].in; @@ -383,7 +383,7 @@ UINT8 riot6532_porta_in_get(const device_config *device) value -------------------------------------------------*/ -UINT8 riot6532_portb_in_get(const device_config *device) +UINT8 riot6532_portb_in_get(running_device *device) { riot6532_state *riot = get_safe_token(device); return riot->port[1].in; @@ -395,7 +395,7 @@ UINT8 riot6532_portb_in_get(const device_config *device) value -------------------------------------------------*/ -UINT8 riot6532_porta_out_get(const device_config *device) +UINT8 riot6532_porta_out_get(running_device *device) { riot6532_state *riot = get_safe_token(device); return riot->port[0].out; @@ -407,7 +407,7 @@ UINT8 riot6532_porta_out_get(const device_config *device) value -------------------------------------------------*/ -UINT8 riot6532_portb_out_get(const device_config *device) +UINT8 riot6532_portb_out_get(running_device *device) { riot6532_state *riot = get_safe_token(device); return riot->port[1].out; @@ -433,8 +433,8 @@ static DEVICE_START( riot6532 ) /* set static values */ riot->device = device; - riot->intf = (riot6532_interface *)device->static_config; - riot->index = device->machine->config->devicelist.index(RIOT6532, device->tag); + riot->intf = (riot6532_interface *)device->baseconfig().static_config; + riot->index = device->machine->devicelist.index(RIOT6532, device->tag); /* configure the ports */ devcb_resolve_read8(&riot->port[0].in_func, &riot->intf->in_a_func, device); diff --git a/src/emu/machine/6532riot.h b/src/emu/machine/6532riot.h index 07b7f9f48ad..ca4c0593ed3 100644 --- a/src/emu/machine/6532riot.h +++ b/src/emu/machine/6532riot.h @@ -42,14 +42,14 @@ struct _riot6532_interface READ8_DEVICE_HANDLER( riot6532_r ); WRITE8_DEVICE_HANDLER( riot6532_w ); -void riot6532_porta_in_set(const device_config *device, UINT8 data, UINT8 mask); -void riot6532_portb_in_set(const device_config *device, UINT8 data, UINT8 mask); +void riot6532_porta_in_set(running_device *device, UINT8 data, UINT8 mask); +void riot6532_portb_in_set(running_device *device, UINT8 data, UINT8 mask); -UINT8 riot6532_porta_in_get(const device_config *device); -UINT8 riot6532_portb_in_get(const device_config *device); +UINT8 riot6532_porta_in_get(running_device *device); +UINT8 riot6532_portb_in_get(running_device *device); -UINT8 riot6532_porta_out_get(const device_config *device); -UINT8 riot6532_portb_out_get(const device_config *device); +UINT8 riot6532_porta_out_get(running_device *device); +UINT8 riot6532_portb_out_get(running_device *device); /* ----- device interface ----- */ diff --git a/src/emu/machine/6821pia.c b/src/emu/machine/6821pia.c index e2ffbee92ee..59c07a1159d 100644 --- a/src/emu/machine/6821pia.c +++ b/src/emu/machine/6821pia.c @@ -107,7 +107,7 @@ struct _pia6821_state INLINE FUNCTIONS ***************************************************************************/ -INLINE pia6821_state *get_token(const device_config *device) +INLINE pia6821_state *get_token(running_device *device) { assert(device != NULL); assert((device->type == PIA6821) || (device->type == PIA6822)); @@ -115,11 +115,11 @@ INLINE pia6821_state *get_token(const device_config *device) } -INLINE const pia6821_interface *get_interface(const device_config *device) +INLINE const pia6821_interface *get_interface(running_device *device) { assert(device != NULL); assert((device->type == PIA6821) || (device->type == PIA6822)); - return (const pia6821_interface *) device->static_config; + return (const pia6821_interface *) device->baseconfig().static_config; } @@ -252,7 +252,7 @@ static DEVICE_RESET( pia6821 ) update_interrupts -------------------------------------------------*/ -static void update_interrupts(const device_config *device) +static void update_interrupts(running_device *device) { pia6821_state *p = get_token(device); int new_state; @@ -281,7 +281,7 @@ static void update_interrupts(const device_config *device) get_in_a_value -------------------------------------------------*/ -static UINT8 get_in_a_value(const device_config *device) +static UINT8 get_in_a_value(running_device *device) { pia6821_state *p = get_token(device); UINT8 port_a_data = 0; @@ -322,7 +322,7 @@ static UINT8 get_in_a_value(const device_config *device) get_in_b_value -------------------------------------------------*/ -static UINT8 get_in_b_value(const device_config *device) +static UINT8 get_in_b_value(running_device *device) { pia6821_state *p = get_token(device); UINT8 ret; @@ -366,7 +366,7 @@ static UINT8 get_in_b_value(const device_config *device) get_out_a_value -------------------------------------------------*/ -static UINT8 get_out_a_value(const device_config *device) +static UINT8 get_out_a_value(running_device *device) { pia6821_state *p = get_token(device); UINT8 ret; @@ -386,7 +386,7 @@ static UINT8 get_out_a_value(const device_config *device) get_out_b_value -------------------------------------------------*/ -static UINT8 get_out_b_value(const device_config *device) +static UINT8 get_out_b_value(running_device *device) { pia6821_state *p = get_token(device); @@ -399,7 +399,7 @@ static UINT8 get_out_b_value(const device_config *device) set_out_ca2 -------------------------------------------------*/ -static void set_out_ca2(const device_config *device, int data) +static void set_out_ca2(running_device *device, int data) { pia6821_state *p = get_token(device); @@ -425,7 +425,7 @@ static void set_out_ca2(const device_config *device, int data) set_out_cb2 -------------------------------------------------*/ -static void set_out_cb2(const device_config *device, int data) +static void set_out_cb2(running_device *device, int data) { pia6821_state *p = get_token(device); @@ -454,7 +454,7 @@ static void set_out_cb2(const device_config *device, int data) port_a_r -------------------------------------------------*/ -static UINT8 port_a_r(const device_config *device) +static UINT8 port_a_r(running_device *device) { pia6821_state *p = get_token(device); @@ -486,7 +486,7 @@ static UINT8 port_a_r(const device_config *device) ddr_a_r -------------------------------------------------*/ -static UINT8 ddr_a_r(const device_config *device) +static UINT8 ddr_a_r(running_device *device) { pia6821_state *p = get_token(device); @@ -502,7 +502,7 @@ static UINT8 ddr_a_r(const device_config *device) port_b_r -------------------------------------------------*/ -static UINT8 port_b_r(const device_config *device) +static UINT8 port_b_r(running_device *device) { pia6821_state *p = get_token(device); @@ -530,7 +530,7 @@ static UINT8 port_b_r(const device_config *device) ddr_b_r -------------------------------------------------*/ -static UINT8 ddr_b_r(const device_config *device) +static UINT8 ddr_b_r(running_device *device) { pia6821_state *p = get_token(device); @@ -546,7 +546,7 @@ static UINT8 ddr_b_r(const device_config *device) control_a_r -------------------------------------------------*/ -static UINT8 control_a_r(const device_config *device) +static UINT8 control_a_r(running_device *device) { pia6821_state *p = get_token(device); UINT8 ret; @@ -588,7 +588,7 @@ static UINT8 control_a_r(const device_config *device) control_b_r -------------------------------------------------*/ -static UINT8 control_b_r(const device_config *device) +static UINT8 control_b_r(running_device *device) { pia6821_state *p = get_token(device); UINT8 ret; @@ -679,7 +679,7 @@ READ8_DEVICE_HANDLER( pia6821_alt_r ) pia6821_get_port_b_z_mask -------------------------------------------------*/ -UINT8 pia6821_get_port_b_z_mask(const device_config *device) +UINT8 pia6821_get_port_b_z_mask(running_device *device) { pia6821_state *p = get_token(device); return ~p->ddr_b; @@ -690,7 +690,7 @@ UINT8 pia6821_get_port_b_z_mask(const device_config *device) send_to_out_a_func -------------------------------------------------*/ -static void send_to_out_a_func(const device_config *device, const char* message) +static void send_to_out_a_func(running_device *device, const char* message) { pia6821_state *p = get_token(device); @@ -715,7 +715,7 @@ static void send_to_out_a_func(const device_config *device, const char* message) send_to_out_b_func -------------------------------------------------*/ -static void send_to_out_b_func(const device_config *device, const char* message) +static void send_to_out_b_func(running_device *device, const char* message) { pia6821_state *p = get_token(device); @@ -740,7 +740,7 @@ static void send_to_out_b_func(const device_config *device, const char* message) port_a_w -------------------------------------------------*/ -static void port_a_w(const device_config *device, UINT8 data) +static void port_a_w(running_device *device, UINT8 data) { pia6821_state *p = get_token(device); @@ -755,7 +755,7 @@ static void port_a_w(const device_config *device, UINT8 data) ddr_a_w -------------------------------------------------*/ -static void ddr_a_w(const device_config *device, UINT8 data) +static void ddr_a_w(running_device *device, UINT8 data) { pia6821_state *p = get_token(device); @@ -780,7 +780,7 @@ static void ddr_a_w(const device_config *device, UINT8 data) port_b_w -------------------------------------------------*/ -static void port_b_w(const device_config *device, UINT8 data) +static void port_b_w(running_device *device, UINT8 data) { pia6821_state *p = get_token(device); @@ -806,7 +806,7 @@ static void port_b_w(const device_config *device, UINT8 data) ddr_b_w -------------------------------------------------*/ -static void ddr_b_w(const device_config *device, UINT8 data) +static void ddr_b_w(running_device *device, UINT8 data) { pia6821_state *p = get_token(device); @@ -831,7 +831,7 @@ static void ddr_b_w(const device_config *device, UINT8 data) control_a_w -------------------------------------------------*/ -static void control_a_w(const device_config *device, UINT8 data) +static void control_a_w(running_device *device, UINT8 data) { pia6821_state *p = get_token(device); @@ -867,7 +867,7 @@ static void control_a_w(const device_config *device, UINT8 data) control_b_w -------------------------------------------------*/ -static void control_b_w(const device_config *device, UINT8 data) +static void control_b_w(running_device *device, UINT8 data) { pia6821_state *p = get_token(device); int temp; @@ -944,7 +944,7 @@ WRITE8_DEVICE_HANDLER( pia6821_alt_w ) pia6821_set_port_a_z_mask -------------------------------------------------*/ -void pia6821_set_port_a_z_mask(const device_config *device, UINT8 data) +void pia6821_set_port_a_z_mask(running_device *device, UINT8 data) { pia6821_state *p = get_token(device); @@ -968,7 +968,7 @@ READ8_DEVICE_HANDLER( pia6821_porta_r ) pia6821_set_input_a -------------------------------------------------*/ -void pia6821_set_input_a(const device_config *device, UINT8 data, UINT8 z_mask) +void pia6821_set_input_a(running_device *device, UINT8 data, UINT8 z_mask) { pia6821_state *p = get_token(device); @@ -996,7 +996,7 @@ WRITE8_DEVICE_HANDLER( pia6821_porta_w ) pia6821_get_output_a -------------------------------------------------*/ -UINT8 pia6821_get_output_a(const device_config *device) +UINT8 pia6821_get_output_a(running_device *device) { pia6821_state *p = get_token(device); @@ -1103,7 +1103,7 @@ WRITE8_DEVICE_HANDLER( pia6821_ca2_w ) pia6821_get_output_ca2 -------------------------------------------------*/ -int pia6821_get_output_ca2(const device_config *device) +int pia6821_get_output_ca2(running_device *device) { pia6821_state *p = get_token(device); @@ -1119,7 +1119,7 @@ int pia6821_get_output_ca2(const device_config *device) pullup resistor -------------------------------------------------*/ -int pia6821_get_output_ca2_z(const device_config *device) +int pia6821_get_output_ca2_z(running_device *device) { pia6821_state *p = get_token(device); @@ -1165,7 +1165,7 @@ WRITE8_DEVICE_HANDLER( pia6821_portb_w ) pia6821_get_output_b -------------------------------------------------*/ -UINT8 pia6821_get_output_b(const device_config *device) +UINT8 pia6821_get_output_b(running_device *device) { pia6821_state *p = get_token(device); @@ -1273,7 +1273,7 @@ WRITE8_DEVICE_HANDLER( pia6821_cb2_w ) pia6821_get_output_cb2 -------------------------------------------------*/ -int pia6821_get_output_cb2(const device_config *device) +int pia6821_get_output_cb2(running_device *device) { pia6821_state *p = get_token(device); @@ -1287,7 +1287,7 @@ int pia6821_get_output_cb2(const device_config *device) pia6821_get_output_cb2_z -------------------------------------------------*/ -int pia6821_get_output_cb2_z(const device_config *device) +int pia6821_get_output_cb2_z(running_device *device) { pia6821_state *p = get_token(device); @@ -1299,7 +1299,7 @@ int pia6821_get_output_cb2_z(const device_config *device) pia6821_get_irq_a -------------------------------------------------*/ -int pia6821_get_irq_a(const device_config *device) +int pia6821_get_irq_a(running_device *device) { pia6821_state *p = get_token(device); @@ -1311,7 +1311,7 @@ int pia6821_get_irq_a(const device_config *device) pia6821_get_irq_b -------------------------------------------------*/ -int pia6821_get_irq_b(const device_config *device) +int pia6821_get_irq_b(running_device *device) { pia6821_state *p = get_token(device); diff --git a/src/emu/machine/6821pia.h b/src/emu/machine/6821pia.h index f8dd795db7a..58080e02864 100644 --- a/src/emu/machine/6821pia.h +++ b/src/emu/machine/6821pia.h @@ -67,36 +67,36 @@ WRITE8_DEVICE_HANDLER( pia6821_w ); READ8_DEVICE_HANDLER( pia6821_alt_r ); WRITE8_DEVICE_HANDLER( pia6821_alt_w ); -UINT8 pia6821_get_port_b_z_mask(const device_config *device); /* see first note */ -void pia6821_set_port_a_z_mask(const device_config *device, UINT8 data); /* see second note */ +UINT8 pia6821_get_port_b_z_mask(running_device *device); /* see first note */ +void pia6821_set_port_a_z_mask(running_device *device, UINT8 data); /* see second note */ READ8_DEVICE_HANDLER( pia6821_porta_r ); WRITE8_DEVICE_HANDLER( pia6821_porta_w ); -void pia6821_set_input_a(const device_config *device, UINT8 data, UINT8 z_mask); -UINT8 pia6821_get_output_a(const device_config *device); +void pia6821_set_input_a(running_device *device, UINT8 data, UINT8 z_mask); +UINT8 pia6821_get_output_a(running_device *device); READ8_DEVICE_HANDLER( pia6821_ca1_r ); WRITE8_DEVICE_HANDLER( pia6821_ca1_w ); READ8_DEVICE_HANDLER( pia6821_ca2_r ); WRITE8_DEVICE_HANDLER( pia6821_ca2_w ); -int pia6821_get_output_ca2(const device_config *device); -int pia6821_get_output_ca2_z(const device_config *device); +int pia6821_get_output_ca2(running_device *device); +int pia6821_get_output_ca2_z(running_device *device); READ8_DEVICE_HANDLER( pia6821_portb_r ); WRITE8_DEVICE_HANDLER( pia6821_portb_w ); -UINT8 pia6821_get_output_b(const device_config *device); +UINT8 pia6821_get_output_b(running_device *device); READ8_DEVICE_HANDLER( pia6821_cb1_r ); WRITE8_DEVICE_HANDLER( pia6821_cb1_w ); READ8_DEVICE_HANDLER( pia6821_cb2_r ); WRITE8_DEVICE_HANDLER( pia6821_cb2_w ); -int pia6821_get_output_cb2(const device_config *device); -int pia6821_get_output_cb2_z(const device_config *device); +int pia6821_get_output_cb2(running_device *device); +int pia6821_get_output_cb2_z(running_device *device); -int pia6821_get_irq_a(const device_config *device); -int pia6821_get_irq_b(const device_config *device); +int pia6821_get_irq_a(running_device *device); +int pia6821_get_irq_b(running_device *device); /*************************************************************************** diff --git a/src/emu/machine/6840ptm.c b/src/emu/machine/6840ptm.c index 55d05b3611a..65889db8c1f 100644 --- a/src/emu/machine/6840ptm.c +++ b/src/emu/machine/6840ptm.c @@ -69,7 +69,7 @@ static const char *const opmode[] = "111 pulse width comparison mode" }; -static void ptm6840_timeout(const device_config *device, int idx); +static void ptm6840_timeout(running_device *device, int idx); /*************************************************************************** TYPE DEFINITIONS @@ -110,7 +110,7 @@ struct _ptm6840_state INLINE FUNCTIONS ***************************************************************************/ -INLINE ptm6840_state *get_safe_token(const device_config *device) +INLINE ptm6840_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -118,11 +118,11 @@ INLINE ptm6840_state *get_safe_token(const device_config *device) return (ptm6840_state *)device->token; } -INLINE const ptm6840_interface *get_interface(const device_config *device) +INLINE const ptm6840_interface *get_interface(running_device *device) { assert(device != NULL); assert((device->type == PTM6840)); - return (const ptm6840_interface *) device->static_config; + return (const ptm6840_interface *) device->baseconfig().static_config; } @@ -134,7 +134,7 @@ INLINE const ptm6840_interface *get_interface(const device_config *device) ptm6840_get_status - Get enabled status -------------------------------------------------*/ -int ptm6840_get_status( const device_config *device, int clock ) +int ptm6840_get_status( running_device *device, int clock ) { ptm6840_state *ptm6840 = get_safe_token(device); return ptm6840->enabled[clock - 1]; @@ -144,7 +144,7 @@ int ptm6840_get_status( const device_config *device, int clock ) ptm6840_get_irq - Get IRQ state -------------------------------------------------*/ -int ptm6840_get_irq( const device_config *device ) +int ptm6840_get_irq( running_device *device ) { ptm6840_state *ptm6840 = get_safe_token(device); return ptm6840->IRQ; @@ -154,7 +154,7 @@ int ptm6840_get_irq( const device_config *device ) subtract_from_counter - Subtract from Counter -------------------------------------------------*/ -static void subtract_from_counter( const device_config *device, int counter, int count ) +static void subtract_from_counter( running_device *device, int counter, int count ) { ptm6840_state *ptm6840 = get_safe_token(device); int clock; @@ -231,7 +231,7 @@ static void subtract_from_counter( const device_config *device, int counter, int ptm_tick -------------------------------------------------*/ -static void ptm_tick( const device_config *device, int counter, int count ) +static void ptm_tick( running_device *device, int counter, int count ) { ptm6840_state *ptm6840 = get_safe_token(device); @@ -255,7 +255,7 @@ static void ptm_tick( const device_config *device, int counter, int count ) update_interrupts - Update Internal Interrupts -------------------------------------------------*/ -INLINE void update_interrupts( const device_config *device ) +INLINE void update_interrupts( running_device *device ) { ptm6840_state *ptm6840 = get_safe_token(device); int new_state; @@ -281,7 +281,7 @@ INLINE void update_interrupts( const device_config *device ) compute_counter - Compute Counter -------------------------------------------------*/ -static UINT16 compute_counter( const device_config *device, int counter ) +static UINT16 compute_counter( running_device *device, int counter ) { ptm6840_state *ptm6840 = get_safe_token(device); int clock; @@ -324,7 +324,7 @@ static UINT16 compute_counter( const device_config *device, int counter ) reload_count - Reload Counter -------------------------------------------------*/ -static void reload_count( const device_config *device, int idx ) +static void reload_count( running_device *device, int idx ) { ptm6840_state *ptm6840 = get_safe_token(device); int clock; @@ -549,7 +549,7 @@ WRITE8_DEVICE_HANDLER( ptm6840_write ) ptm6840_timeout - Called if timer is mature -------------------------------------------------*/ -static void ptm6840_timeout( const device_config *device, int idx ) +static void ptm6840_timeout( running_device *device, int idx ) { ptm6840_state *ptm6840 = get_safe_token(device); @@ -598,19 +598,19 @@ static void ptm6840_timeout( const device_config *device, int idx ) static TIMER_CALLBACK( ptm6840_timer1_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; ptm6840_timeout(device, 0); } static TIMER_CALLBACK( ptm6840_timer2_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; ptm6840_timeout(device, 1); } static TIMER_CALLBACK( ptm6840_timer3_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; ptm6840_timeout(device, 2); } @@ -619,7 +619,7 @@ static TIMER_CALLBACK( ptm6840_timer3_cb ) ptm6840_set_gate - set gate status (0 or 1) -------------------------------------------------*/ -INLINE void ptm6840_set_gate( const device_config *device, int state, int idx ) +INLINE void ptm6840_set_gate( running_device *device, int state, int idx ) { ptm6840_state *ptm6840 = get_safe_token(device); @@ -654,7 +654,7 @@ WRITE8_DEVICE_HANDLER( ptm6840_set_g3 ) ptm6840_set_clock - set clock status (0 or 1) -------------------------------------------------*/ -INLINE void ptm6840_set_clock( const device_config *device, int state, int idx ) +INLINE void ptm6840_set_clock( running_device *device, int state, int idx ) { ptm6840_state *ptm6840 = get_safe_token(device); @@ -691,7 +691,7 @@ WRITE8_DEVICE_HANDLER( ptm6840_set_c3 ) ptm6840_get_count - get count value -------------------------------------------------*/ -UINT16 ptm6840_get_count( const device_config *device, int counter ) +UINT16 ptm6840_get_count( running_device *device, int counter ) { return compute_counter(device, counter); } @@ -700,7 +700,7 @@ UINT16 ptm6840_get_count( const device_config *device, int counter ) ptm6840_set_ext_clock - set external clock frequency ------------------------------------------------------------*/ -void ptm6840_set_ext_clock( const device_config *device, int counter, int clock ) +void ptm6840_set_ext_clock( running_device *device, int counter, int clock ) { ptm6840_state *ptm6840 = get_safe_token(device); @@ -742,7 +742,7 @@ void ptm6840_set_ext_clock( const device_config *device, int counter, int clock ptm6840_get_ext_clock - get external clock frequency ------------------------------------------------------------*/ -int ptm6840_get_ext_clock( const device_config *device, int counter ) +int ptm6840_get_ext_clock( running_device *device, int counter ) { ptm6840_state *ptm6840 = get_safe_token(device); return ptm6840->external_clock[counter]; diff --git a/src/emu/machine/6840ptm.h b/src/emu/machine/6840ptm.h index 568dfeaa1f4..f49c4381e43 100644 --- a/src/emu/machine/6840ptm.h +++ b/src/emu/machine/6840ptm.h @@ -44,11 +44,11 @@ struct _ptm6840_interface /* device interface */ DEVICE_GET_INFO( ptm6840 ); -int ptm6840_get_status( const device_config *device, int clock ); // get whether timer is enabled -int ptm6840_get_irq( const device_config *device ); // get IRQ state -UINT16 ptm6840_get_count( const device_config *device, int counter );// get counter value -void ptm6840_set_ext_clock( const device_config *device, int counter, int clock ); // set clock frequency -int ptm6840_get_ext_clock( const device_config *device, int counter );// get clock frequency +int ptm6840_get_status( running_device *device, int clock ); // get whether timer is enabled +int ptm6840_get_irq( running_device *device ); // get IRQ state +UINT16 ptm6840_get_count( running_device *device, int counter );// get counter value +void ptm6840_set_ext_clock( running_device *device, int counter, int clock ); // set clock frequency +int ptm6840_get_ext_clock( running_device *device, int counter );// get clock frequency WRITE8_DEVICE_HANDLER( ptm6840_set_g1 ); // set gate1 state WRITE8_DEVICE_HANDLER( ptm6840_set_g2 ); // set gate2 state diff --git a/src/emu/machine/6850acia.c b/src/emu/machine/6850acia.c index 64f63c4e83b..a75597e573c 100644 --- a/src/emu/machine/6850acia.c +++ b/src/emu/machine/6850acia.c @@ -130,7 +130,7 @@ static TIMER_CALLBACK( transmit_event ); INLINE FUNCTIONS ***************************************************************************/ -INLINE acia6850_t *get_token(const device_config *device) +INLINE acia6850_t *get_token(running_device *device) { assert(device != NULL); assert(device->type == ACIA6850); @@ -138,11 +138,11 @@ INLINE acia6850_t *get_token(const device_config *device) } -INLINE acia6850_interface *get_interface(const device_config *device) +INLINE acia6850_interface *get_interface(running_device *device) { assert(device != NULL); assert(device->type == ACIA6850); - return (acia6850_interface *) device->static_config; + return (acia6850_interface *) device->baseconfig().static_config; } @@ -362,7 +362,7 @@ WRITE8_DEVICE_HANDLER( acia6850_ctrl_w ) acia6850_check_interrupts -------------------------------------------------*/ -static void acia6850_check_interrupts(const device_config *device) +static void acia6850_check_interrupts(running_device *device) { acia6850_t *acia_p = get_token(device); @@ -442,7 +442,7 @@ READ8_DEVICE_HANDLER( acia6850_data_r ) tx_tick - Transmit a bit -------------------------------------------------*/ -static void tx_tick(const device_config *device) +static void tx_tick(running_device *device) { acia6850_t *acia_p = get_token(device); @@ -565,7 +565,7 @@ static void tx_tick(const device_config *device) static TIMER_CALLBACK( transmit_event ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; acia6850_t *acia_p = get_token(device); tx_tick(device); acia_p->tx_counter = 0; @@ -576,7 +576,7 @@ static TIMER_CALLBACK( transmit_event ) acia6850_tx_clock_in - As above, but using the tx pin -------------------------------------------------*/ -void acia6850_tx_clock_in(const device_config *device) +void acia6850_tx_clock_in(running_device *device) { acia6850_t *acia_p = get_token(device); @@ -606,7 +606,7 @@ void acia6850_tx_clock_in(const device_config *device) rx_tick - Receive a bit -------------------------------------------------*/ -static void rx_tick(const device_config *device) +static void rx_tick(running_device *device) { acia6850_t *acia_p = get_token(device); @@ -756,7 +756,7 @@ static void rx_tick(const device_config *device) static TIMER_CALLBACK( receive_event ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; acia6850_t *acia_p = get_token(device); rx_tick(device); acia_p->rx_counter = 0; @@ -767,7 +767,7 @@ static TIMER_CALLBACK( receive_event ) acia6850_rx_clock_in - As above, but using the rx pin -------------------------------------------------*/ -void acia6850_rx_clock_in(const device_config *device) +void acia6850_rx_clock_in(running_device *device) { acia6850_t *acia_p = get_token(device); @@ -798,7 +798,7 @@ void acia6850_rx_clock_in(const device_config *device) dynamically -------------------------------------------------*/ -void acia6850_set_rx_clock(const device_config *device, int clock) +void acia6850_set_rx_clock(running_device *device, int clock) { acia6850_t *acia_p = get_token(device); acia_p->rx_clock = clock; @@ -810,7 +810,7 @@ void acia6850_set_rx_clock(const device_config *device, int clock) dynamically -------------------------------------------------*/ -void acia6850_set_tx_clock(const device_config *device, int clock) +void acia6850_set_tx_clock(running_device *device, int clock) { acia6850_t *acia_p = get_token(device); acia_p->tx_clock = clock; diff --git a/src/emu/machine/6850acia.h b/src/emu/machine/6850acia.h index a0d535410b2..987fe5b48c5 100644 --- a/src/emu/machine/6850acia.h +++ b/src/emu/machine/6850acia.h @@ -60,11 +60,11 @@ struct _acia6850_interface DEVICE_GET_INFO( acia6850 ); -void acia6850_tx_clock_in(const device_config *device) ATTR_NONNULL(1); -void acia6850_rx_clock_in(const device_config *device) ATTR_NONNULL(1); +void acia6850_tx_clock_in(running_device *device) ATTR_NONNULL(1); +void acia6850_rx_clock_in(running_device *device) ATTR_NONNULL(1); -void acia6850_set_rx_clock(const device_config *device, int clock) ATTR_NONNULL(1); -void acia6850_set_tx_clock(const device_config *device, int clock) ATTR_NONNULL(1); +void acia6850_set_rx_clock(running_device *device, int clock) ATTR_NONNULL(1); +void acia6850_set_tx_clock(running_device *device, int clock) ATTR_NONNULL(1); WRITE8_DEVICE_HANDLER( acia6850_ctrl_w ); READ8_DEVICE_HANDLER( acia6850_stat_r ); diff --git a/src/emu/machine/68681.c b/src/emu/machine/68681.c index 1ff3124a61f..2dcab33310a 100644 --- a/src/emu/machine/68681.c +++ b/src/emu/machine/68681.c @@ -74,7 +74,7 @@ typedef struct typedef struct { /* device */ - const device_config *device; + running_device *device; /* config */ const duart68681_config *duart_config; @@ -99,7 +99,7 @@ typedef struct } duart68681_state; -INLINE duart68681_state *get_safe_token(const device_config *device) +INLINE duart68681_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -238,7 +238,7 @@ static void duart68681_update_interrupts(duart68681_state *duart68681) static TIMER_CALLBACK( duart_timer_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; duart68681_state *duart68681 = get_safe_token(device); duart68681->ISR |= INT_COUNTER_READY; @@ -396,7 +396,7 @@ static UINT8 duart68681_read_rx_fifo(duart68681_state *duart68681, int ch) static TIMER_CALLBACK( tx_timer_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; duart68681_state *duart68681 = get_safe_token(device); int ch = param & 1; @@ -657,7 +657,7 @@ WRITE8_DEVICE_HANDLER(duart68681_w) } } -void duart68681_rx_data( const device_config* device, int ch, UINT8 data ) +void duart68681_rx_data( running_device* device, int ch, UINT8 data ) { duart68681_state *duart68681 = get_safe_token(device); @@ -690,7 +690,7 @@ static DEVICE_START(duart68681) /* validate arguments */ assert(device != NULL); - duart68681->duart_config = (const duart68681_config *)device->static_config; + duart68681->duart_config = (const duart68681_config *)device->baseconfig().static_config; duart68681->device = device; duart68681->channel[0].tx_timer = timer_alloc(device->machine, tx_timer_callback, (void*)device); diff --git a/src/emu/machine/68681.h b/src/emu/machine/68681.h index 83947707542..51e85a36ba7 100644 --- a/src/emu/machine/68681.h +++ b/src/emu/machine/68681.h @@ -4,10 +4,10 @@ typedef struct _duart68681_config duart68681_config; struct _duart68681_config { - void (*irq_handler)(const device_config *device, UINT8 vector); - void (*tx_callback)(const device_config *device, int channel, UINT8 data); - UINT8 (*input_port_read)(const device_config *device); - void (*output_port_write)(const device_config *device, UINT8 data); + void (*irq_handler)(running_device *device, UINT8 vector); + void (*tx_callback)(running_device *device, int channel, UINT8 data); + UINT8 (*input_port_read)(running_device *device); + void (*output_port_write)(running_device *device, UINT8 data); /* clocks for external baud rates */ INT32 ip3clk, ip4clk, ip5clk, ip6clk; @@ -24,6 +24,6 @@ DEVICE_GET_INFO(duart68681); READ8_DEVICE_HANDLER(duart68681_r); WRITE8_DEVICE_HANDLER(duart68681_w); -void duart68681_rx_data( const device_config* device, int ch, UINT8 data ); +void duart68681_rx_data( running_device* device, int ch, UINT8 data ); #endif //_68681_H diff --git a/src/emu/machine/74123.c b/src/emu/machine/74123.c index 96c10d98101..6582842ab13 100644 --- a/src/emu/machine/74123.c +++ b/src/emu/machine/74123.c @@ -28,7 +28,7 @@ struct _ttl74123_t /* ----------------------------------------------------------------------- */ -INLINE ttl74123_t *get_safe_token(const device_config *device) { +INLINE ttl74123_t *get_safe_token(running_device *device) { assert( device != NULL ); assert( device->token != NULL ); assert( device->type == TTL74123 ); @@ -73,14 +73,14 @@ static int timer_running(ttl74123_t *chip) static TIMER_CALLBACK( output_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; ttl74123_t *chip = get_safe_token(device); chip->intf->output_changed_cb(device, 0, param); } -static void set_output(const device_config *device) +static void set_output(running_device *device) { ttl74123_t *chip = get_safe_token(device); int output = timer_running(chip); @@ -93,7 +93,7 @@ static void set_output(const device_config *device) static TIMER_CALLBACK( clear_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; ttl74123_t *chip = get_safe_token(device); int output = timer_running(chip); @@ -103,7 +103,7 @@ static TIMER_CALLBACK( clear_callback ) -static void start_pulse(const device_config *device) +static void start_pulse(running_device *device) { ttl74123_t *chip = get_safe_token(device); @@ -191,7 +191,7 @@ static DEVICE_START( ttl74123 ) ttl74123_t *chip = get_safe_token(device); /* validate arguments */ - chip->intf = (ttl74123_config *)device->static_config; + chip->intf = (ttl74123_config *)device->baseconfig().static_config; assert_always(chip->intf, "No interface specified"); assert_always((chip->intf->connection_type != TTL74123_GROUNDED) || (chip->intf->cap >= CAP_U(0.01)), "Only capacitors >= 0.01uF supported for GROUNDED type"); diff --git a/src/emu/machine/74148.c b/src/emu/machine/74148.c index c600c6a9384..07c1c9dfae9 100644 --- a/src/emu/machine/74148.c +++ b/src/emu/machine/74148.c @@ -46,7 +46,7 @@ typedef struct _ttl74148_state ttl74148_state; struct _ttl74148_state { /* callback */ - void (*output_cb)(const device_config *device); + void (*output_cb)(running_device *device); /* inputs */ int input_lines[8]; /* pins 1-4,10-13 */ @@ -64,7 +64,7 @@ struct _ttl74148_state }; -INLINE ttl74148_state *get_safe_token(const device_config *device) +INLINE ttl74148_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -73,7 +73,7 @@ INLINE ttl74148_state *get_safe_token(const device_config *device) return (ttl74148_state *)device->token; } -void ttl74148_update(const device_config *device) +void ttl74148_update(running_device *device) { ttl74148_state *state = get_safe_token(device); @@ -144,35 +144,35 @@ void ttl74148_update(const device_config *device) } -void ttl74148_input_line_w(const device_config *device, int input_line, int data) +void ttl74148_input_line_w(running_device *device, int input_line, int data) { ttl74148_state *state = get_safe_token(device); state->input_lines[input_line] = data ? 1 : 0; } -void ttl74148_enable_input_w(const device_config *device, int data) +void ttl74148_enable_input_w(running_device *device, int data) { ttl74148_state *state = get_safe_token(device); state->enable_input = data ? 1 : 0; } -int ttl74148_output_r(const device_config *device) +int ttl74148_output_r(running_device *device) { ttl74148_state *state = get_safe_token(device); return state->output; } -int ttl74148_output_valid_r(const device_config *device) +int ttl74148_output_valid_r(running_device *device) { ttl74148_state *state = get_safe_token(device); return state->output_valid; } -int ttl74148_enable_output_r(const device_config *device) +int ttl74148_enable_output_r(running_device *device) { ttl74148_state *state = get_safe_token(device); return state->enable_output; @@ -181,7 +181,7 @@ int ttl74148_enable_output_r(const device_config *device) static DEVICE_START( ttl74148 ) { - ttl74148_config *config = (ttl74148_config *)device->inline_config; + ttl74148_config *config = (ttl74148_config *)device->baseconfig().inline_config; ttl74148_state *state = get_safe_token(device); state->output_cb = config->output_cb; diff --git a/src/emu/machine/74148.h b/src/emu/machine/74148.h index 30b13ae7a7c..95f74d56118 100644 --- a/src/emu/machine/74148.h +++ b/src/emu/machine/74148.h @@ -45,7 +45,7 @@ typedef struct _ttl74148_config ttl74148_config; struct _ttl74148_config { - void (*output_cb)(const device_config *device); + void (*output_cb)(running_device *device); }; @@ -55,13 +55,13 @@ struct _ttl74148_config /* must call ttl74148_update() after setting the inputs */ -void ttl74148_update(const device_config *device); +void ttl74148_update(running_device *device); -void ttl74148_input_line_w(const device_config *device, int input_line, int data); -void ttl74148_enable_input_w(const device_config *device, int data); -int ttl74148_output_r(const device_config *device); -int ttl74148_output_valid_r(const device_config *device); -int ttl74148_enable_output_r(const device_config *device); +void ttl74148_input_line_w(running_device *device, int input_line, int data); +void ttl74148_enable_input_w(running_device *device, int data); +int ttl74148_output_r(running_device *device); +int ttl74148_output_valid_r(running_device *device); +int ttl74148_enable_output_r(running_device *device); /* device get info callback */ #define TTL74148 DEVICE_GET_INFO_NAME(ttl74148) diff --git a/src/emu/machine/74153.c b/src/emu/machine/74153.c index cc3af530962..38bf3bc2e5c 100644 --- a/src/emu/machine/74153.c +++ b/src/emu/machine/74153.c @@ -41,7 +41,7 @@ typedef struct _ttl74153_state ttl74153_state; struct _ttl74153_state { /* callback */ - void (*output_cb)(const device_config *device); + void (*output_cb)(running_device *device); /* inputs */ int a; /* pin 14 */ @@ -56,7 +56,7 @@ struct _ttl74153_state int last_output[2]; }; -INLINE ttl74153_state *get_safe_token(const device_config *device) +INLINE ttl74153_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -67,7 +67,7 @@ INLINE ttl74153_state *get_safe_token(const device_config *device) -void ttl74153_update(const device_config *device) +void ttl74153_update(running_device *device) { ttl74153_state *state = get_safe_token(device); int sel; @@ -100,35 +100,35 @@ void ttl74153_update(const device_config *device) } -void ttl74153_a_w(const device_config *device, int data) +void ttl74153_a_w(running_device *device, int data) { ttl74153_state *state = get_safe_token(device); state->a = data ? 1 : 0; } -void ttl74153_b_w(const device_config *device, int data) +void ttl74153_b_w(running_device *device, int data) { ttl74153_state *state = get_safe_token(device); state->b = data ? 1 : 0; } -void ttl74153_input_line_w(const device_config *device, int section, int input_line, int data) +void ttl74153_input_line_w(running_device *device, int section, int input_line, int data) { ttl74153_state *state = get_safe_token(device); state->input_lines[section][input_line] = data ? 1 : 0; } -void ttl74153_enable_w(const device_config *device, int section, int data) +void ttl74153_enable_w(running_device *device, int section, int data) { ttl74153_state *state = get_safe_token(device); state->enable[section] = data ? 1 : 0; } -int ttl74153_output_r(const device_config *device, int section) +int ttl74153_output_r(running_device *device, int section) { ttl74153_state *state = get_safe_token(device); return state->output[section]; @@ -137,7 +137,7 @@ int ttl74153_output_r(const device_config *device, int section) static DEVICE_START( ttl74153 ) { - ttl74153_config *config = (ttl74153_config *)device->inline_config; + ttl74153_config *config = (ttl74153_config *)device->baseconfig().inline_config; ttl74153_state *state = get_safe_token(device); state->output_cb = config->output_cb; diff --git a/src/emu/machine/74153.h b/src/emu/machine/74153.h index 84e0be091b4..852547af0b6 100644 --- a/src/emu/machine/74153.h +++ b/src/emu/machine/74153.h @@ -40,7 +40,7 @@ typedef struct _ttl74153_config ttl74153_config; struct _ttl74153_config { - void (*output_cb)(const device_config *device); + void (*output_cb)(running_device *device); }; @@ -51,13 +51,13 @@ struct _ttl74153_config /* must call TTL74153_update() after setting the inputs */ -void ttl74153_update(const device_config *device); +void ttl74153_update(running_device *device); -void ttl74153_a_w(const device_config *device, int data); -void ttl74153_b_w(const device_config *device, int data); -void ttl74153_input_line_w(const device_config *device, int section, int input_line, int data); -void ttl74153_enable_w(const device_config *device, int section, int data); -int ttl74153_output_r(const device_config *device, int section); +void ttl74153_a_w(running_device *device, int data); +void ttl74153_b_w(running_device *device, int data); +void ttl74153_input_line_w(running_device *device, int section, int input_line, int data); +void ttl74153_enable_w(running_device *device, int section, int data); +int ttl74153_output_r(running_device *device, int section); /* device get info callback */ #define TTL74153 DEVICE_GET_INFO_NAME(ttl74153) diff --git a/src/emu/machine/7474.c b/src/emu/machine/7474.c index 259230cea17..ec2927eb4c2 100644 --- a/src/emu/machine/7474.c +++ b/src/emu/machine/7474.c @@ -45,7 +45,7 @@ typedef struct _ttl7474_state ttl7474_state; struct _ttl7474_state { /* callback */ - void (*output_cb)(const device_config *); + void (*output_cb)(running_device *); /* inputs */ UINT8 clear; /* pin 1/13 */ @@ -63,7 +63,7 @@ struct _ttl7474_state UINT8 last_output_comp; }; -INLINE ttl7474_state *get_safe_token(const device_config *device) +INLINE ttl7474_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -73,7 +73,7 @@ INLINE ttl7474_state *get_safe_token(const device_config *device) } -void ttl7474_update(const device_config *device) +void ttl7474_update(running_device *device) { ttl7474_state *state = get_safe_token(device); @@ -114,38 +114,38 @@ void ttl7474_update(const device_config *device) } -void ttl7474_clear_w(const device_config *device, int data) +void ttl7474_clear_w(running_device *device, int data) { ttl7474_state *state = get_safe_token(device); state->clear = data ? 1 : 0; } -void ttl7474_preset_w(const device_config *device, int data) +void ttl7474_preset_w(running_device *device, int data) { ttl7474_state *state = get_safe_token(device); state->preset = data ? 1 : 0; } -void ttl7474_clock_w(const device_config *device, int data) +void ttl7474_clock_w(running_device *device, int data) { ttl7474_state *state = get_safe_token(device); state->clock = data ? 1 : 0; } -void ttl7474_d_w(const device_config *device, int data) +void ttl7474_d_w(running_device *device, int data) { ttl7474_state *state = get_safe_token(device); state->d = data ? 1 : 0; } -int ttl7474_output_r(const device_config *device) +int ttl7474_output_r(running_device *device) { ttl7474_state *state = get_safe_token(device); return state->output; } -int ttl7474_output_comp_r(const device_config *device) +int ttl7474_output_comp_r(running_device *device) { ttl7474_state *state = get_safe_token(device); return state->output_comp; @@ -154,7 +154,7 @@ int ttl7474_output_comp_r(const device_config *device) static DEVICE_START( ttl7474 ) { - ttl7474_config *config = (ttl7474_config *)device->inline_config; + ttl7474_config *config = (ttl7474_config *)device->baseconfig().inline_config; ttl7474_state *state = get_safe_token(device); state->output_cb = config->output_cb; diff --git a/src/emu/machine/7474.h b/src/emu/machine/7474.h index 3e71851ae0f..4b03940c2cf 100644 --- a/src/emu/machine/7474.h +++ b/src/emu/machine/7474.h @@ -44,7 +44,7 @@ typedef struct _ttl7474_config ttl7474_config; struct _ttl7474_config { - void (*output_cb)(const device_config *device); + void (*output_cb)(running_device *device); }; @@ -55,14 +55,14 @@ struct _ttl7474_config /* must call TTL7474_update() after setting the inputs */ -void ttl7474_update(const device_config *device); - -void ttl7474_clear_w(const device_config *device, int data); -void ttl7474_preset_w(const device_config *device, int data); -void ttl7474_clock_w(const device_config *device, int data); -void ttl7474_d_w(const device_config *device, int data); -int ttl7474_output_r(const device_config *device); -int ttl7474_output_comp_r(const device_config *device); /* NOT strictly the same as !ttl7474_output_r() */ +void ttl7474_update(running_device *device); + +void ttl7474_clear_w(running_device *device, int data); +void ttl7474_preset_w(running_device *device, int data); +void ttl7474_clock_w(running_device *device, int data); +void ttl7474_d_w(running_device *device, int data); +int ttl7474_output_r(running_device *device); +int ttl7474_output_comp_r(running_device *device); /* NOT strictly the same as !ttl7474_output_r() */ /* device get info callback */ #define TTL7474 DEVICE_GET_INFO_NAME(ttl7474) diff --git a/src/emu/machine/8237dma.c b/src/emu/machine/8237dma.c index 1f984878474..eb149baea59 100644 --- a/src/emu/machine/8237dma.c +++ b/src/emu/machine/8237dma.c @@ -109,7 +109,7 @@ struct _i8237_t /* ----------------------------------------------------------------------- */ -INLINE i8237_t *get_safe_token(const device_config *device) { +INLINE i8237_t *get_safe_token(running_device *device) { assert( device != NULL ); assert( device->token != NULL ); assert( device->type == I8237 ); @@ -120,7 +120,7 @@ INLINE i8237_t *get_safe_token(const device_config *device) { /* ----------------------------------------------------------------------- */ -INLINE void dma8237_do_read( const device_config *device ) +INLINE void dma8237_do_read( running_device *device ) { i8237_t *i8237 = get_safe_token( device ); int channel = i8237->service_channel; @@ -140,7 +140,7 @@ INLINE void dma8237_do_read( const device_config *device ) } -INLINE void dma8237_do_write( const device_config *device ) +INLINE void dma8237_do_write( running_device *device ) { i8237_t *i8237 = get_safe_token( device ); int channel = i8237->service_channel; @@ -160,7 +160,7 @@ INLINE void dma8237_do_write( const device_config *device ) } -INLINE void dma8237_advance( const device_config *device ) +INLINE void dma8237_advance( running_device *device ) { i8237_t *i8237 = get_safe_token( device ); int channel = i8237->service_channel; @@ -225,7 +225,7 @@ static void set_dack(i8237_t *i8237, int channel) static TIMER_CALLBACK( dma8237_timerproc ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; i8237_t *i8237 = get_safe_token(device); /* Check if operation is disabled */ @@ -575,7 +575,7 @@ WRITE8_DEVICE_HANDLER( i8237_w ) -static void dma8237_drq_write(const device_config *device, int channel, int state) +static void dma8237_drq_write(running_device *device, int channel, int state) { i8237_t *i8237 = get_safe_token( device ); @@ -610,7 +610,7 @@ WRITE_LINE_DEVICE_HANDLER( i8237_eop_w ) static DEVICE_START( i8237 ) { i8237_t *i8237 = get_safe_token(device); - i8237_interface *intf = (i8237_interface *)device->static_config; + i8237_interface *intf = (i8237_interface *)device->baseconfig().static_config; int i; /* resolve callbacks */ diff --git a/src/emu/machine/8255ppi.c b/src/emu/machine/8255ppi.c index 53366a65eaa..b4df7273d07 100644 --- a/src/emu/machine/8255ppi.c +++ b/src/emu/machine/8255ppi.c @@ -129,11 +129,11 @@ struct _ppi8255 }; -static void set_mode(const device_config *device, int data, int call_handlers); -static void ppi8255_write_port(const device_config *device, int port); +static void set_mode(running_device *device, int data, int call_handlers); +static void ppi8255_write_port(running_device *device, int port); -INLINE ppi8255_t *get_safe_token(const device_config *device) { +INLINE ppi8255_t *get_safe_token(running_device *device) { assert( device != NULL ); assert( device->token != NULL ); assert( device->type == DEVICE_GET_INFO_NAME(ppi8255) ); @@ -193,7 +193,7 @@ INLINE void ppi8255_get_handshake_signals(ppi8255_t *ppi8255, int is_read, UINT8 -static void ppi8255_input(const device_config *device, int port, UINT8 data) +static void ppi8255_input(running_device *device, int port, UINT8 data) { ppi8255_t *ppi8255 = get_safe_token(device); int changed = 0; @@ -250,7 +250,7 @@ static void ppi8255_input(const device_config *device, int port, UINT8 data) -static UINT8 ppi8255_read_port(const device_config *device, int port) +static UINT8 ppi8255_read_port(running_device *device, int port) { ppi8255_t *ppi8255 = get_safe_token(device); UINT8 result = 0x00; @@ -312,7 +312,7 @@ READ8_DEVICE_HANDLER( ppi8255_r ) -static void ppi8255_write_port(const device_config *device, int port) +static void ppi8255_write_port(running_device *device, int port) { ppi8255_t *ppi8255 = get_safe_token(device); UINT8 write_data; @@ -406,45 +406,45 @@ WRITE8_DEVICE_HANDLER( ppi8255_w ) } -void ppi8255_set_port_a_read(const device_config *device, const devcb_read8 *config) +void ppi8255_set_port_a_read(running_device *device, const devcb_read8 *config) { ppi8255_t *ppi8255 = get_safe_token(device); devcb_resolve_read8(&ppi8255->port_read[0], config, device); } -void ppi8255_set_port_b_read(const device_config *device, const devcb_read8 *config) +void ppi8255_set_port_b_read(running_device *device, const devcb_read8 *config) { ppi8255_t *ppi8255 = get_safe_token(device); devcb_resolve_read8(&ppi8255->port_read[1], config, device); } -void ppi8255_set_port_c_read(const device_config *device, const devcb_read8 *config) +void ppi8255_set_port_c_read(running_device *device, const devcb_read8 *config) { ppi8255_t *ppi8255 = get_safe_token(device); devcb_resolve_read8(&ppi8255->port_read[2], config, device); } -void ppi8255_set_port_a_write(const device_config *device, const devcb_write8 *config) +void ppi8255_set_port_a_write(running_device *device, const devcb_write8 *config) { ppi8255_t *ppi8255 = get_safe_token(device); devcb_resolve_write8(&ppi8255->port_write[0], config, device); } -void ppi8255_set_port_b_write(const device_config *device, const devcb_write8 *config) +void ppi8255_set_port_b_write(running_device *device, const devcb_write8 *config) { ppi8255_t *ppi8255 = get_safe_token(device); devcb_resolve_write8(&ppi8255->port_write[1], config, device); } -void ppi8255_set_port_c_write(const device_config *device, const devcb_write8 *config) +void ppi8255_set_port_c_write(running_device *device, const devcb_write8 *config) { ppi8255_t *ppi8255 = get_safe_token(device); devcb_resolve_write8(&ppi8255->port_write[2], config, device); } -static void set_mode(const device_config *device, int data, int call_handlers) +static void set_mode(running_device *device, int data, int call_handlers) { ppi8255_t *ppi8255 = get_safe_token(device); int i; @@ -541,23 +541,23 @@ static void set_mode(const device_config *device, int data, int call_handlers) } -void ppi8255_set_port_a( const device_config *device, UINT8 data ) { ppi8255_input(device, 0, data); } -void ppi8255_set_port_b( const device_config *device, UINT8 data ) { ppi8255_input(device, 1, data); } -void ppi8255_set_port_c( const device_config *device, UINT8 data ) { ppi8255_input(device, 2, data); } +void ppi8255_set_port_a( running_device *device, UINT8 data ) { ppi8255_input(device, 0, data); } +void ppi8255_set_port_b( running_device *device, UINT8 data ) { ppi8255_input(device, 1, data); } +void ppi8255_set_port_c( running_device *device, UINT8 data ) { ppi8255_input(device, 2, data); } -UINT8 ppi8255_get_port_a( const device_config *device ) { +UINT8 ppi8255_get_port_a( running_device *device ) { ppi8255_t *ppi8255 = get_safe_token(device); return ppi8255->output[0]; } -UINT8 ppi8255_get_port_b( const device_config *device ) { +UINT8 ppi8255_get_port_b( running_device *device ) { ppi8255_t *ppi8255 = get_safe_token(device); return ppi8255->output[1]; } -UINT8 ppi8255_get_port_c( const device_config *device ) { +UINT8 ppi8255_get_port_c( running_device *device ) { ppi8255_t *ppi8255 = get_safe_token(device); return ppi8255->output[2]; @@ -567,7 +567,7 @@ UINT8 ppi8255_get_port_c( const device_config *device ) { static DEVICE_START( ppi8255 ) { ppi8255_t *ppi8255 = get_safe_token(device); - ppi8255->intf = (const ppi8255_interface *)device->static_config; + ppi8255->intf = (const ppi8255_interface *)device->baseconfig().static_config; devcb_resolve_read8(&ppi8255->port_read[0], &ppi8255->intf->port_a_read, device); devcb_resolve_read8(&ppi8255->port_read[1], &ppi8255->intf->port_b_read, device); diff --git a/src/emu/machine/8255ppi.h b/src/emu/machine/8255ppi.h index 0e6d80d692c..f975ed4de60 100644 --- a/src/emu/machine/8255ppi.h +++ b/src/emu/machine/8255ppi.h @@ -51,20 +51,20 @@ READ8_DEVICE_HANDLER( ppi8255_r ); WRITE8_DEVICE_HANDLER( ppi8255_w ); -void ppi8255_set_port_a_read( const device_config *device, const devcb_read8 *config ); -void ppi8255_set_port_b_read( const device_config *device, const devcb_read8 *config ); -void ppi8255_set_port_c_read( const device_config *device, const devcb_read8 *config ); +void ppi8255_set_port_a_read( running_device *device, const devcb_read8 *config ); +void ppi8255_set_port_b_read( running_device *device, const devcb_read8 *config ); +void ppi8255_set_port_c_read( running_device *device, const devcb_read8 *config ); -void ppi8255_set_port_a_write( const device_config *device, const devcb_write8 *config ); -void ppi8255_set_port_b_write( const device_config *device, const devcb_write8 *config ); -void ppi8255_set_port_c_write( const device_config *device, const devcb_write8 *config ); +void ppi8255_set_port_a_write( running_device *device, const devcb_write8 *config ); +void ppi8255_set_port_b_write( running_device *device, const devcb_write8 *config ); +void ppi8255_set_port_c_write( running_device *device, const devcb_write8 *config ); -void ppi8255_set_port_a( const device_config *device, UINT8 data ); -void ppi8255_set_port_b( const device_config *device, UINT8 data ); -void ppi8255_set_port_c( const device_config *device, UINT8 data ); +void ppi8255_set_port_a( running_device *device, UINT8 data ); +void ppi8255_set_port_b( running_device *device, UINT8 data ); +void ppi8255_set_port_c( running_device *device, UINT8 data ); -UINT8 ppi8255_get_port_a( const device_config *device ); -UINT8 ppi8255_get_port_b( const device_config *device ); -UINT8 ppi8255_get_port_c( const device_config *device ); +UINT8 ppi8255_get_port_a( running_device *device ); +UINT8 ppi8255_get_port_b( running_device *device ); +UINT8 ppi8255_get_port_c( running_device *device ); #endif /* __8255PPI_H_ */ diff --git a/src/emu/machine/8257dma.c b/src/emu/machine/8257dma.c index 2a92d126fab..3d9ce46b1b0 100644 --- a/src/emu/machine/8257dma.c +++ b/src/emu/machine/8257dma.c @@ -78,19 +78,19 @@ struct _dma8257_t static TIMER_CALLBACK( dma8257_timerproc ); static TIMER_CALLBACK( dma8257_msbflip_timerproc ); -static void dma8257_update_status(const device_config *device); +static void dma8257_update_status(running_device *device); /* ----------------------------------------------------------------------- */ -INLINE i8257_t *get_safe_token(const device_config *device) { +INLINE i8257_t *get_safe_token(running_device *device) { assert( device != NULL ); assert( device->token != NULL ); assert( device->type == I8257 ); return ( i8257_t * ) device->token; } -static int dma8257_do_operation(const device_config *device, int channel) +static int dma8257_do_operation(running_device *device, int channel) { i8257_t *i8257 = get_safe_token(device); int done; @@ -167,7 +167,7 @@ static int dma8257_do_operation(const device_config *device, int channel) static TIMER_CALLBACK( dma8257_timerproc ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; i8257_t *i8257 = get_safe_token(device); int i, channel = 0, rr; int done; @@ -200,14 +200,14 @@ static TIMER_CALLBACK( dma8257_timerproc ) static TIMER_CALLBACK( dma8257_msbflip_timerproc ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; i8257_t *i8257 = get_safe_token(device); i8257->msb ^= 1; } -static void dma8257_update_status(const device_config *device) +static void dma8257_update_status(running_device *device) { i8257_t *i8257 = get_safe_token(device); UINT16 pending_transfer; @@ -333,7 +333,7 @@ WRITE8_DEVICE_HANDLER( i8257_w ) static TIMER_CALLBACK( dma8257_drq_write_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; i8257_t *i8257 = get_safe_token(device); int channel = param >> 1; int state = param & 0x01; @@ -384,7 +384,7 @@ WRITE_LINE_DEVICE_HANDLER( i8257_drq3_w ) { dma8257_drq_w(device, 3, state); } static DEVICE_START( i8257 ) { i8257_t *i8257 = get_safe_token(device); - i8257_interface *intf = (i8257_interface *)device->static_config; + i8257_interface *intf = (i8257_interface *)device->baseconfig().static_config; int i; /* validate arguments */ diff --git a/src/emu/machine/adc083x.c b/src/emu/machine/adc083x.c index 2f29a0e1e76..daad3328732 100644 --- a/src/emu/machine/adc083x.c +++ b/src/emu/machine/adc083x.c @@ -71,7 +71,7 @@ struct _adc0831_state INLINE FUNCTIONS ***************************************************************************/ -INLINE adc0831_state *get_safe_token( const device_config *device ) +INLINE adc0831_state *get_safe_token( running_device *device ) { assert( device != NULL ); assert( device->token != NULL ); @@ -79,11 +79,11 @@ INLINE adc0831_state *get_safe_token( const device_config *device ) return (adc0831_state *) device->token; } -INLINE const adc083x_interface *get_interface( const device_config *device ) +INLINE const adc083x_interface *get_interface( running_device *device ) { assert( device != NULL ); assert( ( device->type == ADC0831 ) || ( device->type == ADC0832 ) || ( device->type == ADC0834 ) || ( device->type == ADC0838 ) ); - return (const adc083x_interface *) device->static_config; + return (const adc083x_interface *) device->baseconfig().static_config; } @@ -95,7 +95,7 @@ INLINE const adc083x_interface *get_interface( const device_config *device ) adc083x_clear_sars -------------------------------------------------*/ -static void adc083x_clear_sars( const device_config *device, adc0831_state *adc083x ) +static void adc083x_clear_sars( running_device *device, adc0831_state *adc083x ) { if( device->type == ADC0834 ||device->type == ADC0838 ) { @@ -149,7 +149,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_cs_write ) adc083x_conversion -------------------------------------------------*/ -static UINT8 adc083x_conversion( const device_config *device ) +static UINT8 adc083x_conversion( running_device *device ) { adc0831_state *adc083x = get_safe_token( device ); int result; diff --git a/src/emu/machine/adc083x.h b/src/emu/machine/adc083x.h index b3be6b1d1fc..5963dc9450f 100644 --- a/src/emu/machine/adc083x.h +++ b/src/emu/machine/adc083x.h @@ -56,7 +56,7 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef double (*adc083x_input_convert_func)(const device_config *device, UINT8 input); +typedef double (*adc083x_input_convert_func)(running_device *device, UINT8 input); typedef struct _adc083x_interface adc083x_interface; struct _adc083x_interface diff --git a/src/emu/machine/adc1038.c b/src/emu/machine/adc1038.c index bb5ef3c90fa..29042faaf04 100644 --- a/src/emu/machine/adc1038.c +++ b/src/emu/machine/adc1038.c @@ -33,7 +33,7 @@ struct _adc1038_state INLINE FUNCTIONS *****************************************************************************/ -INLINE adc1038_state *adc1038_get_safe_token( const device_config *device ) +INLINE adc1038_state *adc1038_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -42,11 +42,11 @@ INLINE adc1038_state *adc1038_get_safe_token( const device_config *device ) return (adc1038_state *)device->token; } -INLINE const adc1038_interface *adc1038_get_interface( const device_config *device ) +INLINE const adc1038_interface *adc1038_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == ADC1038)); - return (const adc1038_interface *) device->static_config; + return (const adc1038_interface *) device->baseconfig().static_config; } /***************************************************************************** diff --git a/src/emu/machine/adc1038.h b/src/emu/machine/adc1038.h index c9e648cbe12..b5be502d7c4 100644 --- a/src/emu/machine/adc1038.h +++ b/src/emu/machine/adc1038.h @@ -15,7 +15,7 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef int (*adc1038_input_read_func)(const device_config *device, int input); +typedef int (*adc1038_input_read_func)(running_device *device, int input); typedef struct _adc1038_interface adc1038_interface; struct _adc1038_interface diff --git a/src/emu/machine/adc1213x.c b/src/emu/machine/adc1213x.c index fed2f8a6ac2..0877012881d 100644 --- a/src/emu/machine/adc1213x.c +++ b/src/emu/machine/adc1213x.c @@ -54,7 +54,7 @@ struct _adc12138_state INLINE FUNCTIONS ***************************************************************************/ -INLINE adc12138_state *get_safe_token(const device_config *device) +INLINE adc12138_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -62,11 +62,11 @@ INLINE adc12138_state *get_safe_token(const device_config *device) return (adc12138_state *)device->token; } -INLINE const adc12138_interface *get_interface(const device_config *device) +INLINE const adc12138_interface *get_interface(running_device *device) { assert(device != NULL); assert((device->type == ADC12130) || (device->type == ADC12132) || (device->type == ADC12138)); - return (const adc12138_interface *) device->static_config; + return (const adc12138_interface *) device->baseconfig().static_config; } @@ -88,7 +88,7 @@ WRITE8_DEVICE_HANDLER( adc1213x_di_w ) adc1213x_convert -------------------------------------------------*/ -static void adc1213x_convert(const device_config *device, int channel, int bits16, int lsbfirst) +static void adc1213x_convert(running_device *device, int channel, int bits16, int lsbfirst) { adc12138_state *adc1213x = get_safe_token(device); int i; diff --git a/src/emu/machine/adc1213x.h b/src/emu/machine/adc1213x.h index 2a38c806291..b75a0e7f2f2 100644 --- a/src/emu/machine/adc1213x.h +++ b/src/emu/machine/adc1213x.h @@ -36,7 +36,7 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef double (*adc1213x_input_convert_func)(const device_config *device, UINT8 input); +typedef double (*adc1213x_input_convert_func)(running_device *device, UINT8 input); typedef struct _adc12138_interface adc12138_interface; struct _adc12138_interface diff --git a/src/emu/machine/at28c16.c b/src/emu/machine/at28c16.c index d304eeae395..710dee985ac 100644 --- a/src/emu/machine/at28c16.c +++ b/src/emu/machine/at28c16.c @@ -35,7 +35,7 @@ static TIMER_CALLBACK( write_finished ) in device is, in fact, an AT28C16 -------------------------------------------------*/ -INLINE at28c16_state *get_safe_token(const device_config *device) +INLINE at28c16_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -107,14 +107,14 @@ READ8_DEVICE_HANDLER( at28c16_r ) } } -void at28c16_a9_12v( const device_config *device, int a9_12v ) +void at28c16_a9_12v( running_device *device, int a9_12v ) { at28c16_state *c = get_safe_token(device); c->a9_12v = a9_12v; } -void at28c16_oe_12v( const device_config *device, int oe_12v ) +void at28c16_oe_12v( running_device *device, int oe_12v ) { at28c16_state *c = get_safe_token(device); @@ -132,8 +132,8 @@ static DEVICE_START(at28c16) /* validate some basic stuff */ assert(device != NULL); -// assert(device->static_config != NULL); -// assert(device->inline_config == NULL); +// assert(device->baseconfig().static_config != NULL); +// assert(device->baseconfig().inline_config == NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); @@ -145,7 +145,7 @@ static DEVICE_START(at28c16) c->write_timer = timer_alloc(device->machine, write_finished, c ); c->default_data = *device->region; - config = (const at28c16_config *)device->inline_config; + config = (const at28c16_config *)device->baseconfig().inline_config; if (config->id != NULL) c->default_id = memory_region( device->machine, config->id ); diff --git a/src/emu/machine/at28c16.h b/src/emu/machine/at28c16.h index 13852133e0b..075479cc707 100644 --- a/src/emu/machine/at28c16.h +++ b/src/emu/machine/at28c16.h @@ -22,8 +22,8 @@ DEVICE_GET_INFO(at28c16); MDRV_DEVICE_CONFIG_DATAPTR(at28c16_config, id, _id) -extern void at28c16_a9_12v( const device_config *device, int a9_12v ); -extern void at28c16_oe_12v( const device_config *device, int a9_12v ); +extern void at28c16_a9_12v( running_device *device, int a9_12v ); +extern void at28c16_oe_12v( running_device *device, int a9_12v ); /* memory handlers */ diff --git a/src/emu/machine/cdp1852.c b/src/emu/machine/cdp1852.c index 275b3bdae22..833cce6b8b4 100644 --- a/src/emu/machine/cdp1852.c +++ b/src/emu/machine/cdp1852.c @@ -37,18 +37,18 @@ struct _cdp1852_t INLINE FUNCTIONS ***************************************************************************/ -INLINE cdp1852_t *get_safe_token(const device_config *device) +INLINE cdp1852_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); return (cdp1852_t *)device->token; } -INLINE const cdp1852_interface *get_interface(const device_config *device) +INLINE const cdp1852_interface *get_interface(running_device *device) { assert(device != NULL); assert((device->type == CDP1852)); - return (const cdp1852_interface *) device->static_config; + return (const cdp1852_interface *) device->baseconfig().static_config; } /*************************************************************************** @@ -75,7 +75,7 @@ static void set_sr_line(cdp1852_t *cdp1852, int level) static TIMER_CALLBACK( cdp1852_scan_tick ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; cdp1852_t *cdp1852 = get_safe_token(device); switch (cdp1852->mode) diff --git a/src/emu/machine/ds1302.c b/src/emu/machine/ds1302.c index 50c2b030453..5932dc4cf0b 100644 --- a/src/emu/machine/ds1302.c +++ b/src/emu/machine/ds1302.c @@ -44,7 +44,7 @@ struct _ds1302_state INLINE FUNCTIONS ***************************************************************************/ -INLINE ds1302_state *get_safe_token(const device_config *device) +INLINE ds1302_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/machine/ds2404.c b/src/emu/machine/ds2404.c index ad5b742d790..9ea3017d45e 100644 --- a/src/emu/machine/ds2404.c +++ b/src/emu/machine/ds2404.c @@ -30,7 +30,7 @@ struct _ds2404_state { int state_ptr; }; -INLINE ds2404_state *get_safe_token(const device_config *device) +INLINE ds2404_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -285,7 +285,7 @@ WRITE8_DEVICE_HANDLER( ds2404_clk_w ) static TIMER_CALLBACK( ds2404_tick ) { - ds2404_state *state = get_safe_token((const device_config *)ptr); + ds2404_state *state = get_safe_token((running_device *)ptr); int i; for( i = 0; i < 5; i++ ) { @@ -300,7 +300,7 @@ static TIMER_CALLBACK( ds2404_tick ) static DEVICE_START( ds2404 ) { - ds2404_config *config = (ds2404_config *)device->inline_config; + ds2404_config *config = (ds2404_config *)device->baseconfig().inline_config; ds2404_state *state = get_safe_token(device); struct tm ref_tm; diff --git a/src/emu/machine/eeprom.c b/src/emu/machine/eeprom.c index e39bb075997..f5e8af9edbf 100644 --- a/src/emu/machine/eeprom.c +++ b/src/emu/machine/eeprom.c @@ -30,7 +30,7 @@ struct _eeprom_state in device is, in fact, an I2C memory -------------------------------------------------*/ -INLINE eeprom_state *get_safe_token(const device_config *device) +INLINE eeprom_state *get_safe_token(running_device *device) { assert( device != NULL ); assert( device->token != NULL ); @@ -125,7 +125,7 @@ const eeprom_interface eeprom_interface_93C66B = // "*10010xxxxxx", /* erase all */ }; -static void eeprom_write(const device_config *device, int bit) +static void eeprom_write(running_device *device, int bit) { eeprom_state *eestate = get_safe_token(device); @@ -339,7 +339,7 @@ static DEVICE_NVRAM( eeprom ) } else { - const eeprom_config *config = (const eeprom_config *)device->inline_config; + const eeprom_config *config = (const eeprom_config *)device->baseconfig().inline_config; UINT16 default_value = 0xffff; int offs; @@ -383,11 +383,11 @@ static DEVICE_START( eeprom ) /* validate some basic stuff */ assert(device != NULL); - assert(device->inline_config != NULL); + assert(device->baseconfig().inline_config != NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); - config = (const eeprom_config *)device->inline_config; + config = (const eeprom_config *)device->baseconfig().inline_config; eestate->intf = config->pinterface; diff --git a/src/emu/machine/f3853.c b/src/emu/machine/f3853.c index 238f29742af..d9136cae409 100644 --- a/src/emu/machine/f3853.c +++ b/src/emu/machine/f3853.c @@ -46,7 +46,7 @@ static TIMER_CALLBACK( f3853_timer_callback ); : ( f3853->low | ( f3853->high << 8 ) ) & ~0x80 ) -INLINE f3853_t *get_safe_token(const device_config *device) +INLINE f3853_t *get_safe_token(running_device *device) { assert( device != NULL ); assert( device->token != NULL ); @@ -55,7 +55,7 @@ INLINE f3853_t *get_safe_token(const device_config *device) } -static void f3853_set_interrupt_request_line(const device_config *device) +static void f3853_set_interrupt_request_line(running_device *device) { f3853_t *f3853 = get_safe_token( device ); @@ -71,7 +71,7 @@ static void f3853_set_interrupt_request_line(const device_config *device) } -static void f3853_timer_start(const device_config *device, UINT8 value) +static void f3853_timer_start(running_device *device, UINT8 value) { f3853_t *f3853 = get_safe_token( device ); @@ -83,7 +83,7 @@ static void f3853_timer_start(const device_config *device, UINT8 value) static TIMER_CALLBACK( f3853_timer_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; f3853_t *f3853 = get_safe_token( device ); if (f3853->timer_enable) @@ -95,7 +95,7 @@ static TIMER_CALLBACK( f3853_timer_callback ) } -void f3853_set_external_interrupt_in_line(const device_config *device, int level) +void f3853_set_external_interrupt_in_line(running_device *device, int level) { f3853_t *f3853 = get_safe_token( device ); @@ -106,7 +106,7 @@ void f3853_set_external_interrupt_in_line(const device_config *device, int level } -void f3853_set_priority_in_line(const device_config *device, int level) +void f3853_set_priority_in_line(running_device *device, int level) { f3853_t *f3853 = get_safe_token( device ); @@ -167,7 +167,7 @@ static DEVICE_START( f3853 ) UINT8 reg=0xfe; int i; - f3853->config = (const f3853_config *)device->static_config; + f3853->config = (const f3853_config *)device->baseconfig().static_config; for (i=254/*known to get 0xfe after 255 cycles*/; i>=0; i--) { diff --git a/src/emu/machine/f3853.h b/src/emu/machine/f3853.h index 9b4fadb4f75..fcbc2ef89e6 100644 --- a/src/emu/machine/f3853.h +++ b/src/emu/machine/f3853.h @@ -19,7 +19,7 @@ typedef struct _f3853_config f3853_config; struct _f3853_config { - void (*interrupt_request)(const device_config *device, UINT16 addr, int level); + void (*interrupt_request)(running_device *device, UINT16 addr, int level); }; @@ -38,7 +38,7 @@ DEVICE_GET_INFO(f3853); READ8_DEVICE_HANDLER(f3853_r); WRITE8_DEVICE_HANDLER(f3853_w); -void f3853_set_external_interrupt_in_line(const device_config *device, int level); -void f3853_set_priority_in_line(const device_config *device, int level); +void f3853_set_external_interrupt_in_line(running_device *device, int level); +void f3853_set_priority_in_line(running_device *device, int level); #endif /* __F3853_H__ */ diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c index 730bd8cbaca..74d3b673d1f 100644 --- a/src/emu/machine/generic.c +++ b/src/emu/machine/generic.c @@ -55,7 +55,7 @@ struct _generic_machine_private are enabled for the given CPU -------------------------------------------------*/ -INLINE int interrupt_enabled(const device_config *device) +INLINE int interrupt_enabled(running_device *device) { generic_machine_private *state = device->machine->generic_machine_data; int cpunum = cpu_get_index(device); @@ -328,7 +328,7 @@ mame_file *nvram_fopen(running_machine *machine, UINT32 openflags) void nvram_load(running_machine *machine) { mame_file *nvram_file = NULL; - const device_config *device; + running_device *device; /* read data from general NVRAM handler first */ if (machine->config->nvram_handler != NULL) @@ -338,9 +338,9 @@ void nvram_load(running_machine *machine) } /* find all devices with NVRAM handlers, and read from them next */ - for (device = machine->config->devicelist.first(); device != NULL; device = device->next) + for (device = machine->devicelist.first(); device != NULL; device = device->next) { - device_nvram_func nvram = (device_nvram_func)device_get_info_fct(device, DEVINFO_FCT_NVRAM); + device_nvram_func nvram = (device_nvram_func)device->get_config_fct(DEVINFO_FCT_NVRAM); if (nvram != NULL) { if (nvram_file == NULL) @@ -361,7 +361,7 @@ void nvram_load(running_machine *machine) void nvram_save(running_machine *machine) { mame_file *nvram_file = NULL; - const device_config *device; + running_device *device; /* write data from general NVRAM handler first */ if (machine->config->nvram_handler != NULL) @@ -371,9 +371,9 @@ void nvram_save(running_machine *machine) } /* find all devices with NVRAM handlers, and write them next */ - for (device = machine->config->devicelist.first(); device != NULL; device = device->next) + for (device = machine->devicelist.first(); device != NULL; device = device->next) { - device_nvram_func nvram = (device_nvram_func)device_get_info_fct(device, DEVINFO_FCT_NVRAM); + device_nvram_func nvram = (device_nvram_func)device->get_config_fct(DEVINFO_FCT_NVRAM); if (nvram != NULL) { if (nvram_file == NULL) @@ -633,7 +633,7 @@ static void interrupt_reset(running_machine *machine) static TIMER_CALLBACK( clear_all_lines ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; int inputcount = cpu_get_input_lines(device); int line; @@ -650,7 +650,7 @@ static TIMER_CALLBACK( clear_all_lines ) static TIMER_CALLBACK( irq_pulse_clear ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; int irqline = param; cpu_set_input_line(device, irqline, CLEAR_LINE); } @@ -662,7 +662,7 @@ static TIMER_CALLBACK( irq_pulse_clear ) later -------------------------------------------------*/ -void generic_pulse_irq_line(const device_config *device, int irqline) +void generic_pulse_irq_line(running_device *device, int irqline) { int multiplier = cpu_get_clock_multiplier(device); int clocks = (cpu_get_min_cycles(device) * cpu_get_clock_divider(device) + multiplier - 1) / multiplier; @@ -678,7 +678,7 @@ void generic_pulse_irq_line(const device_config *device, int irqline) 1 cycle later, specifying a vector -------------------------------------------------*/ -void generic_pulse_irq_line_and_vector(const device_config *device, int irqline, int vector) +void generic_pulse_irq_line_and_vector(running_device *device, int irqline, int vector) { assert(irqline != INPUT_LINE_NMI && irqline != INPUT_LINE_RESET); cpu_set_input_line_and_vector(device, irqline, ASSERT_LINE, vector); @@ -691,7 +691,7 @@ void generic_pulse_irq_line_and_vector(const device_config *device, int irqline, disable value for global interrupts -------------------------------------------------*/ -void cpu_interrupt_enable(const device_config *device, int enabled) +void cpu_interrupt_enable(running_device *device, int enabled) { generic_machine_private *state = device->machine->generic_machine_data; int cpunum = cpu_get_index(device); diff --git a/src/emu/machine/generic.h b/src/emu/machine/generic.h index d37a58e5157..de1214c9983 100644 --- a/src/emu/machine/generic.h +++ b/src/emu/machine/generic.h @@ -118,9 +118,9 @@ void set_led_status(running_machine *machine, int num, int value); /* ----- interrupt enable and vector helpers ----- */ -void generic_pulse_irq_line(const device_config *device, int irqline); -void generic_pulse_irq_line_and_vector(const device_config *device, int irqline, int vector); -void cpu_interrupt_enable(const device_config *device, int enabled); +void generic_pulse_irq_line(running_device *device, int irqline); +void generic_pulse_irq_line_and_vector(running_device *device, int irqline, int vector); +void cpu_interrupt_enable(running_device *device, int enabled); READ8_HANDLER( interrupt_enable_r ); WRITE8_HANDLER( interrupt_enable_w ); diff --git a/src/emu/machine/i2cmemdev.c b/src/emu/machine/i2cmemdev.c index e081c20b750..ded90ea6e07 100644 --- a/src/emu/machine/i2cmemdev.c +++ b/src/emu/machine/i2cmemdev.c @@ -75,7 +75,7 @@ struct _i2cmem_state in device is, in fact, an I2C memory -------------------------------------------------*/ -INLINE i2cmem_state *get_safe_token( const device_config *device ) +INLINE i2cmem_state *get_safe_token( running_device *device ) { assert( device != NULL ); assert( device->token != NULL ); @@ -102,7 +102,7 @@ static int data_offset( i2cmem_state *c ) return ( ( ( c->devsel << 7 ) & 0xff00 ) | ( c->byteaddr & 0xff ) ) & ( c->data_size - 1 ); } -void i2cmemdev_write( const device_config *device, int line, int data ) +void i2cmemdev_write( running_device *device, int line, int data ) { i2cmem_state *c = get_safe_token( device ); @@ -326,7 +326,7 @@ void i2cmemdev_write( const device_config *device, int line, int data ) } } -int i2cmemdev_read( const device_config *device, int line ) +int i2cmemdev_read( running_device *device, int line ) { i2cmem_state *c = get_safe_token( device ); @@ -352,7 +352,7 @@ int i2cmemdev_read( const device_config *device, int line ) return 0; } -void i2cmemdev_set_read_mode( const device_config *device, int mode ) +void i2cmemdev_set_read_mode( running_device *device, int mode ) { i2cmem_state *c = get_safe_token( device ); @@ -371,11 +371,11 @@ static DEVICE_START( i2cmem ) /* validate some basic stuff */ assert( device != NULL ); - assert( device->inline_config != NULL ); + assert( device->baseconfig().inline_config != NULL ); assert( device->machine != NULL ); assert( device->machine->config != NULL ); - config = (const i2cmem_config *)device->inline_config; + config = (const i2cmem_config *)device->baseconfig().inline_config; c->scl = 0; c->sdaw = 0; @@ -431,7 +431,7 @@ static DEVICE_RESET( i2cmem ) static DEVICE_NVRAM( i2cmem ) { - const i2cmem_config *config = (const i2cmem_config *)device->inline_config; + const i2cmem_config *config = (const i2cmem_config *)device->baseconfig().inline_config; i2cmem_state *c = get_safe_token( device ); if( read_or_write ) diff --git a/src/emu/machine/i2cmemdev.h b/src/emu/machine/i2cmemdev.h index 9aa62685d76..6384854edbd 100644 --- a/src/emu/machine/i2cmemdev.h +++ b/src/emu/machine/i2cmemdev.h @@ -36,8 +36,8 @@ DEVICE_GET_INFO(i2cmem); MDRV_DEVICE_CONFIG_DATAPTR(i2cmem_config, data, _data) -void i2cmemdev_write( const device_config *device, int line, int data ); -int i2cmemdev_read( const device_config *device, int line ); -void i2cmemdev_set_read_mode( const device_config *device, int mode ); +void i2cmemdev_write( running_device *device, int line, int data ); +int i2cmemdev_read( running_device *device, int line ); +void i2cmemdev_set_read_mode( running_device *device, int mode ); #endif diff --git a/src/emu/machine/i8243.c b/src/emu/machine/i8243.c index d56d32e2c0d..83b2281c848 100644 --- a/src/emu/machine/i8243.c +++ b/src/emu/machine/i8243.c @@ -32,7 +32,7 @@ struct _i8243_state INLINE FUNCTIONS ***************************************************************************/ -INLINE i8243_state *get_safe_token(const device_config *device) +INLINE i8243_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->type == I8243); @@ -40,11 +40,11 @@ INLINE i8243_state *get_safe_token(const device_config *device) } -INLINE i8243_config *get_safe_config(const device_config *device) +INLINE i8243_config *get_safe_config(running_device *device) { assert(device != NULL); assert(device->type == I8243); - return (i8243_config *)device->inline_config; + return (i8243_config *)device->baseconfig().inline_config; } diff --git a/src/emu/machine/i8255a.c b/src/emu/machine/i8255a.c index 67f5aebbaaf..e6e20aae4ed 100644 --- a/src/emu/machine/i8255a.c +++ b/src/emu/machine/i8255a.c @@ -77,7 +77,7 @@ struct _i8255a_t INLINE FUNCTIONS ***************************************************************************/ -INLINE i8255a_t *get_safe_token(const device_config *device) +INLINE i8255a_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -85,11 +85,11 @@ INLINE i8255a_t *get_safe_token(const device_config *device) return (i8255a_t *)device->token; } -INLINE const i8255a_interface *get_interface(const device_config *device) +INLINE const i8255a_interface *get_interface(running_device *device) { assert(device != NULL); assert((device->type == I8255A)); - return (const i8255a_interface *) device->static_config; + return (const i8255a_interface *) device->baseconfig().static_config; } INLINE int group_mode(i8255a_t *i8255a, int group) @@ -564,7 +564,7 @@ static void write_pc(i8255a_t *i8255a, UINT8 data) } } -static void set_mode(const device_config *device, UINT8 data) +static void set_mode(running_device *device, UINT8 data) { i8255a_t *i8255a = get_safe_token(device); @@ -599,7 +599,7 @@ static void set_mode(const device_config *device, UINT8 data) output_pc(i8255a); } -static void set_pc_bit(const device_config *device, int bit, int state) +static void set_pc_bit(running_device *device, int bit, int state) { i8255a_t *i8255a = get_safe_token(device); diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c index 02e5cf0d276..a40626316e6 100644 --- a/src/emu/machine/idectrl.c +++ b/src/emu/machine/idectrl.c @@ -104,7 +104,7 @@ typedef struct _ide_state ide_state; struct _ide_state { - const device_config *device; + running_device *device; UINT8 adapter_control; UINT8 status; @@ -178,8 +178,8 @@ static TIMER_CALLBACK( read_sector_done_callback ); static void read_first_sector(ide_state *ide); static void read_next_sector(ide_state *ide); -static UINT32 ide_controller_read(const device_config *device, int bank, offs_t offset, int size); -static void ide_controller_write(const device_config *device, int bank, offs_t offset, int size, UINT32 data); +static UINT32 ide_controller_read(running_device *device, int bank, offs_t offset, int size); +static void ide_controller_write(running_device *device, int bank, offs_t offset, int size, UINT32 data); @@ -192,7 +192,7 @@ static void ide_controller_write(const device_config *device, int bank, offs_t o in device is, in fact, an IDE controller -------------------------------------------------*/ -INLINE ide_state *get_safe_token(const device_config *device) +INLINE ide_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -204,7 +204,7 @@ INLINE ide_state *get_safe_token(const device_config *device) INLINE void signal_interrupt(ide_state *ide) { - const ide_config *config = (const ide_config *)ide->device->inline_config; + const ide_config *config = (const ide_config *)ide->device->baseconfig().inline_config; LOG(("IDE interrupt assert\n")); @@ -218,7 +218,7 @@ INLINE void signal_interrupt(ide_state *ide) INLINE void clear_interrupt(ide_state *ide) { - const ide_config *config = (const ide_config *)ide->device->inline_config; + const ide_config *config = (const ide_config *)ide->device->baseconfig().inline_config; LOG(("IDE interrupt clear\n")); @@ -270,19 +270,19 @@ INLINE void signal_delayed_interrupt(ide_state *ide, attotime time, int buffer_r INITIALIZATION AND RESET ***************************************************************************/ -UINT8 *ide_get_features(const device_config *device) +UINT8 *ide_get_features(running_device *device) { ide_state *ide = get_safe_token(device); return ide->features; } -void ide_set_gnet_readlock(const device_config *device, const UINT8 onoff) +void ide_set_gnet_readlock(running_device *device, const UINT8 onoff) { ide_state *ide = get_safe_token(device); ide->gnetreadlock = onoff; } -void ide_set_master_password(const device_config *device, const UINT8 *password) +void ide_set_master_password(running_device *device, const UINT8 *password) { ide_state *ide = get_safe_token(device); @@ -291,7 +291,7 @@ void ide_set_master_password(const device_config *device, const UINT8 *password) } -void ide_set_user_password(const device_config *device, const UINT8 *password) +void ide_set_user_password(running_device *device, const UINT8 *password) { ide_state *ide = get_safe_token(device); @@ -302,7 +302,7 @@ void ide_set_user_password(const device_config *device, const UINT8 *password) static TIMER_CALLBACK( reset_callback ) { - device_reset((const device_config *)ptr); + device_reset((running_device *)ptr); } @@ -1238,7 +1238,7 @@ static void handle_command(ide_state *ide, UINT8 command) * *************************************/ -static UINT32 ide_controller_read(const device_config *device, int bank, offs_t offset, int size) +static UINT32 ide_controller_read(running_device *device, int bank, offs_t offset, int size) { ide_state *ide = get_safe_token(device); UINT32 result = 0; @@ -1347,7 +1347,7 @@ static UINT32 ide_controller_read(const device_config *device, int bank, offs_t * *************************************/ -static void ide_controller_write(const device_config *device, int bank, offs_t offset, int size, UINT32 data) +static void ide_controller_write(running_device *device, int bank, offs_t offset, int size, UINT32 data) { ide_state *ide = get_safe_token(device); @@ -1515,7 +1515,7 @@ static void ide_controller_write(const device_config *device, int bank, offs_t o * *************************************/ -static UINT32 ide_bus_master_read(const device_config *device, offs_t offset, int size) +static UINT32 ide_bus_master_read(running_device *device, offs_t offset, int size) { ide_state *ide = get_safe_token(device); @@ -1544,7 +1544,7 @@ static UINT32 ide_bus_master_read(const device_config *device, offs_t offset, in * *************************************/ -static void ide_bus_master_write(const device_config *device, offs_t offset, int size, UINT32 data) +static void ide_bus_master_write(running_device *device, offs_t offset, int size, UINT32 data) { ide_state *ide = get_safe_token(device); @@ -1619,7 +1619,7 @@ static void ide_bus_master_write(const device_config *device, offs_t offset, int select: 0->CS1Fx active, 1->CS3Fx active offset: register offset (state of DA2-DA0) */ -int ide_bus_r(const device_config *device, int select, int offset) +int ide_bus_r(running_device *device, int select, int offset) { return ide_controller_read(device, select ? 1 : 0, offset, select == 0 && offset == 0 ? 2 : 1); } @@ -1633,7 +1633,7 @@ int ide_bus_r(const device_config *device, int select, int offset) offset: register offset (state of DA2-DA0) data: data written (state of D0-D15 or D0-D7) */ -void ide_bus_w(const device_config *device, int select, int offset, int data) +void ide_bus_w(running_device *device, int select, int offset, int data) { if (select == 0 && offset == 0) ide_controller_write(device, 0, 0, 2, data); @@ -1641,7 +1641,7 @@ void ide_bus_w(const device_config *device, int select, int offset, int data) ide_controller_write(device, select ? 1 : 0, offset, 1, data & 0xff); } -UINT32 ide_controller_r(const device_config *device, int reg, int size) +UINT32 ide_controller_r(running_device *device, int reg, int size) { if (reg >= 0x1f0 && reg < 0x1f8) return ide_controller_read(device, 0, reg & 7, size); @@ -1652,7 +1652,7 @@ UINT32 ide_controller_r(const device_config *device, int reg, int size) return 0xffffffff; } -void ide_controller_w(const device_config *device, int reg, int size, UINT32 data) +void ide_controller_w(running_device *device, int reg, int size, UINT32 data) { if (reg >= 0x1f0 && reg < 0x1f8) ide_controller_write(device, 0, reg & 7, size, data); @@ -1791,8 +1791,8 @@ static DEVICE_START( ide_controller ) /* validate some basic stuff */ assert(device != NULL); - assert(device->static_config == NULL); - assert(device->inline_config != NULL); + assert(device->baseconfig().static_config == NULL); + assert(device->baseconfig().inline_config != NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); @@ -1800,7 +1800,7 @@ static DEVICE_START( ide_controller ) ide->device = device; /* set MAME harddisk handle */ - config = (const ide_config *)device->inline_config; + config = (const ide_config *)device->baseconfig().inline_config; ide->handle = get_disk_handle(device->machine, (config->master != NULL) ? config->master : device->tag.cstr()); ide->disk = hard_disk_open(ide->handle); assert_always(config->slave == NULL, "IDE controller does not yet support slave drives\n"); diff --git a/src/emu/machine/idectrl.h b/src/emu/machine/idectrl.h index b67a5875f66..efe778cdb39 100644 --- a/src/emu/machine/idectrl.h +++ b/src/emu/machine/idectrl.h @@ -24,7 +24,7 @@ typedef struct _ide_config ide_config; struct _ide_config { - void (*interrupt)(const device_config *device, int state); + void (*interrupt)(running_device *device, int state); const char *master; /* name of master region (defaults to device tag) */ const char *slave; /* name of slave region (defaults to NULL) */ const char *bmcpu; /* name of bus master CPU */ @@ -55,18 +55,18 @@ struct _ide_config FUNCTION PROTOTYPES ***************************************************************************/ -UINT8 *ide_get_features(const device_config *device); +UINT8 *ide_get_features(running_device *device); -void ide_set_master_password(const device_config *device, const UINT8 *password); -void ide_set_user_password(const device_config *device, const UINT8 *password); +void ide_set_master_password(running_device *device, const UINT8 *password); +void ide_set_user_password(running_device *device, const UINT8 *password); -void ide_set_gnet_readlock(const device_config *device, const UINT8 onoff); +void ide_set_gnet_readlock(running_device *device, const UINT8 onoff); -int ide_bus_r(const device_config *config, int select, int offset); -void ide_bus_w(const device_config *config, int select, int offset, int data); +int ide_bus_r(running_device *config, int select, int offset); +void ide_bus_w(running_device *config, int select, int offset, int data); -UINT32 ide_controller_r(const device_config *config, int reg, int size); -void ide_controller_w(const device_config *config, int reg, int size, UINT32 data); +UINT32 ide_controller_r(running_device *config, int reg, int size); +void ide_controller_w(running_device *config, int reg, int size, UINT32 data); READ32_DEVICE_HANDLER( ide_controller32_r ); WRITE32_DEVICE_HANDLER( ide_controller32_w ); diff --git a/src/emu/machine/k033906.c b/src/emu/machine/k033906.c index bc39bdb1e23..e532aadecbd 100644 --- a/src/emu/machine/k033906.c +++ b/src/emu/machine/k033906.c @@ -20,14 +20,14 @@ struct _k033906_state int reg_set; // 1 = access reg / 0 = access ram - const device_config *voodoo; + running_device *voodoo; }; /***************************************************************************** INLINE FUNCTIONS *****************************************************************************/ -INLINE k033906_state *k033906_get_safe_token( const device_config *device ) +INLINE k033906_state *k033906_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -36,24 +36,24 @@ INLINE k033906_state *k033906_get_safe_token( const device_config *device ) return (k033906_state *)device->token; } -INLINE const k033906_interface *k033906_get_interface( const device_config *device ) +INLINE const k033906_interface *k033906_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K033906)); - return (const k033906_interface *) device->static_config; + return (const k033906_interface *) device->baseconfig().static_config; } /***************************************************************************** DEVICE HANDLERS *****************************************************************************/ -void k033906_set_reg( const device_config *device, int state ) +void k033906_set_reg( running_device *device, int state ) { k033906_state *k033906 = k033906_get_safe_token(device); k033906->reg_set = state; } -static UINT32 k033906_reg_r( const device_config *device, int reg ) +static UINT32 k033906_reg_r( running_device *device, int reg ) { k033906_state *k033906 = k033906_get_safe_token(device); @@ -70,7 +70,7 @@ static UINT32 k033906_reg_r( const device_config *device, int reg ) return 0; } -static void k033906_reg_w( const device_config *device, int reg, UINT32 data ) +static void k033906_reg_w( running_device *device, int reg, UINT32 data ) { k033906_state *k033906 = k033906_get_safe_token(device); diff --git a/src/emu/machine/k033906.h b/src/emu/machine/k033906.h index daee3b323e9..05e6b272c5c 100644 --- a/src/emu/machine/k033906.h +++ b/src/emu/machine/k033906.h @@ -42,7 +42,7 @@ DEVICE_GET_INFO( k033906 ); extern READ32_DEVICE_HANDLER( k033906_r ); extern WRITE32_DEVICE_HANDLER( k033906_w ); -extern void k033906_set_reg( const device_config *device, int state ); +extern void k033906_set_reg( running_device *device, int state ); #endif /* __K033906_H__ */ diff --git a/src/emu/machine/k056230.c b/src/emu/machine/k056230.c index 0d046703d0b..9466a5bd867 100644 --- a/src/emu/machine/k056230.c +++ b/src/emu/machine/k056230.c @@ -17,14 +17,14 @@ struct _k056230_state UINT32 * ram; int is_thunderh; - const device_config *cpu; + running_device *cpu; }; /***************************************************************************** INLINE FUNCTIONS *****************************************************************************/ -INLINE k056230_state *k056230_get_safe_token( const device_config *device ) +INLINE k056230_state *k056230_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -33,11 +33,11 @@ INLINE k056230_state *k056230_get_safe_token( const device_config *device ) return (k056230_state *)device->token; } -INLINE const k056230_interface *k056230_get_interface( const device_config *device ) +INLINE const k056230_interface *k056230_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K056230)); - return (const k056230_interface *) device->static_config; + return (const k056230_interface *) device->baseconfig().static_config; } /***************************************************************************** diff --git a/src/emu/machine/laserdsc.h b/src/emu/machine/laserdsc.h index b2e7f29633d..3fbc10fbaeb 100644 --- a/src/emu/machine/laserdsc.h +++ b/src/emu/machine/laserdsc.h @@ -61,11 +61,11 @@ enum TYPE DEFINITIONS ***************************************************************************/ -typedef chd_file *(*laserdisc_get_disc_func)(const device_config *device); +typedef chd_file *(*laserdisc_get_disc_func)(running_device *device); -typedef void (*laserdisc_audio_func)(const device_config *device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1); +typedef void (*laserdisc_audio_func)(running_device *device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1); -typedef void (*vp931_data_ready_func)(const device_config *device, int state); +typedef void (*vp931_data_ready_func)(running_device *device, int state); typedef struct _laserdisc_config laserdisc_config; struct _laserdisc_config @@ -151,49 +151,49 @@ struct _laserdisc_config /* ----- core control and status ----- */ /* get a bitmap for the current frame; return TRUE if valid or FALSE if video off */ -int laserdisc_get_video(const device_config *device, bitmap_t **bitmap); +int laserdisc_get_video(running_device *device, bitmap_t **bitmap); /* return the raw philips or white flag codes */ -UINT32 laserdisc_get_field_code(const device_config *device, UINT32 code, UINT8 zero_if_squelched); +UINT32 laserdisc_get_field_code(running_device *device, UINT32 code, UINT8 zero_if_squelched); /* ----- input and output ----- */ /* write to the parallel data port of the player */ -void laserdisc_data_w(const device_config *device, UINT8 data); +void laserdisc_data_w(running_device *device, UINT8 data); /* assert or clear a signal line connected to the player */ -void laserdisc_line_w(const device_config *device, UINT8 line, UINT8 newstate); +void laserdisc_line_w(running_device *device, UINT8 line, UINT8 newstate); /* read from the parallel data port of the player */ -UINT8 laserdisc_data_r(const device_config *device); +UINT8 laserdisc_data_r(running_device *device); /* read the state of a signal line connected to the player */ -UINT8 laserdisc_line_r(const device_config *device, UINT8 line); +UINT8 laserdisc_line_r(running_device *device, UINT8 line); /* ----- player specifics ----- */ /* specify the "slow" speed of the Pioneer PR-7820 */ -void pr7820_set_slow_speed(const device_config *device, double frame_rate_scaler); +void pr7820_set_slow_speed(running_device *device, double frame_rate_scaler); /* set a callback for data ready on the Phillips 22VP931 */ -void vp931_set_data_ready_callback(const device_config *device, vp931_data_ready_func callback); +void vp931_set_data_ready_callback(running_device *device, vp931_data_ready_func callback); /* control the audio squelch of the Simutrek modified players */ -void simutrek_set_audio_squelch(const device_config *device, int state); +void simutrek_set_audio_squelch(running_device *device, int state); /* ----- video interface ----- */ /* enable/disable the video */ -void laserdisc_video_enable(const device_config *device, int enable); +void laserdisc_video_enable(running_device *device, int enable); /* enable/disable the overlay */ -void laserdisc_overlay_enable(const device_config *device, int enable); +void laserdisc_overlay_enable(running_device *device, int enable); /* video update callback */ VIDEO_UPDATE( laserdisc ); @@ -203,10 +203,10 @@ VIDEO_UPDATE( laserdisc ); /* ----- configuration ----- */ /* return a copy of the current live configuration settings */ -void laserdisc_get_config(const device_config *device, laserdisc_config *config); +void laserdisc_get_config(running_device *device, laserdisc_config *config); /* change the current live configuration settings */ -void laserdisc_set_config(const device_config *device, const laserdisc_config *config); +void laserdisc_set_config(running_device *device, const laserdisc_config *config); @@ -221,8 +221,8 @@ DEVICE_GET_INFO( laserdisc ); DEVICE_GET_INFO( laserdisc_sound ); /* type setter */ -int laserdisc_get_type(const device_config *device); -void laserdisc_set_type(const device_config *device, int type); +int laserdisc_get_type(running_device *device); +void laserdisc_set_type(running_device *device, int type); #endif /* __LASERDSC_H__ */ diff --git a/src/emu/machine/latch8.c b/src/emu/machine/latch8.c index 900b17dce4f..ffcd1d5735f 100644 --- a/src/emu/machine/latch8.c +++ b/src/emu/machine/latch8.c @@ -19,19 +19,19 @@ struct _latch8_t UINT8 has_node_map; UINT8 has_devread; UINT8 has_read; - const device_config *devices[8]; + running_device *devices[8]; }; /* ----------------------------------------------------------------------- */ -INLINE latch8_t *get_safe_token(const device_config *device) { +INLINE latch8_t *get_safe_token(running_device *device) { assert( device != NULL ); assert( device->token != NULL ); assert( device->type == LATCH8 ); return ( latch8_t * ) device->token; } -static void update(const device_config *device, UINT8 new_val, UINT8 mask) +static void update(running_device *device, UINT8 new_val, UINT8 mask) { /* temporary hack until the discrete system is a device */ latch8_t *latch8 = get_safe_token(device); @@ -51,7 +51,7 @@ static void update(const device_config *device, UINT8 new_val, UINT8 mask) static TIMER_CALLBACK( latch8_timerproc ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; UINT8 new_val = param & 0xFF; UINT8 mask = param >> 8; @@ -73,7 +73,7 @@ READ8_DEVICE_HANDLER( latch8_r ) int i; for (i=0; i<8; i++) { - const device_config *read_dev = latch8->devices[i]; + running_device *read_dev = latch8->devices[i]; if (read_dev != NULL) { res &= ~( 1 << i); @@ -124,7 +124,7 @@ WRITE8_DEVICE_HANDLER( latch8_reset) /* read bit x */ /* return (latch >> x) & 0x01 */ -INLINE UINT8 latch8_bitx_r(const device_config *device, offs_t offset, int bit) +INLINE UINT8 latch8_bitx_r(running_device *device, offs_t offset, int bit) { latch8_t *latch8 = get_safe_token(device); @@ -154,7 +154,7 @@ READ8_DEVICE_HANDLER( latch8_bit7_q_r) { return latch8_bitx_r(device, offset, 7) /* write bit x from data into bit determined by offset */ /* latch = (latch & ~(1<<offset)) | (((data >> x) & 0x01) << offset) */ -INLINE void latch8_bitx_w(const device_config *device, int bit, offs_t offset, UINT8 data) +INLINE void latch8_bitx_w(running_device *device, int bit, offs_t offset, UINT8 data) { latch8_t *latch8 = get_safe_token(device); UINT8 mask = (1<<offset); @@ -188,7 +188,7 @@ static DEVICE_START( latch8 ) int i; /* validate arguments */ - latch8->intf = (latch8_config *)device->inline_config; + latch8->intf = (latch8_config *)device->baseconfig().inline_config; latch8->value = 0x0; diff --git a/src/emu/machine/ldcore.c b/src/emu/machine/ldcore.c index 4377e8ddb71..5e7cc9f6e11 100644 --- a/src/emu/machine/ldcore.c +++ b/src/emu/machine/ldcore.c @@ -105,7 +105,7 @@ struct _ldcore_data UINT32 audiobufout; /* output index */ UINT32 audiocursamples; /* current samples this track */ UINT32 audiomaxsamples; /* maximum samples per track */ - const device_config *audiocustom; /* custom sound device */ + running_device *audiocustom; /* custom sound device */ /* metadata */ vbi_metadata metadata[2]; /* metadata parsed from the stream, for each field */ @@ -144,7 +144,7 @@ struct _sound_token /* generic helper functions */ static TIMER_CALLBACK( perform_player_update ); static void read_track_data(laserdisc_state *ld); -static void process_track_data(const device_config *device); +static void process_track_data(running_device *device); static DEVICE_START( laserdisc_sound ); static STREAM_UPDATE( custom_stream_callback ); static void configuration_load(running_machine *machine, int config_type, xml_data_node *parentnode); @@ -178,7 +178,7 @@ static const ldplayer_interface *const player_interfaces[] = in device is, in fact, a laserdisc device -------------------------------------------------*/ -INLINE laserdisc_state *get_safe_token(const device_config *device) +INLINE laserdisc_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -289,9 +289,9 @@ static void update_slider_pos(ldcore_data *ldcore, attotime curtime) change of the VBLANK signal -------------------------------------------------*/ -static void vblank_state_changed(const device_config *screen, void *param, int vblank_state) +static void vblank_state_changed(running_device *screen, void *param, int vblank_state) { - const device_config *device = (const device_config *)param; + running_device *device = (running_device *)param; laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; attotime curtime = timer_get_time(screen->machine); @@ -347,7 +347,7 @@ static TIMER_CALLBACK( perform_player_update ) laserdisc player -------------------------------------------------*/ -void laserdisc_data_w(const device_config *device, UINT8 data) +void laserdisc_data_w(running_device *device, UINT8 data) { laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; @@ -364,7 +364,7 @@ void laserdisc_data_w(const device_config *device, UINT8 data) laserdisc_line_w - control an input line -------------------------------------------------*/ -void laserdisc_line_w(const device_config *device, UINT8 line, UINT8 newstate) +void laserdisc_line_w(running_device *device, UINT8 line, UINT8 newstate) { laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; @@ -403,7 +403,7 @@ void laserdisc_line_w(const device_config *device, UINT8 line, UINT8 newstate) data byte -------------------------------------------------*/ -UINT8 laserdisc_data_r(const device_config *device) +UINT8 laserdisc_data_r(running_device *device) { laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; @@ -422,7 +422,7 @@ UINT8 laserdisc_data_r(const device_config *device) of an output line -------------------------------------------------*/ -UINT8 laserdisc_line_r(const device_config *device, UINT8 line) +UINT8 laserdisc_line_r(running_device *device, UINT8 line) { laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; @@ -445,7 +445,7 @@ UINT8 laserdisc_line_r(const device_config *device, UINT8 line) if video off -------------------------------------------------*/ -int laserdisc_get_video(const device_config *device, bitmap_t **bitmap) +int laserdisc_get_video(running_device *device, bitmap_t **bitmap) { laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; @@ -475,7 +475,7 @@ int laserdisc_get_video(const device_config *device, bitmap_t **bitmap) information read from the disc -------------------------------------------------*/ -UINT32 laserdisc_get_field_code(const device_config *device, UINT32 code, UINT8 zero_if_squelched) +UINT32 laserdisc_get_field_code(running_device *device, UINT32 code, UINT8 zero_if_squelched) { laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; @@ -517,7 +517,7 @@ UINT32 laserdisc_get_field_code(const device_config *device, UINT32 code, UINT8 type checking from a device -------------------------------------------------*/ -laserdisc_state *ldcore_get_safe_token(const device_config *device) +laserdisc_state *ldcore_get_safe_token(running_device *device) { return get_safe_token(device); } @@ -906,7 +906,7 @@ static void read_track_data(laserdisc_state *ld) track after it has been read -------------------------------------------------*/ -static void process_track_data(const device_config *device) +static void process_track_data(running_device *device) { laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; @@ -1091,7 +1091,7 @@ static void configuration_load(running_machine *machine, int config_type, xml_da for (ldnode = xml_get_sibling(parentnode->child, "device"); ldnode != NULL; ldnode = xml_get_sibling(ldnode->next, "device")) { const char *devtag = xml_get_attribute_string(ldnode, "tag", ""); - const device_config *device = machine->device(devtag); + running_device *device = machine->device(devtag); if (device != NULL) { laserdisc_state *ld = get_safe_token(device); @@ -1119,16 +1119,16 @@ static void configuration_load(running_machine *machine, int config_type, xml_da static void configuration_save(running_machine *machine, int config_type, xml_data_node *parentnode) { - const device_config *device; + running_device *device; /* we only care about game files */ if (config_type != CONFIG_TYPE_GAME) return; /* iterate over disc devices */ - for (device = machine->config->devicelist.first(LASERDISC); device != NULL; device = device->typenext()) + for (device = machine->devicelist.first(LASERDISC); device != NULL; device = device->typenext()) { - laserdisc_config *origconfig = (laserdisc_config *)device->inline_config; + laserdisc_config *origconfig = (laserdisc_config *)device->baseconfig().inline_config; laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; xml_data_node *overnode; @@ -1191,7 +1191,7 @@ static void configuration_save(running_machine *machine, int config_type, xml_da video -------------------------------------------------*/ -void laserdisc_video_enable(const device_config *device, int enable) +void laserdisc_video_enable(running_device *device, int enable) { laserdisc_state *ld = get_safe_token(device); ld->core->videoenable = enable; @@ -1203,7 +1203,7 @@ void laserdisc_video_enable(const device_config *device, int enable) video -------------------------------------------------*/ -void laserdisc_overlay_enable(const device_config *device, int enable) +void laserdisc_overlay_enable(running_device *device, int enable) { laserdisc_state *ld = get_safe_token(device); ld->core->overenable = enable; @@ -1216,7 +1216,7 @@ void laserdisc_overlay_enable(const device_config *device, int enable) VIDEO_UPDATE( laserdisc ) { - const device_config *laserdisc = screen->machine->config->devicelist.first(LASERDISC); + running_device *laserdisc = screen->machine->devicelist.first(LASERDISC); if (laserdisc != NULL) { const rectangle *visarea = video_screen_get_visible_area(screen); @@ -1293,7 +1293,7 @@ VIDEO_UPDATE( laserdisc ) current live configuration settings -------------------------------------------------*/ -void laserdisc_get_config(const device_config *device, laserdisc_config *config) +void laserdisc_get_config(running_device *device, laserdisc_config *config) { laserdisc_state *ld = get_safe_token(device); *config = ld->core->config; @@ -1305,7 +1305,7 @@ void laserdisc_get_config(const device_config *device, laserdisc_config *config) configuration settings -------------------------------------------------*/ -void laserdisc_set_config(const device_config *device, const laserdisc_config *config) +void laserdisc_set_config(running_device *device, const laserdisc_config *config) { laserdisc_state *ld = get_safe_token(device); ld->core->config = *config; @@ -1322,9 +1322,9 @@ void laserdisc_set_config(const device_config *device, const laserdisc_config *c CHD disc -------------------------------------------------*/ -static void init_disc(const device_config *device) +static void init_disc(running_device *device) { - const laserdisc_config *config = (const laserdisc_config *)device->inline_config; + const laserdisc_config *config = (const laserdisc_config *)device->baseconfig().inline_config; laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; chd_error err; @@ -1388,7 +1388,7 @@ static void init_disc(const device_config *device) video rendering -------------------------------------------------*/ -static void init_video(const device_config *device) +static void init_video(running_device *device) { laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; @@ -1448,7 +1448,7 @@ static void init_video(const device_config *device) audio rendering -------------------------------------------------*/ -static void init_audio(const device_config *device) +static void init_audio(running_device *device) { laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore = ld->core; @@ -1475,7 +1475,7 @@ static void init_audio(const device_config *device) static DEVICE_START( laserdisc ) { - const laserdisc_config *config = (const laserdisc_config *)device->inline_config; + const laserdisc_config *config = (const laserdisc_config *)device->baseconfig().inline_config; laserdisc_state *ld = get_safe_token(device); ldcore_data *ldcore; int statesize; @@ -1600,7 +1600,7 @@ static DEVICE_RESET( laserdisc ) device set info callback -------------------------------------------------*/ -int laserdisc_get_type(const device_config *device) +int laserdisc_get_type(running_device *device) { laserdisc_state *ld = get_safe_token(device); if (ld->core != NULL) @@ -1608,7 +1608,7 @@ int laserdisc_get_type(const device_config *device) return LASERDISC_TYPE_UNKNOWN; } -void laserdisc_set_type(const device_config *device, int type) +void laserdisc_set_type(running_device *device, int type) { laserdisc_state *ld = get_safe_token(device); if (ld->core != NULL && ld->core->config.type != type) @@ -1623,32 +1623,25 @@ void laserdisc_set_type(const device_config *device, int type) device get info callback -------------------------------------------------*/ -DEVICE_GET_INFO( laserdisc ) +static const ldplayer_interface *get_interface(const device_config *devconfig) { - const laserdisc_config *config = NULL; - const ldplayer_interface *intf = NULL; - int pltype; - - /* if we have a device, figure out where our config lives */ - if (device != NULL) - { - laserdisc_state *ld = (laserdisc_state *)device->token; - config = (const laserdisc_config *)device->inline_config; - if (ld != NULL && ld->core != NULL) - { - config = &ld->core->config; - intf = &ld->core->intf; - } - } + if (devconfig == NULL) + return NULL; + + const laserdisc_config *config = (const laserdisc_config *)devconfig->inline_config; + if (config == NULL) + return NULL; + + for (int pltype = 0; pltype < ARRAY_LENGTH(player_interfaces); pltype++) + if (player_interfaces[pltype]->type == config->type) + return player_interfaces[pltype]; + + return NULL; +} - /* if we don't have an interface, but we have a config, look up the interface */ - if (intf == NULL && config != NULL) - for (pltype = 0; pltype < ARRAY_LENGTH(player_interfaces); pltype++) - if (player_interfaces[pltype]->type == config->type) - { - intf = player_interfaces[pltype]; - break; - } +DEVICE_GET_INFO( laserdisc ) +{ + const ldplayer_interface *intf; switch (state) { @@ -1658,8 +1651,8 @@ DEVICE_GET_INFO( laserdisc ) case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_VIDEO; break; /* --- the following bits of info are returned as pointers --- */ - case DEVINFO_PTR_ROM_REGION: info->romregion = (intf != NULL) ? intf->romregion : NULL; break; - case DEVINFO_PTR_MACHINE_CONFIG: info->machine_config = (intf != NULL) ? intf->machine_config : NULL; break; + case DEVINFO_PTR_ROM_REGION: intf = get_interface(device); info->romregion = (intf != NULL) ? intf->romregion : NULL; break; + case DEVINFO_PTR_MACHINE_CONFIG: intf = get_interface(device); info->machine_config = (intf != NULL) ? intf->machine_config : NULL; break; /* --- the following bits of info are returned as pointers to data or functions --- */ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(laserdisc); break; @@ -1667,7 +1660,7 @@ DEVICE_GET_INFO( laserdisc ) case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(laserdisc); break; /* --- the following bits of info are returned as NULL-terminated strings --- */ - case DEVINFO_STR_NAME: strcpy(info->s, (intf != NULL) ? intf->name : "Unknown Laserdisc Player"); break; + case DEVINFO_STR_NAME: intf = get_interface(device); strcpy(info->s, (intf != NULL) ? intf->name : "Unknown Laserdisc Player"); break; case DEVINFO_STR_FAMILY: strcpy(info->s, "Laserdisc Player"); break; case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; diff --git a/src/emu/machine/ldcore.h b/src/emu/machine/ldcore.h index 63a19d83b8d..ae53797da90 100644 --- a/src/emu/machine/ldcore.h +++ b/src/emu/machine/ldcore.h @@ -121,8 +121,8 @@ struct _ldplayer_state typedef struct _laserdisc_state laserdisc_state; struct _laserdisc_state { - const device_config * device; /* pointer to owning device */ - const device_config * screen; /* pointer to the screen device */ + running_device * device; /* pointer to owning device */ + running_device * screen; /* pointer to the screen device */ ldcore_data * core; /* private core data */ ldplayer_data * player; /* private player data */ @@ -184,7 +184,7 @@ extern const ldplayer_interface vp932_interface; /* ----- player interface ----- */ /* return a token with type checking from a device */ -laserdisc_state *ldcore_get_safe_token(const device_config *device); +laserdisc_state *ldcore_get_safe_token(running_device *device); /* set the left/right audio squelch states */ void ldcore_set_audio_squelch(laserdisc_state *ld, UINT8 squelchleft, UINT8 squelchright); diff --git a/src/emu/machine/ldpr8210.c b/src/emu/machine/ldpr8210.c index 15f79542ebc..dbcfb7b35b4 100644 --- a/src/emu/machine/ldpr8210.c +++ b/src/emu/machine/ldpr8210.c @@ -88,7 +88,7 @@ struct _pioneer_pia typedef struct _simutrek_data simutrek_data; struct _simutrek_data { - const device_config *cpu; /* 8748 CPU device */ + running_device *cpu; /* 8748 CPU device */ UINT8 audio_squelch; /* audio squelch value */ UINT8 data; /* parallel data for simutrek */ UINT8 data_ready; /* ready flag for simutrek data */ @@ -109,7 +109,7 @@ struct _ldplayer_data attotime firstbittime; /* time of first bit in command */ /* low-level emulation data */ - const device_config *cpu; /* 8049 CPU device */ + running_device *cpu; /* 8049 CPU device */ attotime slowtrg; /* time of the last SLOW TRG */ pioneer_pia pia; /* PIA state */ UINT8 vsync; /* live VSYNC state */ @@ -1054,7 +1054,7 @@ const ldplayer_interface simutrek_interface = command to enable/disable audio squelch -------------------------------------------------*/ -void simutrek_set_audio_squelch(const device_config *device, int state) +void simutrek_set_audio_squelch(running_device *device, int state) { laserdisc_state *ld = ldcore_get_safe_token(device); ldplayer_data *player = ld->player; @@ -1083,7 +1083,7 @@ static void simutrek_init(laserdisc_state *ld) player->simutrek.data_ready = 1; /* find the Simutrek CPU */ - player->simutrek.cpu = ld->device->machine->device(device_build_tag(tempstring, ld->device, "simutrek")); + player->simutrek.cpu = ld->device->subdevice("simutrek"); } diff --git a/src/emu/machine/ldv1000.c b/src/emu/machine/ldv1000.c index 51f3a76b939..a785a1dd6c1 100644 --- a/src/emu/machine/ldv1000.c +++ b/src/emu/machine/ldv1000.c @@ -55,9 +55,9 @@ struct _ldplayer_data { /* low-level emulation data */ - const device_config *cpu; /* CPU index of the Z80 */ - const device_config *ctc; /* CTC device */ - const device_config *multitimer; /* multi-jump timer device */ + running_device *cpu; /* CPU index of the Z80 */ + running_device *ctc; /* CTC device */ + running_device *multitimer; /* multi-jump timer device */ /* communication status */ UINT8 command; /* command byte to the player */ @@ -98,7 +98,7 @@ static TIMER_CALLBACK( vsync_off ); static TIMER_CALLBACK( vbi_data_fetch ); static TIMER_DEVICE_CALLBACK( multijump_timer ); -static void ctc_interrupt(const device_config *device, int state); +static void ctc_interrupt(running_device *device, int state); static WRITE8_HANDLER( decoder_display_port_w ); static READ8_HANDLER( decoder_display_port_r ); @@ -234,9 +234,9 @@ static void ldv1000_init(laserdisc_state *ld) memset(player, 0, sizeof(*player)); /* find our devices */ - player->cpu = ld->device->machine->device(device_build_tag(tempstring, ld->device, "ldv1000")); - player->ctc = ld->device->machine->device(device_build_tag(tempstring, ld->device, "ldvctc")); - player->multitimer = ld->device->machine->device(device_build_tag(tempstring, ld->device, "multitimer")); + player->cpu = ld->device->subdevice("ldv1000"); + player->ctc = ld->device->subdevice("ldvctc"); + player->multitimer = ld->device->subdevice("multitimer"); timer_device_set_ptr(player->multitimer, ld); } diff --git a/src/emu/machine/ldvp931.c b/src/emu/machine/ldvp931.c index db04b4a9d81..e6ff82593bb 100644 --- a/src/emu/machine/ldvp931.c +++ b/src/emu/machine/ldvp931.c @@ -49,8 +49,8 @@ struct _ldplayer_data { /* low-level emulation data */ - const device_config *cpu; /* CPU index of the 8049 */ - const device_config *tracktimer; /* timer device */ + running_device *cpu; /* CPU index of the 8049 */ + running_device *tracktimer; /* timer device */ vp931_data_ready_func data_ready_cb; /* data ready callback */ /* I/O port states */ @@ -187,7 +187,7 @@ const ldplayer_interface vp931_interface = ready callback -------------------------------------------------*/ -void vp931_set_data_ready_callback(const device_config *device, vp931_data_ready_func callback) +void vp931_set_data_ready_callback(running_device *device, vp931_data_ready_func callback) { laserdisc_state *ld = ldcore_get_safe_token(device); ld->player->data_ready_cb = callback; @@ -215,8 +215,8 @@ static void vp931_init(laserdisc_state *ld) player->data_ready_cb = cbsave; /* find our devices */ - player->cpu = ld->device->machine->device(device_build_tag(tempstring, ld->device, "vp931")); - player->tracktimer = ld->device->machine->device(device_build_tag(tempstring, ld->device, "tracktimer")); + player->cpu = ld->device->subdevice("vp931"); + player->tracktimer = ld->device->subdevice("tracktimer"); timer_device_set_ptr(player->tracktimer, ld); } diff --git a/src/emu/machine/mb14241.c b/src/emu/machine/mb14241.c index 17019fcc184..9d8a37a1afe 100644 --- a/src/emu/machine/mb14241.c +++ b/src/emu/machine/mb14241.c @@ -18,7 +18,7 @@ struct _mb14241_state INLINE FUNCTIONS *****************************************************************************/ -INLINE mb14241_state *get_safe_token( const device_config *device ) +INLINE mb14241_state *get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/machine/mb3773.c b/src/emu/machine/mb3773.c index 826c2fa5214..b714043b00e 100644 --- a/src/emu/machine/mb3773.c +++ b/src/emu/machine/mb3773.c @@ -31,7 +31,7 @@ struct _mb3773_state INLINE FUNCTIONS ***************************************************************************/ -INLINE mb3773_state *get_safe_token(const device_config *device) +INLINE mb3773_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -56,7 +56,7 @@ static TIMER_CALLBACK( watchdog_timeout ) reset_timer -------------------------------------------------*/ -static void reset_timer( const device_config *device ) +static void reset_timer( running_device *device ) { mb3773_state *mb3773 = get_safe_token(device); timer_adjust_oneshot(mb3773->watchdog_timer, ATTOTIME_IN_SEC( 5 ), 0); diff --git a/src/emu/machine/mb87078.c b/src/emu/machine/mb87078.c index b18b286adb9..8803fa73e17 100644 --- a/src/emu/machine/mb87078.c +++ b/src/emu/machine/mb87078.c @@ -111,7 +111,7 @@ static const int mb87078_gain_percent[66] = { INLINE FUNCTIONS *****************************************************************************/ -INLINE mb87078_state *get_safe_token( const device_config *device ) +INLINE mb87078_state *get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -120,11 +120,11 @@ INLINE mb87078_state *get_safe_token( const device_config *device ) return (mb87078_state *)device->token; } -INLINE const mb87078_interface *get_interface( const device_config *device ) +INLINE const mb87078_interface *get_interface( running_device *device ) { assert(device != NULL); assert((device->type == MB87078)); - return (const mb87078_interface *) device->static_config; + return (const mb87078_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -166,7 +166,7 @@ static int calc_gain_index( int data0, int data1 ) } -static void gain_recalc( const device_config *device ) +static void gain_recalc( running_device *device ) { mb87078_state *mb87078 = get_safe_token(device); int i; @@ -182,7 +182,7 @@ static void gain_recalc( const device_config *device ) -void mb87078_data_w( const device_config *device, int data, int dsel ) +void mb87078_data_w( running_device *device, int data, int dsel ) { mb87078_state *mb87078 = get_safe_token(device); @@ -202,20 +202,20 @@ void mb87078_data_w( const device_config *device, int data, int dsel ) } -float mb87078_gain_decibel_r( const device_config *device, int channel ) +float mb87078_gain_decibel_r( running_device *device, int channel ) { mb87078_state *mb87078 = get_safe_token(device); return mb87078_gain_decibel[mb87078->gain[channel]]; } -int mb87078_gain_percent_r( const device_config *device, int channel ) +int mb87078_gain_percent_r( running_device *device, int channel ) { mb87078_state *mb87078 = get_safe_token(device); return mb87078_gain_percent[mb87078->gain[channel]]; } -void mb87078_reset_comp_w( const device_config *device, int level ) +void mb87078_reset_comp_w( running_device *device, int level ) { mb87078_state *mb87078 = get_safe_token(device); diff --git a/src/emu/machine/mb87078.h b/src/emu/machine/mb87078.h index f0fecb610ee..a4a54a52bda 100644 --- a/src/emu/machine/mb87078.h +++ b/src/emu/machine/mb87078.h @@ -43,21 +43,21 @@ DEVICE_GET_INFO( mb87078 ); DEVICE I/O FUNCTIONS ***************************************************************************/ -void mb87078_data_w(const device_config *device, int data, int dsel); -void mb87078_reset_comp_w(const device_config *device, int level); +void mb87078_data_w(running_device *device, int data, int dsel); +void mb87078_reset_comp_w(running_device *device, int level); /* mb87078_gain_decibel_r will return 'channel' gain on the device. Returned value represents channel gain expressed in decibels, Range from 0 to -32.0 (or -256.0 for -infinity) */ -float mb87078_gain_decibel_r(const device_config *device, int channel); +float mb87078_gain_decibel_r(running_device *device, int channel); /* mb87078_gain_percent_r will return 'channel' gain on the device. Returned value represents channel gain expressed in percents of maximum volume. Range from 100 to 0. (100 = 0dB; 50 = -6dB; 0 = -infinity) This function is designed for use with MAME mixer_xxx() functions. */ -int mb87078_gain_percent_r(const device_config *device, int channel); +int mb87078_gain_percent_r(running_device *device, int channel); #endif /* __MB87078_H__ */ diff --git a/src/emu/machine/msm6242.c b/src/emu/machine/msm6242.c index 105e6d52efe..b9b41a73c0a 100644 --- a/src/emu/machine/msm6242.c +++ b/src/emu/machine/msm6242.c @@ -38,7 +38,7 @@ struct _msm6242_t /* makes sure that the passed in device is the right type */ -INLINE msm6242_t *get_safe_token(const device_config *device) +INLINE msm6242_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/machine/pci.c b/src/emu/machine/pci.c index 99233bc10c8..b24a92c363a 100644 --- a/src/emu/machine/pci.c +++ b/src/emu/machine/pci.c @@ -78,9 +78,9 @@ typedef struct _pci_bus_state pci_bus_state; struct _pci_bus_state { - const device_config * busdevice; + running_device * busdevice; const pci_bus_config * config; - const device_config * device[32]; + running_device * device[32]; offs_t address; INT8 devicenum; }; @@ -96,7 +96,7 @@ struct _pci_bus_state in device is, in fact, an IDE controller -------------------------------------------------*/ -INLINE pci_bus_state *get_safe_token(const device_config *device) +INLINE pci_bus_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -205,13 +205,13 @@ static DEVICE_START( pci_bus ) /* validate some basic stuff */ assert(device != NULL); - assert(device->static_config == NULL); - assert(device->inline_config != NULL); + assert(device->baseconfig().static_config == NULL); + assert(device->baseconfig().inline_config != NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); /* store a pointer back to the device */ - pcibus->config = (const pci_bus_config *)device->inline_config; + pcibus->config = (const pci_bus_config *)device->baseconfig().inline_config; pcibus->busdevice = device; pcibus->devicenum = -1; diff --git a/src/emu/machine/pci.h b/src/emu/machine/pci.h index b0226970f07..98dbe0b2774 100644 --- a/src/emu/machine/pci.h +++ b/src/emu/machine/pci.h @@ -14,8 +14,8 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef UINT32 (*pci_read_func)(const device_config *pcibus, const device_config *device, int function, int reg, UINT32 mem_mask); -typedef void (*pci_write_func)(const device_config *pcibus, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask); +typedef UINT32 (*pci_read_func)(running_device *pcibus, running_device *device, int function, int reg, UINT32 mem_mask); +typedef void (*pci_write_func)(running_device *pcibus, running_device *device, int function, int reg, UINT32 data, UINT32 mem_mask); typedef struct _pci_device_entry pci_device_entry; struct _pci_device_entry diff --git a/src/emu/machine/pd4990a.c b/src/emu/machine/pd4990a.c index 08ca627db58..cf6efd601c5 100644 --- a/src/emu/machine/pd4990a.c +++ b/src/emu/machine/pd4990a.c @@ -82,7 +82,7 @@ struct _upd4990a_state INLINE FUNCTIONS ***************************************************************************/ -INLINE upd4990a_state *get_safe_token(const device_config *device) +INLINE upd4990a_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -104,7 +104,7 @@ INLINE UINT8 convert_to_bcd(int val) upd4990a_increment_month -------------------------------------------------*/ -static void upd4990a_increment_month( const device_config *device ) +static void upd4990a_increment_month( running_device *device ) { upd4990a_state *upd4990a = get_safe_token(device); @@ -127,7 +127,7 @@ static void upd4990a_increment_month( const device_config *device ) upd4990a_increment_day -------------------------------------------------*/ -static void upd4990a_increment_day( const device_config *device ) +static void upd4990a_increment_day( running_device *device ) { upd4990a_state *upd4990a = get_safe_token(device); int real_year; @@ -185,7 +185,7 @@ static void upd4990a_increment_day( const device_config *device ) upd4990a_addretrace -------------------------------------------------*/ -void upd4990a_addretrace( const device_config *device ) +void upd4990a_addretrace( running_device *device ) { upd4990a_state *upd4990a = get_safe_token(device); @@ -258,7 +258,7 @@ READ8_DEVICE_HANDLER( upd4990a_databit_r ) upd4990a_readbit -------------------------------------------------*/ -static void upd4990a_readbit( const device_config *device ) +static void upd4990a_readbit( running_device *device ) { upd4990a_state *upd4990a = get_safe_token(device); @@ -300,7 +300,7 @@ static void upd4990a_readbit( const device_config *device ) upd4990a_resetbitstream -------------------------------------------------*/ -static void upd4990a_resetbitstream( const device_config *device ) +static void upd4990a_resetbitstream( running_device *device ) { upd4990a_state *upd4990a = get_safe_token(device); @@ -313,7 +313,7 @@ static void upd4990a_resetbitstream( const device_config *device ) upd4990a_writebit -------------------------------------------------*/ -static void upd4990a_writebit( const device_config *device , UINT8 bit ) +static void upd4990a_writebit( running_device *device , UINT8 bit ) { upd4990a_state *upd4990a = get_safe_token(device); if (upd4990a->bitno <= 31) //low part @@ -326,7 +326,7 @@ static void upd4990a_writebit( const device_config *device , UINT8 bit ) upd4990a_nextbit -------------------------------------------------*/ -static void upd4990a_nextbit( const device_config *device ) +static void upd4990a_nextbit( running_device *device ) { upd4990a_state *upd4990a = get_safe_token(device); ++upd4990a->bitno; @@ -346,7 +346,7 @@ static void upd4990a_nextbit( const device_config *device ) upd4990a_getcommand -------------------------------------------------*/ -static UINT8 upd4990a_getcommand( const device_config *device ) +static UINT8 upd4990a_getcommand( running_device *device ) { upd4990a_state *upd4990a = get_safe_token(device); //Warning: problems if the 4 bits are in different @@ -361,7 +361,7 @@ static UINT8 upd4990a_getcommand( const device_config *device ) upd4990a_update_date -------------------------------------------------*/ -static void upd4990a_update_date( const device_config *device ) +static void upd4990a_update_date( running_device *device ) { upd4990a_state *upd4990a = get_safe_token(device); @@ -378,7 +378,7 @@ static void upd4990a_update_date( const device_config *device ) upd4990a_process_command -------------------------------------------------*/ -static void upd4990a_process_command( const device_config *device ) +static void upd4990a_process_command( running_device *device ) { upd4990a_state *upd4990a = get_safe_token(device); @@ -412,7 +412,7 @@ static void upd4990a_process_command( const device_config *device ) upd4990a_serial_control -------------------------------------------------*/ -static void upd4990a_serial_control( const device_config *device, UINT8 data ) +static void upd4990a_serial_control( running_device *device, UINT8 data ) { upd4990a_state *upd4990a = get_safe_token(device); diff --git a/src/emu/machine/pd4990a.h b/src/emu/machine/pd4990a.h index 5171482fcf4..8b0146d2974 100644 --- a/src/emu/machine/pd4990a.h +++ b/src/emu/machine/pd4990a.h @@ -28,7 +28,7 @@ DEVICE_GET_INFO( upd4990a ); /* this should be refactored, once RTCs get unified */ -extern void upd4990a_addretrace( const device_config *device ); +extern void upd4990a_addretrace( running_device *device ); extern READ8_DEVICE_HANDLER( upd4990a_testbit_r ); extern READ8_DEVICE_HANDLER( upd4990a_databit_r ); diff --git a/src/emu/machine/pic8259.c b/src/emu/machine/pic8259.c index 5e550b7c6be..2a0480b7005 100644 --- a/src/emu/machine/pic8259.c +++ b/src/emu/machine/pic8259.c @@ -70,7 +70,7 @@ struct pic8259 }; -INLINE pic8259_t *get_safe_token(const device_config *device) { +INLINE pic8259_t *get_safe_token(running_device *device) { assert( device != NULL ); assert( device->token != NULL ); assert( device->type == DEVICE_GET_INFO_NAME(pic8259) ); @@ -80,7 +80,7 @@ INLINE pic8259_t *get_safe_token(const device_config *device) { static TIMER_CALLBACK( pic8259_timerproc ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; pic8259_t *pic8259 = get_safe_token(device); int irq; UINT8 mask; @@ -119,7 +119,7 @@ INLINE void pic8259_set_timer(pic8259_t *pic8259) } -void pic8259_set_irq_line(const device_config *device, int irq, int state) +void pic8259_set_irq_line(running_device *device, int irq, int state) { pic8259_t *pic8259 = get_safe_token(device); UINT8 old_irq_lines = pic8259->irq_lines; @@ -151,7 +151,7 @@ void pic8259_set_irq_line(const device_config *device, int irq, int state) -int pic8259_acknowledge(const device_config *device) +int pic8259_acknowledge(running_device *device) { pic8259_t *pic8259 = get_safe_token(device); UINT8 mask; @@ -394,7 +394,7 @@ WRITE8_DEVICE_HANDLER( pic8259_w ) static DEVICE_START( pic8259 ) { pic8259_t *pic8259 = get_safe_token(device); - pic8259->intf = (const struct pic8259_interface *)device->static_config; + pic8259->intf = (const struct pic8259_interface *)device->baseconfig().static_config; pic8259->timer = timer_alloc( device->machine, pic8259_timerproc, (void *)device ); } diff --git a/src/emu/machine/pic8259.h b/src/emu/machine/pic8259.h index 0b968d7bf9d..1d8269261a8 100644 --- a/src/emu/machine/pic8259.h +++ b/src/emu/machine/pic8259.h @@ -13,8 +13,8 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef void (*pic8259_set_int_line_func)(const device_config *device, int interrupt); -#define PIC8259_SET_INT_LINE(name) void name(const device_config *device, int interrupt) +typedef void (*pic8259_set_int_line_func)(running_device *device, int interrupt); +#define PIC8259_SET_INT_LINE(name) void name(running_device *device, int interrupt) struct pic8259_interface { @@ -36,7 +36,7 @@ struct pic8259_interface { DEVICE_GET_INFO(pic8259); READ8_DEVICE_HANDLER( pic8259_r ); WRITE8_DEVICE_HANDLER( pic8259_w ); -int pic8259_acknowledge(const device_config *device); -void pic8259_set_irq_line(const device_config *device, int irq, int state); +int pic8259_acknowledge(running_device *device); +void pic8259_set_irq_line(running_device *device, int irq, int state); #endif /* __PIC8259_H_ */ diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c index e06c72d3b3f..08076b12094 100644 --- a/src/emu/machine/pit8253.c +++ b/src/emu/machine/pit8253.c @@ -101,7 +101,7 @@ struct _pit8253_t ***************************************************************************/ /* makes sure that the passed in device is of the right type */ -INLINE pit8253_t *get_safe_token(const device_config *device) { +INLINE pit8253_t *get_safe_token(running_device *device) { assert( device != NULL ); assert( device->token != NULL ); assert( ( device->type == DEVICE_GET_INFO_NAME(pit8253) ) || @@ -205,7 +205,7 @@ static void decrease_counter_value(struct pit8253_timer *timer,UINT64 cycles) /* Counter loading: transfer of a count from the CR to the CE */ -static void load_counter_value(const device_config *device, struct pit8253_timer *timer) +static void load_counter_value(running_device *device, struct pit8253_timer *timer) { timer->value = timer->count; timer->null_count = 1; @@ -214,7 +214,7 @@ static void load_counter_value(const device_config *device, struct pit8253_timer } -static void set_output(const device_config *device, struct pit8253_timer *timer,int output) +static void set_output(running_device *device, struct pit8253_timer *timer,int output) { if (output != timer->output) { @@ -229,7 +229,7 @@ static void set_output(const device_config *device, struct pit8253_timer *timer, /* This emulates timer "timer" for "elapsed_cycles" cycles and assumes no callbacks occur during that time. */ -static void simulate2(const device_config *device, struct pit8253_timer *timer, INT64 elapsed_cycles) +static void simulate2(running_device *device, struct pit8253_timer *timer, INT64 elapsed_cycles) { UINT32 adjusted_value; int bcd = CTRL_BCD(timer->control); @@ -632,7 +632,7 @@ static void simulate2(const device_config *device, struct pit8253_timer *timer, inaccurate by more than one cycle, and the output changed multiple times during the discrepancy. In practice updates should still be O(1). */ -static void simulate(const device_config *device, struct pit8253_timer *timer, INT64 elapsed_cycles) +static void simulate(running_device *device, struct pit8253_timer *timer, INT64 elapsed_cycles) { if ( elapsed_cycles > 0 ) simulate2(device, timer, elapsed_cycles); @@ -643,7 +643,7 @@ static void simulate(const device_config *device, struct pit8253_timer *timer, I /* This brings timer "timer" up to date */ -static void update(const device_config *device, struct pit8253_timer *timer) +static void update(running_device *device, struct pit8253_timer *timer) { /* With the 82C54's maximum clockin of 10MHz, 64 bits is nearly 60,000 years of time. Should be enough for now. */ @@ -668,7 +668,7 @@ static void update(const device_config *device, struct pit8253_timer *timer) static TIMER_CALLBACK( update_timer_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; pit8253_t *pit8253 = get_safe_token(device); struct pit8253_timer *timer = get_timer(pit8253,param); @@ -766,7 +766,7 @@ READ8_DEVICE_HANDLER( pit8253_r ) /* Loads a new value from the bus to the count register (CR) */ -static void load_count(const device_config *device, struct pit8253_timer *timer, UINT16 newcount) +static void load_count(running_device *device, struct pit8253_timer *timer, UINT16 newcount) { int mode = CTRL_MODE(timer->control); @@ -799,7 +799,7 @@ static void load_count(const device_config *device, struct pit8253_timer *timer, } -static void readback(const device_config *device, struct pit8253_timer *timer,int command) +static void readback(running_device *device, struct pit8253_timer *timer,int command) { UINT16 value; update(device, timer); @@ -1005,7 +1005,7 @@ WRITE8_DEVICE_HANDLER( pit8253_gate_w ) /* ----------------------------------------------------------------------- */ -int pit8253_get_output(const device_config *device, int timerno) +int pit8253_get_output(running_device *device, int timerno) { pit8253_t *pit8253 = get_safe_token(device); struct pit8253_timer *timer = get_timer(pit8253,timerno); @@ -1019,7 +1019,7 @@ int pit8253_get_output(const device_config *device, int timerno) -void pit8253_set_clockin(const device_config *device, int timerno, double new_clockin) +void pit8253_set_clockin(running_device *device, int timerno, double new_clockin) { pit8253_t *pit8253 = get_safe_token(device); struct pit8253_timer *timer = get_timer(pit8253,timerno); @@ -1032,7 +1032,7 @@ void pit8253_set_clockin(const device_config *device, int timerno, double new_cl } -void pit8253_set_clock_signal(const device_config *device, int timerno, int state) +void pit8253_set_clock_signal(running_device *device, int timerno, int state) { pit8253_t *pit8253 = get_safe_token(device); struct pit8253_timer *timer = get_timer(pit8253,timerno); @@ -1049,11 +1049,11 @@ void pit8253_set_clock_signal(const device_config *device, int timerno, int stat } -static void common_start( const device_config *device, int device_type ) { +static void common_start( running_device *device, int device_type ) { pit8253_t *pit8253 = get_safe_token(device); int timerno; - pit8253->config = (const struct pit8253_config *)device->static_config; + pit8253->config = (const struct pit8253_config *)device->baseconfig().static_config; pit8253->device_type = device_type; /* register for state saving */ diff --git a/src/emu/machine/pit8253.h b/src/emu/machine/pit8253.h index 14ca887cd39..a93311eb3ed 100644 --- a/src/emu/machine/pit8253.h +++ b/src/emu/machine/pit8253.h @@ -11,8 +11,8 @@ #define PIT8254 DEVICE_GET_INFO_NAME(pit8254) -typedef void (*pit8253_output_changed_func)(const device_config *device, int state); -#define PIT8253_OUTPUT_CHANGED(name) void name(const device_config *device, int state ) +typedef void (*pit8253_output_changed_func)(running_device *device, int state); +#define PIT8253_OUTPUT_CHANGED(name) void name(running_device *device, int state ) struct pit8253_config @@ -63,9 +63,9 @@ WRITE8_DEVICE_HANDLER( pit8253_gate_w ); to 0 with pit8253_set_clockin and call pit8253_set_clock_signal to change the state of the input CLKx signal. */ -int pit8253_get_output(const device_config *device, int timer); -void pit8253_set_clockin(const device_config *device, int timer, double new_clockin); -void pit8253_set_clock_signal(const device_config *device, int timer, int state); +int pit8253_get_output(running_device *device, int timer); +void pit8253_set_clockin(running_device *device, int timer, double new_clockin); +void pit8253_set_clock_signal(running_device *device, int timer, int state); #endif /* __PIT8253_H_ */ diff --git a/src/emu/machine/rp5h01.c b/src/emu/machine/rp5h01.c index 9ff5785a827..8746a1551fb 100644 --- a/src/emu/machine/rp5h01.c +++ b/src/emu/machine/rp5h01.c @@ -41,7 +41,7 @@ struct _rp5h01_state INLINE FUNCTIONS ***************************************************************************/ -INLINE rp5h01_state *get_safe_token(const device_config *device) +INLINE rp5h01_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -49,11 +49,11 @@ INLINE rp5h01_state *get_safe_token(const device_config *device) return (rp5h01_state *)device->token; } -INLINE const rp5h01_interface *get_interface(const device_config *device) +INLINE const rp5h01_interface *get_interface(running_device *device) { assert(device != NULL); assert((device->type == RP5H01)); - return (const rp5h01_interface *) device->static_config; + return (const rp5h01_interface *) device->baseconfig().static_config; } /*************************************************************************** diff --git a/src/emu/machine/rtc65271.c b/src/emu/machine/rtc65271.c index ab554994636..acaebf0953c 100644 --- a/src/emu/machine/rtc65271.c +++ b/src/emu/machine/rtc65271.c @@ -18,7 +18,7 @@ #include "emu.h" #include "rtc65271.h" -static void field_interrupts(const device_config *device); +static void field_interrupts(running_device *device); static TIMER_CALLBACK( rtc_SQW_callback ); static TIMER_CALLBACK( rtc_begin_update_callback ); static TIMER_CALLBACK( rtc_end_update_callback ); @@ -50,10 +50,10 @@ struct _rtc65271_state UINT8 SQW_internal_state; /* callback called when interrupt pin state changes (may be NULL) */ - void (*interrupt_callback)(const device_config *device, int state); + void (*interrupt_callback)(running_device *device, int state); }; -INLINE rtc65271_state *get_safe_token(const device_config *device) +INLINE rtc65271_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -194,7 +194,7 @@ static UINT8 BCD_to_binary(UINT8 data) /* load the SRAM and register contents from file */ -static int rtc65271_file_load(const device_config *device, mame_file *file) +static int rtc65271_file_load(running_device *device, mame_file *file) { rtc65271_state *state = get_safe_token(device); UINT8 buf; @@ -278,7 +278,7 @@ static int rtc65271_file_load(const device_config *device, mame_file *file) /* save the SRAM and register contents to file */ -static int rtc65271_file_save(const device_config *device, mame_file *file) +static int rtc65271_file_save(running_device *device, mame_file *file) { rtc65271_state *state = get_safe_token(device); UINT8 buf; @@ -322,7 +322,7 @@ static int rtc65271_file_save(const device_config *device, mame_file *file) xramsel: select RTC register if 0, XRAM if 1 offset: address (A0-A5 pins) */ -UINT8 rtc65271_r(const device_config *device, int xramsel, offs_t offset) +UINT8 rtc65271_r(running_device *device, int xramsel, offs_t offset) { rtc65271_state *state = get_safe_token(device); int reply; @@ -380,7 +380,7 @@ READ8_DEVICE_HANDLER( rtc65271_xram_r ) xramsel: select RTC register if 0, XRAM if 1 offset: address (A0-A5 pins) */ -void rtc65271_w(const device_config *device, int xramsel, offs_t offset, UINT8 data) +void rtc65271_w(running_device *device, int xramsel, offs_t offset, UINT8 data) { rtc65271_state *state = get_safe_token(device); if (xramsel) @@ -465,7 +465,7 @@ WRITE8_DEVICE_HANDLER( rtc65271_xram_w ) rtc65271_w( device, 1, offset, data ); } -static void field_interrupts(const device_config *device) +static void field_interrupts(running_device *device) { rtc65271_state *state = get_safe_token(device); @@ -494,7 +494,7 @@ static void field_interrupts(const device_config *device) */ static TIMER_CALLBACK( rtc_SQW_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; rtc65271_state *state = get_safe_token(device); attotime half_period; @@ -515,7 +515,7 @@ static TIMER_CALLBACK( rtc_SQW_callback ) */ static TIMER_CALLBACK( rtc_begin_update_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; rtc65271_state *state = get_safe_token(device); if (((state->regs[reg_A] & reg_A_DV) == 0x20) && ! (state->regs[reg_B] & reg_B_SET)) @@ -538,7 +538,7 @@ static TIMER_CALLBACK( rtc_end_update_callback ) 31,28,31, 30,31,30, 31,31,30, 31,30,31 }; - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; rtc65271_state *state = get_safe_token(device); UINT8 (*increment)(UINT8 data); int c59, c23, c12, c11, c29; @@ -686,7 +686,7 @@ static TIMER_CALLBACK( rtc_end_update_callback ) static DEVICE_START( rtc65271 ) { - rtc65271_config *config = (rtc65271_config *)device->inline_config; + rtc65271_config *config = (rtc65271_config *)device->baseconfig().inline_config; rtc65271_state *state = get_safe_token(device); state->update_timer = timer_alloc(device->machine, rtc_begin_update_callback, (void *)device); diff --git a/src/emu/machine/rtc65271.h b/src/emu/machine/rtc65271.h index 6a254fdf7fe..57593c848c2 100644 --- a/src/emu/machine/rtc65271.h +++ b/src/emu/machine/rtc65271.h @@ -5,7 +5,7 @@ typedef struct _rtc65271_config rtc65271_config; struct _rtc65271_config { - void (*interrupt_callback)(const device_config *device, int state); + void (*interrupt_callback)(running_device *device, int state); }; @@ -14,8 +14,8 @@ struct _rtc65271_config MDRV_DEVICE_CONFIG_DATAPTR(rtc65271_config, interrupt_callback, _callback) -UINT8 rtc65271_r(const device_config *device, int xramsel, offs_t offset); -void rtc65271_w(const device_config *device, int xramsel, offs_t offset, UINT8 data); +UINT8 rtc65271_r(running_device *device, int xramsel, offs_t offset); +void rtc65271_w(running_device *device, int xramsel, offs_t offset, UINT8 data); READ8_DEVICE_HANDLER( rtc65271_rtc_r ); READ8_DEVICE_HANDLER( rtc65271_xram_r ); diff --git a/src/emu/machine/scsicd.c b/src/emu/machine/scsicd.c index 11569b3cbce..c9173be42a0 100644 --- a/src/emu/machine/scsicd.c +++ b/src/emu/machine/scsicd.c @@ -45,7 +45,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode ) SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance ); cdrom_file *cdrom = our_this->cdrom; - const device_config *cdda; + running_device *cdda; int trk; SCSIGetCommand( scsiInstance, &command, &commandLength ); @@ -317,7 +317,7 @@ static void scsicd_read_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL cdrom_file *cdrom = our_this->cdrom; UINT32 temp; UINT8 tmp_buffer[2048]; - const device_config *cdda; + running_device *cdda; SCSIGetCommand( scsiInstance, &command, &commandLength ); diff --git a/src/emu/machine/smc91c9x.c b/src/emu/machine/smc91c9x.c index 4b7ad3bd260..fb2f4326871 100644 --- a/src/emu/machine/smc91c9x.c +++ b/src/emu/machine/smc91c9x.c @@ -109,7 +109,7 @@ static const char *const ethernet_regname[64] = typedef struct _smc91c9x_state smc91c9x_state; struct _smc91c9x_state { - const device_config *device; + running_device *device; smc91c9x_irq_func irq_handler; /* raw register data and masks */ @@ -151,7 +151,7 @@ static void update_ethernet_irq(smc91c9x_state *smc); in device is, in fact, an IDE controller -------------------------------------------------*/ -INLINE smc91c9x_state *get_safe_token(const device_config *device) +INLINE smc91c9x_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -510,13 +510,13 @@ WRITE16_DEVICE_HANDLER( smc91c9x_w ) static DEVICE_START( smc91c9x ) { - const smc91c9x_config *config = (const smc91c9x_config *)device->inline_config; + const smc91c9x_config *config = (const smc91c9x_config *)device->baseconfig().inline_config; smc91c9x_state *smc = get_safe_token(device); /* validate some basic stuff */ assert(device != NULL); - assert(device->static_config == NULL); - assert(device->inline_config != NULL); + assert(device->baseconfig().static_config == NULL); + assert(device->baseconfig().inline_config != NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); diff --git a/src/emu/machine/smc91c9x.h b/src/emu/machine/smc91c9x.h index 6ba0bad0747..c1a550dff8e 100644 --- a/src/emu/machine/smc91c9x.h +++ b/src/emu/machine/smc91c9x.h @@ -14,7 +14,7 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef void (*smc91c9x_irq_func)(const device_config *device, int state); +typedef void (*smc91c9x_irq_func)(running_device *device, int state); typedef struct _smc91c9x_config smc91c9x_config; diff --git a/src/emu/machine/timekpr.c b/src/emu/machine/timekpr.c index e3f656c409d..e3b97056792 100644 --- a/src/emu/machine/timekpr.c +++ b/src/emu/machine/timekpr.c @@ -25,7 +25,7 @@ typedef struct UINT8 century; UINT8 *data; UINT8 *default_data; - const device_config *device; + running_device *device; int size; int offset_control; int offset_seconds; @@ -222,7 +222,7 @@ static TIMER_CALLBACK( timekeeper_tick ) in device is the right type -------------------------------------------------*/ -INLINE timekeeper_state *get_safe_token(const device_config *device) +INLINE timekeeper_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -291,8 +291,8 @@ static DEVICE_START(timekeeper) /* validate some basic stuff */ assert(device != NULL); -// assert(device->static_config != NULL); - assert(device->inline_config == NULL); +// assert(device->baseconfig().static_config != NULL); + assert(device->baseconfig().inline_config == NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); diff --git a/src/emu/machine/upd4701.c b/src/emu/machine/upd4701.c index b431e2627c0..cf818e49984 100644 --- a/src/emu/machine/upd4701.c +++ b/src/emu/machine/upd4701.c @@ -45,7 +45,7 @@ struct _upd4701_state INLINE FUNCTIONS ***************************************************************************/ -INLINE upd4701_state *get_safe_token(const device_config *device) +INLINE upd4701_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/machine/x2212.c b/src/emu/machine/x2212.c index 06d29a40c7f..d20d3ec91ea 100644 --- a/src/emu/machine/x2212.c +++ b/src/emu/machine/x2212.c @@ -24,7 +24,7 @@ typedef struct in device is, in fact, an X2212 -------------------------------------------------*/ -INLINE x2212_state *get_safe_token(const device_config *device) +INLINE x2212_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -33,7 +33,7 @@ INLINE x2212_state *get_safe_token(const device_config *device) return (x2212_state *)device->token; } -void x2212_write( const device_config *device, int offset, int data ) +void x2212_write( running_device *device, int offset, int data ) { x2212_state *c = get_safe_token(device); @@ -41,14 +41,14 @@ void x2212_write( const device_config *device, int offset, int data ) } -int x2212_read( const device_config *device, int offset ) +int x2212_read( running_device *device, int offset ) { x2212_state *c = get_safe_token(device); return c->sram[ offset ]; } -void x2212_store( const device_config *device, int store ) +void x2212_store( running_device *device, int store ) { x2212_state *c = get_safe_token(device); @@ -60,7 +60,7 @@ void x2212_store( const device_config *device, int store ) c->store = store; } -void x2212_array_recall( const device_config *device, int array_recall ) +void x2212_array_recall( running_device *device, int array_recall ) { x2212_state *c = get_safe_token(device); @@ -83,8 +83,8 @@ static DEVICE_START(x2212) /* validate some basic stuff */ assert(device != NULL); -// assert(device->static_config != NULL); - assert(device->inline_config == NULL); +// assert(device->baseconfig().static_config != NULL); + assert(device->baseconfig().inline_config == NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); @@ -93,7 +93,7 @@ static DEVICE_START(x2212) c->store = 1; c->array_recall = 1; - config = (const x2212_config *)device->static_config; + config = (const x2212_config *)device->baseconfig().static_config; if( config != NULL && config->data != NULL ) { c->default_data = memory_region( device->machine, config->data ); diff --git a/src/emu/machine/x2212.h b/src/emu/machine/x2212.h index a987ffbd718..e88a6046c83 100644 --- a/src/emu/machine/x2212.h +++ b/src/emu/machine/x2212.h @@ -21,9 +21,9 @@ DEVICE_GET_INFO(x2212); MDRV_DEVICE_ADD(_tag, X2212, 0) -extern void x2212_write( const device_config *device, int offset, int data ); -extern int x2212_read( const device_config *device, int offset ); -extern void x2212_store( const device_config *device, int store ); -extern void x2212_array_recall( const device_config *device, int array_recall ); +extern void x2212_write( running_device *device, int offset, int data ); +extern int x2212_read( running_device *device, int offset ); +extern void x2212_store( running_device *device, int store ); +extern void x2212_array_recall( running_device *device, int array_recall ); #endif diff --git a/src/emu/machine/z80ctc.c b/src/emu/machine/z80ctc.c index c16ad4773d1..6a1050cd6d8 100644 --- a/src/emu/machine/z80ctc.c +++ b/src/emu/machine/z80ctc.c @@ -104,9 +104,9 @@ struct _z80ctc FUNCTION PROTOTYPES ***************************************************************************/ -static int z80ctc_irq_state(const device_config *device); -static int z80ctc_irq_ack(const device_config *device); -static void z80ctc_irq_reti(const device_config *device); +static int z80ctc_irq_state(running_device *device); +static int z80ctc_irq_ack(running_device *device); +static void z80ctc_irq_reti(running_device *device); @@ -114,7 +114,7 @@ static void z80ctc_irq_reti(const device_config *device); INLINE FUNCTIONS ***************************************************************************/ -INLINE z80ctc *get_safe_token(const device_config *device) +INLINE z80ctc *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -128,7 +128,7 @@ INLINE z80ctc *get_safe_token(const device_config *device) INTERNAL STATE MANAGEMENT ***************************************************************************/ -static void interrupt_check(const device_config *device) +static void interrupt_check(running_device *device) { z80ctc *ctc = get_safe_token(device); int state = (z80ctc_irq_state(device) & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE; @@ -138,7 +138,7 @@ static void interrupt_check(const device_config *device) static TIMER_CALLBACK( timercallback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; z80ctc *ctc = get_safe_token(device); ctc_channel *channel = &ctc->channel[param]; @@ -164,7 +164,7 @@ static TIMER_CALLBACK( timercallback ) INITIALIZATION/CONFIGURATION ***************************************************************************/ -attotime z80ctc_getperiod(const device_config *device, int ch) +attotime z80ctc_getperiod(running_device *device, int ch) { z80ctc *ctc = get_safe_token(device); ctc_channel *channel = &ctc->channel[ch]; @@ -314,7 +314,7 @@ READ8_DEVICE_HANDLER( z80ctc_r ) EXTERNAL TRIGGERS ***************************************************************************/ -static void z80ctc_trg_w(const device_config *device, int ch, UINT8 data) +static void z80ctc_trg_w(running_device *device, int ch, UINT8 data) { z80ctc *ctc = get_safe_token(device); ctc_channel *channel = &ctc->channel[ch]; @@ -378,7 +378,7 @@ WRITE_LINE_DEVICE_HANDLER( z80ctc_trg3_w ) { z80ctc_trg_w(device, 3, state); } DAISY CHAIN INTERFACE ***************************************************************************/ -static int z80ctc_irq_state(const device_config *device) +static int z80ctc_irq_state(running_device *device) { z80ctc *ctc = get_safe_token(device); int state = 0; @@ -404,7 +404,7 @@ static int z80ctc_irq_state(const device_config *device) } -static int z80ctc_irq_ack(const device_config *device) +static int z80ctc_irq_ack(running_device *device) { z80ctc *ctc = get_safe_token(device); int ch; @@ -431,7 +431,7 @@ static int z80ctc_irq_ack(const device_config *device) } -static void z80ctc_irq_reti(const device_config *device) +static void z80ctc_irq_reti(running_device *device) { z80ctc *ctc = get_safe_token(device); int ch; @@ -458,7 +458,7 @@ static void z80ctc_irq_reti(const device_config *device) static DEVICE_START( z80ctc ) { - const z80ctc_interface *intf = (const z80ctc_interface *)device->static_config; + const z80ctc_interface *intf = (const z80ctc_interface *)device->baseconfig().static_config; z80ctc *ctc = get_safe_token(device); astring tempstring; int ch; diff --git a/src/emu/machine/z80ctc.h b/src/emu/machine/z80ctc.h index e459b96db10..4b4b7ea2270 100644 --- a/src/emu/machine/z80ctc.h +++ b/src/emu/machine/z80ctc.h @@ -56,7 +56,7 @@ struct _z80ctc_interface INITIALIZATION/CONFIGURATION ***************************************************************************/ -attotime z80ctc_getperiod(const device_config *device, int ch); +attotime z80ctc_getperiod(running_device *device, int ch); diff --git a/src/emu/machine/z80dma.c b/src/emu/machine/z80dma.c index ce11aee7f9e..58204fe728f 100644 --- a/src/emu/machine/z80dma.c +++ b/src/emu/machine/z80dma.c @@ -131,18 +131,18 @@ struct _z80dma_t }; static TIMER_CALLBACK( z80dma_timerproc ); -static void z80dma_update_status(const device_config *device); +static void z80dma_update_status(running_device *device); /* ----------------------------------------------------------------------- */ -INLINE z80dma_t *get_safe_token(const device_config *device) { +INLINE z80dma_t *get_safe_token(running_device *device) { assert( device != NULL ); assert( device->token != NULL ); assert( device->type == Z80DMA ); return ( z80dma_t * ) device->token; } -static void z80dma_do_read(const device_config *device) +static void z80dma_do_read(running_device *device) { z80dma_t *cntx = get_safe_token(device); UINT8 mode; @@ -181,7 +181,7 @@ static void z80dma_do_read(const device_config *device) } } -static int z80dma_do_write(const device_config *device) +static int z80dma_do_write(running_device *device) { z80dma_t *cntx = get_safe_token(device); int done; @@ -249,7 +249,7 @@ static int z80dma_do_write(const device_config *device) static TIMER_CALLBACK( z80dma_timerproc ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; z80dma_t *cntx = get_safe_token(device); int done; @@ -277,7 +277,7 @@ static TIMER_CALLBACK( z80dma_timerproc ) } } -static void z80dma_update_status(const device_config *device) +static void z80dma_update_status(running_device *device) { z80dma_t *z80dma = get_safe_token(device); UINT16 pending_transfer; @@ -502,7 +502,7 @@ WRITE8_DEVICE_HANDLER( z80dma_w ) static TIMER_CALLBACK( z80dma_rdy_write_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; int state = param & 0x01; z80dma_t *cntx = get_safe_token(device); @@ -537,19 +537,19 @@ WRITE_LINE_DEVICE_HANDLER( z80dma_bai_w ) DAISY CHAIN INTERFACE ***************************************************************************/ -static int z80dma_irq_state(const device_config *device) +static int z80dma_irq_state(running_device *device) { int state = 0; return state; } -static int z80dma_irq_ack(const device_config *device) +static int z80dma_irq_ack(running_device *device) { return 0; } -static void z80dma_irq_reti(const device_config *device) +static void z80dma_irq_reti(running_device *device) { } @@ -560,7 +560,7 @@ static void z80dma_irq_reti(const device_config *device) static DEVICE_START( z80dma ) { z80dma_t *z80dma = get_safe_token(device); - z80dma_interface *intf = (z80dma_interface *)device->static_config; + z80dma_interface *intf = (z80dma_interface *)device->baseconfig().static_config; /* resolve callbacks */ devcb_resolve_write_line(&z80dma->out_busreq_func, &intf->out_busreq_func, device); diff --git a/src/emu/machine/z80pio.c b/src/emu/machine/z80pio.c index 129e7b2e74c..950b837a230 100644 --- a/src/emu/machine/z80pio.c +++ b/src/emu/machine/z80pio.c @@ -77,9 +77,9 @@ struct _z80pio FUNCTION PROTOTYPES ***************************************************************************/ -static int z80pio_irq_state(const device_config *device); -static int z80pio_irq_ack(const device_config *device); -static void z80pio_irq_reti(const device_config *device); +static int z80pio_irq_state(running_device *device); +static int z80pio_irq_ack(running_device *device); +static void z80pio_irq_reti(running_device *device); @@ -87,7 +87,7 @@ static void z80pio_irq_reti(const device_config *device); INLINE FUNCTIONS ***************************************************************************/ -INLINE z80pio_t *get_safe_token(const device_config *device) +INLINE z80pio_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -100,7 +100,7 @@ INLINE z80pio_t *get_safe_token(const device_config *device) INTERNAL STATE MANAGEMENT ***************************************************************************/ -INLINE void set_rdy(const device_config *device, int ch, int state) +INLINE void set_rdy(running_device *device, int ch, int state) { z80pio_t *z80pio = get_safe_token( device ); /* set state */ @@ -111,7 +111,7 @@ INLINE void set_rdy(const device_config *device, int ch, int state) } -INLINE void interrupt_check(const device_config *device) +INLINE void interrupt_check(running_device *device) { z80pio_t *z80pio = get_safe_token( device ); @@ -120,7 +120,7 @@ INLINE void interrupt_check(const device_config *device) } -static void update_irq_state(const device_config *device, int ch) +static void update_irq_state(running_device *device, int ch) { z80pio_t *z80pio = get_safe_token( device ); int old_state = z80pio->int_state[ch]; @@ -392,7 +392,7 @@ READ8_DEVICE_HANDLER( z80pio_p_r ) STROBE STATE MANAGEMENT ***************************************************************************/ -static void z80pio_update_strobe(const device_config *device, int ch, int state) +static void z80pio_update_strobe(running_device *device, int ch, int state) { z80pio_t *z80pio = get_safe_token( device ); @@ -443,8 +443,8 @@ static void z80pio_update_strobe(const device_config *device, int ch, int state) } -void z80pio_astb_w(const device_config *device, int state) { z80pio_update_strobe(device, 0, state); } -void z80pio_bstb_w(const device_config *device, int state) { z80pio_update_strobe(device, 1, state); } +void z80pio_astb_w(running_device *device, int state) { z80pio_update_strobe(device, 0, state); } +void z80pio_bstb_w(running_device *device, int state) { z80pio_update_strobe(device, 1, state); } @@ -452,7 +452,7 @@ void z80pio_bstb_w(const device_config *device, int state) { z80pio_update_strob DAISY CHAIN INTERFACE ***************************************************************************/ -static int z80pio_irq_state(const device_config *device) +static int z80pio_irq_state(running_device *device) { z80pio_t *z80pio = get_safe_token( device ); int state = 0; @@ -473,7 +473,7 @@ static int z80pio_irq_state(const device_config *device) } -static int z80pio_irq_ack(const device_config *device) +static int z80pio_irq_ack(running_device *device) { z80pio_t *z80pio = get_safe_token( device ); int ch; @@ -495,7 +495,7 @@ static int z80pio_irq_ack(const device_config *device) } -static void z80pio_irq_reti(const device_config *device) +static void z80pio_irq_reti(running_device *device) { z80pio_t *z80pio = get_safe_token( device ); int ch; @@ -549,7 +549,7 @@ WRITE8_DEVICE_HANDLER(z80pio_alt_w) static DEVICE_START( z80pio ) { - const z80pio_interface *intf = (const z80pio_interface *)device->static_config; + const z80pio_interface *intf = (const z80pio_interface *)device->baseconfig().static_config; z80pio_t *z80pio = get_safe_token( device ); devcb_resolve_write_line(&z80pio->intr, &intf->intr, device); diff --git a/src/emu/machine/z80pio.h b/src/emu/machine/z80pio.h index 6db02f5ea1b..90d0c47e794 100644 --- a/src/emu/machine/z80pio.h +++ b/src/emu/machine/z80pio.h @@ -91,8 +91,8 @@ READ8_DEVICE_HANDLER( z80pio_p_r ); STROBE STATE MANAGEMENT ***************************************************************************/ -void z80pio_astb_w(const device_config *device, int state); -void z80pio_bstb_w(const device_config *device, int state); +void z80pio_astb_w(running_device *device, int state); +void z80pio_bstb_w(running_device *device, int state); /*************************************************************************** diff --git a/src/emu/machine/z80sio.c b/src/emu/machine/z80sio.c index 0df63d098d0..a449ae6d400 100644 --- a/src/emu/machine/z80sio.c +++ b/src/emu/machine/z80sio.c @@ -179,12 +179,12 @@ struct _z80sio sio_channel chan[2]; /* 2 channels */ UINT8 int_state[8]; /* interrupt states */ - void (*irq_cb)(const device_config *device, int state); + void (*irq_cb)(running_device *device, int state); write8_device_func dtr_changed_cb; write8_device_func rts_changed_cb; write8_device_func break_changed_cb; write8_device_func transmit_cb; - int (*receive_poll_cb)(const device_config *device, int channel); + int (*receive_poll_cb)(running_device *device, int channel); }; @@ -253,9 +253,9 @@ static TIMER_CALLBACK( serial_callback ); FUNCTION PROTOTYPES ***************************************************************************/ -static int z80sio_irq_state(const device_config *device); -static int z80sio_irq_ack(const device_config *device); -static void z80sio_irq_reti(const device_config *device); +static int z80sio_irq_state(running_device *device); +static int z80sio_irq_ack(running_device *device); +static void z80sio_irq_reti(running_device *device); @@ -263,7 +263,7 @@ static void z80sio_irq_reti(const device_config *device); INLINE FUNCTIONS ***************************************************************************/ -INLINE z80sio *get_safe_token(const device_config *device) +INLINE z80sio *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -272,7 +272,7 @@ INLINE z80sio *get_safe_token(const device_config *device) } -INLINE void interrupt_check(const device_config *device) +INLINE void interrupt_check(running_device *device) { /* if we have a callback, update it with the current state */ z80sio *sio = get_safe_token(device); @@ -297,7 +297,7 @@ INLINE attotime compute_time_per_character(z80sio *sio, int which) reset_channel - reset a single SIO channel -------------------------------------------------*/ -static void reset_channel(const device_config *device, int ch) +static void reset_channel(running_device *device, int ch) { z80sio *sio = get_safe_token(device); attotime tpc = compute_time_per_character(sio, ch); @@ -524,7 +524,7 @@ READ8_DEVICE_HANDLER( z80sio_get_rts ) static TIMER_CALLBACK( change_input_line ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; z80sio *sio = get_safe_token(device); sio_channel *chan = &sio->chan[param & 1]; UINT8 line = (param >> 8) & 0xff; @@ -607,7 +607,7 @@ WRITE8_DEVICE_HANDLER( z80sio_receive_data ) static TIMER_CALLBACK( serial_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; z80sio *sio = get_safe_token(device); sio_channel *chan = &sio->chan[param]; int ch = param; @@ -699,7 +699,7 @@ static const UINT8 int_priority[] = }; -static int z80sio_irq_state(const device_config *device) +static int z80sio_irq_state(running_device *device) { z80sio *sio = get_safe_token(device); int state = 0; @@ -727,7 +727,7 @@ static int z80sio_irq_state(const device_config *device) } -static int z80sio_irq_ack(const device_config *device) +static int z80sio_irq_ack(running_device *device) { z80sio *sio = get_safe_token(device); int i; @@ -754,7 +754,7 @@ static int z80sio_irq_ack(const device_config *device) } -static void z80sio_irq_reti(const device_config *device) +static void z80sio_irq_reti(running_device *device) { z80sio *sio = get_safe_token(device); int i; @@ -782,7 +782,7 @@ static void z80sio_irq_reti(const device_config *device) static DEVICE_START( z80sio ) { - const z80sio_interface *intf = (const z80sio_interface *)device->static_config; + const z80sio_interface *intf = (const z80sio_interface *)device->baseconfig().static_config; z80sio *sio = get_safe_token(device); void *ptr = (void *)device; astring tempstring; diff --git a/src/emu/machine/z80sio.h b/src/emu/machine/z80sio.h index 39f20d25aab..433395cddc5 100644 --- a/src/emu/machine/z80sio.h +++ b/src/emu/machine/z80sio.h @@ -18,12 +18,12 @@ typedef struct _z80sio_interface z80sio_interface; struct _z80sio_interface { - void (*irq_cb)(const device_config *device, int state); + void (*irq_cb)(running_device *device, int state); write8_device_func dtr_changed_cb; write8_device_func rts_changed_cb; write8_device_func break_changed_cb; write8_device_func transmit_cb; - int (*receive_poll_cb)(const device_config *device, int channel); + int (*receive_poll_cb)(running_device *device, int channel); }; diff --git a/src/emu/mame.c b/src/emu/mame.c index 7c7799db36e..8b235704cf9 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -207,7 +207,7 @@ static void logfile_callback(running_machine *machine, const char *buffer); INLINE void eat_all_cpu_cycles(running_machine *machine) { - const device_config *cpu; + running_device *cpu; if(machine->cpuexec_data) for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu)) @@ -1308,12 +1308,12 @@ running_machine::running_machine(const game_driver *driver) if (config->driver_data_size != 0) driver_data = auto_alloc_array_clear(this, UINT8, config->driver_data_size); - /* find devices */ - firstcpu = cpu_first(config); - primary_screen = video_screen_first(config); - /* attach this machine to all the devices in the configuration */ - device_list_attach_machine(this); + devicelist.import_config_list(config->devicelist, *this); + + /* find devices */ + firstcpu = cpu_first(this); + primary_screen = video_screen_first(this); /* fetch core options */ sample_rate = options_get_int(mame_options(), OPTION_SAMPLERATE); diff --git a/src/emu/mame.h b/src/emu/mame.h index 6a6c78672a2..fb4fcaa3ada 100644 --- a/src/emu/mame.h +++ b/src/emu/mame.h @@ -219,19 +219,20 @@ public: running_machine(const game_driver *driver); ~running_machine(); - inline const device_config *device(const char *tag); + inline running_device *device(const char *tag); inline const input_port_config *port(const char *tag); inline const region_info *region(const char *tag); resource_pool respool; /* pool of resources for this machine */ region_list regionlist; /* list of memory regions */ + device_list devicelist; /* list of running devices */ /* configuration data */ const machine_config * config; /* points to the constructed machine_config */ ioport_list portlist; /* points to a list of input port configurations */ /* CPU information */ - const device_config * firstcpu; /* first CPU (allows for quick iteration via typenext) */ + running_device * firstcpu; /* first CPU (allows for quick iteration via typenext) */ /* game-related information */ const game_driver * gamedrv; /* points to the definition of the game machine */ @@ -239,7 +240,7 @@ public: /* video-related information */ gfx_element * gfx[MAX_GFX_ELEMENTS];/* array of pointers to graphic sets (chars, sprites) */ - const device_config * primary_screen; /* the primary screen device, or NULL if screenless */ + running_device * primary_screen; /* the primary screen device, or NULL if screenless */ palette_t * palette; /* global palette object */ /* palette-related information */ @@ -474,9 +475,9 @@ void mame_get_current_datetime(running_machine *machine, mame_system_time *systi INLINE FUNCTIONS ***************************************************************************/ -inline const device_config *running_machine::device(const char *tag) +inline running_device *running_machine::device(const char *tag) { - return config->devicelist.find(tag); + return devicelist.find(tag); } inline const input_port_config *running_machine::port(const char *tag) diff --git a/src/emu/mconfig.c b/src/emu/mconfig.c index 9d158b74378..ed842db2eec 100644 --- a/src/emu/mconfig.c +++ b/src/emu/mconfig.c @@ -147,7 +147,7 @@ static void machine_config_detokenize(machine_config *config, const machine_conf case MCONFIG_TOKEN_DEVICE_CONFIG_CUSTOM_9: case MCONFIG_TOKEN_DEVICE_CONFIG_CUSTOM_FREE: assert(device != NULL); - custom = (device_custom_config_func)devtype_get_info_fct(device->type, DEVINFO_FCT_CUSTOM_CONFIG); + custom = (device_custom_config_func)device->get_config_fct(DEVINFO_FCT_CUSTOM_CONFIG); assert(custom != NULL); tokens = (*custom)(device, entrytype, tokens); break; @@ -293,7 +293,7 @@ static void machine_config_detokenize(machine_config *config, const machine_conf if (depth == 0) for (device = config->devicelist.first(); device != NULL; device = device->next) { - tokens = (const machine_config_token *)device_get_info_ptr(device, DEVINFO_PTR_MACHINE_CONFIG); + tokens = (const machine_config_token *)device->get_config_ptr(DEVINFO_PTR_MACHINE_CONFIG); if (tokens != NULL) machine_config_detokenize(config, tokens, device, depth + 1); } diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h index 565369a3fcc..fec35d8fce1 100644 --- a/src/emu/mconfig.h +++ b/src/emu/mconfig.h @@ -60,7 +60,7 @@ #define VIDEO_EOF_CALL(name) VIDEO_EOF_NAME(name)(machine) #define VIDEO_UPDATE_NAME(name) video_update_##name -#define VIDEO_UPDATE(name) UINT32 VIDEO_UPDATE_NAME(name)(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) +#define VIDEO_UPDATE(name) UINT32 VIDEO_UPDATE_NAME(name)(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) #define VIDEO_UPDATE_CALL(name) VIDEO_UPDATE_NAME(name)(screen, bitmap, cliprect) @@ -88,7 +88,7 @@ typedef void (*video_start_func)(running_machine *machine); typedef void (*video_reset_func)(running_machine *machine); typedef void (*palette_init_func)(running_machine *machine, const UINT8 *color_prom); typedef void (*video_eof_func)(running_machine *machine); -typedef UINT32 (*video_update_func)(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); +typedef UINT32 (*video_update_func)(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect); @@ -219,7 +219,7 @@ struct _machine_config sound_start_func sound_start; /* one-time sound start callback */ sound_reset_func sound_reset; /* sound reset callback */ - device_list devicelist; /* list head for devices */ + device_config_list devicelist; /* list of device configs */ }; diff --git a/src/emu/memory.c b/src/emu/memory.c index 31341deef2b..f6221341374 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -823,24 +823,6 @@ void memory_init(running_machine *machine) } -/*------------------------------------------------- - memory_find_address_space - find an address - space in our internal list; for faster access - use device->space[] after device is started --------------------------------------------------*/ - -const address_space *memory_find_address_space(const device_config *device, int spacenum) -{ - memory_private *memdata = device->machine->memory_data; - const address_space *space; - - for (space = memdata->spacelist; space != NULL; space = space->next) - if (space->cpu == device && space->spacenum == spacenum) - return space; - return NULL; -} - - /*************************************************************************** ADDRESS MAPS @@ -851,7 +833,7 @@ const address_space *memory_find_address_space(const device_config *device, int address map for a device's address space -------------------------------------------------*/ -address_map *address_map_alloc(const device_config *device, const game_driver *driver, int spacenum, void *memdata) +address_map *address_map_alloc(const device_config *devconfig, const game_driver *driver, int spacenum, void *memdata) { const addrmap_token *internal_map; const addrmap_token *default_map; @@ -860,18 +842,18 @@ address_map *address_map_alloc(const device_config *device, const game_driver *d map = global_alloc_clear(address_map); /* append the internal device map (first so it takes priority) */ - internal_map = (const addrmap_token *)device_get_info_ptr(device, DEVINFO_PTR_INTERNAL_MEMORY_MAP + spacenum); + internal_map = (const addrmap_token *)devconfig->get_config_ptr(DEVINFO_PTR_INTERNAL_MEMORY_MAP + spacenum); if (internal_map != NULL) - map_detokenize((memory_private *)memdata, map, driver, device->tag, internal_map); + map_detokenize((memory_private *)memdata, map, driver, devconfig->tag, internal_map); /* construct the standard map */ - if (device->address_map[spacenum] != NULL) - map_detokenize((memory_private *)memdata, map, driver, device->tag, device->address_map[spacenum]); + if (devconfig->address_map[spacenum] != NULL) + map_detokenize((memory_private *)memdata, map, driver, devconfig->tag, devconfig->address_map[spacenum]); /* append the default device map (last so it can be overridden) */ - default_map = (const addrmap_token *)device_get_info_ptr(device, DEVINFO_PTR_DEFAULT_MEMORY_MAP + spacenum); + default_map = (const addrmap_token *)devconfig->get_config_ptr(DEVINFO_PTR_DEFAULT_MEMORY_MAP + spacenum); if (default_map != NULL) - map_detokenize((memory_private *)memdata, map, driver, device->tag, default_map); + map_detokenize((memory_private *)memdata, map, driver, devconfig->tag, default_map); return map; } @@ -1333,7 +1315,7 @@ UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart, but explicitly for 8-bit handlers -------------------------------------------------*/ -UINT8 *_memory_install_device_handler8(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rhandler_name, write8_device_func whandler, const char *whandler_name, int handlerunitmask) +UINT8 *_memory_install_device_handler8(const address_space *space, running_device *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rhandler_name, write8_device_func whandler, const char *whandler_name, int handlerunitmask) { address_space *spacerw = (address_space *)space; if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT) @@ -1354,7 +1336,7 @@ UINT8 *_memory_install_device_handler8(const address_space *space, const device_ above but explicitly for 16-bit handlers -------------------------------------------------*/ -UINT16 *_memory_install_device_handler16(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rhandler_name, write16_device_func whandler, const char *whandler_name, int handlerunitmask) +UINT16 *_memory_install_device_handler16(const address_space *space, running_device *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rhandler_name, write16_device_func whandler, const char *whandler_name, int handlerunitmask) { address_space *spacerw = (address_space *)space; if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT) @@ -1375,7 +1357,7 @@ UINT16 *_memory_install_device_handler16(const address_space *space, const devic above but explicitly for 32-bit handlers -------------------------------------------------*/ -UINT32 *_memory_install_device_handler32(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rhandler_name, write32_device_func whandler, const char *whandler_name, int handlerunitmask) +UINT32 *_memory_install_device_handler32(const address_space *space, running_device *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rhandler_name, write32_device_func whandler, const char *whandler_name, int handlerunitmask) { address_space *spacerw = (address_space *)space; if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT) @@ -1396,7 +1378,7 @@ UINT32 *_memory_install_device_handler32(const address_space *space, const devic above but explicitly for 64-bit handlers -------------------------------------------------*/ -UINT64 *_memory_install_device_handler64(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rhandler_name, write64_device_func whandler, const char *whandler_name, int handlerunitmask) +UINT64 *_memory_install_device_handler64(const address_space *space, running_device *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rhandler_name, write64_device_func whandler, const char *whandler_name, int handlerunitmask) { address_space *spacerw = (address_space *)space; if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT) @@ -1703,7 +1685,7 @@ static void memory_init_spaces(running_machine *machine) { memory_private *memdata = machine->memory_data; address_space **nextptr = (address_space **)&memdata->spacelist; - const device_config *device; + running_device *device; int spacenum; /* create a global watchpoint-filled table */ @@ -1711,7 +1693,7 @@ static void memory_init_spaces(running_machine *machine) memset(memdata->wptable, STATIC_WATCHPOINT, 1 << LEVEL1_BITS); /* loop over devices */ - for (device = machine->config->devicelist.first(); device != NULL; device = device->next) + for (device = machine->devicelist.first(); device != NULL; device = device->next) for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) if (device_get_addrbus_width(device, spacenum) > 0) { @@ -1799,6 +1781,9 @@ static void memory_init_spaces(running_machine *machine) /* link us in */ *nextptr = space; nextptr = (address_space **)&space->next; + + /* notify the deveice */ + device->set_address_space(spacenum, space); } } @@ -1824,7 +1809,7 @@ static void memory_init_preflight(running_machine *machine) int entrynum; /* allocate the address map */ - space->map = address_map_alloc(space->cpu, machine->gamedrv, space->spacenum, memdata); + space->map = address_map_alloc(&space->cpu->baseconfig(), machine->gamedrv, space->spacenum, memdata); /* extract global parameters specified by the map */ space->unmap = (space->map->unmapval == 0) ? 0 : ~0; @@ -1926,7 +1911,7 @@ static void memory_init_populate(running_machine *machine) static void memory_init_map_entry(address_space *space, const address_map_entry *entry, read_or_write readorwrite) { const map_handler_data *handler = (readorwrite == ROW_READ) ? &entry->read : &entry->write; - const device_config *device; + running_device *device; /* based on the handler type, alter the bits, name, funcptr, and object */ switch (handler->type) diff --git a/src/emu/memory.h b/src/emu/memory.h index 0ef3ae106b1..49836240fa4 100644 --- a/src/emu/memory.h +++ b/src/emu/memory.h @@ -87,6 +87,7 @@ enum /* referenced types from other classes */ class device_config; +class running_device; struct game_driver; @@ -136,14 +137,14 @@ typedef void (*write64_space_func)(ATTR_UNUSED const address_space *space, ATTR_ /* device read/write handlers */ -typedef UINT8 (*read8_device_func) (ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset); -typedef void (*write8_device_func) (ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data); -typedef UINT16 (*read16_device_func) (ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask); -typedef void (*write16_device_func)(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask); -typedef UINT32 (*read32_device_func) (ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask); -typedef void (*write32_device_func)(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask); -typedef UINT64 (*read64_device_func) (ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask); -typedef void (*write64_device_func)(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask); +typedef UINT8 (*read8_device_func) (ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset); +typedef void (*write8_device_func) (ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data); +typedef UINT16 (*read16_device_func) (ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask); +typedef void (*write16_device_func)(ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask); +typedef UINT32 (*read32_device_func) (ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask); +typedef void (*write32_device_func)(ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask); +typedef UINT64 (*read64_device_func) (ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask); +typedef void (*write64_device_func)(ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask); /* data_accessors is a struct with accessors of all flavors */ @@ -285,7 +286,8 @@ struct _address_space { address_space * next; /* next address space in the global list */ running_machine * machine; /* reference to the owning machine */ - const device_config * cpu; /* reference to the owning device */ + running_device * cpu; /* reference to the owning device */ + const device_config * devconfig; /* pointer to the owning device's config */ address_map * map; /* original memory map */ const char * name; /* friendly name of the address space */ UINT8 * readlookup; /* live lookup table for reads */ @@ -438,14 +440,14 @@ union _addrmap64_token /* device read/write handler function macros */ -#define READ8_DEVICE_HANDLER(name) UINT8 name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset) -#define WRITE8_DEVICE_HANDLER(name) void name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data) -#define READ16_DEVICE_HANDLER(name) UINT16 name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask) -#define WRITE16_DEVICE_HANDLER(name) void name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask) -#define READ32_DEVICE_HANDLER(name) UINT32 name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask) -#define WRITE32_DEVICE_HANDLER(name) void name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask) -#define READ64_DEVICE_HANDLER(name) UINT64 name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask) -#define WRITE64_DEVICE_HANDLER(name) void name(ATTR_UNUSED const device_config *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask) +#define READ8_DEVICE_HANDLER(name) UINT8 name(ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset) +#define WRITE8_DEVICE_HANDLER(name) void name(ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT8 data) +#define READ16_DEVICE_HANDLER(name) UINT16 name(ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 mem_mask) +#define WRITE16_DEVICE_HANDLER(name) void name(ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 data, ATTR_UNUSED UINT16 mem_mask) +#define READ32_DEVICE_HANDLER(name) UINT32 name(ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 mem_mask) +#define WRITE32_DEVICE_HANDLER(name) void name(ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT32 data, ATTR_UNUSED UINT32 mem_mask) +#define READ64_DEVICE_HANDLER(name) UINT64 name(ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 mem_mask) +#define WRITE64_DEVICE_HANDLER(name) void name(ATTR_UNUSED running_device *device, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT64 data, ATTR_UNUSED UINT64 mem_mask) /* helper macro for merging data with the memory mask */ @@ -943,15 +945,12 @@ extern const char *const address_space_names[ADDRESS_SPACES]; /* initialize the memory system */ void memory_init(running_machine *machine); -/* find an address space in our internal list; for faster access use device->space[] after device is started */ -const address_space *memory_find_address_space(const device_config *device, int spacenum); - /* ----- address maps ----- */ /* build and allocate an address map for a device's address space */ -address_map *address_map_alloc(const device_config *device, const game_driver *driver, int spacenum, void *memdata); +address_map *address_map_alloc(const device_config *devconfig, const game_driver *driver, int spacenum, void *memdata); /* release allocated memory for an address map */ void address_map_free(address_map *map); @@ -1011,16 +1010,16 @@ UINT32 *_memory_install_handler32(const address_space *space, offs_t addrstart, UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, const char *rhandler_name, write64_space_func whandler, const char *whandler_name, int handlerunitmask) ATTR_NONNULL(1); /* install a new 8-bit device memory handler into the given address space, returning a pointer to the memory backing it, if present */ -UINT8 *_memory_install_device_handler8(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rhandler_name, write8_device_func whandler, const char *whandler_name, int handlerunitmask) ATTR_NONNULL(1, 2); +UINT8 *_memory_install_device_handler8(const address_space *space, running_device *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, const char *rhandler_name, write8_device_func whandler, const char *whandler_name, int handlerunitmask) ATTR_NONNULL(1, 2); /* same as above but explicitly for 16-bit handlers */ -UINT16 *_memory_install_device_handler16(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rhandler_name, write16_device_func whandler, const char *whandler_name, int handlerunitmask) ATTR_NONNULL(1, 2); +UINT16 *_memory_install_device_handler16(const address_space *space, running_device *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, const char *rhandler_name, write16_device_func whandler, const char *whandler_name, int handlerunitmask) ATTR_NONNULL(1, 2); /* same as above but explicitly for 32-bit handlers */ -UINT32 *_memory_install_device_handler32(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rhandler_name, write32_device_func whandler, const char *whandler_name, int handlerunitmask) ATTR_NONNULL(1, 2); +UINT32 *_memory_install_device_handler32(const address_space *space, running_device *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, const char *rhandler_name, write32_device_func whandler, const char *whandler_name, int handlerunitmask) ATTR_NONNULL(1, 2); /* same as above but explicitly for 64-bit handlers */ -UINT64 *_memory_install_device_handler64(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rhandler_name, write64_device_func whandler, const char *whandler_name, int handlerunitmask) ATTR_NONNULL(1, 2); +UINT64 *_memory_install_device_handler64(const address_space *space, running_device *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, const char *rhandler_name, write64_device_func whandler, const char *whandler_name, int handlerunitmask) ATTR_NONNULL(1, 2); /* install a new port into the given address space */ void _memory_install_port(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, const char *rtag, const char *wtag) ATTR_NONNULL(1); diff --git a/src/emu/profiler.c b/src/emu/profiler.c index 0a28f4b83b4..d84449fc66c 100644 --- a/src/emu/profiler.c +++ b/src/emu/profiler.c @@ -186,7 +186,7 @@ astring &_profiler_get_text(running_machine *machine, astring &string) /* and then the text */ if (curtype >= PROFILER_CPU_FIRST && curtype <= PROFILER_CPU_MAX) - string.catprintf("CPU '%s'", machine->config->devicelist.find(CPU, curtype - PROFILER_CPU_FIRST)->tag.cstr()); + string.catprintf("CPU '%s'", machine->devicelist.find(CPU, curtype - PROFILER_CPU_FIRST)->tag.cstr()); else for (nameindex = 0; nameindex < ARRAY_LENGTH(names); nameindex++) if (names[nameindex].type == curtype) diff --git a/src/emu/render.c b/src/emu/render.c index eb3d1b74653..b3f84981dc7 100644 --- a/src/emu/render.c +++ b/src/emu/render.c @@ -952,7 +952,7 @@ static void render_save(running_machine *machine, int config_type, xml_data_node is 'live' -------------------------------------------------*/ -int render_is_live_screen(const device_config *screen) +int render_is_live_screen(running_device *screen) { render_target *target; int screen_index; @@ -963,7 +963,7 @@ int render_is_live_screen(const device_config *screen) assert(screen->machine->config != NULL); assert(screen->tag != NULL); - screen_index = screen->machine->config->devicelist.index(VIDEO_SCREEN, screen->tag); + screen_index = screen->machine->devicelist.index(VIDEO_SCREEN, screen->tag); assert(screen_index != -1); @@ -1468,6 +1468,7 @@ void render_target_get_minimum_size(render_target *target, INT32 *minwidth, INT3 { const device_config *screen = target->machine->config->devicelist.find(VIDEO_SCREEN, item->index); const screen_config *scrconfig = (const screen_config *)screen->inline_config; + running_device *screendev = target->machine->device(screen->tag); const rectangle vectorvis = { 0, 639, 0, 479 }; const rectangle *visarea = NULL; render_container *container = get_screen_container_by_index(item->index); @@ -1477,8 +1478,8 @@ void render_target_get_minimum_size(render_target *target, INT32 *minwidth, INT3 /* we may be called very early, before machine->visible_area is initialized; handle that case */ if (scrconfig->type == SCREEN_TYPE_VECTOR) visarea = &vectorvis; - else if (screen->token != NULL) - visarea = video_screen_get_visible_area(screen); + else if (screendev != NULL && screendev->token != NULL) + visarea = video_screen_get_visible_area(screendev); else visarea = &scrconfig->visarea; @@ -2946,6 +2947,12 @@ render_container *render_container_get_screen(const device_config *screen) } +render_container *render_container_get_screen(running_device *screen) +{ + return render_container_get_screen(&screen->baseconfig()); +} + + /*------------------------------------------------- render_container_item_add_generic - add a generic item to a container diff --git a/src/emu/render.h b/src/emu/render.h index a690cc45842..f1ec29dfae4 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -164,6 +164,11 @@ enum TYPE DEFINITIONS ***************************************************************************/ +// forward definitions +class running_device; +class device_config; + + /*------------------------------------------------- callbacks -------------------------------------------------*/ @@ -325,7 +330,7 @@ struct _render_container_user_settings void render_init(running_machine *machine); /* return a boolean indicating if the screen is live */ -int render_is_live_screen(const device_config *screen); +int render_is_live_screen(running_device *screen); /* return the smallest maximum update rate across all targets */ float render_get_max_update_rate(void); @@ -447,6 +452,7 @@ render_container *render_container_get_ui(void); /* return a pointer to the container for the given screen */ render_container *render_container_get_screen(const device_config *screen); +render_container *render_container_get_screen(running_device *screen); /* add a line item to the specified container */ void render_container_add_line(render_container *container, float x0, float y0, float x1, float y1, float width, rgb_t argb, UINT32 flags); diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c index ea2b3cb701a..dac640d67c9 100644 --- a/src/emu/rendlay.c +++ b/src/emu/rendlay.c @@ -1335,15 +1335,15 @@ static void layout_element_draw_led16segsc(bitmap_t *dest, const rectangle *boun static int get_variable_value(const machine_config *config, const char *string, char **outputptr) { - const device_config *device; + const device_config *devconfig; int num, den; char temp[100]; /* screen 0 parameters */ - for (device = video_screen_first(config); device != NULL; device = video_screen_next(device)) + for (devconfig = video_screen_first(config); devconfig != NULL; devconfig = video_screen_next(devconfig)) { - int scrnum = config->devicelist.index(VIDEO_SCREEN, device->tag); - const screen_config *scrconfig = (const screen_config *)device->inline_config; + int scrnum = config->devicelist.index(VIDEO_SCREEN, devconfig->tag); + const screen_config *scrconfig = (const screen_config *)devconfig->inline_config; /* native X aspect factor */ sprintf(temp, "~scr%dnativexaspect~", scrnum); diff --git a/src/emu/romload.c b/src/emu/romload.c index 1fcdf5285b7..6058cc39986 100644 --- a/src/emu/romload.c +++ b/src/emu/romload.c @@ -156,7 +156,7 @@ int rom_source_is_gamedrv(const game_driver *drv, const rom_source *source) const rom_source *rom_first_source(const game_driver *drv, const machine_config *config) { - const device_config *device; + const device_config *devconfig; /* if the driver has a ROM pointer, that's what we want */ if (drv->rom != NULL) @@ -164,11 +164,11 @@ const rom_source *rom_first_source(const game_driver *drv, const machine_config /* otherwise, look through devices */ if (config != NULL) - for (device = config->devicelist.first(); device != NULL; device = device->next) + for (devconfig = config->devicelist.first(); devconfig != NULL; devconfig = devconfig->next) { - const rom_entry *devromp = (const rom_entry *)device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION); + const rom_entry *devromp = (const rom_entry *)devconfig->get_config_ptr(DEVINFO_PTR_ROM_REGION); if (devromp != NULL) - return (rom_source *)device; + return (rom_source *)devconfig; } return NULL; } @@ -181,20 +181,20 @@ const rom_source *rom_first_source(const game_driver *drv, const machine_config const rom_source *rom_next_source(const game_driver *drv, const machine_config *config, const rom_source *previous) { - const device_config *device; + const device_config *devconfig; /* if the previous was the driver, we want the first device */ if (rom_source_is_gamedrv(drv, previous)) - device = (config != NULL) ? config->devicelist.first() : NULL; + devconfig = (config != NULL) ? config->devicelist.first() : NULL; else - device = ((const device_config *)previous)->next; + devconfig = ((const device_config *)previous)->next; /* look for further devices with ROM definitions */ - for ( ; device != NULL; device = device->next) + for ( ; devconfig != NULL; devconfig = devconfig->next) { - const rom_entry *devromp = (const rom_entry *)device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION); + const rom_entry *devromp = (const rom_entry *)devconfig->get_config_ptr(DEVINFO_PTR_ROM_REGION); if (devromp != NULL) - return (rom_source *)device; + return (rom_source *)devconfig; } return NULL; } @@ -212,7 +212,7 @@ const rom_entry *rom_first_region(const game_driver *drv, const rom_source *sour if (source == NULL || rom_source_is_gamedrv(drv, source)) romp = drv->rom; else - romp = (const rom_entry *)device_get_info_ptr((const device_config *)source, DEVINFO_PTR_ROM_REGION); + romp = (const rom_entry *)((const device_config *)source)->get_config_ptr(DEVINFO_PTR_ROM_REGION); return (romp != NULL && !ROMENTRY_ISEND(romp)) ? romp : NULL; } @@ -271,8 +271,8 @@ astring &rom_region_name(astring &result, const game_driver *drv, const rom_sour result.cpy(ROMREGION_GETTAG(romp)); else { - const device_config *device = (const device_config *)source; - result.printf("%s:%s", device->tag.cstr(), ROMREGION_GETTAG(romp)); + const device_config *devconfig = (const device_config *)source; + result.printf("%s:%s", devconfig->tag.cstr(), ROMREGION_GETTAG(romp)); } return result; } @@ -1229,7 +1229,7 @@ static void process_disk_entries(rom_load_data *romdata, const char *regiontag, static UINT32 normalize_flags_for_device(running_machine *machine, UINT32 startflags, const char *rgntag) { - const device_config *device = machine->device(rgntag); + running_device *device = machine->device(rgntag); if (device != NULL && device_get_databus_width(device, ADDRESS_SPACE_0) != 0) { int buswidth; diff --git a/src/emu/sound.c b/src/emu/sound.c index 322a3795eb1..9dbd97fd65b 100644 --- a/src/emu/sound.c +++ b/src/emu/sound.c @@ -127,7 +127,7 @@ static STATE_POSTLOAD( mixer_postload ); class data -------------------------------------------------*/ -INLINE sound_class_data *get_class_data(const device_config *device) +INLINE sound_class_data *get_class_data(running_device *device) { assert(device != NULL); assert(device->type == SOUND); @@ -142,7 +142,7 @@ INLINE sound_class_data *get_class_data(const device_config *device) in device is, in fact, a timer -------------------------------------------------*/ -INLINE speaker_info *get_safe_token(const device_config *device) +INLINE speaker_info *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -159,11 +159,11 @@ INLINE speaker_info *get_safe_token(const device_config *device) INLINE speaker_info *index_to_input(running_machine *machine, int index, int *input) { - const device_config *curspeak; + running_device *curspeak; int count = 0; /* scan through the speakers until we find the indexed input */ - for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak)) + for (curspeak = speaker_output_first(machine); curspeak != NULL; curspeak = speaker_output_next(curspeak)) { speaker_info *info = (speaker_info *)curspeak->token; if (index < count + info->inputs) @@ -270,17 +270,17 @@ static DEVICE_START( sound ) /* validate some basic stuff */ assert(device != NULL); - assert(device->inline_config != NULL); + assert(device->baseconfig().inline_config != NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); /* get pointers to our data */ - config = (const sound_config *)device->inline_config; + config = (const sound_config *)device->baseconfig().inline_config; classdata = get_class_data(device); /* get the chip's start function */ devinfo.start = NULL; - (*config->type)(device, DEVINFO_FCT_START, &devinfo); + (*config->type)(&device->baseconfig(), DEVINFO_FCT_START, &devinfo); assert(devinfo.start != NULL); /* initialize this sound chip */ @@ -421,22 +421,22 @@ DEVICE_GET_INFO( sound ) static void route_sound(running_machine *machine) { - const device_config *curspeak; - const device_config *sound; + running_device *curspeak; + running_device *sound; astring tempstring; int outputnum; /* first count up the inputs for each speaker */ - for (sound = sound_first(machine->config); sound != NULL; sound = sound_next(sound)) + for (sound = sound_first(machine); sound != NULL; sound = sound_next(sound)) { - const sound_config *config = (const sound_config *)sound->inline_config; + const sound_config *config = (const sound_config *)sound->baseconfig().inline_config; int numoutputs = stream_get_device_outputs(sound); const sound_route *route; /* iterate over all routes */ for (route = config->routelist; route != NULL; route = route->next) { - const device_config *target_device = machine->device(route->target); + running_device *target_device = machine->device(route->target); /* if neither found, it's fatal */ if (target_device == NULL) @@ -449,7 +449,7 @@ static void route_sound(running_machine *machine) } /* now allocate the mixers and input data */ - for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak)) + for (curspeak = speaker_output_first(machine); curspeak != NULL; curspeak = speaker_output_next(curspeak)) { speaker_info *info = get_safe_token(curspeak); if (info->inputs != 0) @@ -464,16 +464,16 @@ static void route_sound(running_machine *machine) } /* iterate again over all the sound chips */ - for (sound = sound_first(machine->config); sound != NULL; sound = sound_next(sound)) + for (sound = sound_first(machine); sound != NULL; sound = sound_next(sound)) { - const sound_config *config = (const sound_config *)sound->inline_config; + const sound_config *config = (const sound_config *)sound->baseconfig().inline_config; int numoutputs = stream_get_device_outputs(sound); const sound_route *route; /* iterate over all routes */ for (route = config->routelist; route != NULL; route = route->next) { - const device_config *target_device = machine->device(route->target); + running_device *target_device = machine->device(route->target); int inputnum = route->input; sound_stream *stream; int streamoutput; @@ -529,10 +529,10 @@ static void route_sound(running_machine *machine) static void sound_reset(running_machine *machine) { - const device_config *sound; + running_device *sound; /* reset all the sound chips */ - for (sound = sound_first(machine->config); sound != NULL; sound = sound_next(sound)) + for (sound = sound_first(machine); sound != NULL; sound = sound_next(sound)) device_reset(sound); } @@ -690,7 +690,7 @@ static void sound_save(running_machine *machine, int config_type, xml_data_node static TIMER_CALLBACK( sound_update ) { UINT32 finalmix_step, finalmix_offset; - const device_config *curspeak; + running_device *curspeak; int samples_this_update = 0; int sample; sound_private *global = machine->sound_data; @@ -706,7 +706,7 @@ static TIMER_CALLBACK( sound_update ) finalmix = global->finalmix; /* force all the speaker streams to generate the proper number of samples */ - for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak)) + for (curspeak = speaker_output_first(machine); curspeak != NULL; curspeak = speaker_output_next(curspeak)) { speaker_info *spk = (speaker_info *)curspeak->token; const stream_sample_t *stream_buf; @@ -863,7 +863,7 @@ static DEVICE_START( speaker_output ) speaker_info *info = (speaker_info *)device->token; /* copy in all the relevant info */ - info->speaker = (const speaker_config *)device->inline_config; + info->speaker = (const speaker_config *)device->baseconfig().inline_config; info->tag = device->tag; } @@ -924,7 +924,7 @@ DEVICE_GET_INFO( speaker_output ) particular output -------------------------------------------------*/ -void sound_set_output_gain(const device_config *device, int output, float gain) +void sound_set_output_gain(running_device *device, int output, float gain) { sound_stream *stream; int outputnum; @@ -946,11 +946,11 @@ void sound_set_output_gain(const device_config *device, int output, float gain) int sound_get_user_gain_count(running_machine *machine) { - const device_config *curspeak; + running_device *curspeak; int count = 0; /* count up the number of speaker inputs */ - for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak)) + for (curspeak = speaker_output_first(machine); curspeak != NULL; curspeak = speaker_output_next(curspeak)) { speaker_info *info = (speaker_info *)curspeak->token; count += info->inputs; diff --git a/src/emu/sound.h b/src/emu/sound.h index fab44615717..a43c15fd7d9 100644 --- a/src/emu/sound.h +++ b/src/emu/sound.h @@ -172,7 +172,7 @@ const char *sound_get_user_gain_name(running_machine *machine, int index); /* driver gain controls on chip outputs */ -void sound_set_output_gain(const device_config *device, int output, float gain); +void sound_set_output_gain(running_device *device, int output, float gain); /* ----- sound speaker device interface ----- */ @@ -192,11 +192,16 @@ DEVICE_GET_INFO( speaker_output ); specified sound chip -------------------------------------------------*/ -INLINE sound_type sound_get_type(const device_config *device) +INLINE sound_type sound_get_type(const device_config *devconfig) { - const sound_config *config = (const sound_config *)device->inline_config; + const sound_config *config = (const sound_config *)devconfig->inline_config; return config->type; } +INLINE sound_type sound_get_type(running_device *device) +{ + return sound_get_type(&device->baseconfig()); +} + #endif /* __SOUND_H__ */ diff --git a/src/emu/sound/2151intf.c b/src/emu/sound/2151intf.c index 3916f5fb5c9..cdd29c8f0a4 100644 --- a/src/emu/sound/2151intf.c +++ b/src/emu/sound/2151intf.c @@ -24,7 +24,7 @@ struct _ym2151_state }; -INLINE ym2151_state *get_safe_token(const device_config *device) +INLINE ym2151_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -54,7 +54,7 @@ static DEVICE_START( ym2151 ) ym2151_state *info = get_safe_token(device); int rate; - info->intf = device->static_config ? (const ym2151_interface *)device->static_config : &dummy; + info->intf = device->baseconfig().static_config ? (const ym2151_interface *)device->baseconfig().static_config : &dummy; rate = device->clock/64; diff --git a/src/emu/sound/2151intf.h b/src/emu/sound/2151intf.h index fb9bb6e3f00..f20963e8386 100644 --- a/src/emu/sound/2151intf.h +++ b/src/emu/sound/2151intf.h @@ -6,7 +6,7 @@ typedef struct _ym2151_interface ym2151_interface; struct _ym2151_interface { - void (*irqhandler)(const device_config *device, int irq); + void (*irqhandler)(running_device *device, int irq); write8_device_func portwritehandler; }; diff --git a/src/emu/sound/2203intf.c b/src/emu/sound/2203intf.c index 398cfe723a7..c831095a7d2 100644 --- a/src/emu/sound/2203intf.c +++ b/src/emu/sound/2203intf.c @@ -12,11 +12,11 @@ struct _ym2203_state void * chip; void * psg; const ym2203_interface *intf; - const device_config *device; + running_device *device; }; -INLINE ym2203_state *get_safe_token(const device_config *device) +INLINE ym2203_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -127,7 +127,7 @@ static DEVICE_START( ym2203 ) }, NULL }; - const ym2203_interface *intf = device->static_config ? (const ym2203_interface *)device->static_config : &generic_2203; + const ym2203_interface *intf = device->baseconfig().static_config ? (const ym2203_interface *)device->baseconfig().static_config : &generic_2203; ym2203_state *info = get_safe_token(device); int rate = device->clock/72; /* ??? */ diff --git a/src/emu/sound/2203intf.h b/src/emu/sound/2203intf.h index 48d64ad1a06..9d4f24c7ab3 100644 --- a/src/emu/sound/2203intf.h +++ b/src/emu/sound/2203intf.h @@ -11,7 +11,7 @@ typedef struct _ym2203_interface ym2203_interface; struct _ym2203_interface { const ay8910_interface ay8910_intf; - void (*handler)(const device_config *device, int irq); + void (*handler)(running_device *device, int irq); }; READ8_DEVICE_HANDLER( ym2203_r ); diff --git a/src/emu/sound/2413intf.c b/src/emu/sound/2413intf.c index 201235d9909..b09ccbeb584 100644 --- a/src/emu/sound/2413intf.c +++ b/src/emu/sound/2413intf.c @@ -19,7 +19,7 @@ struct _ym2413_state }; -INLINE ym2413_state *get_safe_token(const device_config *device) +INLINE ym2413_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c index f802f09ae6a..2cecf5824a4 100644 --- a/src/emu/sound/2608intf.c +++ b/src/emu/sound/2608intf.c @@ -25,11 +25,11 @@ struct _ym2608_state void * chip; void * psg; const ym2608_interface *intf; - const device_config *device; + running_device *device; }; -INLINE ym2608_state *get_safe_token(const device_config *device) +INLINE ym2608_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -140,7 +140,7 @@ static DEVICE_START( ym2608 ) }, NULL }; - const ym2608_interface *intf = device->static_config ? (const ym2608_interface *)device->static_config : &generic_2608; + const ym2608_interface *intf = device->baseconfig().static_config ? (const ym2608_interface *)device->baseconfig().static_config : &generic_2608; int rate = device->clock/72; void *pcmbufa; int pcmsizea; diff --git a/src/emu/sound/2608intf.h b/src/emu/sound/2608intf.h index f541742c068..03ffcd372c1 100644 --- a/src/emu/sound/2608intf.h +++ b/src/emu/sound/2608intf.h @@ -12,7 +12,7 @@ typedef struct _ym2608_interface ym2608_interface; struct _ym2608_interface { const ay8910_interface ay8910_intf; - void ( *handler )( const device_config *device, int irq ); /* IRQ handler for the YM2608 */ + void ( *handler )( running_device *device, int irq ); /* IRQ handler for the YM2608 */ }; READ8_DEVICE_HANDLER( ym2608_r ); diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c index c7601ab9ec3..761a34647bf 100644 --- a/src/emu/sound/2610intf.c +++ b/src/emu/sound/2610intf.c @@ -25,11 +25,11 @@ struct _ym2610_state void * chip; void * psg; const ym2610_interface *intf; - const device_config *device; + running_device *device; }; -INLINE ym2610_state *get_safe_token(const device_config *device) +INLINE ym2610_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -145,7 +145,7 @@ static DEVICE_START( ym2610 ) AY8910_DEFAULT_LOADS, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }; - const ym2610_interface *intf = device->static_config ? (const ym2610_interface *)device->static_config : &generic_2610; + const ym2610_interface *intf = device->baseconfig().static_config ? (const ym2610_interface *)device->baseconfig().static_config : &generic_2610; int rate = device->clock/72; void *pcmbufa,*pcmbufb; int pcmsizea,pcmsizeb; diff --git a/src/emu/sound/2610intf.h b/src/emu/sound/2610intf.h index 31129b477e5..93fab60de42 100644 --- a/src/emu/sound/2610intf.h +++ b/src/emu/sound/2610intf.h @@ -11,7 +11,7 @@ void ym2610_update_request(void *param); typedef struct _ym2610_interface ym2610_interface; struct _ym2610_interface { - void ( *handler )( const device_config *device, int irq ); /* IRQ handler for the YM2610 */ + void ( *handler )( running_device *device, int irq ); /* IRQ handler for the YM2610 */ }; READ8_DEVICE_HANDLER( ym2610_r ); diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c index 745dd08e87d..0bc9b4e9e6f 100644 --- a/src/emu/sound/2612intf.c +++ b/src/emu/sound/2612intf.c @@ -24,11 +24,11 @@ struct _ym2612_state emu_timer * timer[2]; void * chip; const ym2612_interface *intf; - const device_config *device; + running_device *device; }; -INLINE ym2612_state *get_safe_token(const device_config *device) +INLINE ym2612_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -106,7 +106,7 @@ static DEVICE_START( ym2612 ) ym2612_state *info = get_safe_token(device); int rate = device->clock/72; - info->intf = device->static_config ? (const ym2612_interface *)device->static_config : &dummy; + info->intf = device->baseconfig().static_config ? (const ym2612_interface *)device->baseconfig().static_config : &dummy; info->device = device; /* FM init */ diff --git a/src/emu/sound/2612intf.h b/src/emu/sound/2612intf.h index 1cce505d279..84f09ded98b 100644 --- a/src/emu/sound/2612intf.h +++ b/src/emu/sound/2612intf.h @@ -8,7 +8,7 @@ void ym2612_update_request(void *param); typedef struct _ym2612_interface ym2612_interface; struct _ym2612_interface { - void (*handler)(const device_config *device, int irq); + void (*handler)(running_device *device, int irq); }; READ8_DEVICE_HANDLER( ym2612_r ); @@ -32,7 +32,7 @@ DEVICE_GET_INFO( ym2612 ); typedef struct _ym3438_interface ym3438_interface; struct _ym3438_interface { - void (*handler)(const device_config *device, int irq); + void (*handler)(running_device *device, int irq); }; diff --git a/src/emu/sound/262intf.c b/src/emu/sound/262intf.c index c763dcecb2f..e83ad4899c1 100644 --- a/src/emu/sound/262intf.c +++ b/src/emu/sound/262intf.c @@ -18,11 +18,11 @@ struct _ymf262_state emu_timer * timer[2]; void * chip; const ymf262_interface *intf; - const device_config *device; + running_device *device; }; -INLINE ymf262_state *get_safe_token(const device_config *device) +INLINE ymf262_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -84,7 +84,7 @@ static DEVICE_START( ymf262 ) ymf262_state *info = get_safe_token(device); int rate = device->clock/288; - info->intf = device->static_config ? (const ymf262_interface *)device->static_config : &dummy; + info->intf = device->baseconfig().static_config ? (const ymf262_interface *)device->baseconfig().static_config : &dummy; info->device = device; /* stream system initialize */ diff --git a/src/emu/sound/262intf.h b/src/emu/sound/262intf.h index 7bcf1a69da3..8f7d1d99315 100644 --- a/src/emu/sound/262intf.h +++ b/src/emu/sound/262intf.h @@ -7,7 +7,7 @@ typedef struct _ymf262_interface ymf262_interface; struct _ymf262_interface { - void (*handler)(const device_config *device, int irq); + void (*handler)(running_device *device, int irq); }; diff --git a/src/emu/sound/3526intf.c b/src/emu/sound/3526intf.c index 833b9c33a3b..7c05d5ff9d4 100644 --- a/src/emu/sound/3526intf.c +++ b/src/emu/sound/3526intf.c @@ -30,11 +30,11 @@ struct _ym3526_state emu_timer * timer[2]; void * chip; const ym3526_interface *intf; - const device_config *device; + running_device *device; }; -INLINE ym3526_state *get_safe_token(const device_config *device) +INLINE ym3526_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -95,7 +95,7 @@ static DEVICE_START( ym3526 ) ym3526_state *info = get_safe_token(device); int rate = device->clock/72; - info->intf = device->static_config ? (const ym3526_interface *)device->static_config : &dummy; + info->intf = device->baseconfig().static_config ? (const ym3526_interface *)device->baseconfig().static_config : &dummy; info->device = device; /* stream system initialize */ diff --git a/src/emu/sound/3526intf.h b/src/emu/sound/3526intf.h index b61928928b5..550e441c43a 100644 --- a/src/emu/sound/3526intf.h +++ b/src/emu/sound/3526intf.h @@ -6,7 +6,7 @@ typedef struct _ym3526_interface ym3526_interface; struct _ym3526_interface { - void (*handler)(const device_config *device, int linestate); + void (*handler)(running_device *device, int linestate); }; READ8_DEVICE_HANDLER( ym3526_r ); diff --git a/src/emu/sound/3812intf.c b/src/emu/sound/3812intf.c index 9487c477e11..14333c293bd 100644 --- a/src/emu/sound/3812intf.c +++ b/src/emu/sound/3812intf.c @@ -30,11 +30,11 @@ struct _ym3812_state emu_timer * timer[2]; void * chip; const ym3812_interface *intf; - const device_config *device; + running_device *device; }; -INLINE ym3812_state *get_safe_token(const device_config *device) +INLINE ym3812_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -95,7 +95,7 @@ static DEVICE_START( ym3812 ) ym3812_state *info = get_safe_token(device); int rate = device->clock/72; - info->intf = device->static_config ? (const ym3812_interface *)device->static_config : &dummy; + info->intf = device->baseconfig().static_config ? (const ym3812_interface *)device->baseconfig().static_config : &dummy; info->device = device; /* stream system initialize */ diff --git a/src/emu/sound/3812intf.h b/src/emu/sound/3812intf.h index 7f1fe932cdb..c68b93bb15e 100644 --- a/src/emu/sound/3812intf.h +++ b/src/emu/sound/3812intf.h @@ -6,7 +6,7 @@ typedef struct _ym3812_interface ym3812_interface; struct _ym3812_interface { - void (*handler)(const device_config *device, int linestate); + void (*handler)(running_device *device, int linestate); }; READ8_DEVICE_HANDLER( ym3812_r ); diff --git a/src/emu/sound/8950intf.c b/src/emu/sound/8950intf.c index 2510d3e6cf4..a9f8561b134 100644 --- a/src/emu/sound/8950intf.c +++ b/src/emu/sound/8950intf.c @@ -30,11 +30,11 @@ struct _y8950_state emu_timer * timer[2]; void * chip; const y8950_interface *intf; - const device_config *device; + running_device *device; }; -INLINE y8950_state *get_safe_token(const device_config *device) +INLINE y8950_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -122,7 +122,7 @@ static DEVICE_START( y8950 ) y8950_state *info = get_safe_token(device); int rate = device->clock/72; - info->intf = device->static_config ? (const y8950_interface *)device->static_config : &dummy; + info->intf = device->baseconfig().static_config ? (const y8950_interface *)device->baseconfig().static_config : &dummy; info->device = device; /* stream system initialize */ diff --git a/src/emu/sound/8950intf.h b/src/emu/sound/8950intf.h index d4ad63fbd36..a838cf05103 100644 --- a/src/emu/sound/8950intf.h +++ b/src/emu/sound/8950intf.h @@ -6,7 +6,7 @@ typedef struct _y8950_interface y8950_interface; struct _y8950_interface { - void (*handler)(const device_config *device, int linestate); + void (*handler)(running_device *device, int linestate); read8_device_func keyboardread; write8_device_func keyboardwrite; diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c index c4152de929f..a17e214ca4d 100644 --- a/src/emu/sound/aica.c +++ b/src/emu/sound/aica.c @@ -172,7 +172,7 @@ struct _AICA unsigned char *AICARAM; UINT32 AICARAM_LENGTH, RAM_MASK, RAM_MASK16; char Master; - void (*IntARMCB)(const device_config *device, int irq); + void (*IntARMCB)(running_device *device, int irq); sound_stream * stream; INT32 *buffertmpl, *buffertmpr; @@ -202,7 +202,7 @@ struct _AICA int ARTABLE[64], DRTABLE[64]; struct _AICADSP DSP; - const device_config *device; + running_device *device; }; static const float SDLT[16]={-1000000.0,-42.0,-39.0,-36.0,-33.0,-30.0,-27.0,-24.0,-21.0,-18.0,-15.0,-12.0,-9.0,-6.0,-3.0,0.0}; @@ -214,7 +214,7 @@ static int length; static signed short *RBUFDST; //this points to where the sample will be stored in the RingBuf -INLINE aica_state *get_safe_token(const device_config *device) +INLINE aica_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -520,7 +520,7 @@ static void AICA_StopSlot(struct _SLOT *slot,int keyoff) #define log_base_2(n) (log((float) n)/log((float) 2)) -static void AICA_Init(const device_config *device, aica_state *AICA, const aica_interface *intf) +static void AICA_Init(running_device *device, aica_state *AICA, const aica_interface *intf) { int i; @@ -1285,7 +1285,7 @@ static DEVICE_START( aica ) aica_state *AICA = get_safe_token(device); - intf = (const aica_interface *)device->static_config; + intf = (const aica_interface *)device->baseconfig().static_config; // init the emulation AICA_Init(device, AICA, intf); @@ -1304,7 +1304,7 @@ static DEVICE_STOP( aica ) } #endif -void aica_set_ram_base(const device_config *device, void *base, int size) +void aica_set_ram_base(running_device *device, void *base, int size) { aica_state *AICA = get_safe_token(device); if (AICA) diff --git a/src/emu/sound/aica.h b/src/emu/sound/aica.h index ac31e89b075..7050426ba7c 100644 --- a/src/emu/sound/aica.h +++ b/src/emu/sound/aica.h @@ -11,10 +11,10 @@ struct _aica_interface { int master; int roffset; /* offset in the region */ - void (*irq_callback)(const device_config *device, int state); /* irq callback */ + void (*irq_callback)(running_device *device, int state); /* irq callback */ }; -void aica_set_ram_base(const device_config *device, void *base, int size); +void aica_set_ram_base(running_device *device, void *base, int size); // AICA register access READ16_DEVICE_HANDLER( aica_r ); diff --git a/src/emu/sound/astrocde.c b/src/emu/sound/astrocde.c index 17a5f50cc47..c50fd362baf 100644 --- a/src/emu/sound/astrocde.c +++ b/src/emu/sound/astrocde.c @@ -70,7 +70,7 @@ struct _astrocade_state }; -INLINE astrocade_state *get_safe_token(const device_config *device) +INLINE astrocade_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -236,7 +236,7 @@ static DEVICE_RESET( astrocade ) * *************************************/ -static void astrocade_state_save_register(astrocade_state *chip, const device_config *device) +static void astrocade_state_save_register(astrocade_state *chip, running_device *device) { state_save_register_device_item_array(device, 0, chip->reg); diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c index cc139197986..6adde49fbc1 100644 --- a/src/emu/sound/ay8910.c +++ b/src/emu/sound/ay8910.c @@ -164,7 +164,7 @@ struct _ay_ym_param typedef struct _ay8910_context ay8910_context; struct _ay8910_context { - const device_config *device; + running_device *device; int streams; int ready; sound_stream *channel; @@ -197,7 +197,7 @@ struct _ay8910_context devcb_resolved_write8 portBwrite; }; -INLINE ay8910_context *get_safe_token(const device_config *device) +INLINE ay8910_context *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -705,7 +705,7 @@ static void build_mixer_table(ay8910_context *psg) build_3D_table(psg->intf->res_load[0], psg->par, psg->par_env, normalize, 3, psg->zero_is_off, psg->vol3d_table); } -static void ay8910_statesave(ay8910_context *psg, const device_config *device) +static void ay8910_statesave(ay8910_context *psg, running_device *device) { state_save_register_device_item(device, 0, psg->register_latch); state_save_register_device_item_array(device, 0, psg->regs); @@ -736,7 +736,7 @@ static void ay8910_statesave(ay8910_context *psg, const device_config *device) * *************************************/ -void *ay8910_start_ym(void *infoptr, sound_type chip_type, const device_config *device, int clock, const ay8910_interface *intf) +void *ay8910_start_ym(void *infoptr, sound_type chip_type, running_device *device, int clock, const ay8910_interface *intf) { ay8910_context *info = (ay8910_context *)infoptr; @@ -828,7 +828,7 @@ void ay8910_reset_ym(void *chip) #endif } -void ay8910_set_volume(const device_config *device,int channel,int volume) +void ay8910_set_volume(running_device *device,int channel,int volume) { ay8910_context *psg = get_safe_token(device); int ch; @@ -917,7 +917,7 @@ static DEVICE_START( ay8910 ) AY8910_DEFAULT_LOADS, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }; - const ay8910_interface *intf = (device->static_config ? (const ay8910_interface *)device->static_config : &generic_ay8910); + const ay8910_interface *intf = (device->baseconfig().static_config ? (const ay8910_interface *)device->baseconfig().static_config : &generic_ay8910); ay8910_start_ym(get_safe_token(device), SOUND_AY8910, device, device->clock, intf); } @@ -929,7 +929,7 @@ static DEVICE_START( ym2149 ) AY8910_DEFAULT_LOADS, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }; - const ay8910_interface *intf = (device->static_config ? (const ay8910_interface *)device->static_config : &generic_ay8910); + const ay8910_interface *intf = (device->baseconfig().static_config ? (const ay8910_interface *)device->baseconfig().static_config : &generic_ay8910); ay8910_start_ym(get_safe_token(device), SOUND_YM2149, device, device->clock, intf); } diff --git a/src/emu/sound/ay8910.h b/src/emu/sound/ay8910.h index d208638ccca..cb805219836 100644 --- a/src/emu/sound/ay8910.h +++ b/src/emu/sound/ay8910.h @@ -73,7 +73,7 @@ struct _ay8910_interface }; -void ay8910_set_volume(const device_config *device,int channel,int volume); +void ay8910_set_volume(running_device *device,int channel,int volume); READ8_DEVICE_HANDLER( ay8910_r ); WRITE8_DEVICE_HANDLER( ay8910_address_w ); @@ -88,7 +88,7 @@ WRITE8_DEVICE_HANDLER( ay8910_address_data_w ); /*********** An interface for SSG of YM2203 ***********/ -void *ay8910_start_ym(void *infoptr, sound_type chip_type, const device_config *device, int clock, const ay8910_interface *intf); +void *ay8910_start_ym(void *infoptr, sound_type chip_type, running_device *device, int clock, const ay8910_interface *intf); void ay8910_stop_ym(void *chip); void ay8910_reset_ym(void *chip); diff --git a/src/emu/sound/beep.c b/src/emu/sound/beep.c index 466f5730def..6e9c8e67962 100644 --- a/src/emu/sound/beep.c +++ b/src/emu/sound/beep.c @@ -29,7 +29,7 @@ struct _beep_state }; -INLINE beep_state *get_safe_token(const device_config *device) +INLINE beep_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -110,7 +110,7 @@ static DEVICE_START( beep ) * *************************************/ -void beep_set_state(const device_config *device, int on) +void beep_set_state(running_device *device, int on) { beep_state *info = get_safe_token(device); @@ -134,7 +134,7 @@ void beep_set_state(const device_config *device, int on) * *************************************/ -void beep_set_frequency(const device_config *device,int frequency) +void beep_set_frequency(running_device *device,int frequency) { beep_state *info = get_safe_token(device); @@ -155,7 +155,7 @@ void beep_set_frequency(const device_config *device,int frequency) * *************************************/ -void beep_set_volume(const device_config *device, int volume) +void beep_set_volume(running_device *device, int volume) { beep_state *info = get_safe_token(device); diff --git a/src/emu/sound/beep.h b/src/emu/sound/beep.h index 41784e553bf..b2e6bcd6399 100644 --- a/src/emu/sound/beep.h +++ b/src/emu/sound/beep.h @@ -3,9 +3,9 @@ #ifndef __BEEP_H__ #define __BEEP_H__ -void beep_set_state(const device_config *device, int on); -void beep_set_frequency(const device_config *device, int frequency); -void beep_set_volume(const device_config *device, int volume); +void beep_set_state(running_device *device, int on); +void beep_set_frequency(running_device *device, int frequency); +void beep_set_volume(running_device *device, int volume); DEVICE_GET_INFO( beep ); #define SOUND_BEEP DEVICE_GET_INFO_NAME( beep ) diff --git a/src/emu/sound/bsmt2000.c b/src/emu/sound/bsmt2000.c index 585076008f4..d7791c91cba 100644 --- a/src/emu/sound/bsmt2000.c +++ b/src/emu/sound/bsmt2000.c @@ -95,7 +95,7 @@ static void set_regmap(bsmt2000_chip *chip, UINT8 posbase, UINT8 ratebase, UINT8 INLINE FUNCTIONS ***************************************************************************/ -INLINE bsmt2000_chip *get_safe_token(const device_config *device) +INLINE bsmt2000_chip *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c index 265ab534e7c..cb632cb096d 100644 --- a/src/emu/sound/c140.c +++ b/src/emu/sound/c140.c @@ -106,7 +106,7 @@ struct _c140_state VOICE voi[MAX_VOICE]; }; -INLINE c140_state *get_safe_token(const device_config *device) +INLINE c140_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -256,7 +256,7 @@ WRITE8_DEVICE_HANDLER( c140_w ) } } -void c140_set_base(const device_config *device, void *base) +void c140_set_base(running_device *device, void *base) { c140_state *info = get_safe_token(device); info->pRom = base; @@ -466,7 +466,7 @@ static STREAM_UPDATE( update_stereo ) static DEVICE_START( c140 ) { - const c140_interface *intf = (const c140_interface *)device->static_config; + const c140_interface *intf = (const c140_interface *)device->baseconfig().static_config; c140_state *info = get_safe_token(device); info->sample_rate=info->baserate=device->clock; diff --git a/src/emu/sound/c140.h b/src/emu/sound/c140.h index f814e9c242e..2c1cef40316 100644 --- a/src/emu/sound/c140.h +++ b/src/emu/sound/c140.h @@ -8,7 +8,7 @@ READ8_DEVICE_HANDLER( c140_r ); WRITE8_DEVICE_HANDLER( c140_w ); -void c140_set_base(const device_config *device, void *base); +void c140_set_base(running_device *device, void *base); enum { diff --git a/src/emu/sound/c352.c b/src/emu/sound/c352.c index 98870afce38..30582389b00 100644 --- a/src/emu/sound/c352.c +++ b/src/emu/sound/c352.c @@ -82,7 +82,7 @@ struct _c352_state unsigned int mseq_reg; }; -INLINE c352_state *get_safe_token(const device_config *device) +INLINE c352_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -490,7 +490,7 @@ static void c352_write_reg16(c352_state *info, unsigned long address, unsigned s } } -static void c352_init(c352_state *info, const device_config *device) +static void c352_init(c352_state *info, running_device *device) { int i; double x_max = 32752.0; diff --git a/src/emu/sound/c6280.c b/src/emu/sound/c6280.c index bca3383d8c4..f00a080557b 100644 --- a/src/emu/sound/c6280.c +++ b/src/emu/sound/c6280.c @@ -71,8 +71,8 @@ typedef struct { typedef struct { sound_stream *stream; - const device_config *device; - const device_config *cpudevice; + running_device *device; + running_device *cpudevice; UINT8 select; UINT8 balance; UINT8 lfo_frequency; @@ -83,7 +83,7 @@ typedef struct { UINT32 wave_freq_tab[4096]; } c6280_t; -INLINE c6280_t *get_safe_token(const device_config *device) +INLINE c6280_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -97,9 +97,9 @@ INLINE c6280_t *get_safe_token(const device_config *device) #include "cpu/h6280/h6280.h" -static void c6280_init(const device_config *device, c6280_t *p, double clk, double rate) +static void c6280_init(running_device *device, c6280_t *p, double clk, double rate) { - const c6280_interface *intf = (const c6280_interface *)device->static_config; + const c6280_interface *intf = (const c6280_interface *)device->baseconfig().static_config; int i; double step; diff --git a/src/emu/sound/cdda.c b/src/emu/sound/cdda.c index 2949ac5c24a..2d336c5eb32 100644 --- a/src/emu/sound/cdda.c +++ b/src/emu/sound/cdda.c @@ -22,7 +22,7 @@ struct _cdda_info UINT32 audio_bptr; }; -INLINE cdda_info *get_safe_token(const device_config *device) +INLINE cdda_info *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -59,7 +59,7 @@ static DEVICE_START( cdda ) /* allocate an audio cache */ info->audio_cache = auto_alloc_array( device->machine, UINT8, CD_MAX_SECTOR_DATA * MAX_SECTORS ); - intf = (const struct CDDAinterface *)device->static_config; + intf = (const struct CDDAinterface *)device->baseconfig().static_config; info->stream = stream_create(device, 0, 2, 44100, info, cdda_update); @@ -79,7 +79,7 @@ static DEVICE_START( cdda ) given CDDA stream -------------------------------------------------*/ -void cdda_set_cdrom(const device_config *device, void *file) +void cdda_set_cdrom(running_device *device, void *file) { cdda_info *info = get_safe_token(device); info->disc = (cdrom_file *)file; @@ -91,11 +91,11 @@ void cdda_set_cdrom(const device_config *device, void *file) that references the given CD-ROM file -------------------------------------------------*/ -const device_config *cdda_from_cdrom(running_machine *machine, void *file) +running_device *cdda_from_cdrom(running_machine *machine, void *file) { - const device_config *device; + running_device *device; - for (device = sound_first(machine->config); device != NULL; device = sound_next(device)) + for (device = sound_first(machine); device != NULL; device = sound_next(device)) if (sound_get_type(device) == SOUND_CDDA) { cdda_info *info = get_safe_token(device); @@ -112,7 +112,7 @@ const device_config *cdda_from_cdrom(running_machine *machine, void *file) Book audio track -------------------------------------------------*/ -void cdda_start_audio(const device_config *device, UINT32 startlba, UINT32 numblocks) +void cdda_start_audio(running_device *device, UINT32 startlba, UINT32 numblocks) { cdda_info *info = get_safe_token(device); @@ -130,7 +130,7 @@ void cdda_start_audio(const device_config *device, UINT32 startlba, UINT32 numbl audio track -------------------------------------------------*/ -void cdda_stop_audio(const device_config *device) +void cdda_stop_audio(running_device *device) { cdda_info *info = get_safe_token(device); @@ -145,7 +145,7 @@ void cdda_stop_audio(const device_config *device) a Red Book audio track -------------------------------------------------*/ -void cdda_pause_audio(const device_config *device, int pause) +void cdda_pause_audio(running_device *device, int pause) { cdda_info *info = get_safe_token(device); @@ -159,7 +159,7 @@ void cdda_pause_audio(const device_config *device, int pause) (physical sector) during Red Book playback -------------------------------------------------*/ -UINT32 cdda_get_audio_lba(const device_config *device) +UINT32 cdda_get_audio_lba(running_device *device) { cdda_info *info = get_safe_token(device); @@ -173,7 +173,7 @@ UINT32 cdda_get_audio_lba(const device_config *device) playback status -------------------------------------------------*/ -int cdda_audio_active(const device_config *device) +int cdda_audio_active(running_device *device) { cdda_info *info = get_safe_token(device); @@ -187,7 +187,7 @@ int cdda_audio_active(const device_config *device) playback is paused -------------------------------------------------*/ -int cdda_audio_paused(const device_config *device) +int cdda_audio_paused(running_device *device) { cdda_info *info = get_safe_token(device); return info->audio_pause; @@ -199,7 +199,7 @@ int cdda_audio_paused(const device_config *device) track reached it's natural end -------------------------------------------------*/ -int cdda_audio_ended(const device_config *device) +int cdda_audio_ended(running_device *device) { cdda_info *info = get_safe_token(device); return info->audio_ended_normally; diff --git a/src/emu/sound/cdda.h b/src/emu/sound/cdda.h index 5a7fe1bd5f8..951cbda4068 100644 --- a/src/emu/sound/cdda.h +++ b/src/emu/sound/cdda.h @@ -3,17 +3,17 @@ #ifndef __CDDA_H__ #define _CDDA_H_ -void cdda_set_cdrom(const device_config *device, void *file); -const device_config *cdda_from_cdrom(running_machine *machine, void *file); +void cdda_set_cdrom(running_device *device, void *file); +running_device *cdda_from_cdrom(running_machine *machine, void *file); -void cdda_start_audio(const device_config *device, UINT32 startlba, UINT32 numblocks); -void cdda_stop_audio(const device_config *device); -void cdda_pause_audio(const device_config *device, int pause); +void cdda_start_audio(running_device *device, UINT32 startlba, UINT32 numblocks); +void cdda_stop_audio(running_device *device); +void cdda_pause_audio(running_device *device, int pause); -UINT32 cdda_get_audio_lba(const device_config *device); -int cdda_audio_active(const device_config *device); -int cdda_audio_paused(const device_config *device); -int cdda_audio_ended(const device_config *device); +UINT32 cdda_get_audio_lba(running_device *device); +int cdda_audio_active(running_device *device); +int cdda_audio_paused(running_device *device); +int cdda_audio_ended(running_device *device); DEVICE_GET_INFO( cdda ); #define SOUND_CDDA DEVICE_GET_INFO_NAME( cdda ) diff --git a/src/emu/sound/cdp1863.c b/src/emu/sound/cdp1863.c index d3ec336333f..6b5830ffd98 100644 --- a/src/emu/sound/cdp1863.c +++ b/src/emu/sound/cdp1863.c @@ -49,17 +49,17 @@ struct _cdp1863_t INLINE FUNCTIONS ***************************************************************************/ -INLINE cdp1863_t *get_safe_token(const device_config *device) +INLINE cdp1863_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); return (cdp1863_t *)device->token; } -INLINE cdp1863_config *get_safe_config(const device_config *device) +INLINE cdp1863_config *get_safe_config(running_device *device) { assert(device != NULL); - return (cdp1863_config *)device->inline_config; + return (cdp1863_config *)device->baseconfig().inline_config; } /*************************************************************************** @@ -92,7 +92,7 @@ WRITE_LINE_DEVICE_HANDLER( cdp1863_oe_w ) cdp1863_set_clk1 - set clock 1 frequency ------------------------------------------------*/ -void cdp1863_set_clk1(const device_config *device, int frequency) +void cdp1863_set_clk1(running_device *device, int frequency) { cdp1863_t *cdp1863 = get_safe_token(device); @@ -103,7 +103,7 @@ void cdp1863_set_clk1(const device_config *device, int frequency) cdp1863_set_clk2 - set clock 2 frequency ------------------------------------------------*/ -void cdp1863_set_clk2(const device_config *device, int frequency) +void cdp1863_set_clk2(running_device *device, int frequency) { cdp1863_t *cdp1863 = get_safe_token(device); diff --git a/src/emu/sound/cdp1863.h b/src/emu/sound/cdp1863.h index 31d0cf5329c..042e6db0111 100644 --- a/src/emu/sound/cdp1863.h +++ b/src/emu/sound/cdp1863.h @@ -62,7 +62,7 @@ WRITE8_DEVICE_HANDLER( cdp1863_str_w ); WRITE_LINE_DEVICE_HANDLER( cdp1863_oe_w ); /* clock setters */ -void cdp1863_set_clk1(const device_config *device, int frequency) ATTR_NONNULL(1); -void cdp1863_set_clk2(const device_config *device, int frequency) ATTR_NONNULL(1); +void cdp1863_set_clk1(running_device *device, int frequency) ATTR_NONNULL(1); +void cdp1863_set_clk2(running_device *device, int frequency) ATTR_NONNULL(1); #endif diff --git a/src/emu/sound/cdp1864.c b/src/emu/sound/cdp1864.c index 66366de82ad..0fc6c53f282 100644 --- a/src/emu/sound/cdp1864.c +++ b/src/emu/sound/cdp1864.c @@ -53,7 +53,7 @@ struct _cdp1864_t devcb_resolved_write_line out_dmao_func; devcb_resolved_write_line out_efx_func; - const device_config *screen; /* screen */ + running_device *screen; /* screen */ bitmap_t *bitmap; /* bitmap */ sound_stream *stream; /* sound output */ @@ -74,14 +74,14 @@ struct _cdp1864_t emu_timer *efx_timer; /* EFx timer */ emu_timer *dma_timer; /* DMA timer */ - const device_config *cpu; + running_device *cpu; }; /*************************************************************************** INLINE FUNCTIONS ***************************************************************************/ -INLINE cdp1864_t *get_safe_token(const device_config *device) +INLINE cdp1864_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -98,7 +98,7 @@ INLINE cdp1864_t *get_safe_token(const device_config *device) static TIMER_CALLBACK( cdp1864_int_tick ) { - const device_config *device = (const device_config *) ptr; + running_device *device = (running_device *) ptr; cdp1864_t *cdp1864 = get_safe_token(device); int scanline = video_screen_get_vpos(cdp1864->screen); @@ -129,7 +129,7 @@ static TIMER_CALLBACK( cdp1864_int_tick ) static TIMER_CALLBACK( cdp1864_efx_tick ) { - const device_config *device = (const device_config *) ptr; + running_device *device = (running_device *) ptr; cdp1864_t *cdp1864 = get_safe_token(device); int scanline = video_screen_get_vpos(cdp1864->screen); @@ -164,7 +164,7 @@ static TIMER_CALLBACK( cdp1864_efx_tick ) static TIMER_CALLBACK( cdp1864_dma_tick ) { - const device_config *device = (const device_config *) ptr; + running_device *device = (running_device *) ptr; cdp1864_t *cdp1864 = get_safe_token(device); int scanline = video_screen_get_vpos(cdp1864->screen); @@ -203,7 +203,7 @@ static TIMER_CALLBACK( cdp1864_dma_tick ) cdp1864_init_palette - initialize palette -------------------------------------------------*/ -static void cdp1864_init_palette(const device_config *device, const cdp1864_interface *intf) +static void cdp1864_init_palette(running_device *device, const cdp1864_interface *intf) { int i; @@ -402,7 +402,7 @@ static STREAM_UPDATE( cdp1864_stream_update ) cdp1864_update - update screen -------------------------------------------------*/ -void cdp1864_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) +void cdp1864_update(running_device *device, bitmap_t *bitmap, const rectangle *cliprect) { cdp1864_t *cdp1864 = get_safe_token(device); @@ -424,7 +424,7 @@ void cdp1864_update(const device_config *device, bitmap_t *bitmap, const rectang static DEVICE_START( cdp1864 ) { cdp1864_t *cdp1864 = get_safe_token(device); - const cdp1864_interface *intf = (const cdp1864_interface *) device->static_config; + const cdp1864_interface *intf = (const cdp1864_interface *) device->baseconfig().static_config; /* resolve callbacks */ devcb_resolve_read_line(&cdp1864->in_rdata_func, &intf->in_rdata_func, device); diff --git a/src/emu/sound/cdp1864.h b/src/emu/sound/cdp1864.h index f495966ff61..7e3dbcbe8d6 100644 --- a/src/emu/sound/cdp1864.h +++ b/src/emu/sound/cdp1864.h @@ -155,6 +155,6 @@ WRITE_LINE_DEVICE_HANDLER( cdp1864_aoe_w ) ATTR_NONNULL(1); WRITE8_DEVICE_HANDLER( cdp1864_dma_w ) ATTR_NONNULL(1); /* screen update */ -void cdp1864_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) ATTR_NONNULL(1) ATTR_NONNULL(2) ATTR_NONNULL(3); +void cdp1864_update(running_device *device, bitmap_t *bitmap, const rectangle *cliprect) ATTR_NONNULL(1) ATTR_NONNULL(2) ATTR_NONNULL(3); #endif diff --git a/src/emu/sound/cdp1869.c b/src/emu/sound/cdp1869.c index 21417e0c547..f8bef3d70ef 100644 --- a/src/emu/sound/cdp1869.c +++ b/src/emu/sound/cdp1869.c @@ -53,10 +53,10 @@ struct _cdp1869_t devcb_resolved_write_line out_prd_func; devcb_resolved_read_line in_pal_ntsc_func; - const device_config *device; + running_device *device; const cdp1869_interface *intf; /* interface */ - const device_config *screen; /* screen */ - const device_config *cpu; /* CPU */ + running_device *screen; /* screen */ + running_device *cpu; /* CPU */ sound_stream *stream; /* sound output */ int color_clock; @@ -94,7 +94,7 @@ struct _cdp1869_t INLINE FUNCTIONS ***************************************************************************/ -INLINE cdp1869_t *get_safe_token(const device_config *device) +INLINE cdp1869_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -165,7 +165,7 @@ static void update_prd_changed_timer(cdp1869_t *cdp1869) static TIMER_CALLBACK( prd_changed_tick ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; cdp1869_t *cdp1869 = get_safe_token(device); devcb_call_write_line(&cdp1869->out_prd_func, param); @@ -217,7 +217,7 @@ static rgb_t get_rgb(int i, int c, int l) get_lines - get number of character lines -------------------------------------------------*/ -static int get_lines(const device_config *device) +static int get_lines(running_device *device) { cdp1869_t *cdp1869 = get_safe_token(device); @@ -239,7 +239,7 @@ static int get_lines(const device_config *device) get_pmemsize - get page memory size -------------------------------------------------*/ -static UINT16 get_pmemsize(const device_config *device, int cols, int rows) +static UINT16 get_pmemsize(running_device *device, int cols, int rows) { cdp1869_t *cdp1869 = get_safe_token(device); @@ -255,7 +255,7 @@ static UINT16 get_pmemsize(const device_config *device, int cols, int rows) get_pma - get page memory address -------------------------------------------------*/ -static UINT16 get_pma(const device_config *device) +static UINT16 get_pma(running_device *device) { cdp1869_t *cdp1869 = get_safe_token(device); @@ -273,7 +273,7 @@ static UINT16 get_pma(const device_config *device) get_pen - get pen for color bits -------------------------------------------------*/ -static int get_pen(const device_config *device, int ccb0, int ccb1, int pcb) +static int get_pen(running_device *device, int ccb0, int ccb1, int pcb) { cdp1869_t *cdp1869 = get_safe_token(device); @@ -317,7 +317,7 @@ static int get_pen(const device_config *device, int ccb0, int ccb1, int pcb) draw_line - draw character line -------------------------------------------------*/ -static void draw_line(const device_config *device, bitmap_t *bitmap, int x, int y, int data, int color) +static void draw_line(running_device *device, bitmap_t *bitmap, int x, int y, int data, int color) { cdp1869_t *cdp1869 = get_safe_token(device); @@ -362,7 +362,7 @@ static void draw_line(const device_config *device, bitmap_t *bitmap, int x, int draw_char - draw character -------------------------------------------------*/ -static void draw_char(const device_config *device, bitmap_t *bitmap, int x, int y, UINT16 pma, const rectangle *screenrect) +static void draw_char(running_device *device, bitmap_t *bitmap, int x, int y, UINT16 pma, const rectangle *screenrect) { cdp1869_t *cdp1869 = get_safe_token(device); @@ -717,7 +717,7 @@ READ_LINE_DEVICE_HANDLER( cdp1869_predisplay_r ) cdp1869_update - screen update -------------------------------------------------*/ -void cdp1869_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) +void cdp1869_update(running_device *device, bitmap_t *bitmap, const rectangle *cliprect) { cdp1869_t *cdp1869 = get_safe_token(device); @@ -861,7 +861,7 @@ static DEVICE_START( cdp1869 ) cdp1869_t *cdp1869 = get_safe_token(device); /* validate arguments */ - cdp1869->intf = (const cdp1869_interface *)device->static_config; + cdp1869->intf = (const cdp1869_interface *)device->baseconfig().static_config; assert(cdp1869->intf->pcb_r != NULL); assert(cdp1869->intf->char_ram_r != NULL); diff --git a/src/emu/sound/cdp1869.h b/src/emu/sound/cdp1869.h index b340dc9286f..2a39f4a217f 100644 --- a/src/emu/sound/cdp1869.h +++ b/src/emu/sound/cdp1869.h @@ -108,9 +108,9 @@ #define CDP1869_INTERFACE(_name) \ const cdp1869_interface (_name) = -#define CDP1869_CHAR_RAM_READ(name) UINT8 name(const device_config *device, UINT16 pma, UINT8 cma) -#define CDP1869_CHAR_RAM_WRITE(name) void name(const device_config *device, UINT16 pma, UINT8 cma, UINT8 data) -#define CDP1869_PCB_READ(name) int name(const device_config *device, UINT16 pma, UINT8 cma) +#define CDP1869_CHAR_RAM_READ(name) UINT8 name(running_device *device, UINT16 pma, UINT8 cma) +#define CDP1869_CHAR_RAM_WRITE(name) void name(running_device *device, UINT16 pma, UINT8 cma, UINT8 data) +#define CDP1869_PCB_READ(name) int name(running_device *device, UINT16 pma, UINT8 cma) #define CDP1869_PAL \ DEVCB_LINE_VCC @@ -122,9 +122,9 @@ TYPE DEFINITIONS ***************************************************************************/ -typedef UINT8 (*cdp1869_char_ram_read_func)(const device_config *device, UINT16 pma, UINT8 cma); -typedef void (*cdp1869_char_ram_write_func)(const device_config *device, UINT16 pma, UINT8 cma, UINT8 data); -typedef int (*cdp1869_pcb_read_func)(const device_config *device, UINT16 pma, UINT8 cma); +typedef UINT8 (*cdp1869_char_ram_read_func)(running_device *device, UINT16 pma, UINT8 cma); +typedef void (*cdp1869_char_ram_write_func)(running_device *device, UINT16 pma, UINT8 cma, UINT8 data); +typedef int (*cdp1869_pcb_read_func)(running_device *device, UINT16 pma, UINT8 cma); /* interface */ typedef struct _cdp1869_interface cdp1869_interface; @@ -187,6 +187,6 @@ WRITE8_DEVICE_HANDLER ( cdp1869_pageram_w ); READ_LINE_DEVICE_HANDLER( cdp1869_predisplay_r ); /* screen update */ -void cdp1869_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); +void cdp1869_update(running_device *device, bitmap_t *bitmap, const rectangle *cliprect); #endif diff --git a/src/emu/sound/cem3394.c b/src/emu/sound/cem3394.c index ed969435b70..89fdcb45f1d 100644 --- a/src/emu/sound/cem3394.c +++ b/src/emu/sound/cem3394.c @@ -108,7 +108,7 @@ typedef struct _cem3394_state cem3394_state; struct _cem3394_state { sound_stream * stream; /* our stream */ - void (*external)(const device_config *, int, short *);/* callback to generate external samples */ + void (*external)(running_device *, int, short *);/* callback to generate external samples */ double vco_zero_freq; /* frequency of VCO at 0.0V */ double filter_zero_freq; /* frequency of filter at 0.0V */ @@ -131,14 +131,14 @@ struct _cem3394_state double inv_sample_rate; int sample_rate; - const device_config *device; + running_device *device; INT16 *mixer_buffer; INT16 *external_buffer; }; -INLINE cem3394_state *get_safe_token(const device_config *device) +INLINE cem3394_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -327,7 +327,7 @@ static STREAM_UPDATE( cem3394_update ) static DEVICE_START( cem3394 ) { - const cem3394_interface *intf = (const cem3394_interface *)device->static_config; + const cem3394_interface *intf = (const cem3394_interface *)device->baseconfig().static_config; cem3394_state *chip = get_safe_token(device); chip->device = device; @@ -417,7 +417,7 @@ INLINE UINT32 compute_db_volume(double voltage) } -void cem3394_set_voltage(const device_config *device, int input, double voltage) +void cem3394_set_voltage(running_device *device, int input, double voltage) { cem3394_state *chip = get_safe_token(device); double temp; @@ -511,7 +511,7 @@ void cem3394_set_voltage(const device_config *device, int input, double voltage) } -double cem3394_get_parameter(const device_config *device, int input) +double cem3394_get_parameter(running_device *device, int input) { cem3394_state *chip = get_safe_token(device); double voltage = chip->values[input]; diff --git a/src/emu/sound/cem3394.h b/src/emu/sound/cem3394.h index 8db36dbf712..110f8132129 100644 --- a/src/emu/sound/cem3394.h +++ b/src/emu/sound/cem3394.h @@ -13,7 +13,7 @@ struct _cem3394_interface { double vco_zero_freq; /* frequency at 0V for VCO */ double filter_zero_freq; /* frequency at 0V for filter */ - void (*external)(const device_config *, int, short *);/* external input source */ + void (*external)(running_device *, int, short *);/* external input source */ }; /* inputs */ @@ -30,7 +30,7 @@ enum }; /* set the voltage going to a particular parameter */ -void cem3394_set_voltage(const device_config *device, int input, double voltage); +void cem3394_set_voltage(running_device *device, int input, double voltage); /* get the translated parameter associated with the given input as follows: CEM3394_VCO_FREQUENCY: frequency in Hz @@ -41,7 +41,7 @@ void cem3394_set_voltage(const device_config *device, int input, double voltage) CEM3394_FILTER_RESONANCE: resonance, from 0.0 to 1.0 CEM3394_FILTER_FREQENCY: frequency, in Hz CEM3394_FINAL_GAIN: gain, in dB */ -double cem3394_get_parameter(const device_config *device, int input); +double cem3394_get_parameter(running_device *device, int input); DEVICE_GET_INFO( cem3394 ); #define SOUND_CEM3394 DEVICE_GET_INFO_NAME( cem3394 ) diff --git a/src/emu/sound/dac.c b/src/emu/sound/dac.c index 3375835fc8e..45a24f33bc1 100644 --- a/src/emu/sound/dac.c +++ b/src/emu/sound/dac.c @@ -17,7 +17,7 @@ struct _dac_state }; -INLINE dac_state *get_safe_token(const device_config *device) +INLINE dac_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -37,7 +37,7 @@ static STREAM_UPDATE( DAC_update ) } -void dac_data_w(const device_config *device, UINT8 data) +void dac_data_w(running_device *device, UINT8 data) { dac_state *info = get_safe_token(device); INT16 out = info->UnsignedVolTable[data]; @@ -51,7 +51,7 @@ void dac_data_w(const device_config *device, UINT8 data) } -void dac_signed_data_w(const device_config *device, UINT8 data) +void dac_signed_data_w(running_device *device, UINT8 data) { dac_state *info = get_safe_token(device); INT16 out = info->SignedVolTable[data]; @@ -65,7 +65,7 @@ void dac_signed_data_w(const device_config *device, UINT8 data) } -void dac_data_16_w(const device_config *device, UINT16 data) +void dac_data_16_w(running_device *device, UINT16 data) { dac_state *info = get_safe_token(device); INT16 out = data >> 1; /* range 0..32767 */ @@ -79,7 +79,7 @@ void dac_data_16_w(const device_config *device, UINT16 data) } -void dac_signed_data_16_w(const device_config *device, UINT16 data) +void dac_signed_data_16_w(running_device *device, UINT16 data) { dac_state *info = get_safe_token(device); INT16 out = (INT32)data - (INT32)0x08000; /* range -32768..32767 */ diff --git a/src/emu/sound/dac.h b/src/emu/sound/dac.h index a5f46decdc5..68573ba2049 100644 --- a/src/emu/sound/dac.h +++ b/src/emu/sound/dac.h @@ -3,10 +3,10 @@ #ifndef __DAC_H__ #define __DAC_H__ -void dac_data_w(const device_config *device, UINT8 data) ATTR_NONNULL(1); -void dac_signed_data_w(const device_config *device, UINT8 data) ATTR_NONNULL(1); -void dac_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL(1); -void dac_signed_data_16_w(const device_config *device, UINT16 data) ATTR_NONNULL(1); +void dac_data_w(running_device *device, UINT8 data) ATTR_NONNULL(1); +void dac_signed_data_w(running_device *device, UINT8 data) ATTR_NONNULL(1); +void dac_data_16_w(running_device *device, UINT16 data) ATTR_NONNULL(1); +void dac_signed_data_16_w(running_device *device, UINT16 data) ATTR_NONNULL(1); WRITE8_DEVICE_HANDLER( dac_w ); WRITE8_DEVICE_HANDLER( dac_signed_w ); diff --git a/src/emu/sound/digitalk.c b/src/emu/sound/digitalk.c index e4c65eedc91..746939b7d21 100644 --- a/src/emu/sound/digitalk.c +++ b/src/emu/sound/digitalk.c @@ -240,7 +240,7 @@ complete set of waveforms is repeated R times. typedef struct { const UINT8 *rom; - const device_config *device; + running_device *device; sound_stream *stream; // Port/lines state @@ -285,7 +285,7 @@ static const int pitch_vals[32] = { }; -INLINE digitalker *get_safe_token(const device_config *device) +INLINE digitalker *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -677,25 +677,25 @@ DEVICE_GET_INFO(digitalker) } } -void digitalker_0_cs_w(const device_config *device, int line) +void digitalker_0_cs_w(running_device *device, int line) { digitalker *dg = get_safe_token(device); digitalker_cs_w(dg, line); } -void digitalker_0_cms_w(const device_config *device, int line) +void digitalker_0_cms_w(running_device *device, int line) { digitalker *dg = get_safe_token(device); digitalker_cms_w(dg, line); } -void digitalker_0_wr_w(const device_config *device, int line) +void digitalker_0_wr_w(running_device *device, int line) { digitalker *dg = get_safe_token(device); digitalker_wr_w(dg, line); } -int digitalker_0_intr_r(const device_config *device) +int digitalker_0_intr_r(running_device *device) { digitalker *dg = get_safe_token(device); return digitalker_intr_r(dg); diff --git a/src/emu/sound/digitalk.h b/src/emu/sound/digitalk.h index e933041fbdc..4138124ccab 100644 --- a/src/emu/sound/digitalk.h +++ b/src/emu/sound/digitalk.h @@ -1,10 +1,10 @@ #ifndef _DIGITALKER_H_ #define _DIGITALKER_H_ -void digitalker_0_cs_w(const device_config *device, int line); -void digitalker_0_cms_w(const device_config *device, int line); -void digitalker_0_wr_w(const device_config *device, int line); -int digitalker_0_intr_r(const device_config *device); +void digitalker_0_cs_w(running_device *device, int line); +void digitalker_0_cms_w(running_device *device, int line); +void digitalker_0_wr_w(running_device *device, int line); +int digitalker_0_intr_r(running_device *device); WRITE8_DEVICE_HANDLER(digitalker_data_w); DEVICE_GET_INFO(digitalker); diff --git a/src/emu/sound/disc_inp.c b/src/emu/sound/disc_inp.c index f02a6c80bf8..e5e1b2b8312 100644 --- a/src/emu/sound/disc_inp.c +++ b/src/emu/sound/disc_inp.c @@ -44,7 +44,7 @@ struct dss_input_context sound_stream *buffer_stream; }; -INLINE discrete_info *get_safe_token(const device_config *device) +INLINE discrete_info *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/sound/discrete.c b/src/emu/sound/discrete.c index 0204ff62088..2bc0f662e04 100644 --- a/src/emu/sound/discrete.c +++ b/src/emu/sound/discrete.c @@ -81,7 +81,7 @@ * *************************************/ -static void init_nodes(discrete_info *info, const linked_list_entry *block_list, const device_config *device); +static void init_nodes(discrete_info *info, const linked_list_entry *block_list, running_device *device); static void find_input_nodes(const discrete_info *info); static node_description *discrete_find_node(const discrete_info *info, int node); static DEVICE_RESET( discrete ); @@ -478,7 +478,7 @@ static DEVICE_START( discrete ) { linked_list_entry **intf; const linked_list_entry *entry; - const discrete_sound_block *intf_start = (discrete_sound_block *)device->static_config; + const discrete_sound_block *intf_start = (discrete_sound_block *)device->baseconfig().static_config; discrete_info *info = get_safe_token(device); char name[32]; @@ -805,7 +805,7 @@ static STREAM_UPDATE( discrete_stream_update ) *************************************/ -static void init_nodes(discrete_info *info, const linked_list_entry *block_list, const device_config *device) +static void init_nodes(discrete_info *info, const linked_list_entry *block_list, running_device *device) { const linked_list_entry *entry; linked_list_entry *task_node_list = NULL; diff --git a/src/emu/sound/discrete.h b/src/emu/sound/discrete.h index 2b82c992885..f5d2e3b0d15 100644 --- a/src/emu/sound/discrete.h +++ b/src/emu/sound/discrete.h @@ -3825,7 +3825,7 @@ struct _discrete_source_node struct _discrete_info { - const device_config *device; + running_device *device; /* emulation info */ int sample_rate; diff --git a/src/emu/sound/dmadac.c b/src/emu/sound/dmadac.c index baf3afa1c09..3f864dfc3b0 100644 --- a/src/emu/sound/dmadac.c +++ b/src/emu/sound/dmadac.c @@ -56,7 +56,7 @@ struct _dmadac_state }; -INLINE dmadac_state *get_safe_token(const device_config *device) +INLINE dmadac_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -134,7 +134,7 @@ static DEVICE_START( dmadac ) * *************************************/ -void dmadac_transfer(const device_config **devlist, UINT8 num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data) +void dmadac_transfer(running_device **devlist, UINT8 num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data) { int i, j; @@ -181,7 +181,7 @@ void dmadac_transfer(const device_config **devlist, UINT8 num_channels, offs_t c * *************************************/ -void dmadac_enable(const device_config **devlist, UINT8 num_channels, UINT8 enable) +void dmadac_enable(running_device **devlist, UINT8 num_channels, UINT8 enable) { int i; @@ -204,7 +204,7 @@ void dmadac_enable(const device_config **devlist, UINT8 num_channels, UINT8 enab * *************************************/ -void dmadac_set_frequency(const device_config **devlist, UINT8 num_channels, double frequency) +void dmadac_set_frequency(running_device **devlist, UINT8 num_channels, double frequency) { int i; @@ -224,7 +224,7 @@ void dmadac_set_frequency(const device_config **devlist, UINT8 num_channels, dou * *************************************/ -void dmadac_set_volume(const device_config **devlist, UINT8 num_channels, UINT16 volume) +void dmadac_set_volume(running_device **devlist, UINT8 num_channels, UINT16 volume) { int i; diff --git a/src/emu/sound/dmadac.h b/src/emu/sound/dmadac.h index 0f2e8f339be..651a52eabfc 100644 --- a/src/emu/sound/dmadac.h +++ b/src/emu/sound/dmadac.h @@ -10,10 +10,10 @@ #ifndef __DMADAC_H__ #define __DMADAC_H__ -void dmadac_transfer(const device_config **devlist, UINT8 num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data); -void dmadac_enable(const device_config **devlist, UINT8 num_channels, UINT8 enable); -void dmadac_set_frequency(const device_config **devlist, UINT8 num_channels, double frequency); -void dmadac_set_volume(const device_config **devlist, UINT8 num_channels, UINT16 volume); +void dmadac_transfer(running_device **devlist, UINT8 num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data); +void dmadac_enable(running_device **devlist, UINT8 num_channels, UINT8 enable); +void dmadac_set_frequency(running_device **devlist, UINT8 num_channels, double frequency); +void dmadac_set_volume(running_device **devlist, UINT8 num_channels, UINT16 volume); DEVICE_GET_INFO( dmadac ); #define SOUND_DMADAC DEVICE_GET_INFO_NAME( dmadac ) diff --git a/src/emu/sound/es5503.c b/src/emu/sound/es5503.c index e28cf731aac..f9d63471310 100644 --- a/src/emu/sound/es5503.c +++ b/src/emu/sound/es5503.c @@ -63,7 +63,7 @@ typedef struct sound_stream * stream; - void (*irq_callback)(const device_config *, int); // IRQ callback + void (*irq_callback)(running_device *, int); // IRQ callback read8_device_func adc_read; // callback for the 5503's built-in analog to digital converter @@ -73,10 +73,10 @@ typedef struct UINT32 clock; UINT32 output_rate; - const device_config *device; + running_device *device; } ES5503Chip; -INLINE ES5503Chip *get_safe_token(const device_config *device) +INLINE ES5503Chip *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -235,7 +235,7 @@ static DEVICE_START( es5503 ) int osc; ES5503Chip *chip = get_safe_token(device); - intf = (const es5503_interface *)device->static_config; + intf = (const es5503_interface *)device->baseconfig().static_config; chip->irq_callback = intf->irq_callback; chip->adc_read = intf->adc_read; @@ -497,7 +497,7 @@ WRITE8_DEVICE_HANDLER( es5503_w ) } } -void es5503_set_base(const device_config *device, UINT8 *wavemem) +void es5503_set_base(running_device *device, UINT8 *wavemem) { ES5503Chip *chip = get_safe_token(device); diff --git a/src/emu/sound/es5503.h b/src/emu/sound/es5503.h index de368a7aca1..a21c29e1252 100644 --- a/src/emu/sound/es5503.h +++ b/src/emu/sound/es5503.h @@ -6,14 +6,14 @@ typedef struct _es5503_interface es5503_interface; struct _es5503_interface { - void (*irq_callback)(const device_config *device, int state); + void (*irq_callback)(running_device *device, int state); read8_device_func adc_read; UINT8 *wave_memory; }; READ8_DEVICE_HANDLER( es5503_r ); WRITE8_DEVICE_HANDLER( es5503_w ); -void es5503_set_base(const device_config *device, UINT8 *wavemem); +void es5503_set_base(running_device *device, UINT8 *wavemem); DEVICE_GET_INFO( es5503 ); #define SOUND_ES5503 DEVICE_GET_INFO_NAME( es5503 ) diff --git a/src/emu/sound/es5506.c b/src/emu/sound/es5506.c index ca86ecc933c..9e617c799e9 100644 --- a/src/emu/sound/es5506.c +++ b/src/emu/sound/es5506.c @@ -102,7 +102,7 @@ struct _es5506_state UINT32 write_latch; /* currently accumulated data for write */ UINT32 read_latch; /* currently accumulated data for read */ UINT32 master_clock; /* master clock frequency */ - void (*irq_callback)(const device_config *, int); /* IRQ callback */ + void (*irq_callback)(running_device *, int); /* IRQ callback */ UINT16 (*port_read)(void); /* input port read */ UINT8 current_page; /* current register page */ @@ -119,7 +119,7 @@ struct _es5506_state INT16 * ulaw_lookup; UINT16 * volume_lookup; - const device_config *device; + running_device *device; #if MAKE_WAVS void * wavraw; /* raw waveform */ @@ -127,7 +127,7 @@ struct _es5506_state }; -INLINE es5506_state *get_safe_token(const device_config *device) +INLINE es5506_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -826,7 +826,7 @@ static STREAM_UPDATE( es5506_update ) ***********************************************************************************************/ -static void es5506_start_common(const device_config *device, const void *config, sound_type sndtype) +static void es5506_start_common(running_device *device, const void *config, sound_type sndtype) { const es5506_interface *intf = (const es5506_interface *)config; es5506_state *chip = get_safe_token(device); @@ -876,7 +876,7 @@ static void es5506_start_common(const device_config *device, const void *config, static DEVICE_START( es5506 ) { - es5506_start_common(device, device->static_config, SOUND_ES5506); + es5506_start_common(device, device->baseconfig().static_config, SOUND_ES5506); } @@ -1426,7 +1426,7 @@ READ8_DEVICE_HANDLER( es5506_r ) -void es5506_voice_bank_w(const device_config *device, int voice, int bank) +void es5506_voice_bank_w(running_device *device, int voice, int bank) { es5506_state *chip = get_safe_token(device); chip->voice[voice].exbank=bank; @@ -1441,7 +1441,7 @@ void es5506_voice_bank_w(const device_config *device, int voice, int bank) static DEVICE_START( es5505 ) { - const es5505_interface *intf = (const es5505_interface *)device->static_config; + const es5505_interface *intf = (const es5505_interface *)device->baseconfig().static_config; es5506_interface es5506intf; memset(&es5506intf, 0, sizeof(es5506intf)); @@ -2028,7 +2028,7 @@ READ16_DEVICE_HANDLER( es5505_r ) -void es5505_voice_bank_w(const device_config *device, int voice, int bank) +void es5505_voice_bank_w(running_device *device, int voice, int bank) { es5506_state *chip = get_safe_token(device); #if RAINE_CHECK diff --git a/src/emu/sound/es5506.h b/src/emu/sound/es5506.h index d0380c8ee7b..ece48c1d4ca 100644 --- a/src/emu/sound/es5506.h +++ b/src/emu/sound/es5506.h @@ -15,13 +15,13 @@ struct _es5505_interface { const char * region0; /* memory region where the sample ROM lives */ const char * region1; /* memory region where the sample ROM lives */ - void (*irq_callback)(const device_config *device, int state); /* irq callback */ - UINT16 (*read_port)(const device_config *device); /* input port read */ + void (*irq_callback)(running_device *device, int state); /* irq callback */ + UINT16 (*read_port)(running_device *device); /* input port read */ }; READ16_DEVICE_HANDLER( es5505_r ); WRITE16_DEVICE_HANDLER( es5505_w ); -void es5505_voice_bank_w(const device_config *device, int voice, int bank); +void es5505_voice_bank_w(running_device *device, int voice, int bank); DEVICE_GET_INFO( es5505 ); #define SOUND_ES5505 DEVICE_GET_INFO_NAME( es5505 ) @@ -34,13 +34,13 @@ struct _es5506_interface const char * region1; /* memory region where the sample ROM lives */ const char * region2; /* memory region where the sample ROM lives */ const char * region3; /* memory region where the sample ROM lives */ - void (*irq_callback)(const device_config *device, int state); /* irq callback */ - UINT16 (*read_port)(const device_config *device); /* input port read */ + void (*irq_callback)(running_device *device, int state); /* irq callback */ + UINT16 (*read_port)(running_device *device); /* input port read */ }; READ8_DEVICE_HANDLER( es5506_r ); WRITE8_DEVICE_HANDLER( es5506_w ); -void es5506_voice_bank_w(const device_config *device, int voice, int bank); +void es5506_voice_bank_w(running_device *device, int voice, int bank); DEVICE_GET_INFO( es5506 ); #define SOUND_ES5506 DEVICE_GET_INFO_NAME( es5506 ) diff --git a/src/emu/sound/es8712.c b/src/emu/sound/es8712.c index 5fff26f4b18..ebb8eb933aa 100644 --- a/src/emu/sound/es8712.c +++ b/src/emu/sound/es8712.c @@ -48,7 +48,7 @@ static const int index_shift[8] = { -1, -1, -1, -1, 2, 4, 6, 8 }; static int diff_lookup[49*16]; -INLINE es8712_state *get_safe_token(const device_config *device) +INLINE es8712_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -191,7 +191,7 @@ static STREAM_UPDATE( es8712_update ) ***********************************************************************************************/ -static void es8712_state_save_register(es8712_state *chip, const device_config *device) +static void es8712_state_save_register(es8712_state *chip, running_device *device) { state_save_register_device_item(device, 0, chip->bank_offset); @@ -266,7 +266,7 @@ static DEVICE_RESET( es8712 ) *****************************************************************************/ -void es8712_set_bank_base(const device_config *device, int base) +void es8712_set_bank_base(running_device *device, int base) { es8712_state *chip = get_safe_token(device); stream_update(chip->stream); @@ -280,7 +280,7 @@ void es8712_set_bank_base(const device_config *device, int base) *****************************************************************************/ -void es8712_set_frequency(const device_config *device, int frequency) +void es8712_set_frequency(running_device *device, int frequency) { es8712_state *chip = get_safe_token(device); @@ -297,7 +297,7 @@ void es8712_set_frequency(const device_config *device, int frequency) ***********************************************************************************************/ -void es8712_play(const device_config *device) +void es8712_play(running_device *device) { es8712_state *chip = get_safe_token(device); diff --git a/src/emu/sound/es8712.h b/src/emu/sound/es8712.h index 5cb33dcb322..85ef903a514 100644 --- a/src/emu/sound/es8712.h +++ b/src/emu/sound/es8712.h @@ -5,9 +5,9 @@ /* An interface for the ES8712 ADPCM chip */ -void es8712_play(const device_config *device); -void es8712_set_bank_base(const device_config *device, int base); -void es8712_set_frequency(const device_config *device, int frequency); +void es8712_play(running_device *device); +void es8712_set_bank_base(running_device *device, int base); +void es8712_set_frequency(running_device *device, int frequency); WRITE8_DEVICE_HANDLER( es8712_w ); diff --git a/src/emu/sound/filter.c b/src/emu/sound/filter.c index 734f17389e4..ecb8e9e93be 100644 --- a/src/emu/sound/filter.c +++ b/src/emu/sound/filter.c @@ -131,7 +131,7 @@ filter* filter_lp_fir_alloc(double freq, int order) { } -void filter2_setup(const device_config *device, int type, double fc, double d, double gain, +void filter2_setup(running_device *device, int type, double fc, double d, double gain, filter2_context *filter2) { int sample_rate = device->machine->sample_rate; @@ -202,7 +202,7 @@ void filter2_step(filter2_context *filter2) /* Setup a filter2 structure based on an op-amp multipole bandpass circuit. */ -void filter_opamp_m_bandpass_setup(const device_config *device, double r1, double r2, double r3, double c1, double c2, +void filter_opamp_m_bandpass_setup(running_device *device, double r1, double r2, double r3, double c1, double c2, filter2_context *filter2) { double r_in, fc, d, gain; diff --git a/src/emu/sound/filter.h b/src/emu/sound/filter.h index ccc3a728da6..92c5ac9dcc4 100644 --- a/src/emu/sound/filter.h +++ b/src/emu/sound/filter.h @@ -81,7 +81,7 @@ struct _filter2_context * d - damp = 1/Q * gain - overall filter gain. Set to 1 if not needed. */ -void filter2_setup(const device_config *device, int type, double fc, double d, double gain, +void filter2_setup(running_device *device, int type, double fc, double d, double gain, filter2_context *filter2); @@ -114,7 +114,7 @@ void filter2_step(filter2_context *filter2); * gnd vRef >---' |/ * */ -void filter_opamp_m_bandpass_setup(const device_config *device, double r1, double r2, double r3, double c1, double c2, +void filter_opamp_m_bandpass_setup(running_device *device, double r1, double r2, double r3, double c1, double c2, filter2_context *filter2); #endif /* __FILTER_H__ */ diff --git a/src/emu/sound/flt_rc.c b/src/emu/sound/flt_rc.c index 75cac16d8ee..b54dce460cb 100644 --- a/src/emu/sound/flt_rc.c +++ b/src/emu/sound/flt_rc.c @@ -5,14 +5,14 @@ typedef struct _filter_rc_state filter_rc_state; struct _filter_rc_state { - const device_config *device; + running_device *device; sound_stream * stream; int k; int memory; int type; }; -INLINE filter_rc_state *get_safe_token(const device_config *device) +INLINE filter_rc_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -93,7 +93,7 @@ static void set_RC_info(filter_rc_state *info, int type, double R1, double R2, d static DEVICE_START( filter_rc ) { filter_rc_state *info = get_safe_token(device); - const flt_rc_config *conf = (const flt_rc_config *)device->static_config; + const flt_rc_config *conf = (const flt_rc_config *)device->baseconfig().static_config; info->device = device; info->stream = stream_create(device, 1, 1, device->machine->sample_rate, info, filter_rc_update); @@ -104,7 +104,7 @@ static DEVICE_START( filter_rc ) } -void filter_rc_set_RC(const device_config *device, int type, double R1, double R2, double R3, double C) +void filter_rc_set_RC(running_device *device, int type, double R1, double R2, double R3, double C) { filter_rc_state *info = get_safe_token(device); diff --git a/src/emu/sound/flt_rc.h b/src/emu/sound/flt_rc.h index 06a575464d4..5900462b1ec 100644 --- a/src/emu/sound/flt_rc.h +++ b/src/emu/sound/flt_rc.h @@ -56,7 +56,7 @@ struct _flt_rc_config extern const flt_rc_config flt_rc_ac_default; -void filter_rc_set_RC(const device_config *device, int type, double R1, double R2, double R3, double C); +void filter_rc_set_RC(running_device *device, int type, double R1, double R2, double R3, double C); DEVICE_GET_INFO( filter_rc ); #define SOUND_FILTER_RC DEVICE_GET_INFO_NAME( filter_rc ) diff --git a/src/emu/sound/flt_vol.c b/src/emu/sound/flt_vol.c index 2f1d5877439..e5bf08611e7 100644 --- a/src/emu/sound/flt_vol.c +++ b/src/emu/sound/flt_vol.c @@ -10,7 +10,7 @@ struct _filter_volume_state int gain; }; -INLINE filter_volume_state *get_safe_token(const device_config *device) +INLINE filter_volume_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -41,7 +41,7 @@ static DEVICE_START( filter_volume ) } -void flt_volume_set_volume(const device_config *device, float volume) +void flt_volume_set_volume(running_device *device, float volume) { filter_volume_state *info = get_safe_token(device); info->gain = (int)(volume * 256); diff --git a/src/emu/sound/flt_vol.h b/src/emu/sound/flt_vol.h index a0de74c4741..1db138e2cd4 100644 --- a/src/emu/sound/flt_vol.h +++ b/src/emu/sound/flt_vol.h @@ -3,7 +3,7 @@ #ifndef __FLT_VOL_H__ #define __FLT_VOL_H__ -void flt_volume_set_volume(const device_config *device, float volume); +void flt_volume_set_volume(running_device *device, float volume); DEVICE_GET_INFO( filter_volume ); #define SOUND_FILTER_VOLUME DEVICE_GET_INFO_NAME( filter_volume ) diff --git a/src/emu/sound/fm.c b/src/emu/sound/fm.c index 203d2402e80..4df7ad6f82b 100644 --- a/src/emu/sound/fm.c +++ b/src/emu/sound/fm.c @@ -587,7 +587,7 @@ typedef struct typedef struct { - const device_config *device; + running_device *device; void * param; /* this chip parameter */ int clock; /* master clock (Hz) */ int rate; /* sampling rate (Hz) */ @@ -1675,7 +1675,7 @@ INLINE void CSMKeyControll(UINT8 type, FM_CH *CH) #ifdef __STATE_H__ /* FM channel save , internal state only */ -static void FMsave_state_channel(const device_config *device,FM_CH *CH,int num_ch) +static void FMsave_state_channel(running_device *device,FM_CH *CH,int num_ch) { int slot , ch; @@ -1695,7 +1695,7 @@ static void FMsave_state_channel(const device_config *device,FM_CH *CH,int num_c } } -static void FMsave_state_st(const device_config *device,FM_ST *ST) +static void FMsave_state_st(running_device *device,FM_ST *ST) { #if FM_BUSY_FLAG_SUPPORT state_save_register_device_item(device, 0, ST->busy_expiry_time.seconds ); @@ -2230,7 +2230,7 @@ void ym2203_postload(void *chip) } } -static void YM2203_save_state(YM2203 *F2203, const device_config *device) +static void YM2203_save_state(YM2203 *F2203, running_device *device) { state_save_register_device_item_array(device, 0, F2203->REGS); FMsave_state_st(device,&F2203->OPN.ST); @@ -2247,7 +2247,7 @@ static void YM2203_save_state(YM2203 *F2203, const device_config *device) 'clock' is the chip clock in Hz 'rate' is sampling rate */ -void * ym2203_init(void *param, const device_config *device, int clock, int rate, +void * ym2203_init(void *param, running_device *device, int clock, int rate, FM_TIMERHANDLER timer_handler,FM_IRQHANDLER IRQHandler, const ssg_callbacks *ssg) { YM2203 *F2203; @@ -2638,7 +2638,7 @@ static void FM_ADPCMAWrite(YM2610 *F2610,int r,int v) #ifdef __STATE_H__ /* FM channel save , internal state only */ -static void FMsave_state_adpcma(const device_config *device,ADPCM_CH *adpcm) +static void FMsave_state_adpcma(running_device *device,ADPCM_CH *adpcm) { int ch; @@ -3437,7 +3437,7 @@ void ym2608_postload(void *chip) } } -static void YM2608_save_state(YM2608 *F2608, const device_config *device) +static void YM2608_save_state(YM2608 *F2608, running_device *device) { state_save_register_device_item_array(device, 0, F2608->REGS); FMsave_state_st(device,&F2608->OPN.ST); @@ -3466,7 +3466,7 @@ static void YM2608_deltat_status_reset(void *chip, UINT8 changebits) FM_STATUS_RESET(&(F2608->OPN.ST), changebits); } /* YM2608(OPNA) */ -void * ym2608_init(void *param, const device_config *device, int clock, int rate, +void * ym2608_init(void *param, running_device *device, int clock, int rate, void *pcmrom,int pcmsize, FM_TIMERHANDLER timer_handler,FM_IRQHANDLER IRQHandler, const ssg_callbacks *ssg) { @@ -4116,7 +4116,7 @@ void ym2610_postload(void *chip) } } -static void YM2610_save_state(YM2610 *F2610, const device_config *device) +static void YM2610_save_state(YM2610 *F2610, running_device *device) { state_save_register_device_item_array(device, 0, F2610->REGS); FMsave_state_st(device,&F2610->OPN.ST); @@ -4147,7 +4147,7 @@ static void YM2610_deltat_status_reset(void *chip, UINT8 changebits) F2610->adpcm_arrivedEndAddress &= (~changebits); } -void *ym2610_init(void *param, const device_config *device, int clock, int rate, +void *ym2610_init(void *param, running_device *device, int clock, int rate, void *pcmroma,int pcmsizea,void *pcmromb,int pcmsizeb, FM_TIMERHANDLER timer_handler,FM_IRQHANDLER IRQHandler, const ssg_callbacks *ssg) diff --git a/src/emu/sound/fm.h b/src/emu/sound/fm.h index 226ef3b6cfe..312717a839f 100644 --- a/src/emu/sound/fm.h +++ b/src/emu/sound/fm.h @@ -122,7 +122,7 @@ typedef void (*FM_IRQHANDLER)(void *param,int irq); ** 'IRQHandler' IRQ callback handler when changed IRQ level ** return 0 = success */ -void * ym2203_init(void *param, const device_config *device, int baseclock, int rate, +void * ym2203_init(void *param, running_device *device, int baseclock, int rate, FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler, const ssg_callbacks *ssg); /* @@ -165,7 +165,7 @@ void ym2203_postload(void *chip); #if BUILD_YM2608 /* -------------------- YM2608(OPNA) Interface -------------------- */ -void * ym2608_init(void *param, const device_config *device, int baseclock, int rate, +void * ym2608_init(void *param, running_device *device, int baseclock, int rate, void *pcmroma,int pcmsizea, FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler, const ssg_callbacks *ssg); void ym2608_shutdown(void *chip); @@ -180,7 +180,7 @@ void ym2608_postload(void *chip); #if (BUILD_YM2610||BUILD_YM2610B) /* -------------------- YM2610(OPNB) Interface -------------------- */ -void * ym2610_init(void *param, const device_config *device, int baseclock, int rate, +void * ym2610_init(void *param, running_device *device, int baseclock, int rate, void *pcmroma,int pcmasize,void *pcmromb,int pcmbsize, FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler, const ssg_callbacks *ssg); void ym2610_shutdown(void *chip); @@ -198,7 +198,7 @@ void ym2610_postload(void *chip); #endif /* (BUILD_YM2610||BUILD_YM2610B) */ #if (BUILD_YM2612||BUILD_YM3438) -void * ym2612_init(void *param, const device_config *device, int baseclock, int rate, +void * ym2612_init(void *param, running_device *device, int baseclock, int rate, FM_TIMERHANDLER TimerHandler,FM_IRQHANDLER IRQHandler); void ym2612_shutdown(void *chip); void ym2612_reset_chip(void *chip); diff --git a/src/emu/sound/fm2612.c b/src/emu/sound/fm2612.c index cddabd4d07b..99a8e5d2279 100644 --- a/src/emu/sound/fm2612.c +++ b/src/emu/sound/fm2612.c @@ -599,7 +599,7 @@ typedef struct typedef struct { - const device_config *device; + running_device *device; void * param; /* this chip parameter */ double freqbase; /* frequency base */ int timer_prescaler; /* timer prescaler */ @@ -1680,7 +1680,7 @@ INLINE void CSMKeyControll(FM_OPN *OPN, FM_CH *CH) #ifdef __STATE_H__ /* FM channel save , internal state only */ -static void FMsave_state_channel(const device_config *device,FM_CH *CH,int num_ch) +static void FMsave_state_channel(running_device *device,FM_CH *CH,int num_ch) { int slot , ch; @@ -1700,7 +1700,7 @@ static void FMsave_state_channel(const device_config *device,FM_CH *CH,int num_c } } -static void FMsave_state_st(const device_config *device,FM_ST *ST) +static void FMsave_state_st(running_device *device,FM_ST *ST) { #if FM_BUSY_FLAG_SUPPORT state_save_register_device_item(device, 0, ST->busy_expiry_time.seconds ); @@ -2345,7 +2345,7 @@ void ym2612_postload(void *chip) } } -static void YM2612_save_state(YM2612 *F2612, const device_config *device) +static void YM2612_save_state(YM2612 *F2612, running_device *device) { state_save_register_device_item_array(device, 0, F2612->REGS); FMsave_state_st(device,&F2612->OPN.ST); @@ -2360,7 +2360,7 @@ static void YM2612_save_state(YM2612 *F2612, const device_config *device) #endif /* _STATE_H */ /* initialize YM2612 emulator(s) */ -void * ym2612_init(void *param, const device_config *device, int clock, int rate, +void * ym2612_init(void *param, running_device *device, int clock, int rate, FM_TIMERHANDLER timer_handler,FM_IRQHANDLER IRQHandler) { YM2612 *F2612; diff --git a/src/emu/sound/fmopl.c b/src/emu/sound/fmopl.c index f2d10ec69ea..510d7be7cc8 100644 --- a/src/emu/sound/fmopl.c +++ b/src/emu/sound/fmopl.c @@ -312,7 +312,7 @@ typedef struct fm_opl_f { UINT32 rate; /* sampling rate (Hz) */ double freqbase; /* frequency base */ attotime TimerBase; /* Timer base time (==sampling time)*/ - const device_config *device; + running_device *device; } FM_OPL; @@ -1722,7 +1722,7 @@ static TIMER_CALLBACK( cymfile_callback ) } /* lock/unlock for common table */ -static int OPL_LockTable(const device_config *device) +static int OPL_LockTable(running_device *device) { num_lock++; if(num_lock>1) return 0; @@ -1868,7 +1868,7 @@ static STATE_POSTLOAD( OPL_postload ) } -static void OPLsave_state_channel(const device_config *device, OPL_CH *CH) +static void OPLsave_state_channel(running_device *device, OPL_CH *CH) { int slot, ch; @@ -1912,7 +1912,7 @@ static void OPLsave_state_channel(const device_config *device, OPL_CH *CH) /* Register savestate for a virtual YM3812/YM3526Y8950 */ -static void OPL_save_state(FM_OPL *OPL, const device_config *device) +static void OPL_save_state(FM_OPL *OPL, running_device *device) { OPLsave_state_channel(device, OPL->P_CH); @@ -1962,7 +1962,7 @@ static void OPL_save_state(FM_OPL *OPL, const device_config *device) /* Create one of virtual YM3812/YM3526/Y8950 */ /* 'clock' is chip clock in Hz */ /* 'rate' is sampling rate */ -static FM_OPL *OPLCreate(const device_config *device, UINT32 clock, UINT32 rate, int type) +static FM_OPL *OPLCreate(running_device *device, UINT32 clock, UINT32 rate, int type) { char *ptr; FM_OPL *OPL; @@ -2150,7 +2150,7 @@ static int OPLTimerOver(FM_OPL *OPL,int c) #if (BUILD_YM3812) -void * ym3812_init(const device_config *device, UINT32 clock, UINT32 rate) +void * ym3812_init(running_device *device, UINT32 clock, UINT32 rate) { /* emulator create */ FM_OPL *YM3812 = OPLCreate(device,clock,rate,OPL_TYPE_YM3812); @@ -2286,7 +2286,7 @@ void ym3812_update_one(void *chip, OPLSAMPLE *buffer, int length) #if (BUILD_YM3526) -void *ym3526_init(const device_config *device, UINT32 clock, UINT32 rate) +void *ym3526_init(running_device *device, UINT32 clock, UINT32 rate) { /* emulator create */ FM_OPL *YM3526 = OPLCreate(device,clock,rate,OPL_TYPE_YM3526); @@ -2433,7 +2433,7 @@ static void Y8950_deltat_status_reset(void *chip, UINT8 changebits) OPL_STATUS_RESET(Y8950, changebits); } -void *y8950_init(const device_config *device, UINT32 clock, UINT32 rate) +void *y8950_init(running_device *device, UINT32 clock, UINT32 rate) { /* emulator create */ FM_OPL *Y8950 = OPLCreate(device,clock,rate,OPL_TYPE_Y8950); diff --git a/src/emu/sound/fmopl.h b/src/emu/sound/fmopl.h index 954514ae6b9..40be25ec77c 100644 --- a/src/emu/sound/fmopl.h +++ b/src/emu/sound/fmopl.h @@ -41,7 +41,7 @@ typedef unsigned char (*OPL_PORTHANDLER_R)(void *param); #if BUILD_YM3812 -void *ym3812_init(const device_config *device, UINT32 clock, UINT32 rate); +void *ym3812_init(running_device *device, UINT32 clock, UINT32 rate); void ym3812_shutdown(void *chip); void ym3812_reset_chip(void *chip); int ym3812_write(void *chip, int a, int v); @@ -65,7 +65,7 @@ void ym3812_set_update_handler(void *chip, OPL_UPDATEHANDLER UpdateHandler, void ** 'clock' is the chip clock in Hz ** 'rate' is sampling rate */ -void *ym3526_init(const device_config *device, UINT32 clock, UINT32 rate); +void *ym3526_init(running_device *device, UINT32 clock, UINT32 rate); /* shutdown the YM3526 emulators*/ void ym3526_shutdown(void *chip); void ym3526_reset_chip(void *chip); @@ -95,7 +95,7 @@ void y8950_set_port_handler(void *chip, OPL_PORTHANDLER_W PortHandler_w, OPL_POR void y8950_set_keyboard_handler(void *chip, OPL_PORTHANDLER_W KeyboardHandler_w, OPL_PORTHANDLER_R KeyboardHandler_r, void *param); void y8950_set_delta_t_memory(void *chip, void * deltat_mem_ptr, int deltat_mem_size ); -void * y8950_init(const device_config *device, UINT32 clock, UINT32 rate); +void * y8950_init(running_device *device, UINT32 clock, UINT32 rate); void y8950_shutdown(void *chip); void y8950_reset_chip(void *chip); int y8950_write(void *chip, int a, int v); diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c index fb69ee27d15..1a60b0adce6 100644 --- a/src/emu/sound/gaelco.c +++ b/src/emu/sound/gaelco.c @@ -78,7 +78,7 @@ struct _gaelco_sound_state static wav_file * wavraw; /* raw waveform */ -INLINE gaelco_sound_state *get_safe_token(const device_config *device) +INLINE gaelco_sound_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -255,7 +255,7 @@ WRITE16_DEVICE_HANDLER( gaelcosnd_w ) static DEVICE_START( gaelco ) { int j, vol; - const gaelcosnd_interface *intf = (const gaelcosnd_interface *)device->static_config; + const gaelcosnd_interface *intf = (const gaelcosnd_interface *)device->baseconfig().static_config; gaelco_sound_state *info = get_safe_token(device); diff --git a/src/emu/sound/hc55516.c b/src/emu/sound/hc55516.c index 966e341adba..756cf2b56ad 100644 --- a/src/emu/sound/hc55516.c +++ b/src/emu/sound/hc55516.c @@ -52,7 +52,7 @@ static STREAM_UPDATE( hc55516_update ); -INLINE hc55516_state *get_safe_token(const device_config *device) +INLINE hc55516_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -64,7 +64,7 @@ INLINE hc55516_state *get_safe_token(const device_config *device) } -static void start_common(const device_config *device, UINT8 _shiftreg_mask, int _active_clock_hi) +static void start_common(running_device *device, UINT8 _shiftreg_mask, int _active_clock_hi) { hc55516_state *chip = get_safe_token(device); @@ -245,7 +245,7 @@ static STREAM_UPDATE( hc55516_update ) } -void hc55516_clock_w(const device_config *device, int state) +void hc55516_clock_w(running_device *device, int state) { hc55516_state *chip = get_safe_token(device); UINT8 clock_state = state ? TRUE : FALSE; @@ -270,7 +270,7 @@ void hc55516_clock_w(const device_config *device, int state) } -void hc55516_digit_w(const device_config *device, int digit) +void hc55516_digit_w(running_device *device, int digit) { hc55516_state *chip = get_safe_token(device); @@ -284,7 +284,7 @@ void hc55516_digit_w(const device_config *device, int digit) } -int hc55516_clock_state_r(const device_config *device) +int hc55516_clock_state_r(running_device *device) { hc55516_state *chip = get_safe_token(device); diff --git a/src/emu/sound/hc55516.h b/src/emu/sound/hc55516.h index f241e8f49f3..f7db0b26093 100644 --- a/src/emu/sound/hc55516.h +++ b/src/emu/sound/hc55516.h @@ -5,13 +5,13 @@ /* sets the digit (0 or 1) */ -void hc55516_digit_w(const device_config *device, int digit); +void hc55516_digit_w(running_device *device, int digit); /* sets the clock state (0 or 1, clocked on the rising edge) */ -void hc55516_clock_w(const device_config *device, int state); +void hc55516_clock_w(running_device *device, int state); /* returns whether the clock is currently LO or HI */ -int hc55516_clock_state_r(const device_config *device); +int hc55516_clock_state_r(running_device *device); DEVICE_GET_INFO( hc55516 ); DEVICE_GET_INFO( mc3417 ); diff --git a/src/emu/sound/ics2115.c b/src/emu/sound/ics2115.c index d32b17ceee6..b6a1594d291 100644 --- a/src/emu/sound/ics2115.c +++ b/src/emu/sound/ics2115.c @@ -42,7 +42,7 @@ typedef struct _ics2115_state ics2115_state; struct _ics2115_state { const ics2115_interface *intf; - const device_config *device; + running_device *device; UINT8 *rom; INT16 *ulaw; @@ -65,7 +65,7 @@ struct _ics2115_state sound_stream * stream; }; -INLINE ics2115_state *get_safe_token(const device_config *device) +INLINE ics2115_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -476,7 +476,7 @@ static DEVICE_START( ics2115 ) int i, vv; chip->device = device; - chip->intf = (const ics2115_interface *)device->static_config; + chip->intf = (const ics2115_interface *)device->baseconfig().static_config; chip->rom = *device->region; chip->timer[0].timer = timer_alloc(device->machine, timer_cb_0, chip); chip->timer[1].timer = timer_alloc(device->machine, timer_cb_1, chip); diff --git a/src/emu/sound/ics2115.h b/src/emu/sound/ics2115.h index 7697bb82f0c..30d2d71a07a 100644 --- a/src/emu/sound/ics2115.h +++ b/src/emu/sound/ics2115.h @@ -5,7 +5,7 @@ typedef struct _ics2115_interface ics2115_interface; struct _ics2115_interface { - void (*irq_cb)(const device_config *, int); + void (*irq_cb)(running_device *, int); }; READ8_DEVICE_HANDLER( ics2115_r ); diff --git a/src/emu/sound/iremga20.c b/src/emu/sound/iremga20.c index 6202b2eb6c7..456439d9376 100644 --- a/src/emu/sound/iremga20.c +++ b/src/emu/sound/iremga20.c @@ -57,7 +57,7 @@ struct _ga20_state }; -INLINE ga20_state *get_safe_token(const device_config *device) +INLINE ga20_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/sound/k005289.c b/src/emu/sound/k005289.c index 33d39318195..d9244360355 100644 --- a/src/emu/sound/k005289.c +++ b/src/emu/sound/k005289.c @@ -61,7 +61,7 @@ struct _k005289_state int k005289_A_latch,k005289_B_latch; }; -INLINE k005289_state *get_safe_token(const device_config *device) +INLINE k005289_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/sound/k007232.c b/src/emu/sound/k007232.c index 54c612da5f1..5ba6eaa1d3f 100644 --- a/src/emu/sound/k007232.c +++ b/src/emu/sound/k007232.c @@ -55,7 +55,7 @@ typedef struct kdacApcm #define BASE_SHIFT (12) -INLINE KDAC_A_PCM *get_safe_token(const device_config *device) +INLINE KDAC_A_PCM *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -307,7 +307,7 @@ static DEVICE_START( k007232 ) int i; KDAC_A_PCM *info = get_safe_token(device); - info->intf = (device->static_config != NULL) ? (const k007232_interface *)device->static_config : &defintrf; + info->intf = (device->baseconfig().static_config != NULL) ? (const k007232_interface *)device->baseconfig().static_config : &defintrf; /* Set up the chips */ @@ -430,14 +430,14 @@ READ8_DEVICE_HANDLER( k007232_r ) /*****************************************************************************/ -void k007232_set_volume(const device_config *device,int channel,int volumeA,int volumeB) +void k007232_set_volume(running_device *device,int channel,int volumeA,int volumeB) { KDAC_A_PCM *info = get_safe_token(device); info->vol[channel][0] = volumeA; info->vol[channel][1] = volumeB; } -void k007232_set_bank( const device_config *device, int chABank, int chBBank ) +void k007232_set_bank( running_device *device, int chABank, int chBBank ) { KDAC_A_PCM *info = get_safe_token(device); info->bank[0] = chABank<<17; diff --git a/src/emu/sound/k007232.h b/src/emu/sound/k007232.h index 51dd44b25e6..7fc40b8a1fb 100644 --- a/src/emu/sound/k007232.h +++ b/src/emu/sound/k007232.h @@ -10,13 +10,13 @@ typedef struct _k007232_interface k007232_interface; struct _k007232_interface { - void (*portwritehandler)(const device_config *, int); + void (*portwritehandler)(running_device *, int); }; WRITE8_DEVICE_HANDLER( k007232_w ); READ8_DEVICE_HANDLER( k007232_r ); -void k007232_set_bank( const device_config *device, int chABank, int chBBank ); +void k007232_set_bank( running_device *device, int chABank, int chBBank ); /* The 007232 has two channels and produces two outputs. The volume control @@ -26,7 +26,7 @@ void k007232_set_bank( const device_config *device, int chABank, int chBBank ); then volumeB will be 0 for channel 0, and volumeA will be 0 for channel 1. Volume is in the range 0-255. */ -void k007232_set_volume(const device_config *device,int channel,int volumeA,int volumeB); +void k007232_set_volume(running_device *device,int channel,int volumeA,int volumeB); DEVICE_GET_INFO( k007232 ); #define SOUND_K007232 DEVICE_GET_INFO_NAME( k007232 ) diff --git a/src/emu/sound/k051649.c b/src/emu/sound/k051649.c index 578ca53e925..27f251196e1 100644 --- a/src/emu/sound/k051649.c +++ b/src/emu/sound/k051649.c @@ -55,7 +55,7 @@ struct _k051649_state int f[10]; }; -INLINE k051649_state *get_safe_token(const device_config *device) +INLINE k051649_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c index 0aab4de76f9..d37682f0f9b 100644 --- a/src/emu/sound/k053260.c +++ b/src/emu/sound/k053260.c @@ -40,10 +40,10 @@ struct _k053260_state { UINT32 *delta_table; k053260_channel channels[4]; const k053260_interface *intf; - const device_config *device; + running_device *device; }; -INLINE k053260_state *get_safe_token(const device_config *device) +INLINE k053260_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -215,7 +215,7 @@ static DEVICE_START( k053260 ) /* Initialize our chip structure */ ic->device = device; - ic->intf = (device->static_config != NULL) ? (const k053260_interface *)device->static_config : &defintrf; + ic->intf = (device->baseconfig().static_config != NULL) ? (const k053260_interface *)device->baseconfig().static_config : &defintrf; ic->mode = 0; diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c index e8e3865bc21..97d8b943305 100644 --- a/src/emu/sound/k054539.c +++ b/src/emu/sound/k054539.c @@ -68,7 +68,7 @@ struct _k054539_channel { typedef struct _k054539_state k054539_state; struct _k054539_state { const k054539_interface *intf; - const device_config *device; + running_device *device; double voltab[256]; double pantab[0xf]; @@ -91,7 +91,7 @@ struct _k054539_state { k054539_channel channels[8]; }; -INLINE k054539_state *get_safe_token(const device_config *device) +INLINE k054539_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -102,13 +102,13 @@ INLINE k054539_state *get_safe_token(const device_config *device) //* -void k054539_init_flags(const device_config *device, int flags) +void k054539_init_flags(running_device *device, int flags) { k054539_state *info = get_safe_token(device); info->k054539_flags = flags; } -void k054539_set_gain(const device_config *device, int channel, double gain) +void k054539_set_gain(running_device *device, int channel, double gain) { k054539_state *info = get_safe_token(device); if (gain >= 0) info->k054539_gain[channel] = gain; @@ -445,7 +445,7 @@ static TIMER_CALLBACK( k054539_irq ) info->intf->irq(info->device); } -static void k054539_init_chip(const device_config *device, k054539_state *info) +static void k054539_init_chip(running_device *device, k054539_state *info) { int i; @@ -651,7 +651,7 @@ static DEVICE_START( k054539 ) info->k054539_gain[i] = 1.0; info->k054539_flags = K054539_RESET_FLAGS; - info->intf = (device->static_config != NULL) ? (const k054539_interface *)device->static_config : &defintrf; + info->intf = (device->baseconfig().static_config != NULL) ? (const k054539_interface *)device->baseconfig().static_config : &defintrf; /* I've tried various equations on volume control but none worked consistently. diff --git a/src/emu/sound/k054539.h b/src/emu/sound/k054539.h index d48681db441..5aeb45ca170 100644 --- a/src/emu/sound/k054539.h +++ b/src/emu/sound/k054539.h @@ -13,8 +13,8 @@ typedef struct _k054539_interface k054539_interface; struct _k054539_interface { const char *rgnoverride; - void (*apan)(const device_config *, double, double); /* Callback for analog output mixing levels (0..1 for each channel) */ - void (*irq)(const device_config *); + void (*apan)(running_device *, double, double); /* Callback for analog output mixing levels (0..1 for each channel) */ + void (*irq)(running_device *); }; @@ -27,7 +27,7 @@ READ8_DEVICE_HANDLER( k054539_r ); #define K054539_DISABLE_REVERB 2 #define K054539_UPDATE_AT_KEYON 4 -void k054539_init_flags(const device_config *device, int flags); +void k054539_init_flags(running_device *device, int flags); /* Note that the eight PCM channels of a K054539 do not have seperate @@ -41,7 +41,7 @@ void k054539_init_flags(const device_config *device, int flags); channel : 0 - 7 gain : 0.0=silent, 1.0=no gain, 2.0=twice as loud, etc. */ -void k054539_set_gain(const device_config *device, int channel, double gain); +void k054539_set_gain(running_device *device, int channel, double gain); DEVICE_GET_INFO( k054539 ); #define SOUND_K054539 DEVICE_GET_INFO_NAME( k054539 ) diff --git a/src/emu/sound/k056800.c b/src/emu/sound/k056800.c index 8a43fe05e90..e15bcaaa879 100644 --- a/src/emu/sound/k056800.c +++ b/src/emu/sound/k056800.c @@ -24,7 +24,7 @@ struct _k056800_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k056800_state *k056800_get_safe_token( const device_config *device ) +INLINE k056800_state *k056800_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -33,11 +33,11 @@ INLINE k056800_state *k056800_get_safe_token( const device_config *device ) return (k056800_state *)device->token; } -INLINE const k056800_interface *k056800_get_interface( const device_config *device ) +INLINE const k056800_interface *k056800_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K056800)); - return (const k056800_interface *) device->static_config; + return (const k056800_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -45,7 +45,7 @@ INLINE const k056800_interface *k056800_get_interface( const device_config *devi *****************************************************************************/ -static UINT8 k056800_host_reg_r( const device_config *device, int reg ) +static UINT8 k056800_host_reg_r( running_device *device, int reg ) { k056800_state *k056800 = k056800_get_safe_token(device); UINT8 value = k056800->host_reg[reg]; @@ -55,7 +55,7 @@ static UINT8 k056800_host_reg_r( const device_config *device, int reg ) return value; } -static void k056800_host_reg_w( const device_config *device, int reg, UINT8 data ) +static void k056800_host_reg_w( running_device *device, int reg, UINT8 data ) { k056800_state *k056800 = k056800_get_safe_token(device); @@ -65,13 +65,13 @@ static void k056800_host_reg_w( const device_config *device, int reg, UINT8 data k056800->irq_cb(device->machine, 1); } -static UINT8 k056800_sound_reg_r( const device_config *device, int reg ) +static UINT8 k056800_sound_reg_r( running_device *device, int reg ) { k056800_state *k056800 = k056800_get_safe_token(device); return k056800->sound_reg[reg]; } -static void k056800_sound_reg_w( const device_config *device, int reg, UINT8 data ) +static void k056800_sound_reg_w( running_device *device, int reg, UINT8 data ) { k056800_state *k056800 = k056800_get_safe_token(device); diff --git a/src/emu/sound/msm5205.c b/src/emu/sound/msm5205.c index 8cb6a0c03e7..15f64b27c11 100644 --- a/src/emu/sound/msm5205.c +++ b/src/emu/sound/msm5205.c @@ -32,7 +32,7 @@ typedef struct _msm5205_state msm5205_state; struct _msm5205_state { const msm5205_interface *intf; - const device_config *device; + running_device *device; sound_stream * stream; /* number of stream system */ INT32 clock; /* clock rate */ emu_timer *timer; /* VCLK callback timer */ @@ -46,7 +46,7 @@ struct _msm5205_state int diff_lookup[49*16]; }; -INLINE msm5205_state *get_safe_token(const device_config *device) +INLINE msm5205_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -182,7 +182,7 @@ static DEVICE_START( msm5205 ) msm5205_state *voice = get_safe_token(device); /* save a global pointer to our interface */ - voice->intf = (const msm5205_interface *)device->static_config; + voice->intf = (const msm5205_interface *)device->baseconfig().static_config; voice->device = device; voice->clock = device->clock; @@ -211,7 +211,7 @@ static DEVICE_START( msm5205 ) * Handle an update of the vclk status of a chip (1 is reset ON, 0 is reset OFF) * This function can use selector = MSM5205_SEX only */ -void msm5205_vclk_w (const device_config *device, int vclk) +void msm5205_vclk_w (running_device *device, int vclk) { msm5205_state *voice = get_safe_token(device); @@ -233,7 +233,7 @@ void msm5205_vclk_w (const device_config *device, int vclk) * Handle an update of the reset status of a chip (1 is reset ON, 0 is reset OFF) */ -void msm5205_reset_w (const device_config *device, int reset) +void msm5205_reset_w (running_device *device, int reset) { msm5205_state *voice = get_safe_token(device); voice->reset = reset; @@ -243,7 +243,7 @@ void msm5205_reset_w (const device_config *device, int reset) * Handle an update of the data to the chip */ -void msm5205_data_w (const device_config *device, int data) +void msm5205_data_w (running_device *device, int data) { msm5205_state *voice = get_safe_token(device); if( voice->bitwidth == 4) @@ -256,7 +256,7 @@ void msm5205_data_w (const device_config *device, int data) * Handle an change of the selector */ -void msm5205_playmode_w(const device_config *device, int select) +void msm5205_playmode_w(running_device *device, int select) { msm5205_state *voice = get_safe_token(device); msm5205_playmode(voice,select); @@ -293,7 +293,7 @@ static void msm5205_playmode(msm5205_state *voice,int select) } -void msm5205_set_volume(const device_config *device,int volume) +void msm5205_set_volume(running_device *device,int volume) { msm5205_state *voice = get_safe_token(device); diff --git a/src/emu/sound/msm5205.h b/src/emu/sound/msm5205.h index cee26a7bf48..4a3be8bdb86 100644 --- a/src/emu/sound/msm5205.h +++ b/src/emu/sound/msm5205.h @@ -19,22 +19,22 @@ typedef struct _msm5205_interface msm5205_interface; struct _msm5205_interface { - void (*vclk_callback)(const device_config *); /* VCLK callback */ + void (*vclk_callback)(running_device *); /* VCLK callback */ int select; /* prescaler / bit width selector */ }; /* reset signal should keep for 2cycle of VCLK */ -void msm5205_reset_w (const device_config *device, int reset); +void msm5205_reset_w (running_device *device, int reset); /* adpcmata is latched after vclk_interrupt callback */ -void msm5205_data_w (const device_config *device, int data); +void msm5205_data_w (running_device *device, int data); /* VCLK slave mode option */ /* if VCLK and reset or data is changed at the same time, */ /* Call msm5205_vclk_w after msm5205_data_w and msm5205_reset_w. */ -void msm5205_vclk_w (const device_config *device, int reset); +void msm5205_vclk_w (running_device *device, int reset); /* option , selected pin seletor */ -void msm5205_playmode_w(const device_config *device, int _select); +void msm5205_playmode_w(running_device *device, int _select); -void msm5205_set_volume(const device_config *device,int volume); +void msm5205_set_volume(running_device *device,int volume); DEVICE_GET_INFO( msm5205 ); #define SOUND_MSM5205 DEVICE_GET_INFO_NAME( msm5205 ) diff --git a/src/emu/sound/msm5232.c b/src/emu/sound/msm5232.c index 821f85f0a43..b5acdc527f4 100644 --- a/src/emu/sound/msm5232.c +++ b/src/emu/sound/msm5232.c @@ -69,13 +69,13 @@ typedef struct { int rate; /* sample rate in Hz */ double external_capacity[8]; /* in Farads, eg 0.39e-6 = 0.36 uF (microFarads) */ - const device_config *device; - void (*gate_handler)(const device_config *device, int state); /* callback called when the GATE output pin changes state */ + running_device *device; + void (*gate_handler)(running_device *device, int state); /* callback called when the GATE output pin changes state */ } MSM5232; -INLINE MSM5232 *get_safe_token(const device_config *device) +INLINE MSM5232 *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -785,7 +785,7 @@ static STREAM_UPDATE( MSM5232_update_one ) static DEVICE_START( msm5232 ) { - const msm5232_interface *intf = (const msm5232_interface *)device->static_config; + const msm5232_interface *intf = (const msm5232_interface *)device->baseconfig().static_config; int rate = device->clock/CLOCK_RATE_DIVIDER; MSM5232 *chip = get_safe_token(device); @@ -796,7 +796,7 @@ static DEVICE_START( msm5232 ) chip->stream = stream_create(device,0,11,rate,chip,MSM5232_update_one); } -void msm5232_set_clock(const device_config *device, int clock) +void msm5232_set_clock(running_device *device, int clock) { MSM5232 *chip = get_safe_token(device); diff --git a/src/emu/sound/msm5232.h b/src/emu/sound/msm5232.h index ec786a10a77..ad1bfb003d2 100644 --- a/src/emu/sound/msm5232.h +++ b/src/emu/sound/msm5232.h @@ -7,12 +7,12 @@ typedef struct _msm5232_interface msm5232_interface; struct _msm5232_interface { double capacity[8]; /* in Farads, capacitors connected to pins: 24,25,26,27 and 37,38,39,40 */ - void (*gate_handler)(const device_config *device, int state); /* callback called when the GATE output pin changes state */ + void (*gate_handler)(running_device *device, int state); /* callback called when the GATE output pin changes state */ }; WRITE8_DEVICE_HANDLER( msm5232_w ); -void msm5232_set_clock(const device_config *device, int clock); +void msm5232_set_clock(running_device *device, int clock); DEVICE_GET_INFO( msm5232 ); #define SOUND_MSM5232 DEVICE_GET_INFO_NAME( msm5232 ) diff --git a/src/emu/sound/multipcm.c b/src/emu/sound/multipcm.c index cc346ba80ba..557cf02da50 100644 --- a/src/emu/sound/multipcm.c +++ b/src/emu/sound/multipcm.c @@ -126,7 +126,7 @@ static const int val2chan[] = #define MULTIPCM_RATE 44100.0 -INLINE MultiPCM *get_safe_token(const device_config *device) +INLINE MultiPCM *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -667,7 +667,7 @@ WRITE8_DEVICE_HANDLER( multipcm_w ) /* MAME/M1 access functions */ -void multipcm_set_bank(const device_config *device, UINT32 leftoffs, UINT32 rightoffs) +void multipcm_set_bank(running_device *device, UINT32 leftoffs, UINT32 rightoffs) { MultiPCM *ptChip = get_safe_token(device); ptChip->BankL = leftoffs; diff --git a/src/emu/sound/multipcm.h b/src/emu/sound/multipcm.h index e7c8f61c27e..9c20693d9fd 100644 --- a/src/emu/sound/multipcm.h +++ b/src/emu/sound/multipcm.h @@ -6,7 +6,7 @@ WRITE8_DEVICE_HANDLER( multipcm_w ); READ8_DEVICE_HANDLER( multipcm_r ); -void multipcm_set_bank(const device_config *device, UINT32 leftoffs, UINT32 rightoffs); +void multipcm_set_bank(running_device *device, UINT32 leftoffs, UINT32 rightoffs); DEVICE_GET_INFO( multipcm ); #define SOUND_MULTIPCM DEVICE_GET_INFO_NAME( multipcm ) diff --git a/src/emu/sound/n63701x.c b/src/emu/sound/n63701x.c index fc7bda5f3e3..56a26029f45 100644 --- a/src/emu/sound/n63701x.c +++ b/src/emu/sound/n63701x.c @@ -47,7 +47,7 @@ struct _namco_63701x static const int vol_table[4] = { 26, 84, 200, 258 }; -INLINE namco_63701x *get_safe_token(const device_config *device) +INLINE namco_63701x *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/sound/namco.c b/src/emu/sound/namco.c index 4cdfadcea19..4bafd0d6f4a 100644 --- a/src/emu/sound/namco.c +++ b/src/emu/sound/namco.c @@ -77,7 +77,7 @@ struct _namco_sound }; -INLINE namco_sound *get_safe_token(const device_config *device) +INLINE namco_sound *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -366,7 +366,7 @@ static STREAM_UPDATE( namco_update_stereo ) static DEVICE_START( namco ) { sound_channel *voice; - const namco_interface *intf = (const namco_interface *)device->static_config; + const namco_interface *intf = (const namco_interface *)device->baseconfig().static_config; int clock_multiple; namco_sound *chip = get_safe_token(device); @@ -549,7 +549,7 @@ it select the 54XX/52XX outputs on those channels 0x3f ch 7 */ -void polepos_sound_enable(const device_config *device, int enable) +void polepos_sound_enable(running_device *device, int enable) { namco_sound *chip = get_safe_token(device); chip->sound_enable = enable; @@ -627,7 +627,7 @@ WRITE8_DEVICE_HANDLER( polepos_sound_w ) 0x3e ch 7 waveform select & frequency */ -void mappy_sound_enable(const device_config *device, int enable) +void mappy_sound_enable(running_device *device, int enable) { namco_sound *chip = get_safe_token(device); chip->sound_enable = enable; diff --git a/src/emu/sound/namco.h b/src/emu/sound/namco.h index d251e34abf3..1135f7c0ec1 100644 --- a/src/emu/sound/namco.h +++ b/src/emu/sound/namco.h @@ -13,10 +13,10 @@ struct _namco_interface WRITE8_DEVICE_HANDLER( pacman_sound_enable_w ); WRITE8_DEVICE_HANDLER( pacman_sound_w ); -void polepos_sound_enable(const device_config *device, int enable); +void polepos_sound_enable(running_device *device, int enable); WRITE8_DEVICE_HANDLER( polepos_sound_w ); -void mappy_sound_enable(const device_config *device, int enable); +void mappy_sound_enable(running_device *device, int enable); WRITE8_DEVICE_HANDLER( namco_15xx_w ); WRITE8_DEVICE_HANDLER( namcos1_cus30_w ); /* wavedata + sound registers + RAM */ diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c index 2358a2dd642..19269003c95 100644 --- a/src/emu/sound/nes_apu.c +++ b/src/emu/sound/nes_apu.c @@ -72,7 +72,7 @@ struct _nesapu_state }; -INLINE nesapu_state *get_safe_token(const device_config *device) +INLINE nesapu_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -687,7 +687,7 @@ static STREAM_UPDATE( nes_psg_update_sound ) /* INITIALIZE APU SYSTEM */ static DEVICE_START( nesapu ) { - const nes_interface *intf = (const nes_interface *)device->static_config; + const nes_interface *intf = (const nes_interface *)device->baseconfig().static_config; nesapu_state *info = get_safe_token(device); int rate = device->clock / 4; int i; diff --git a/src/emu/sound/nile.c b/src/emu/sound/nile.c index 8d6912d94cb..1c2be8ee84f 100644 --- a/src/emu/sound/nile.c +++ b/src/emu/sound/nile.c @@ -63,7 +63,7 @@ struct _nile_state UINT16 ctrl; }; -INLINE nile_state *get_safe_token(const device_config *device) +INLINE nile_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/sound/okim6258.c b/src/emu/sound/okim6258.c index e21ec375980..3b4beb49290 100644 --- a/src/emu/sound/okim6258.c +++ b/src/emu/sound/okim6258.c @@ -49,7 +49,7 @@ static int diff_lookup[49*16]; /* tables computed? */ static int tables_computed = 0; -INLINE okim6258_state *get_safe_token(const device_config *device) +INLINE okim6258_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -172,7 +172,7 @@ static STREAM_UPDATE( okim6258_update ) ***********************************************************************************************/ -static void okim6258_state_save_register(okim6258_state *info, const device_config *device) +static void okim6258_state_save_register(okim6258_state *info, running_device *device) { state_save_register_device_item(device, 0, info->status); state_save_register_device_item(device, 0, info->master_clock); @@ -192,7 +192,7 @@ static void okim6258_state_save_register(okim6258_state *info, const device_conf static DEVICE_START( okim6258 ) { - const okim6258_interface *intf = (const okim6258_interface *)device->static_config; + const okim6258_interface *intf = (const okim6258_interface *)device->baseconfig().static_config; okim6258_state *info = get_safe_token(device); compute_tables(); @@ -237,7 +237,7 @@ static DEVICE_RESET( okim6258 ) ***********************************************************************************************/ -void okim6258_set_divider(const device_config *device, int val) +void okim6258_set_divider(running_device *device, int val) { okim6258_state *info = get_safe_token(device); int divider = dividers[val]; @@ -253,7 +253,7 @@ void okim6258_set_divider(const device_config *device, int val) ***********************************************************************************************/ -void okim6258_set_clock(const device_config *device, int val) +void okim6258_set_clock(running_device *device, int val) { okim6258_state *info = get_safe_token(device); @@ -268,7 +268,7 @@ void okim6258_set_clock(const device_config *device, int val) ***********************************************************************************************/ -int okim6258_get_vclk(const device_config *device) +int okim6258_get_vclk(running_device *device) { okim6258_state *info = get_safe_token(device); diff --git a/src/emu/sound/okim6258.h b/src/emu/sound/okim6258.h index d949f160bba..82cb0f84708 100644 --- a/src/emu/sound/okim6258.h +++ b/src/emu/sound/okim6258.h @@ -24,9 +24,9 @@ struct _okim6258_interface #define OUTPUT_10BITS 0 #define OUTPUT_12BITS 1 -void okim6258_set_divider(const device_config *device, int val); -void okim6258_set_clock(const device_config *device, int val); -int okim6258_get_vclk(const device_config *device); +void okim6258_set_divider(running_device *device, int val); +void okim6258_set_clock(running_device *device, int val); +int okim6258_get_vclk(running_device *device); READ8_DEVICE_HANDLER( okim6258_status_r ); WRITE8_DEVICE_HANDLER( okim6258_data_w ); diff --git a/src/emu/sound/okim6295.c b/src/emu/sound/okim6295.c index 18ccb418d29..1200ce133d1 100644 --- a/src/emu/sound/okim6295.c +++ b/src/emu/sound/okim6295.c @@ -46,7 +46,7 @@ struct _okim6295_state { #define OKIM6295_VOICES 4 struct ADPCMVoice voice[OKIM6295_VOICES]; - const device_config *device; + running_device *device; INT32 command; UINT8 bank_installed; INT32 bank_offs; @@ -96,7 +96,7 @@ static ADDRESS_MAP_START( okim6295, 0, 8 ) ADDRESS_MAP_END -INLINE okim6295_state *get_safe_token(const device_config *device) +INLINE okim6295_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -302,7 +302,7 @@ static STREAM_UPDATE( okim6295_update ) ***********************************************************************************************/ -static void adpcm_state_save_register(struct ADPCMVoice *voice, const device_config *device, int index) +static void adpcm_state_save_register(struct ADPCMVoice *voice, running_device *device, int index) { state_save_register_device_item(device, index, voice->playing); state_save_register_device_item(device, index, voice->sample); @@ -315,12 +315,12 @@ static void adpcm_state_save_register(struct ADPCMVoice *voice, const device_con static STATE_POSTLOAD( okim6295_postload ) { - const device_config *device = (const device_config *)param; + running_device *device = (running_device *)param; okim6295_state *info = get_safe_token(device); okim6295_set_bank_base(device, info->bank_offs); } -static void okim6295_state_save_register(okim6295_state *info, const device_config *device) +static void okim6295_state_save_register(okim6295_state *info, running_device *device) { int j; @@ -342,7 +342,7 @@ static void okim6295_state_save_register(okim6295_state *info, const device_conf static DEVICE_START( okim6295 ) { - const okim6295_interface *intf = (const okim6295_interface *)device->static_config; + const okim6295_interface *intf = (const okim6295_interface *)device->baseconfig().static_config; okim6295_state *info = get_safe_token(device); int divisor = intf->pin7 ? 132 : 165; int voice; @@ -396,7 +396,7 @@ static DEVICE_RESET( okim6295 ) ***********************************************************************************************/ -void okim6295_set_bank_base(const device_config *device, int base) +void okim6295_set_bank_base(running_device *device, int base) { okim6295_state *info = get_safe_token(device); stream_update(info->stream); @@ -425,7 +425,7 @@ void okim6295_set_bank_base(const device_config *device, int base) ***********************************************************************************************/ -void okim6295_set_pin7(const device_config *device, int pin7) +void okim6295_set_pin7(running_device *device, int pin7) { okim6295_state *info = get_safe_token(device); int divisor = pin7 ? 132 : 165; diff --git a/src/emu/sound/okim6295.h b/src/emu/sound/okim6295.h index 3175066dded..f5b5b566eff 100644 --- a/src/emu/sound/okim6295.h +++ b/src/emu/sound/okim6295.h @@ -20,8 +20,8 @@ extern const okim6295_interface okim6295_interface_pin7low; -void okim6295_set_bank_base(const device_config *device, int base); -void okim6295_set_pin7(const device_config *device, int pin7); +void okim6295_set_bank_base(running_device *device, int base); +void okim6295_set_pin7(running_device *device, int pin7); READ8_DEVICE_HANDLER( okim6295_r ); WRITE8_DEVICE_HANDLER( okim6295_w ); diff --git a/src/emu/sound/okim6376.c b/src/emu/sound/okim6376.c index a1e694384cf..229b18d4ca5 100644 --- a/src/emu/sound/okim6376.c +++ b/src/emu/sound/okim6376.c @@ -63,7 +63,7 @@ static const int volume_table[4] = static int tables_computed = 0; -INLINE okim6376_state *get_safe_token(const device_config *device) +INLINE okim6376_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -268,7 +268,7 @@ static STREAM_UPDATE( okim6376_update ) ***********************************************************************************************/ -static void adpcm_state_save_register(struct ADPCMVoice *voice, const device_config *device, int index) +static void adpcm_state_save_register(struct ADPCMVoice *voice, running_device *device, int index) { state_save_register_device_item(device, index, voice->playing); state_save_register_device_item(device, index, voice->sample); @@ -279,7 +279,7 @@ static void adpcm_state_save_register(struct ADPCMVoice *voice, const device_con state_save_register_device_item(device, index, voice->base_offset); } -static void okim6376_state_save_register(okim6376_state *info, const device_config *device) +static void okim6376_state_save_register(okim6376_state *info, running_device *device) { int j; diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c index 2e1dd6fdacd..0ee9555956a 100644 --- a/src/emu/sound/pokey.c +++ b/src/emu/sound/pokey.c @@ -174,7 +174,7 @@ struct _pokey_state UINT32 r9; /* rand9 index */ UINT32 r17; /* rand17 index */ UINT32 clockmult; /* clock multiplier */ - const device_config *device; + running_device *device; sound_stream * channel; /* streams channel */ emu_timer *timer[3]; /* timers for channel 1,2 and 4 events */ attotime timer_period[3]; /* computed periods for these timers */ @@ -185,7 +185,7 @@ struct _pokey_state devcb_resolved_read8 allpot_r; devcb_resolved_read8 serin_r; devcb_resolved_write8 serout_w; - void (*interrupt_cb)(const device_config *device, int mask); + void (*interrupt_cb)(running_device *device, int mask); UINT8 AUDF[4]; /* AUDFx (D200, D202, D204, D206) */ UINT8 AUDC[4]; /* AUDCx (D201, D203, D205, D207) */ UINT8 POTx[8]; /* POTx (R/D200-D207) */ @@ -522,7 +522,7 @@ static TIMER_CALLBACK( pokey_pot_trigger ); #endif -INLINE pokey_state *get_safe_token(const device_config *device) +INLINE pokey_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -575,7 +575,7 @@ static void rand_init(UINT8 *rng, int size, int left, int right, int add) } -static void register_for_save(pokey_state *chip, const device_config *device) +static void register_for_save(pokey_state *chip, running_device *device) { state_save_register_device_item_array(device, 0, chip->counter); state_save_register_device_item_array(device, 0, chip->divisor); @@ -621,8 +621,8 @@ static DEVICE_START( pokey ) int sample_rate = device->clock; int i; - if (device->static_config) - memcpy(&chip->intf, device->static_config, sizeof(pokey_interface)); + if (device->baseconfig().static_config) + memcpy(&chip->intf, device->baseconfig().static_config, sizeof(pokey_interface)); chip->device = device; chip->clock_period = ATTOTIME_IN_HZ(device->clock); @@ -1338,13 +1338,13 @@ WRITE8_HANDLER( quad_pokey_w ) pokey_w(space->machine->device(devname[pokey_num]), pokey_reg, data); } -void pokey_serin_ready(const device_config *device, int after) +void pokey_serin_ready(running_device *device, int after) { pokey_state *p = get_safe_token(device); timer_set(device->machine, attotime_mul(p->clock_period, after), p, 0, pokey_serin_ready_cb); } -void pokey_break_w(const device_config *device, int shift) +void pokey_break_w(running_device *device, int shift) { pokey_state *p = get_safe_token(device); if( shift ) /* shift code ? */ @@ -1361,7 +1361,7 @@ void pokey_break_w(const device_config *device, int shift) } } -void pokey_kbcode_w(const device_config *device, int kbcode, int make) +void pokey_kbcode_w(running_device *device, int kbcode, int make) { pokey_state *p = get_safe_token(device); /* make code ? */ diff --git a/src/emu/sound/pokey.h b/src/emu/sound/pokey.h index 2e17d8e5e82..07ef062bbe9 100644 --- a/src/emu/sound/pokey.h +++ b/src/emu/sound/pokey.h @@ -73,7 +73,7 @@ struct _pokey_interface devcb_read8 allpot_r; devcb_read8 serin_r; devcb_write8 serout_w; - void (*interrupt_cb)(const device_config *device, int mask); + void (*interrupt_cb)(running_device *device, int mask); }; @@ -84,9 +84,9 @@ WRITE8_DEVICE_HANDLER( pokey_w ); READ8_HANDLER( quad_pokey_r ); WRITE8_HANDLER( quad_pokey_w ); -void pokey_serin_ready (const device_config *device, int after); -void pokey_break_w (const device_config *device, int shift); -void pokey_kbcode_w (const device_config *device, int kbcode, int make); +void pokey_serin_ready (running_device *device, int after); +void pokey_break_w (running_device *device, int shift); +void pokey_kbcode_w (running_device *device, int kbcode, int make); DEVICE_GET_INFO( pokey ); #define SOUND_POKEY DEVICE_GET_INFO_NAME( pokey ) diff --git a/src/emu/sound/psx.c b/src/emu/sound/psx.c index 9a059501330..58a2dc3e8e2 100644 --- a/src/emu/sound/psx.c +++ b/src/emu/sound/psx.c @@ -37,7 +37,7 @@ typedef enum { e_attack = 0, e_decay, e_sustain, e_sustainEnd, e_release, e_rele struct psxinfo { const psx_spu_interface *intf; - const device_config *device; + running_device *device; UINT32 *g_p_n_psxram; UINT16 m_n_mainvolumeleft; @@ -84,7 +84,7 @@ struct psxinfo int installHack; }; -INLINE struct psxinfo *get_safe_token(const device_config *device) +INLINE struct psxinfo *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -279,7 +279,7 @@ static DEVICE_START( psxspu ) int n_effect; int n_channel; - chip->intf = (const psx_spu_interface *)device->static_config; + chip->intf = (const psx_spu_interface *)device->baseconfig().static_config; chip->device = device; chip->g_p_n_psxram = *(chip->intf->p_psxram); diff --git a/src/emu/sound/psx.h b/src/emu/sound/psx.h index 95fcd31cded..7444048b670 100644 --- a/src/emu/sound/psx.h +++ b/src/emu/sound/psx.h @@ -22,7 +22,7 @@ typedef struct _psx_spu_interface psx_spu_interface; struct _psx_spu_interface { UINT32 **p_psxram; - void (*irq_set)(const device_config *,UINT32); + void (*irq_set)(running_device *,UINT32); void (*spu_install_read_handler)(int,spu_handler); void (*spu_install_write_handler)(int,spu_handler); }; diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c index 929ef314c54..aaae25e64c9 100644 --- a/src/emu/sound/qsound.c +++ b/src/emu/sound/qsound.c @@ -88,7 +88,7 @@ struct _qsound_state FILE *fpRawDataR; }; -INLINE qsound_state *get_safe_token(const device_config *device) +INLINE qsound_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/sound/rf5c400.c b/src/emu/sound/rf5c400.c index c640fa52004..669a131ded9 100644 --- a/src/emu/sound/rf5c400.c +++ b/src/emu/sound/rf5c400.c @@ -94,7 +94,7 @@ enum { }; -INLINE rf5c400_state *get_safe_token(const device_config *device) +INLINE rf5c400_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -240,7 +240,7 @@ static STREAM_UPDATE( rf5c400_update ) } } -static void rf5c400_init_chip(const device_config *device, rf5c400_state *info) +static void rf5c400_init_chip(running_device *device, rf5c400_state *info) { int i; diff --git a/src/emu/sound/rf5c68.c b/src/emu/sound/rf5c68.c index cb1b9cb18b6..4d5b8ff4f32 100644 --- a/src/emu/sound/rf5c68.c +++ b/src/emu/sound/rf5c68.c @@ -32,12 +32,12 @@ struct _rf5c68_state UINT8 wbank; UINT8 enable; UINT8 data[0x10000]; - void (*sample_callback)(const device_config* device,int channel); - const device_config* device; + void (*sample_callback)(running_device* device,int channel); + running_device* device; }; -INLINE rf5c68_state *get_safe_token(const device_config *device) +INLINE rf5c68_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -139,7 +139,7 @@ static STREAM_UPDATE( rf5c68_update ) static DEVICE_START( rf5c68 ) { - const rf5c68_interface* intf = (const rf5c68_interface*)device->static_config; + const rf5c68_interface* intf = (const rf5c68_interface*)device->baseconfig().static_config; /* allocate memory for the chip */ rf5c68_state *chip = get_safe_token(device); diff --git a/src/emu/sound/rf5c68.h b/src/emu/sound/rf5c68.h index 48e5573c5f4..7ef02a4aac3 100644 --- a/src/emu/sound/rf5c68.h +++ b/src/emu/sound/rf5c68.h @@ -16,7 +16,7 @@ WRITE8_DEVICE_HANDLER( rf5c68_mem_w ); typedef struct _rf5c68_interface rf5c68_interface; struct _rf5c68_interface { - void (*sample_end_callback)(const device_config* device, int channel); + void (*sample_end_callback)(running_device* device, int channel); }; DEVICE_GET_INFO( rf5c68 ); diff --git a/src/emu/sound/s14001a.c b/src/emu/sound/s14001a.c index 7cca2cdeee7..6e686fdae41 100644 --- a/src/emu/sound/s14001a.c +++ b/src/emu/sound/s14001a.c @@ -261,7 +261,7 @@ typedef struct UINT8 VSU1000_amp; // amplitude setting on VSU-1000 board } S14001AChip; -INLINE S14001AChip *get_safe_token(const device_config *device) +INLINE S14001AChip *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -586,7 +586,7 @@ static DEVICE_START( s14001a ) chip->stream = stream_create(device, 0, 1, device->clock ? device->clock : device->machine->sample_rate, chip, s14001a_pcm_update); } -int s14001a_bsy_r(const device_config *device) +int s14001a_bsy_r(running_device *device) { S14001AChip *chip = get_safe_token(device); stream_update(chip->stream); @@ -596,14 +596,14 @@ int s14001a_bsy_r(const device_config *device) return (chip->machineState != 0); } -void s14001a_reg_w(const device_config *device, int data) +void s14001a_reg_w(running_device *device, int data) { S14001AChip *chip = get_safe_token(device); stream_update(chip->stream); chip->WordInput = data; } -void s14001a_rst_w(const device_config *device, int data) +void s14001a_rst_w(running_device *device, int data) { S14001AChip *chip = get_safe_token(device); stream_update(chip->stream); @@ -612,13 +612,13 @@ void s14001a_rst_w(const device_config *device, int data) chip->machineState = chip->resetState ? 1 : chip->machineState; } -void s14001a_set_clock(const device_config *device, int clock) +void s14001a_set_clock(running_device *device, int clock) { S14001AChip *chip = get_safe_token(device); stream_set_sample_rate(chip->stream, clock); } -void s14001a_set_volume(const device_config *device, int volume) +void s14001a_set_volume(running_device *device, int volume) { S14001AChip *chip = get_safe_token(device); stream_update(chip->stream); diff --git a/src/emu/sound/s14001a.h b/src/emu/sound/s14001a.h index f465fb2df18..f10e08db1eb 100644 --- a/src/emu/sound/s14001a.h +++ b/src/emu/sound/s14001a.h @@ -3,11 +3,11 @@ #ifndef __S14001A_H__ #define __S14001A_H__ -int s14001a_bsy_r(const device_config *device); /* read BUSY pin */ -void s14001a_reg_w(const device_config *device, int data); /* write to input latch */ -void s14001a_rst_w(const device_config *device, int data); /* write to RESET pin */ -void s14001a_set_clock(const device_config *device, int clock); /* set VSU-1000 clock */ -void s14001a_set_volume(const device_config *device, int volume); /* set VSU-1000 volume control */ +int s14001a_bsy_r(running_device *device); /* read BUSY pin */ +void s14001a_reg_w(running_device *device, int data); /* write to input latch */ +void s14001a_rst_w(running_device *device, int data); /* write to RESET pin */ +void s14001a_set_clock(running_device *device, int clock); /* set VSU-1000 clock */ +void s14001a_set_volume(running_device *device, int volume); /* set VSU-1000 volume control */ DEVICE_GET_INFO( s14001a ); #define SOUND_S14001A DEVICE_GET_INFO_NAME( s14001a ) diff --git a/src/emu/sound/saa1099.c b/src/emu/sound/saa1099.c index cd19f562f29..15326e2e928 100644 --- a/src/emu/sound/saa1099.c +++ b/src/emu/sound/saa1099.c @@ -100,7 +100,7 @@ struct saa1099_noise typedef struct _saa1099_state saa1099_state; struct _saa1099_state { - const device_config *device; + running_device *device; sound_stream * stream; /* our stream */ int noise_params[2]; /* noise generators parameters */ int env_enable[2]; /* envelope generators enable */ @@ -168,7 +168,7 @@ static const UINT8 envelope[8][64] = { }; -INLINE saa1099_state *get_safe_token(const device_config *device) +INLINE saa1099_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/sound/samples.c b/src/emu/sound/samples.c index 611102facf9..b2620b0b8bc 100644 --- a/src/emu/sound/samples.c +++ b/src/emu/sound/samples.c @@ -23,14 +23,14 @@ struct _sample_channel typedef struct _samples_info samples_info; struct _samples_info { - const device_config *device; + running_device *device; int numchannels; /* how many channels */ sample_channel *channel;/* array of channels */ loaded_samples *samples;/* array of samples */ }; -INLINE samples_info *get_safe_token(const device_config *device) +INLINE samples_info *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -236,7 +236,7 @@ loaded_samples *readsamples(running_machine *machine, const char *const *samplen /* Start one of the samples loaded from disk. Note: channel must be in the range */ /* 0 .. Samplesinterface->channels-1. It is NOT the discrete channel to pass to */ /* mixer_play_sample() */ -void sample_start(const device_config *device,int channel,int samplenum,int loop) +void sample_start(running_device *device,int channel,int samplenum,int loop) { samples_info *info = get_safe_token(device); sample_channel *chan; @@ -267,7 +267,7 @@ void sample_start(const device_config *device,int channel,int samplenum,int loop } -void sample_start_raw(const device_config *device,int channel,const INT16 *sampledata,int samples,int frequency,int loop) +void sample_start_raw(running_device *device,int channel,const INT16 *sampledata,int samples,int frequency,int loop) { samples_info *info = get_safe_token(device); sample_channel *chan; @@ -291,7 +291,7 @@ void sample_start_raw(const device_config *device,int channel,const INT16 *sampl } -void sample_set_freq(const device_config *device,int channel,int freq) +void sample_set_freq(running_device *device,int channel,int freq) { samples_info *info = get_safe_token(device); sample_channel *chan; @@ -307,7 +307,7 @@ void sample_set_freq(const device_config *device,int channel,int freq) } -void sample_set_volume(const device_config *device,int channel,float volume) +void sample_set_volume(running_device *device,int channel,float volume) { samples_info *info = get_safe_token(device); sample_channel *chan; @@ -320,7 +320,7 @@ void sample_set_volume(const device_config *device,int channel,float volume) } -void sample_set_pause(const device_config *device,int channel,int pause) +void sample_set_pause(running_device *device,int channel,int pause) { samples_info *info = get_safe_token(device); sample_channel *chan; @@ -336,7 +336,7 @@ void sample_set_pause(const device_config *device,int channel,int pause) } -void sample_stop(const device_config *device,int channel) +void sample_stop(running_device *device,int channel) { samples_info *info = get_safe_token(device); sample_channel *chan; @@ -352,7 +352,7 @@ void sample_stop(const device_config *device,int channel) } -int sample_get_base_freq(const device_config *device,int channel) +int sample_get_base_freq(running_device *device,int channel) { samples_info *info = get_safe_token(device); sample_channel *chan; @@ -367,7 +367,7 @@ int sample_get_base_freq(const device_config *device,int channel) } -int sample_playing(const device_config *device,int channel) +int sample_playing(running_device *device,int channel) { samples_info *info = get_safe_token(device); sample_channel *chan; @@ -472,7 +472,7 @@ static STATE_POSTLOAD( samples_postload ) static DEVICE_START( samples ) { int i; - const samples_interface *intf = (const samples_interface *)device->static_config; + const samples_interface *intf = (const samples_interface *)device->baseconfig().static_config; samples_info *info = get_safe_token(device); info->device = device; diff --git a/src/emu/sound/samples.h b/src/emu/sound/samples.h index 27c52fe0832..f50085b158a 100644 --- a/src/emu/sound/samples.h +++ b/src/emu/sound/samples.h @@ -23,20 +23,20 @@ struct _samples_interface { int channels; /* number of discrete audio channels needed */ const char *const *samplenames; - void (*start)(const device_config *device); + void (*start)(running_device *device); }; -#define SAMPLES_START(name) void name(const device_config *device) +#define SAMPLES_START(name) void name(running_device *device) -void sample_start(const device_config *device,int channel,int samplenum,int loop); -void sample_start_raw(const device_config *device,int channel,const INT16 *sampledata,int samples,int frequency,int loop); -void sample_set_freq(const device_config *device,int channel,int freq); -void sample_set_volume(const device_config *device,int channel,float volume); -void sample_set_pause(const device_config *device,int channel,int pause); -void sample_stop(const device_config *device,int channel); -int sample_get_base_freq(const device_config *device,int channel); -int sample_playing(const device_config *device,int channel); +void sample_start(running_device *device,int channel,int samplenum,int loop); +void sample_start_raw(running_device *device,int channel,const INT16 *sampledata,int samples,int frequency,int loop); +void sample_set_freq(running_device *device,int channel,int freq); +void sample_set_volume(running_device *device,int channel,float volume); +void sample_set_pause(running_device *device,int channel,int pause); +void sample_stop(running_device *device,int channel); +int sample_get_base_freq(running_device *device,int channel); +int sample_playing(running_device *device,int channel); /* helper function that reads samples from disk - this can be used by other */ /* drivers as well (e.g. a sound chip emulator needing drum samples) */ diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c index d57cb365fff..06e6b706210 100644 --- a/src/emu/sound/scsp.c +++ b/src/emu/sound/scsp.c @@ -193,7 +193,7 @@ struct _SCSP unsigned char *SCSPRAM; UINT32 SCSPRAM_LENGTH; char Master; - void (*Int68kCB)(const device_config *device, int irq); + void (*Int68kCB)(running_device *device, int irq); sound_stream * stream; INT32 *buffertmpl,*buffertmpr; @@ -224,7 +224,7 @@ struct _SCSP struct _SCSPDSP DSP; - const device_config *device; + running_device *device; }; static void dma_scsp(const address_space *space, struct _SCSP *SCSP); /*SCSP DMA transfer function*/ @@ -244,7 +244,7 @@ static int length; static signed short *RBUFDST; //this points to where the sample will be stored in the RingBuf -INLINE SCSP *get_safe_token(const device_config *device) +INLINE SCSP *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -516,7 +516,7 @@ static void SCSP_StopSlot(struct _SLOT *slot,int keyoff) #define log_base_2(n) (log((double)(n))/log(2.0)) -static void SCSP_Init(const device_config *device, struct _SCSP *SCSP, const scsp_interface *intf) +static void SCSP_Init(running_device *device, struct _SCSP *SCSP, const scsp_interface *intf) { int i; @@ -1206,7 +1206,7 @@ static void dma_scsp(const address_space *space, struct _SCSP *SCSP) /*Job done,request a dma end irq*/ if(scsp_regs[0x1e/2] & 0x10) - cpu_set_input_line(space->machine->config->devicelist.find(CPU, 2),dma_transfer_end,HOLD_LINE); + cpu_set_input_line(space->machine->devicelist.find(CPU, 2),dma_transfer_end,HOLD_LINE); } #ifdef UNUSED_FUNCTION @@ -1232,7 +1232,7 @@ static DEVICE_START( scsp ) struct _SCSP *SCSP = get_safe_token(device); - intf = (const scsp_interface *)device->static_config; + intf = (const scsp_interface *)device->baseconfig().static_config; // init the emulation SCSP_Init(device, SCSP, intf); @@ -1246,7 +1246,7 @@ static DEVICE_START( scsp ) } -void scsp_set_ram_base(const device_config *device, void *base) +void scsp_set_ram_base(running_device *device, void *base) { struct _SCSP *SCSP = get_safe_token(device); if (SCSP) diff --git a/src/emu/sound/scsp.h b/src/emu/sound/scsp.h index ab197d595e7..998f7ce1a0c 100644 --- a/src/emu/sound/scsp.h +++ b/src/emu/sound/scsp.h @@ -11,10 +11,10 @@ typedef struct _scsp_interface scsp_interface; struct _scsp_interface { int roffset; /* offset in the region */ - void (*irq_callback)(const device_config *device, int state); /* irq callback */ + void (*irq_callback)(running_device *device, int state); /* irq callback */ }; -void scsp_set_ram_base(const device_config *device, void *base); +void scsp_set_ram_base(running_device *device, void *base); // SCSP register access READ16_DEVICE_HANDLER( scsp_r ); diff --git a/src/emu/sound/segapcm.c b/src/emu/sound/segapcm.c index 86e5f4b75cb..0a6a8b48f3b 100644 --- a/src/emu/sound/segapcm.c +++ b/src/emu/sound/segapcm.c @@ -17,7 +17,7 @@ struct _segapcm_state sound_stream * stream; }; -INLINE segapcm_state *get_safe_token(const device_config *device) +INLINE segapcm_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -88,7 +88,7 @@ static STREAM_UPDATE( SEGAPCM_update ) static DEVICE_START( segapcm ) { - const sega_pcm_interface *intf = (const sega_pcm_interface *)device->static_config; + const sega_pcm_interface *intf = (const sega_pcm_interface *)device->baseconfig().static_config; int mask, rom_mask, len; segapcm_state *spcm = get_safe_token(device); diff --git a/src/emu/sound/sid.h b/src/emu/sound/sid.h index 399e75bc414..25d8f46252d 100644 --- a/src/emu/sound/sid.h +++ b/src/emu/sound/sid.h @@ -15,10 +15,10 @@ /* private area */ typedef struct _SID6581 { - const device_config *device; + running_device *device; sound_stream *mixer_channel; // mame stream/ mixer channel - int (*ad_read) (const device_config *device, int which); + int (*ad_read) (running_device *device, int which); SIDTYPE type; UINT32 clock; diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c index f7ce4e4c07f..2eb966e5b91 100644 --- a/src/emu/sound/sid6581.c +++ b/src/emu/sound/sid6581.c @@ -12,7 +12,7 @@ -static SID6581 *get_sid(const device_config *device) +static SID6581 *get_sid(running_device *device) { assert(device != NULL); assert((sound_get_type(device) == SOUND_SID6581) || (sound_get_type(device) == SOUND_SID8580)); @@ -29,10 +29,10 @@ static STREAM_UPDATE( sid_update ) -static void sid_start(const device_config *device, SIDTYPE sidtype) +static void sid_start(running_device *device, SIDTYPE sidtype) { SID6581 *sid = get_sid(device); - const sid6581_interface *iface = (const sid6581_interface*) device->static_config; + const sid6581_interface *iface = (const sid6581_interface*) device->baseconfig().static_config; sid->device = device; sid->mixer_channel = stream_create (device, 0, 1, device->machine->sample_rate, (void *) sid, sid_update); diff --git a/src/emu/sound/sid6581.h b/src/emu/sound/sid6581.h index bf37dcad281..8da7ef2cd3e 100644 --- a/src/emu/sound/sid6581.h +++ b/src/emu/sound/sid6581.h @@ -22,7 +22,7 @@ typedef enum typedef struct _sid6581_interface sid6581_interface; struct _sid6581_interface { - int (*ad_read)(const device_config *device, int channel); + int (*ad_read)(running_device *device, int channel); } ; diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c index c50b9be6a7a..b78d2293dee 100644 --- a/src/emu/sound/sn76477.c +++ b/src/emu/sound/sn76477.c @@ -255,13 +255,13 @@ struct _sn76477_state /* others */ sound_stream *channel; /* returned by stream_create() */ int sample_rate; /* from machine->sample_rate */ - const device_config *device; + running_device *device; wav_file *file; /* handle of the wave file to produce */ }; -INLINE sn76477_state *get_safe_token(const device_config *device) +INLINE sn76477_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -1002,7 +1002,7 @@ static void SN76477_test_enable_w(sn76477_state *sn, UINT32 data) } -void sn76477_enable_w(const device_config *device, UINT32 data) +void sn76477_enable_w(running_device *device, UINT32 data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1027,7 +1027,7 @@ static void _SN76477_mixer_a_w(sn76477_state *sn, UINT32 data) } -void sn76477_mixer_a_w(const device_config *device, UINT32 data) +void sn76477_mixer_a_w(running_device *device, UINT32 data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1052,7 +1052,7 @@ static void _SN76477_mixer_b_w(sn76477_state *sn, UINT32 data) } -void sn76477_mixer_b_w(const device_config *device, UINT32 data) +void sn76477_mixer_b_w(running_device *device, UINT32 data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1077,7 +1077,7 @@ static void _SN76477_mixer_c_w(sn76477_state *sn, UINT32 data) } -void sn76477_mixer_c_w(const device_config *device, UINT32 data) +void sn76477_mixer_c_w(running_device *device, UINT32 data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1109,7 +1109,7 @@ static void _SN76477_envelope_1_w(sn76477_state *sn, UINT32 data) } -void sn76477_envelope_1_w(const device_config *device, UINT32 data) +void sn76477_envelope_1_w(running_device *device, UINT32 data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1134,7 +1134,7 @@ static void _SN76477_envelope_2_w(sn76477_state *sn, UINT32 data) } -void sn76477_envelope_2_w(const device_config *device, UINT32 data) +void sn76477_envelope_2_w(running_device *device, UINT32 data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1166,7 +1166,7 @@ static void _SN76477_vco_w(sn76477_state *sn, UINT32 data) } -void sn76477_vco_w(const device_config *device, UINT32 data) +void sn76477_vco_w(running_device *device, UINT32 data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1198,7 +1198,7 @@ static void _SN76477_one_shot_res_w(sn76477_state *sn, double data) } -void sn76477_one_shot_res_w(const device_config *device, double data) +void sn76477_one_shot_res_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1230,7 +1230,7 @@ static void _SN76477_one_shot_cap_w(sn76477_state *sn, double data) } -void sn76477_one_shot_cap_w(const device_config *device, double data) +void sn76477_one_shot_cap_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1256,7 +1256,7 @@ void sn76477_one_shot_cap_w(const device_config *device, double data) * *****************************************************************************/ -void sn76477_one_shot_cap_voltage_w(const device_config *device, double data) +void sn76477_one_shot_cap_voltage_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1305,7 +1305,7 @@ static void _SN76477_slf_res_w(sn76477_state *sn, double data) } -void sn76477_slf_res_w(const device_config *device, double data) +void sn76477_slf_res_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1337,7 +1337,7 @@ static void _SN76477_slf_cap_w(sn76477_state *sn, double data) } -void sn76477_slf_cap_w(const device_config *device, double data) +void sn76477_slf_cap_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1365,7 +1365,7 @@ void sn76477_slf_cap_w(const device_config *device, double data) * *****************************************************************************/ -void sn76477_slf_cap_voltage_w(const device_config *device, double data) +void sn76477_slf_cap_voltage_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1414,7 +1414,7 @@ static void _SN76477_vco_res_w(sn76477_state *sn, double data) } -void sn76477_vco_res_w(const device_config *device, double data) +void sn76477_vco_res_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1446,7 +1446,7 @@ static void _SN76477_vco_cap_w(sn76477_state *sn, double data) } -void sn76477_vco_cap_w(const device_config *device, double data) +void sn76477_vco_cap_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1472,7 +1472,7 @@ void sn76477_vco_cap_w(const device_config *device, double data) * *****************************************************************************/ -void sn76477_vco_cap_voltage_w(const device_config *device, double data) +void sn76477_vco_cap_voltage_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1521,7 +1521,7 @@ static void _SN76477_vco_voltage_w(sn76477_state *sn, double data) } -void sn76477_vco_voltage_w(const device_config *device, double data) +void sn76477_vco_voltage_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1554,7 +1554,7 @@ static void _SN76477_pitch_voltage_w(sn76477_state *sn, double data) } -void sn76477_pitch_voltage_w(const device_config *device, double data) +void sn76477_pitch_voltage_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1581,7 +1581,7 @@ void sn76477_pitch_voltage_w(const device_config *device, double data) * *****************************************************************************/ -void sn76477_noise_clock_w(const device_config *device, UINT32 data) +void sn76477_noise_clock_w(running_device *device, UINT32 data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1627,7 +1627,7 @@ static void _SN76477_noise_clock_res_w(sn76477_state *sn, double data) } -void sn76477_noise_clock_res_w(const device_config *device, double data) +void sn76477_noise_clock_res_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1660,7 +1660,7 @@ static void _SN76477_noise_filter_res_w(sn76477_state *sn, double data) } -void sn76477_noise_filter_res_w(const device_config *device, double data) +void sn76477_noise_filter_res_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1692,7 +1692,7 @@ static void _SN76477_noise_filter_cap_w(sn76477_state *sn, double data) } -void sn76477_noise_filter_cap_w(const device_config *device, double data) +void sn76477_noise_filter_cap_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1718,7 +1718,7 @@ void sn76477_noise_filter_cap_w(const device_config *device, double data) * *****************************************************************************/ -void sn76477_noise_filter_cap_voltage_w(const device_config *device, double data) +void sn76477_noise_filter_cap_voltage_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1767,7 +1767,7 @@ static void _SN76477_attack_res_w(sn76477_state *sn, double data) } -void sn76477_attack_res_w(const device_config *device, double data) +void sn76477_attack_res_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1799,7 +1799,7 @@ static void _SN76477_decay_res_w(sn76477_state *sn, double data) } -void sn76477_decay_res_w(const device_config *device, double data) +void sn76477_decay_res_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1831,7 +1831,7 @@ static void _SN76477_attack_decay_cap_w(sn76477_state *sn, double data) } -void sn76477_attack_decay_cap_w(const device_config *device, double data) +void sn76477_attack_decay_cap_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1858,7 +1858,7 @@ void sn76477_attack_decay_cap_w(const device_config *device, double data) * *****************************************************************************/ -void sn76477_attack_decay_cap_voltage_w(const device_config *device, double data) +void sn76477_attack_decay_cap_voltage_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1909,7 +1909,7 @@ static void _SN76477_amplitude_res_w(sn76477_state *sn, double data) } -void sn76477_amplitude_res_w(const device_config *device, double data) +void sn76477_amplitude_res_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -1941,7 +1941,7 @@ static void _SN76477_feedback_res_w(sn76477_state *sn, double data) } -void sn76477_feedback_res_w(const device_config *device, double data) +void sn76477_feedback_res_w(running_device *device, double data) { #if TEST_MODE == 0 sn76477_state *sn = get_safe_token(device); @@ -2330,7 +2330,7 @@ static STREAM_UPDATE( SN76477_update ) * *****************************************************************************/ -static void state_save_register(const device_config *device, sn76477_state *sn) +static void state_save_register(running_device *device, sn76477_state *sn) { state_save_register_device_item(device, 0, sn->enable); state_save_register_device_item(device, 0, sn->envelope_mode); @@ -2401,7 +2401,7 @@ static DEVICE_START( sn76477 ) #if TEST_MODE == 0 - intf = (sn76477_interface *)device->static_config; + intf = (sn76477_interface *)device->baseconfig().static_config; #else intf = &test_interface; #endif diff --git a/src/emu/sound/sn76477.h b/src/emu/sound/sn76477.h index 285957a00f1..45c9120b751 100644 --- a/src/emu/sound/sn76477.h +++ b/src/emu/sound/sn76477.h @@ -85,44 +85,44 @@ struct _sn76477_interface *****************************************************************************/ /* these functions take 0 or 1 as a logic input */ -void sn76477_enable_w(const device_config *device, UINT32 data); /* active LO, 0 = enabled, 1 = disabled */ -void sn76477_mixer_a_w(const device_config *device, UINT32 data); -void sn76477_mixer_b_w(const device_config *device, UINT32 data); -void sn76477_mixer_c_w(const device_config *device, UINT32 data); -void sn76477_envelope_1_w(const device_config *device, UINT32 data); -void sn76477_envelope_2_w(const device_config *device, UINT32 data); -void sn76477_vco_w(const device_config *device, UINT32 data); /* 0 = external, 1 = controlled by SLF */ -void sn76477_noise_clock_w(const device_config *device, UINT32 data); /* noise clock write, if noise_clock_res = 0 */ +void sn76477_enable_w(running_device *device, UINT32 data); /* active LO, 0 = enabled, 1 = disabled */ +void sn76477_mixer_a_w(running_device *device, UINT32 data); +void sn76477_mixer_b_w(running_device *device, UINT32 data); +void sn76477_mixer_c_w(running_device *device, UINT32 data); +void sn76477_envelope_1_w(running_device *device, UINT32 data); +void sn76477_envelope_2_w(running_device *device, UINT32 data); +void sn76477_vco_w(running_device *device, UINT32 data); /* 0 = external, 1 = controlled by SLF */ +void sn76477_noise_clock_w(running_device *device, UINT32 data); /* noise clock write, if noise_clock_res = 0 */ /* these functions take a resistor value in Ohms */ -void sn76477_one_shot_res_w(const device_config *device, double data); -void sn76477_slf_res_w(const device_config *device, double data); -void sn76477_vco_res_w(const device_config *device, double data); -void sn76477_noise_clock_res_w(const device_config *device, double data); /* = 0 if the noise gen is clocked via noise_clock */ -void sn76477_noise_filter_res_w(const device_config *device, double data); -void sn76477_decay_res_w(const device_config *device, double data); -void sn76477_attack_res_w(const device_config *device, double data); -void sn76477_amplitude_res_w(const device_config *device, double data); -void sn76477_feedback_res_w(const device_config *device, double data); +void sn76477_one_shot_res_w(running_device *device, double data); +void sn76477_slf_res_w(running_device *device, double data); +void sn76477_vco_res_w(running_device *device, double data); +void sn76477_noise_clock_res_w(running_device *device, double data); /* = 0 if the noise gen is clocked via noise_clock */ +void sn76477_noise_filter_res_w(running_device *device, double data); +void sn76477_decay_res_w(running_device *device, double data); +void sn76477_attack_res_w(running_device *device, double data); +void sn76477_amplitude_res_w(running_device *device, double data); +void sn76477_feedback_res_w(running_device *device, double data); /* these functions take a capacitor value in Farads or the voltage on it in Volts */ #define SN76477_EXTERNAL_VOLTAGE_DISCONNECT (-1.0) /* indicates that the voltage is internally computed, can be used in all the functions that take a voltage on a capacitor */ -void sn76477_one_shot_cap_w(const device_config *device, double data); -void sn76477_one_shot_cap_voltage_w(const device_config *device, double data); -void sn76477_slf_cap_w(const device_config *device, double data); -void sn76477_slf_cap_voltage_w(const device_config *device, double data); -void sn76477_vco_cap_w(const device_config *device, double data); -void sn76477_vco_cap_voltage_w(const device_config *device, double data); -void sn76477_noise_filter_cap_w(const device_config *device, double data); -void sn76477_noise_filter_cap_voltage_w(const device_config *device, double data); -void sn76477_attack_decay_cap_w(const device_config *device, double data); -void sn76477_attack_decay_cap_voltage_w(const device_config *device, double data); +void sn76477_one_shot_cap_w(running_device *device, double data); +void sn76477_one_shot_cap_voltage_w(running_device *device, double data); +void sn76477_slf_cap_w(running_device *device, double data); +void sn76477_slf_cap_voltage_w(running_device *device, double data); +void sn76477_vco_cap_w(running_device *device, double data); +void sn76477_vco_cap_voltage_w(running_device *device, double data); +void sn76477_noise_filter_cap_w(running_device *device, double data); +void sn76477_noise_filter_cap_voltage_w(running_device *device, double data); +void sn76477_attack_decay_cap_w(running_device *device, double data); +void sn76477_attack_decay_cap_voltage_w(running_device *device, double data); /* these functions take a voltage value in Volts */ -void sn76477_vco_voltage_w(const device_config *device, double data); -void sn76477_pitch_voltage_w(const device_config *device, double data); +void sn76477_vco_voltage_w(running_device *device, double data); +void sn76477_pitch_voltage_w(running_device *device, double data); DEVICE_GET_INFO( sn76477 ); #define SOUND_SN76477 DEVICE_GET_INFO_NAME( sn76477 ) diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c index dcec58dc527..76e84f670de 100644 --- a/src/emu/sound/sn76496.c +++ b/src/emu/sound/sn76496.c @@ -122,7 +122,7 @@ struct _sn76496_state }; -INLINE sn76496_state *get_safe_token(const device_config *device) +INLINE sn76496_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -340,7 +340,7 @@ static void SN76496_set_gain(sn76496_state *R,int gain) -static int SN76496_init(const device_config *device, sn76496_state *R, int stereo) +static int SN76496_init(running_device *device, sn76496_state *R, int stereo) { int sample_rate = device->clock/16; int i; @@ -377,7 +377,7 @@ static int SN76496_init(const device_config *device, sn76496_state *R, int stere } -static void generic_start(const device_config *device, int feedbackmask, int noisetaps, int feedbackinvert, int negate, int stereo) +static void generic_start(running_device *device, int feedbackmask, int noisetaps, int feedbackinvert, int negate, int stereo) { sn76496_state *chip = get_safe_token(device); diff --git a/src/emu/sound/snkwave.c b/src/emu/sound/snkwave.c index 77bd7be31c0..77f88c37d72 100644 --- a/src/emu/sound/snkwave.c +++ b/src/emu/sound/snkwave.c @@ -33,7 +33,7 @@ struct _snkwave_state INT16 waveform[WAVEFORM_LENGTH]; }; -INLINE snkwave_state *get_safe_token(const device_config *device) +INLINE snkwave_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -113,7 +113,7 @@ static DEVICE_START( snkwave ) { snkwave_state *chip = get_safe_token(device); - assert(device->static_config == 0); + assert(device->baseconfig().static_config == 0); /* adjust internal clock */ chip->external_clock = device->clock; diff --git a/src/emu/sound/sp0250.c b/src/emu/sound/sp0250.c index 61e2ee5bb5c..8b56f62c463 100644 --- a/src/emu/sound/sp0250.c +++ b/src/emu/sound/sp0250.c @@ -47,8 +47,8 @@ struct _sp0250_state UINT8 fifo[15]; int fifo_pos; - const device_config *device; - void (*drq)(const device_config *device, int state); + running_device *device; + void (*drq)(running_device *device, int state); struct { @@ -57,7 +57,7 @@ struct _sp0250_state } filter[6]; }; -INLINE sp0250_state *get_safe_token(const device_config *device) +INLINE sp0250_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -202,7 +202,7 @@ static STREAM_UPDATE( sp0250_update ) static DEVICE_START( sp0250 ) { - const struct sp0250_interface *intf = (const struct sp0250_interface *)device->static_config; + const struct sp0250_interface *intf = (const struct sp0250_interface *)device->baseconfig().static_config; sp0250_state *sp = get_safe_token(device); sp->device = device; @@ -233,7 +233,7 @@ WRITE8_DEVICE_HANDLER( sp0250_w ) } -UINT8 sp0250_drq_r(const device_config *device) +UINT8 sp0250_drq_r(running_device *device) { sp0250_state *sp = get_safe_token(device); stream_update(sp->stream); diff --git a/src/emu/sound/sp0250.h b/src/emu/sound/sp0250.h index 0bfc012c424..6acf20f7f97 100644 --- a/src/emu/sound/sp0250.h +++ b/src/emu/sound/sp0250.h @@ -4,11 +4,11 @@ #define __SP0250_H__ struct sp0250_interface { - void (*drq_callback)(const device_config *device, int state); + void (*drq_callback)(running_device *device, int state); }; WRITE8_DEVICE_HANDLER( sp0250_w ); -UINT8 sp0250_drq_r(const device_config *device); +UINT8 sp0250_drq_r(running_device *device); DEVICE_GET_INFO( sp0250 ); #define SOUND_SP0250 DEVICE_GET_INFO_NAME( sp0250 ) diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c index b8be8e6815d..d592dcb1f5b 100644 --- a/src/emu/sound/sp0256.c +++ b/src/emu/sound/sp0256.c @@ -76,7 +76,7 @@ struct lpc12_t typedef struct _sp0256_state sp0256_state; struct _sp0256_state { - const device_config *device; + running_device *device; sound_stream *stream; /* MAME core sound stream */ devcb_resolved_write_line drq; /* Data request callback */ devcb_resolved_write_line sby; /* Standby callback */ @@ -132,7 +132,7 @@ static const INT16 qtbl[128] = 504, 505, 506, 507, 508, 509, 510, 511 }; -INLINE sp0256_state *get_safe_token(const device_config *device) +INLINE sp0256_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -1180,7 +1180,7 @@ static STREAM_UPDATE( sp0256_update ) static DEVICE_START( sp0256 ) { - const sp0256_interface *intf = (const sp0256_interface *)device->static_config; + const sp0256_interface *intf = (const sp0256_interface *)device->baseconfig().static_config; sp0256_state *sp = get_safe_token(device); sp->device = device; diff --git a/src/emu/sound/speaker.c b/src/emu/sound/speaker.c index 569693860af..ced1b85741c 100644 --- a/src/emu/sound/speaker.c +++ b/src/emu/sound/speaker.c @@ -126,7 +126,7 @@ static double make_fraction(attotime a, attotime b, double timediv); static double get_filtered_volume(speaker_state *sp); -INLINE speaker_state *get_safe_token(const device_config *device) +INLINE speaker_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -139,7 +139,7 @@ INLINE speaker_state *get_safe_token(const device_config *device) static DEVICE_START( speaker ) { speaker_state *sp = get_safe_token(device); - const speaker_interface *intf = (const speaker_interface *) device->static_config; + const speaker_interface *intf = (const speaker_interface *) device->baseconfig().static_config; int i; double x; @@ -262,7 +262,7 @@ static STREAM_UPDATE( speaker_sound_update ) } /* speaker_sound_update */ -void speaker_level_w(const device_config *device, int new_level) +void speaker_level_w(running_device *device, int new_level) { speaker_state *sp = get_safe_token(device); int volume; diff --git a/src/emu/sound/speaker.h b/src/emu/sound/speaker.h index 79ed35c0377..1881709ea02 100644 --- a/src/emu/sound/speaker.h +++ b/src/emu/sound/speaker.h @@ -23,7 +23,7 @@ struct _speaker_interface const INT16 *levels; /* optional: pointer to level lookup table */ }; -void speaker_level_w (const device_config *device, int new_level); +void speaker_level_w (running_device *device, int new_level); DEVICE_GET_INFO( speaker ); #define SOUND_SPEAKER DEVICE_GET_INFO_NAME( speaker ) diff --git a/src/emu/sound/st0016.c b/src/emu/sound/st0016.c index e30f172611e..633fb80b18d 100644 --- a/src/emu/sound/st0016.c +++ b/src/emu/sound/st0016.c @@ -19,7 +19,7 @@ struct _st0016_state UINT8 regs[0x100]; }; -INLINE st0016_state *get_safe_token(const device_config *device) +INLINE st0016_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -140,7 +140,7 @@ static STREAM_UPDATE( st0016_update ) static DEVICE_START( st0016 ) { - const st0016_interface *intf = (const st0016_interface *)device->static_config; + const st0016_interface *intf = (const st0016_interface *)device->baseconfig().static_config; st0016_state *info = get_safe_token(device); info->sound_ram = intf->p_soundram; diff --git a/src/emu/sound/t6w28.c b/src/emu/sound/t6w28.c index ba83494d6e1..2e38fc03c59 100644 --- a/src/emu/sound/t6w28.c +++ b/src/emu/sound/t6w28.c @@ -58,7 +58,7 @@ struct _t6w28_state }; -INLINE t6w28_state *get_safe_token(const device_config *device) +INLINE t6w28_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -307,7 +307,7 @@ static void t6w28_set_gain(t6w28_state *R,int gain) -static int t6w28_init(const device_config *device, t6w28_state *R) +static int t6w28_init(running_device *device, t6w28_state *R) { int sample_rate = device->clock/16; int i; diff --git a/src/emu/sound/tiaintf.c b/src/emu/sound/tiaintf.c index df97fecbd8b..8135ff7fe39 100644 --- a/src/emu/sound/tiaintf.c +++ b/src/emu/sound/tiaintf.c @@ -10,7 +10,7 @@ struct _tia_state void *chip; }; -INLINE tia_state *get_safe_token(const device_config *device) +INLINE tia_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/emu/sound/tms3615.c b/src/emu/sound/tms3615.c index 185736d956b..d21e998f5f9 100644 --- a/src/emu/sound/tms3615.c +++ b/src/emu/sound/tms3615.c @@ -21,7 +21,7 @@ struct _tms_state { int enable; /* mask which tones to play */ }; -INLINE tms_state *get_safe_token(const device_config *device) +INLINE tms_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -82,7 +82,7 @@ static STREAM_UPDATE( tms3615_sound_update ) tms->enable = 0; } -void tms3615_enable_w(const device_config *device, int enable) +void tms3615_enable_w(running_device *device, int enable) { tms_state *tms = get_safe_token(device); tms->enable = enable; diff --git a/src/emu/sound/tms3615.h b/src/emu/sound/tms3615.h index b1d14d14eb9..46b20287313 100644 --- a/src/emu/sound/tms3615.h +++ b/src/emu/sound/tms3615.h @@ -3,7 +3,7 @@ #ifndef __TMS3615_H__ #define __TMS3615_H__ -extern void tms3615_enable_w(const device_config *device, int enable); +extern void tms3615_enable_w(running_device *device, int enable); #define TMS3615_FOOTAGE_8 0 #define TMS3615_FOOTAGE_16 1 diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c index d7ebd5d550e..b2ff1b2fa2e 100644 --- a/src/emu/sound/tms36xx.c +++ b/src/emu/sound/tms36xx.c @@ -341,7 +341,7 @@ static const int *const tunes[] = {NULL,tune1,tune2,tune3,tune4}; } -INLINE tms_state *get_safe_token(const device_config *device) +INLINE tms_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -411,7 +411,7 @@ static void tms36xx_reset_counters(tms_state *tms) memset(tms->counter, 0, sizeof(tms->counter)); } -void mm6221aa_tune_w(const device_config *device, int tune) +void mm6221aa_tune_w(running_device *device, int tune) { tms_state *tms = get_safe_token(device); @@ -430,7 +430,7 @@ void mm6221aa_tune_w(const device_config *device, int tune) tms->tune_max = 96; /* fixed for now */ } -void tms36xx_note_w(const device_config *device, int octave, int note) +void tms36xx_note_w(running_device *device, int octave, int note) { tms_state *tms = get_safe_token(device); @@ -489,7 +489,7 @@ static void tms3617_enable(tms_state *tms, int enable) LOG(("%s\n", bits ? "" : " none")); } -void tms3617_enable_w(const device_config *device, int enable) +void tms3617_enable_w(running_device *device, int enable) { tms_state *tms = get_safe_token(device); tms3617_enable(tms, enable); @@ -501,7 +501,7 @@ static DEVICE_START( tms36xx ) tms_state *tms = get_safe_token(device); int enable; - tms->intf = (const tms36xx_interface *)device->static_config; + tms->intf = (const tms36xx_interface *)device->baseconfig().static_config; tms->channel = stream_create(device, 0, 1, device->clock * 64, tms, tms36xx_sound_update); tms->samplerate = device->clock * 64; diff --git a/src/emu/sound/tms36xx.h b/src/emu/sound/tms36xx.h index 27d5d255739..2870b1b0d0f 100644 --- a/src/emu/sound/tms36xx.h +++ b/src/emu/sound/tms36xx.h @@ -18,13 +18,13 @@ struct _tms36xx_interface }; /* MM6221AA interface functions */ -extern void mm6221aa_tune_w(const device_config *device, int tune); +extern void mm6221aa_tune_w(running_device *device, int tune); /* TMS3615/17 interface functions */ -extern void tms36xx_note_w(const device_config *device, int octave, int note); +extern void tms36xx_note_w(running_device *device, int octave, int note); /* TMS3617 interface functions */ -extern void tms3617_enable_w(const device_config *device, int enable); +extern void tms3617_enable_w(running_device *device, int enable); DEVICE_GET_INFO( tms36xx ); #define SOUND_TMS36XX DEVICE_GET_INFO_NAME( tms36xx ) diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c index 401efed217e..d64c0c43c78 100644 --- a/src/emu/sound/tms5110.c +++ b/src/emu/sound/tms5110.c @@ -138,9 +138,9 @@ struct _tms5110_state UINT8 addr_bit; /* external callback */ - int (*M0_callback)(const device_config *); - void (*set_load_address)(const device_config *, int); - const device_config *device; + int (*M0_callback)(running_device *); + void (*set_load_address)(running_device *, int); + running_device *device; /* these contain data describing the current and previous voice frames */ UINT16 old_energy; @@ -185,7 +185,7 @@ struct _tms5110_state -INLINE tms5110_state *get_safe_token(const device_config *device) +INLINE tms5110_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -908,7 +908,7 @@ static const unsigned int example_word_TEN[619]={ #endif -static int speech_rom_read_bit(const device_config *device) +static int speech_rom_read_bit(running_device *device) { tms5110_state *tms = get_safe_token(device); @@ -924,7 +924,7 @@ static int speech_rom_read_bit(const device_config *device) return r; } -static void speech_rom_set_addr(const device_config *device, int addr) +static void speech_rom_set_addr(running_device *device, int addr) { tms5110_state *tms = get_safe_token(device); @@ -942,7 +942,7 @@ static DEVICE_START( tms5110 ) static const tms5110_interface dummy = { 0 }; tms5110_state *tms = get_safe_token(device); - tms->intf = device->static_config ? (const tms5110_interface *)device->static_config : &dummy; + tms->intf = device->baseconfig().static_config ? (const tms5110_interface *)device->baseconfig().static_config : &dummy; tms->table = *device->region; tms->device = device; @@ -1130,7 +1130,7 @@ READ8_DEVICE_HANDLER( m58817_status_r ) static TIMER_CALLBACK( romclk_timer_cb ) { - tms5110_state *tms = get_safe_token((const device_config *) ptr); + tms5110_state *tms = get_safe_token((running_device *) ptr); tms->romclk_state = !tms->romclk_state; } @@ -1158,7 +1158,7 @@ READ8_DEVICE_HANDLER( tms5110_romclk_r ) ******************************************************************************/ -int tms5110_ready_r(const device_config *device) +int tms5110_ready_r(running_device *device) { tms5110_state *tms = get_safe_token(device); @@ -1205,7 +1205,7 @@ static STREAM_UPDATE( tms5110_update ) ******************************************************************************/ -void tms5110_set_frequency(const device_config *device, int frequency) +void tms5110_set_frequency(running_device *device, int frequency) { tms5110_state *tms = get_safe_token(device); stream_set_sample_rate(tms->stream, frequency / 80); diff --git a/src/emu/sound/tms5110.h b/src/emu/sound/tms5110.h index ee93c0e0e27..2d7f9724535 100644 --- a/src/emu/sound/tms5110.h +++ b/src/emu/sound/tms5110.h @@ -21,8 +21,8 @@ typedef struct _tms5110_interface tms5110_interface; struct _tms5110_interface { - int (*M0_callback)(const device_config *device); /* function to be called when chip requests another bit */ - void (*load_address)(const device_config *device, int addr); /* speech ROM load address callback */ + int (*M0_callback)(running_device *device); /* function to be called when chip requests another bit */ + void (*load_address)(running_device *device, int addr); /* speech ROM load address callback */ }; WRITE8_DEVICE_HANDLER( tms5110_ctl_w ); @@ -34,9 +34,9 @@ READ8_DEVICE_HANDLER( tms5110_romclk_r ); /* m58817 status line */ READ8_DEVICE_HANDLER( m58817_status_r ); -int tms5110_ready_r(const device_config *device); +int tms5110_ready_r(running_device *device); -void tms5110_set_frequency(const device_config *device, int frequency); +void tms5110_set_frequency(running_device *device, int frequency); DEVICE_GET_INFO( tms5110 ); DEVICE_GET_INFO( tms5100 ); diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c index d434b517fde..f14459d111f 100644 --- a/src/emu/sound/tms5220.c +++ b/src/emu/sound/tms5220.c @@ -279,7 +279,7 @@ struct _tms5220_state resolution of the output data. */ UINT8 digital_select; - const device_config *device; + running_device *device; const tms5220_interface *intf; sound_stream *stream; @@ -287,7 +287,7 @@ struct _tms5220_state }; -INLINE tms5220_state *get_safe_token(const device_config *device) +INLINE tms5220_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -1220,7 +1220,7 @@ static DEVICE_START( tms5220 ) tms5220_state *tms = get_safe_token(device); /* set the interface and device */ - tms->intf = device->static_config ? (const tms5220_interface *)device->static_config : &dummy; + tms->intf = device->baseconfig().static_config ? (const tms5220_interface *)device->baseconfig().static_config : &dummy; tms->device = device; tms->clock = device->clock; @@ -1495,7 +1495,7 @@ READ_LINE_DEVICE_HANDLER( tms5220_readyq_r ) ***********************************************************************************************/ -double tms5220_time_to_ready(const device_config *device) +double tms5220_time_to_ready(running_device *device) { tms5220_state *tms = get_safe_token(device); double cycles; @@ -1560,7 +1560,7 @@ static STREAM_UPDATE( tms5220_update ) ***********************************************************************************************/ -void tms5220_set_frequency(const device_config *device, int frequency) +void tms5220_set_frequency(running_device *device, int frequency) { tms5220_state *tms = get_safe_token(device); stream_set_sample_rate(tms->stream, frequency / 80); diff --git a/src/emu/sound/tms5220.h b/src/emu/sound/tms5220.h index 024ca089e44..3c5a9e69e26 100644 --- a/src/emu/sound/tms5220.h +++ b/src/emu/sound/tms5220.h @@ -13,9 +13,9 @@ struct _tms5220_interface { devcb_write_line irq_func; /* IRQ callback function */ - int (*read)(const device_config *device, int count); /* speech ROM read callback */ - void (*load_address)(const device_config *device, int data); /* speech ROM load address callback */ - void (*read_and_branch)(const device_config *device); /* speech ROM read and branch callback */ + int (*read)(running_device *device, int count); /* speech ROM read callback */ + void (*load_address)(running_device *device, int data); /* speech ROM load address callback */ + void (*read_and_branch)(running_device *device); /* speech ROM read and branch callback */ }; /* Control lines - once written to will switch interface into @@ -34,9 +34,9 @@ READ_LINE_DEVICE_HANDLER( tms5220_readyq_r ); READ_LINE_DEVICE_HANDLER( tms5220_intq_r ); -double tms5220_time_to_ready(const device_config *device); +double tms5220_time_to_ready(running_device *device); -void tms5220_set_frequency(const device_config *device, int frequency); +void tms5220_set_frequency(running_device *device, int frequency); DEVICE_GET_INFO( tms5220c ); DEVICE_GET_INFO( tms5220 ); diff --git a/src/emu/sound/upd7759.c b/src/emu/sound/upd7759.c index c81d37bceba..4e575b8884b 100644 --- a/src/emu/sound/upd7759.c +++ b/src/emu/sound/upd7759.c @@ -147,7 +147,7 @@ enum typedef struct _upd7759_state upd7759_state; struct _upd7759_state { - const device_config *device; + running_device *device; sound_stream *channel; /* stream channel for playback */ /* internal clock to output sample rate mapping */ @@ -161,7 +161,7 @@ struct _upd7759_state UINT8 reset; /* current state of the RESET line */ UINT8 start; /* current state of the START line */ UINT8 drq; /* current state of the DRQ line */ - void (*drqcallback)(const device_config *device, int param); /* drq callback */ + void (*drqcallback)(running_device *device, int param); /* drq callback */ /* internal state machine */ INT8 state; /* current overall chip state */ @@ -221,7 +221,7 @@ static const int upd7759_state_table[16] = { -1, -1, 0, 0, 1, 2, 2, 3, -1, -1, 0 -INLINE upd7759_state *get_safe_token(const device_config *device) +INLINE upd7759_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -602,7 +602,7 @@ static STATE_POSTLOAD( upd7759_postload ) } -static void register_for_save(upd7759_state *chip, const device_config *device) +static void register_for_save(upd7759_state *chip, running_device *device) { state_save_register_device_item(device, 0, chip->pos); state_save_register_device_item(device, 0, chip->step); @@ -638,7 +638,7 @@ static void register_for_save(upd7759_state *chip, const device_config *device) static DEVICE_START( upd7759 ) { static const upd7759_interface defintrf = { 0 }; - const upd7759_interface *intf = (device->static_config != NULL) ? (const upd7759_interface *)device->static_config : &defintrf; + const upd7759_interface *intf = (device->baseconfig().static_config != NULL) ? (const upd7759_interface *)device->baseconfig().static_config : &defintrf; upd7759_state *chip = get_safe_token(device); chip->device = device; @@ -681,7 +681,7 @@ static DEVICE_START( upd7759 ) *************************************************************/ -void upd7759_reset_w(const device_config *device, UINT8 data) +void upd7759_reset_w(running_device *device, UINT8 data) { /* update the reset value */ upd7759_state *chip = get_safe_token(device); @@ -696,7 +696,7 @@ void upd7759_reset_w(const device_config *device, UINT8 data) upd7759_reset(chip); } -void upd7759_start_w(const device_config *device, UINT8 data) +void upd7759_start_w(running_device *device, UINT8 data) { /* update the start value */ upd7759_state *chip = get_safe_token(device); @@ -728,7 +728,7 @@ WRITE8_DEVICE_HANDLER( upd7759_port_w ) } -int upd7759_busy_r(const device_config *device) +int upd7759_busy_r(running_device *device) { /* return /BUSY */ upd7759_state *chip = get_safe_token(device); @@ -736,7 +736,7 @@ int upd7759_busy_r(const device_config *device) } -void upd7759_set_bank_base(const device_config *device, UINT32 base) +void upd7759_set_bank_base(running_device *device, UINT32 base) { upd7759_state *chip = get_safe_token(device); chip->rom = chip->rombase + base; diff --git a/src/emu/sound/upd7759.h b/src/emu/sound/upd7759.h index 150bf70f72c..ddc4490e9f2 100644 --- a/src/emu/sound/upd7759.h +++ b/src/emu/sound/upd7759.h @@ -13,14 +13,14 @@ typedef struct _upd7759_interface upd7759_interface; struct _upd7759_interface { - void (*drqcallback)(const device_config *device, int param); /* drq callback (per chip, slave mode only) */ + void (*drqcallback)(running_device *device, int param); /* drq callback (per chip, slave mode only) */ }; -void upd7759_set_bank_base(const device_config *device, offs_t base); +void upd7759_set_bank_base(running_device *device, offs_t base); -void upd7759_reset_w(const device_config *device, UINT8 data); -void upd7759_start_w(const device_config *device, UINT8 data); -int upd7759_busy_r(const device_config *device); +void upd7759_reset_w(running_device *device, UINT8 data); +void upd7759_start_w(running_device *device, UINT8 data); +int upd7759_busy_r(running_device *device); WRITE8_DEVICE_HANDLER( upd7759_port_w ); DEVICE_GET_INFO( upd7759 ); diff --git a/src/emu/sound/vlm5030.c b/src/emu/sound/vlm5030.c index 2e41f422e71..0fea930600b 100644 --- a/src/emu/sound/vlm5030.c +++ b/src/emu/sound/vlm5030.c @@ -89,7 +89,7 @@ chirp 12-..: vokume 0 : silent typedef struct _vlm5030_state vlm5030_state; struct _vlm5030_state { - const device_config *device; + running_device *device; const vlm5030_interface *intf; sound_stream * channel; @@ -219,7 +219,7 @@ static const INT16 K5_table[] = { 0, -8127, -16384, -24511, 32638, 24511, 16254, 8127 }; -INLINE vlm5030_state *get_safe_token(const device_config *device) +INLINE vlm5030_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -532,14 +532,14 @@ static DEVICE_RESET( vlm5030 ) /* set speech rom address */ -void vlm5030_set_rom(const device_config *device, void *speech_rom) +void vlm5030_set_rom(running_device *device, void *speech_rom) { vlm5030_state *chip = get_safe_token(device); chip->rom = (UINT8 *)speech_rom; } /* get BSY pin level */ -int vlm5030_bsy(const device_config *device) +int vlm5030_bsy(running_device *device) { vlm5030_state *chip = get_safe_token(device); vlm5030_update(chip); @@ -554,7 +554,7 @@ WRITE8_DEVICE_HANDLER( vlm5030_data_w ) } /* set RST pin level : reset / set table address A8-A15 */ -void vlm5030_rst (const device_config *device, int pin ) +void vlm5030_rst (running_device *device, int pin ) { vlm5030_state *chip = get_safe_token(device); if( chip->pin_RST ) @@ -579,7 +579,7 @@ void vlm5030_rst (const device_config *device, int pin ) } /* set VCU pin level : ?? unknown */ -void vlm5030_vcu(const device_config *device, int pin) +void vlm5030_vcu(running_device *device, int pin) { vlm5030_state *chip = get_safe_token(device); /* direct mode / indirect mode */ @@ -588,7 +588,7 @@ void vlm5030_vcu(const device_config *device, int pin) } /* set ST pin level : set table address A0-A7 / start speech */ -void vlm5030_st(const device_config *device, int pin ) +void vlm5030_st(running_device *device, int pin ) { vlm5030_state *chip = get_safe_token(device); int table; @@ -654,7 +654,7 @@ static DEVICE_START( vlm5030 ) vlm5030_state *chip = get_safe_token(device); chip->device = device; - chip->intf = (device->static_config != NULL) ? (const vlm5030_interface *)device->static_config : &defintrf; + chip->intf = (device->baseconfig().static_config != NULL) ? (const vlm5030_interface *)device->baseconfig().static_config : &defintrf; emulation_rate = device->clock / 440; diff --git a/src/emu/sound/vlm5030.h b/src/emu/sound/vlm5030.h index 6efc9e0b8b1..fa4651c7ed0 100644 --- a/src/emu/sound/vlm5030.h +++ b/src/emu/sound/vlm5030.h @@ -10,18 +10,18 @@ struct _vlm5030_interface }; /* set speech rom address */ -void vlm5030_set_rom(const device_config *device, void *speech_rom); +void vlm5030_set_rom(running_device *device, void *speech_rom); /* get BSY pin level */ -int vlm5030_bsy(const device_config *device); +int vlm5030_bsy(running_device *device); /* latch contoll data */ WRITE8_DEVICE_HANDLER( vlm5030_data_w ); /* set RST pin level : reset / set table address A8-A15 */ -void vlm5030_rst (const device_config *device, int pin ); +void vlm5030_rst (running_device *device, int pin ); /* set VCU pin level : ?? unknown */ -void vlm5030_vcu(const device_config *device, int pin ); +void vlm5030_vcu(running_device *device, int pin ); /* set ST pin level : set table address A0-A7 / start speech */ -void vlm5030_st(const device_config *device, int pin ); +void vlm5030_st(running_device *device, int pin ); DEVICE_GET_INFO( vlm5030 ); #define SOUND_VLM5030 DEVICE_GET_INFO_NAME( vlm5030 ) diff --git a/src/emu/sound/votrax.c b/src/emu/sound/votrax.c index 0dbc9ac6d23..21bd3a19eb1 100644 --- a/src/emu/sound/votrax.c +++ b/src/emu/sound/votrax.c @@ -24,7 +24,7 @@ the variable VotraxBaseFrequency, this is defaulted to 8000 typedef struct _votrax_state votrax_state; struct _votrax_state { - const device_config *device; + running_device *device; int stream; int frequency; /* Some games (Qbert) change this */ int volume; @@ -38,7 +38,7 @@ struct _votrax_state struct loaded_samples *samples; }; -INLINE votrax_state *get_safe_token(const device_config *device) +INLINE votrax_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -152,7 +152,7 @@ WRITE8_DEVICE_HANDLER( votrax_w ) } } -int votrax_status_r(const device_config *device) +int votrax_status_r(running_device *device) { votrax_state *info = get_safe_token(device); stream_update(info->channel); diff --git a/src/emu/sound/votrax.h b/src/emu/sound/votrax.h index abe8b632748..8cc1aeb305c 100644 --- a/src/emu/sound/votrax.h +++ b/src/emu/sound/votrax.h @@ -4,7 +4,7 @@ #define __VOTRAX_H__ WRITE8_DEVICE_HANDLER( votrax_w ); -int votrax_status_r(const device_config *device); +int votrax_status_r(running_device *device); DEVICE_GET_INFO( votrax ); #define SOUND_VOTRAX DEVICE_GET_INFO_NAME( votrax ) diff --git a/src/emu/sound/vrender0.c b/src/emu/sound/vrender0.c index 3472b57d817..4bd4337bdba 100644 --- a/src/emu/sound/vrender0.c +++ b/src/emu/sound/vrender0.c @@ -23,7 +23,7 @@ struct _vr0_state sound_stream * stream; }; -INLINE vr0_state *get_safe_token(const device_config *device) +INLINE vr0_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -96,7 +96,7 @@ static const unsigned short ULawTo16[]= #define LOOPEND(chan) (GETSOUNDREG32(chan,0x10)&0x3fffff) #define ENVVOL(chan) (GETSOUNDREG32(chan,0x04)&0xffffff) */ -void vr0_snd_set_areas(const device_config *device,UINT32 *texture,UINT32 *frame) +void vr0_snd_set_areas(running_device *device,UINT32 *texture,UINT32 *frame) { vr0_state *VR0 = get_safe_token(device); VR0->TexBase=texture; @@ -108,7 +108,7 @@ static DEVICE_START( vrender0 ) const vr0_interface *intf; vr0_state *VR0 = get_safe_token(device); - intf=(const vr0_interface *)device->static_config; + intf=(const vr0_interface *)device->baseconfig().static_config; memcpy(&(VR0->Intf),intf,sizeof(vr0_interface)); memset(VR0->SOUNDREGS,0,sizeof(VR0->SOUNDREGS)); diff --git a/src/emu/sound/vrender0.h b/src/emu/sound/vrender0.h index abeab068c09..1361d6fb67a 100644 --- a/src/emu/sound/vrender0.h +++ b/src/emu/sound/vrender0.h @@ -10,7 +10,7 @@ struct _vr0_interface UINT32 RegBase; }; -void vr0_snd_set_areas(const device_config *device,UINT32 *texture,UINT32 *frame); +void vr0_snd_set_areas(running_device *device,UINT32 *texture,UINT32 *frame); READ32_DEVICE_HANDLER( vr0_snd_read ); WRITE32_DEVICE_HANDLER( vr0_snd_write ); diff --git a/src/emu/sound/wave.c b/src/emu/sound/wave.c index bd2a64e795d..4d82a83c34a 100644 --- a/src/emu/sound/wave.c +++ b/src/emu/sound/wave.c @@ -22,7 +22,7 @@ static STREAM_UPDATE( wave_sound_update ) { #ifdef MESS - const device_config *image = param; + running_device *image = param; cassette_image *cassette; cassette_state state; double time_index; @@ -62,13 +62,13 @@ static STREAM_UPDATE( wave_sound_update ) static DEVICE_START( wave ) { - const device_config *image = NULL; + running_device *image = NULL; assert( device != NULL ); - assert( device->static_config != NULL ); + assert( device->baseconfig().static_config != NULL ); #ifdef MESS - image = device->machine->device( (const char *)device->static_config ); + image = device->machine->device( (const char *)device->baseconfig().static_config ); #endif stream_create(device, 0, 2, device->machine->sample_rate, (void *)image, wave_sound_update); } diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c index 830a0f29763..d3b7e161d93 100644 --- a/src/emu/sound/x1_010.c +++ b/src/emu/sound/x1_010.c @@ -98,7 +98,7 @@ struct _x1_010_state /* mixer tables and internal buffers */ //static short *mixer_buffer = NULL; -INLINE x1_010_state *get_safe_token(const device_config *device) +INLINE x1_010_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -203,7 +203,7 @@ static STREAM_UPDATE( seta_update ) static DEVICE_START( x1_010 ) { int i; - const x1_010_interface *intf = (const x1_010_interface *)device->static_config; + const x1_010_interface *intf = (const x1_010_interface *)device->baseconfig().static_config; x1_010_state *info = get_safe_token(device); info->region = *device->region; @@ -223,7 +223,7 @@ static DEVICE_START( x1_010 ) } -void seta_sound_enable_w(const device_config *device, int data) +void seta_sound_enable_w(running_device *device, int data) { x1_010_state *info = get_safe_token(device); info->sound_enable = data; diff --git a/src/emu/sound/x1_010.h b/src/emu/sound/x1_010.h index 1d75f4b5b2a..5d975fb1cf9 100644 --- a/src/emu/sound/x1_010.h +++ b/src/emu/sound/x1_010.h @@ -17,7 +17,7 @@ WRITE8_DEVICE_HANDLER( seta_sound_w ); READ16_DEVICE_HANDLER ( seta_sound_word_r ); WRITE16_DEVICE_HANDLER( seta_sound_word_w ); -void seta_sound_enable_w(const device_config *device, int data); +void seta_sound_enable_w(running_device *device, int data); DEVICE_GET_INFO( x1_010 ); #define SOUND_X1_010 DEVICE_GET_INFO_NAME( x1_010 ) diff --git a/src/emu/sound/ym2151.c b/src/emu/sound/ym2151.c index d6ed7d859e1..66aaa43a21b 100644 --- a/src/emu/sound/ym2151.c +++ b/src/emu/sound/ym2151.c @@ -158,10 +158,10 @@ typedef struct UINT32 noise_tab[32]; /* 17bit Noise Generator periods */ - void (*irqhandler)(const device_config *device, int irq); /* IRQ function handler */ + void (*irqhandler)(running_device *device, int irq); /* IRQ function handler */ write8_device_func porthandler; /* port write function handler */ - const device_config *device; + running_device *device; unsigned int clock; /* chip clock in Hz (passed from 2151intf.c) */ unsigned int sampfreq; /* sampling frequency in Hz (passed from 2151intf.c) */ } YM2151; @@ -1385,7 +1385,7 @@ STATE_POSTLOAD( ym2151_postload ) set_connect(&YM2151_chip->oper[j*4], j, YM2151_chip->connect[j]); } -static void ym2151_state_save_register( YM2151 *chip, const device_config *device ) +static void ym2151_state_save_register( YM2151 *chip, running_device *device ) { int j; @@ -1487,7 +1487,7 @@ STATE_POSTLOAD( ym2151_postload ) { } -static void ym2151_state_save_register( YM2151 *chip, const device_config *device ) +static void ym2151_state_save_register( YM2151 *chip, running_device *device ) { } #endif @@ -1500,7 +1500,7 @@ static void ym2151_state_save_register( YM2151 *chip, const device_config *devic * 'clock' is the chip clock in Hz * 'rate' is sampling rate */ -void * ym2151_init(const device_config *device, int clock, int rate) +void * ym2151_init(running_device *device, int clock, int rate) { YM2151 *PSG; @@ -2478,7 +2478,7 @@ void ym2151_update_one(void *chip, SAMP **buffers, int length) } } -void ym2151_set_irq_handler(void *chip, void(*handler)(const device_config *device, int irq)) +void ym2151_set_irq_handler(void *chip, void(*handler)(running_device *device, int irq)) { YM2151 *PSG = (YM2151 *)chip; PSG->irqhandler = handler; diff --git a/src/emu/sound/ym2151.h b/src/emu/sound/ym2151.h index 5f717d1d53d..162a8ce3b2b 100644 --- a/src/emu/sound/ym2151.h +++ b/src/emu/sound/ym2151.h @@ -54,7 +54,7 @@ typedef stream_sample_t SAMP; ** 'clock' is the chip clock in Hz ** 'rate' is sampling rate */ -void *ym2151_init(const device_config *device, int clock, int rate); +void *ym2151_init(running_device *device, int clock, int rate); /* shutdown the YM2151 emulators*/ void ym2151_shutdown(void *chip); @@ -78,7 +78,7 @@ void ym2151_write_reg(void *chip, int r, int v); int ym2151_read_status(void *chip); /* set interrupt handler on YM2151 chip number 'n'*/ -void ym2151_set_irq_handler(void *chip, void (*handler)(const device_config *device, int irq)); +void ym2151_set_irq_handler(void *chip, void (*handler)(running_device *device, int irq)); /* set port write handler on YM2151 chip number 'n'*/ void ym2151_set_port_write_handler(void *chip, write8_device_func handler); diff --git a/src/emu/sound/ym2413.c b/src/emu/sound/ym2413.c index 5ea997e2c3c..863cd0d5d87 100644 --- a/src/emu/sound/ym2413.c +++ b/src/emu/sound/ym2413.c @@ -262,7 +262,7 @@ typedef struct { int clock; /* master clock (Hz) */ int rate; /* sampling rate (Hz) */ double freqbase; /* frequency base */ - const device_config *device; + running_device *device; } YM2413; /* key scale level */ @@ -1248,7 +1248,7 @@ static void OPLCloseTable( void ) } -static void OPLL_init_save(YM2413 *chip, const device_config *device) +static void OPLL_init_save(YM2413 *chip, running_device *device) { int chnum; @@ -1320,7 +1320,7 @@ static void OPLL_init_save(YM2413 *chip, const device_config *device) } -static void OPLL_initalize(YM2413 *chip, const device_config *device) +static void OPLL_initalize(YM2413 *chip, running_device *device) { int i; @@ -1916,7 +1916,7 @@ static TIMER_CALLBACK( cymfile_callback ) } /* lock/unlock for common table */ -static int OPLL_LockTable(const device_config *device) +static int OPLL_LockTable(running_device *device) { num_lock++; if(num_lock>1) return 0; @@ -2000,7 +2000,7 @@ static void OPLLResetChip(YM2413 *chip) /* Create one of virtual YM2413 */ /* 'clock' is chip clock in Hz */ /* 'rate' is sampling rate */ -static YM2413 *OPLLCreate(const device_config *device, int clock, int rate) +static YM2413 *OPLLCreate(running_device *device, int clock, int rate) { YM2413 *chip; @@ -2064,7 +2064,7 @@ static unsigned char OPLLRead(YM2413 *chip,int a) -void * ym2413_init(const device_config *device, int clock, int rate) +void * ym2413_init(running_device *device, int clock, int rate) { /* emulator create */ return OPLLCreate(device, clock, rate); diff --git a/src/emu/sound/ym2413.h b/src/emu/sound/ym2413.h index 75df204f25a..09f950b5e52 100644 --- a/src/emu/sound/ym2413.h +++ b/src/emu/sound/ym2413.h @@ -29,7 +29,7 @@ typedef INT8 SAMP; -void *ym2413_init(const device_config *device, int clock, int rate); +void *ym2413_init(running_device *device, int clock, int rate); void ym2413_shutdown(void *chip); void ym2413_reset_chip(void *chip); void ym2413_write(void *chip, int a, int v); diff --git a/src/emu/sound/ymdeltat.c b/src/emu/sound/ymdeltat.c index a4681bdcc9f..096569b0ff3 100644 --- a/src/emu/sound/ymdeltat.c +++ b/src/emu/sound/ymdeltat.c @@ -453,7 +453,7 @@ void YM_DELTAT_postload(YM_DELTAT *DELTAT,UINT8 *regs) DELTAT->now_data = *(DELTAT->memory + (DELTAT->now_addr>>1) ); } -void YM_DELTAT_savestate(const device_config *device,YM_DELTAT *DELTAT) +void YM_DELTAT_savestate(running_device *device,YM_DELTAT *DELTAT) { #ifdef __STATE_H__ state_save_register_device_item(device, 0, DELTAT->portstate); diff --git a/src/emu/sound/ymdeltat.h b/src/emu/sound/ymdeltat.h index 4b4d70c3c64..72b19dd4f58 100644 --- a/src/emu/sound/ymdeltat.h +++ b/src/emu/sound/ymdeltat.h @@ -79,6 +79,6 @@ void YM_DELTAT_ADPCM_Reset(YM_DELTAT *DELTAT,int pan,int emulation_mode); void YM_DELTAT_ADPCM_CALC(YM_DELTAT *DELTAT); void YM_DELTAT_postload(YM_DELTAT *DELTAT,UINT8 *regs); -void YM_DELTAT_savestate(const device_config *device,YM_DELTAT *DELTAT); +void YM_DELTAT_savestate(running_device *device,YM_DELTAT *DELTAT); #endif /* __YMDELTAT_H__ */ diff --git a/src/emu/sound/ymf262.c b/src/emu/sound/ymf262.c index f28798097fb..674c249e6ac 100644 --- a/src/emu/sound/ymf262.c +++ b/src/emu/sound/ymf262.c @@ -267,7 +267,7 @@ typedef struct { int rate; /* sampling rate (Hz) */ double freqbase; /* frequency base */ attotime TimerBase; /* Timer base time (==sampling time)*/ - const device_config *device; + running_device *device; } OPL3; @@ -2243,7 +2243,7 @@ static TIMER_CALLBACK( cymfile_callback ) } /* lock/unlock for common table */ -static int OPL3_LockTable(const device_config *device) +static int OPL3_LockTable(running_device *device) { num_lock++; if(num_lock>1) return 0; @@ -2330,7 +2330,7 @@ static void OPL3ResetChip(OPL3 *chip) /* Create one of virtual YMF262 */ /* 'clock' is chip clock in Hz */ /* 'rate' is sampling rate */ -static OPL3 *OPL3Create(const device_config *device, int clock, int rate, int type) +static OPL3 *OPL3Create(running_device *device, int clock, int rate, int type) { OPL3 *chip; @@ -2457,7 +2457,7 @@ static int OPL3TimerOver(OPL3 *chip,int c) -void * ymf262_init(const device_config *device, int clock, int rate) +void * ymf262_init(running_device *device, int clock, int rate) { return OPL3Create(device,clock,rate,OPL3_TYPE_YMF262); } diff --git a/src/emu/sound/ymf262.h b/src/emu/sound/ymf262.h index 83a512f2f94..4320ac957fa 100644 --- a/src/emu/sound/ymf262.h +++ b/src/emu/sound/ymf262.h @@ -32,7 +32,7 @@ typedef void (*OPL3_IRQHANDLER)(void *param,int irq); typedef void (*OPL3_UPDATEHANDLER)(void *param,int min_interval_us); -void *ymf262_init(const device_config *device, int clock, int rate); +void *ymf262_init(running_device *device, int clock, int rate); void ymf262_shutdown(void *chip); void ymf262_reset_chip(void *chip); int ymf262_write(void *chip, int a, int v); diff --git a/src/emu/sound/ymf271.c b/src/emu/sound/ymf271.c index be9bc60dab5..aea5a0fbb4a 100644 --- a/src/emu/sound/ymf271.c +++ b/src/emu/sound/ymf271.c @@ -108,11 +108,11 @@ typedef struct const UINT8 *rom; devcb_resolved_read8 ext_mem_read; devcb_resolved_write8 ext_mem_write; - void (*irq_callback)(const device_config *, int); + void (*irq_callback)(running_device *, int); UINT32 clock; sound_stream * stream; - const device_config *device; + running_device *device; } YMF271Chip; // slot mapping assists @@ -273,7 +273,7 @@ static int channel_attenuation[16]; static int total_level[128]; static int env_volume_table[256]; -INLINE YMF271Chip *get_safe_token(const device_config *device) +INLINE YMF271Chip *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -1677,7 +1677,7 @@ static void init_tables(running_machine *machine) mix = auto_alloc_array(machine, INT32, 48000*2); } -static void init_state(YMF271Chip *chip, const device_config *device) +static void init_state(YMF271Chip *chip, running_device *device) { int i; @@ -1752,7 +1752,7 @@ static void init_state(YMF271Chip *chip, const device_config *device) state_save_register_device_item(device, 0, chip->ext_read); } -static void ymf271_init(const device_config *device, YMF271Chip *chip, UINT8 *rom, void (*cb)(const device_config *,int), const devcb_read8 *ext_read, const devcb_write8 *ext_write) +static void ymf271_init(running_device *device, YMF271Chip *chip, UINT8 *rom, void (*cb)(running_device *,int), const devcb_read8 *ext_read, const devcb_write8 *ext_write) { chip->timA = timer_alloc(device->machine, ymf271_timer_a_tick, chip); chip->timB = timer_alloc(device->machine, ymf271_timer_b_tick, chip); @@ -1777,7 +1777,7 @@ static DEVICE_START( ymf271 ) chip->device = device; chip->clock = device->clock; - intf = (device->static_config != NULL) ? (const ymf271_interface *)device->static_config : &defintrf; + intf = (device->baseconfig().static_config != NULL) ? (const ymf271_interface *)device->baseconfig().static_config : &defintrf; ymf271_init(device, chip, *device->region, intf->irq_callback, &intf->ext_read, &intf->ext_write); chip->stream = stream_create(device, 0, 2, device->clock/384, chip, ymf271_update); diff --git a/src/emu/sound/ymf271.h b/src/emu/sound/ymf271.h index 093c096ff2e..093cca4c1b8 100644 --- a/src/emu/sound/ymf271.h +++ b/src/emu/sound/ymf271.h @@ -9,7 +9,7 @@ struct _ymf271_interface { devcb_read8 ext_read; /* external memory read */ devcb_write8 ext_write; /* external memory write */ - void (*irq_callback)(const device_config *device, int state); /* irq callback */ + void (*irq_callback)(running_device *device, int state); /* irq callback */ }; READ8_DEVICE_HANDLER( ymf271_r ); diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c index 0e5f72c9a70..5918a8717c9 100644 --- a/src/emu/sound/ymf278b.c +++ b/src/emu/sound/ymf278b.c @@ -116,8 +116,8 @@ typedef struct int irq_line; UINT8 port_A, port_B, port_C; - void (*irq_callback)(const device_config *, int); - const device_config *device; + void (*irq_callback)(running_device *, int); + running_device *device; const UINT8 *rom; int clock; @@ -129,7 +129,7 @@ typedef struct sound_stream * stream; } YMF278BChip; -INLINE YMF278BChip *get_safe_token(const device_config *device) +INLINE YMF278BChip *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -666,7 +666,7 @@ WRITE8_DEVICE_HANDLER( ymf278b_w ) } } -static void ymf278b_init(const device_config *device, YMF278BChip *chip, void (*cb)(const device_config *, int)) +static void ymf278b_init(running_device *device, YMF278BChip *chip, void (*cb)(running_device *, int)) { chip->rom = *device->region; chip->irq_callback = cb; @@ -686,7 +686,7 @@ static DEVICE_START( ymf278b ) YMF278BChip *chip = get_safe_token(device); chip->device = device; - intf = (device->static_config != NULL) ? (const ymf278b_interface *)device->static_config : &defintrf; + intf = (device->baseconfig().static_config != NULL) ? (const ymf278b_interface *)device->baseconfig().static_config : &defintrf; ymf278b_init(device, chip, intf->irq_callback); chip->stream = stream_create(device, 0, 2, device->clock/768, chip, ymf278b_pcm_update); diff --git a/src/emu/sound/ymf278b.h b/src/emu/sound/ymf278b.h index aa10c761c8a..362290d701a 100644 --- a/src/emu/sound/ymf278b.h +++ b/src/emu/sound/ymf278b.h @@ -9,7 +9,7 @@ typedef struct _ymf278b_interface ymf278b_interface; struct _ymf278b_interface { - void (*irq_callback)(const device_config *device, int state); /* irq callback */ + void (*irq_callback)(running_device *device, int state); /* irq callback */ }; READ8_DEVICE_HANDLER( ymf278b_r ); diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c index f7861215bb6..1ac57053601 100644 --- a/src/emu/sound/ymz280b.c +++ b/src/emu/sound/ymz280b.c @@ -87,7 +87,7 @@ struct _ymz280b_state UINT8 irq_enable; /* current IRQ enable */ UINT8 keyon_enable; /* key on enable */ double master_clock; /* master clock frequency */ - void (*irq_callback)(const device_config *, int); /* IRQ callback */ + void (*irq_callback)(running_device *, int); /* IRQ callback */ struct YMZ280BVoice voice[8]; /* the 8 voices */ UINT32 rom_readback_addr; /* where the CPU can read the ROM */ devcb_resolved_read8 ext_ram_read; /* external RAM read handler */ @@ -98,7 +98,7 @@ struct _ymz280b_state #endif INT16 *scratch; - const device_config *device; + running_device *device; }; /* step size index shift table */ @@ -130,7 +130,7 @@ static const timer_fired_func update_irq_state_cb[] = }; -INLINE ymz280b_state *get_safe_token(const device_config *device) +INLINE ymz280b_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -638,7 +638,7 @@ static STREAM_UPDATE( ymz280b_update ) static DEVICE_START( ymz280b ) { static const ymz280b_interface defintrf = { 0 }; - const ymz280b_interface *intf = (device->static_config != NULL) ? (const ymz280b_interface *)device->static_config : &defintrf; + const ymz280b_interface *intf = (device->baseconfig().static_config != NULL) ? (const ymz280b_interface *)device->baseconfig().static_config : &defintrf; ymz280b_state *chip = get_safe_token(device); chip->device = device; diff --git a/src/emu/sound/ymz280b.h b/src/emu/sound/ymz280b.h index 6709255377f..5c7c2b7211f 100644 --- a/src/emu/sound/ymz280b.h +++ b/src/emu/sound/ymz280b.h @@ -14,7 +14,7 @@ typedef struct _ymz280b_interface ymz280b_interface; struct _ymz280b_interface { - void (*irq_callback)(const device_config *device, int state); /* irq callback */ + void (*irq_callback)(running_device *device, int state); /* irq callback */ devcb_read8 ext_read; /* external RAM read */ devcb_write8 ext_write; /* external RAM write */ }; diff --git a/src/emu/streams.c b/src/emu/streams.c index 1768602c063..67cfb4a0529 100644 --- a/src/emu/streams.c +++ b/src/emu/streams.c @@ -112,7 +112,7 @@ struct _stream_output struct _sound_stream { /* linking information */ - const device_config * device; /* owning device */ + running_device * device; /* owning device */ sound_stream * next; /* next stream in the chain */ int index; /* index for save states */ @@ -333,7 +333,7 @@ void streams_update(running_machine *machine) stream_create - create a new stream -------------------------------------------------*/ -sound_stream *stream_create(const device_config *device, int inputs, int outputs, int sample_rate, void *param, stream_update_func callback) +sound_stream *stream_create(running_device *device, int inputs, int outputs, int sample_rate, void *param, stream_update_func callback) { running_machine *machine = device->machine; streams_private *strdata = machine->streams_data; @@ -411,7 +411,7 @@ sound_stream *stream_create(const device_config *device, int inputs, int outputs output pair -------------------------------------------------*/ -int stream_device_output_to_stream_output(const device_config *device, int outputnum, sound_stream **streamptr, int *streamoutputptr) +int stream_device_output_to_stream_output(running_device *device, int outputnum, sound_stream **streamptr, int *streamoutputptr) { streams_private *strdata = device->machine->streams_data; sound_stream *stream; @@ -438,7 +438,7 @@ int stream_device_output_to_stream_output(const device_config *device, int outpu input pair -------------------------------------------------*/ -int stream_device_input_to_stream_input(const device_config *device, int inputnum, sound_stream **streamptr, int *streaminputptr) +int stream_device_input_to_stream_input(running_device *device, int inputnum, sound_stream **streamptr, int *streaminputptr) { streams_private *strdata = device->machine->streams_data; sound_stream *stream; @@ -602,7 +602,7 @@ attotime stream_get_sample_period(sound_stream *stream) number of outputs for the given device -------------------------------------------------*/ -int stream_get_device_outputs(const device_config *device) +int stream_get_device_outputs(running_device *device) { streams_private *strdata = device->machine->streams_data; sound_stream *stream; @@ -621,7 +621,7 @@ int stream_get_device_outputs(const device_config *device) device and index -------------------------------------------------*/ -sound_stream *stream_find_by_device(const device_config *device, int streamindex) +sound_stream *stream_find_by_device(running_device *device, int streamindex) { streams_private *strdata = device->machine->streams_data; sound_stream *stream; diff --git a/src/emu/streams.h b/src/emu/streams.h index 6f649999b29..64513b5b220 100644 --- a/src/emu/streams.h +++ b/src/emu/streams.h @@ -29,9 +29,9 @@ typedef struct _sound_stream sound_stream; -typedef void (*stream_update_func)(const device_config *device, void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples); +typedef void (*stream_update_func)(running_device *device, void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples); -#define STREAM_UPDATE(name) void name(const device_config *device, void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples) +#define STREAM_UPDATE(name) void name(running_device *device, void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples) @@ -53,13 +53,13 @@ void streams_update(running_machine *machine); /* ----- stream configuration and setup ----- */ /* create a new stream */ -sound_stream *stream_create(const device_config *device, int inputs, int outputs, int sample_rate, void *param, stream_update_func callback); +sound_stream *stream_create(running_device *device, int inputs, int outputs, int sample_rate, void *param, stream_update_func callback); /* convert a device/output pair to a stream/output pair */ -int stream_device_output_to_stream_output(const device_config *device, int outputnum, sound_stream **streamptr, int *streamoutputptr); +int stream_device_output_to_stream_output(running_device *device, int outputnum, sound_stream **streamptr, int *streamoutputptr); /* convert a device/input pair to a stream/input pair */ -int stream_device_input_to_stream_input(const device_config *device, int inputnum, sound_stream **streamptr, int *streaminputptr); +int stream_device_input_to_stream_input(running_device *device, int inputnum, sound_stream **streamptr, int *streaminputptr); /* configure a stream's input */ void stream_set_input(sound_stream *stream, int index, sound_stream *input_stream, int output_index, float gain); @@ -91,10 +91,10 @@ attotime stream_get_sample_period(sound_stream *stream); /* ----- stream information and control ----- */ /* return the total number of outputs for the given device */ -int stream_get_device_outputs(const device_config *device); +int stream_get_device_outputs(running_device *device); /* find a stream using a device and index */ -sound_stream *stream_find_by_device(const device_config *device, int streamindex); +sound_stream *stream_find_by_device(running_device *device, int streamindex); /* return the number of inputs for a given stream */ int stream_get_inputs(sound_stream *stream); diff --git a/src/emu/tilemap.c b/src/emu/tilemap.c index 01cf7ad16f7..b145596ae06 100644 --- a/src/emu/tilemap.c +++ b/src/emu/tilemap.c @@ -322,7 +322,7 @@ tilemap_t *tilemap_create(running_machine *machine, tile_get_info_func tile_get_ is owned by a device -------------------------------------------------*/ -tilemap_t *tilemap_create_device(const device_config *device, tile_get_info_device_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows) +tilemap_t *tilemap_create_device(running_device *device, tile_get_info_device_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows) { return tilemap_create_common(device->machine, (void *)device, (tile_get_info_func)tile_get_info, mapper, tilewidth, tileheight, cols, rows); } diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h index e1070049b9c..740477b50ec 100644 --- a/src/emu/tilemap.h +++ b/src/emu/tilemap.h @@ -355,7 +355,7 @@ /* function definition for a get info callback */ #define TILE_GET_INFO(_name) void _name(running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param) -#define TILE_GET_INFO_DEVICE(_name) void _name(const device_config *device, tile_data *tileinfo, tilemap_memory_index tile_index, void *param) +#define TILE_GET_INFO_DEVICE(_name) void _name(running_device *device, tile_data *tileinfo, tilemap_memory_index tile_index, void *param) /* function definition for a logical-to-memory mapper */ #define TILEMAP_MAPPER(_name) tilemap_memory_index _name(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows) @@ -400,7 +400,7 @@ struct _tile_data /* callback function to get info about a tile */ typedef void (*tile_get_info_func)(running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param); -typedef void (*tile_get_info_device_func)(const device_config *device, tile_data *tileinfo, tilemap_memory_index tile_index, void *param); +typedef void (*tile_get_info_device_func)(running_device *device, tile_data *tileinfo, tilemap_memory_index tile_index, void *param); /* callback function to map a column,row pair to a memory index */ typedef tilemap_memory_index (*tilemap_mapper_func)(UINT32 col, UINT32 row, UINT32 num_cols, UINT32 num_rows); @@ -425,7 +425,7 @@ void tilemap_init(running_machine *machine); tilemap_t *tilemap_create(running_machine *machine, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows); /* create a new tilemap that is owned by a device */ -tilemap_t *tilemap_create_device(const device_config *device, tile_get_info_device_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows); +tilemap_t *tilemap_create_device(running_device *device, tile_get_info_device_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows); /* specify a parameter to be passed into the tile_get_info callback */ void tilemap_set_user_data(tilemap_t *tmap, void *user_data); diff --git a/src/emu/timer.c b/src/emu/timer.c index 4972809f676..4fed545b6ce 100644 --- a/src/emu/timer.c +++ b/src/emu/timer.c @@ -239,7 +239,7 @@ INLINE void timer_list_insert(emu_timer *timer) in device is, in fact, a timer -------------------------------------------------*/ -INLINE timer_state *get_safe_token(const device_config *device) +INLINE timer_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -700,10 +700,10 @@ void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param) } -void timer_device_adjust_oneshot(const device_config *timer, attotime duration, INT32 param) +void timer_device_adjust_oneshot(running_device *timer, attotime duration, INT32 param) { #ifdef MAME_DEBUG - timer_config *config = (timer_config *)timer->inline_config; + timer_config *config = (timer_config *)timer->baseconfig().inline_config; /* doesn't make sense for scanline timers */ assert(config->type != TIMER_TYPE_SCANLINE); @@ -752,11 +752,11 @@ void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param, } -void timer_device_adjust_periodic(const device_config *timer, attotime start_delay, INT32 param, attotime period) +void timer_device_adjust_periodic(running_device *timer, attotime start_delay, INT32 param, attotime period) { timer_state *state = get_safe_token(timer); #ifdef MAME_DEBUG - timer_config *config = (timer_config *)timer->inline_config; + timer_config *config = (timer_config *)timer->baseconfig().inline_config; /* doesn't make sense for scanline timers */ assert(config->type != TIMER_TYPE_SCANLINE); @@ -816,11 +816,11 @@ void timer_reset(emu_timer *which, attotime duration) } -void timer_device_reset(const device_config *timer) +void timer_device_reset(running_device *timer) { timer_state *state = get_safe_token(timer); #ifdef MAME_DEBUG - timer_config *config = (timer_config *)timer->inline_config; + timer_config *config = (timer_config *)timer->baseconfig().inline_config; /* doesn't make sense for scanline timers */ assert(config->type != TIMER_TYPE_SCANLINE); @@ -850,7 +850,7 @@ int timer_enable(emu_timer *which, int enable) } -int timer_device_enable(const device_config *timer, int enable) +int timer_device_enable(running_device *timer, int enable) { timer_state *state = get_safe_token(timer); return timer_enable(state->timer, enable); @@ -868,7 +868,7 @@ int timer_enabled(emu_timer *which) } -int timer_device_enabled(const device_config *timer) +int timer_device_enabled(running_device *timer) { timer_state *state = get_safe_token(timer); return timer_enabled(state->timer); @@ -886,11 +886,11 @@ int timer_get_param(emu_timer *which) } -int timer_device_get_param(const device_config *timer) +int timer_device_get_param(running_device *timer) { timer_state *state = get_safe_token(timer); #ifdef MAME_DEBUG - timer_config *config = (timer_config *)timer->inline_config; + timer_config *config = (timer_config *)timer->baseconfig().inline_config; /* doesn't make sense for scanline timers */ assert(config->type != TIMER_TYPE_SCANLINE); @@ -911,11 +911,11 @@ void timer_set_param(emu_timer *which, int param) } -void timer_device_set_param(const device_config *timer, int param) +void timer_device_set_param(running_device *timer, int param) { timer_state *state = get_safe_token(timer); #ifdef MAME_DEBUG - timer_config *config = (timer_config *)timer->inline_config; + timer_config *config = (timer_config *)timer->baseconfig().inline_config; /* doesn't make sense for scanline timers */ assert(config->type != TIMER_TYPE_SCANLINE); @@ -936,7 +936,7 @@ void *timer_get_ptr(emu_timer *which) } -void *timer_device_get_ptr(const device_config *timer) +void *timer_device_get_ptr(running_device *timer) { timer_state *state = get_safe_token(timer); return state->ptr; @@ -954,7 +954,7 @@ void timer_set_ptr(emu_timer *which, void *ptr) } -void timer_device_set_ptr(const device_config *timer, void *ptr) +void timer_device_set_ptr(running_device *timer, void *ptr) { timer_state *state = get_safe_token(timer); state->ptr = ptr; @@ -977,7 +977,7 @@ attotime timer_timeelapsed(emu_timer *which) } -attotime timer_device_timeelapsed(const device_config *timer) +attotime timer_device_timeelapsed(running_device *timer) { timer_state *state = get_safe_token(timer); return timer_timeelapsed(state->timer); @@ -995,7 +995,7 @@ attotime timer_timeleft(emu_timer *which) } -attotime timer_device_timeleft(const device_config *timer) +attotime timer_device_timeleft(running_device *timer) { timer_state *state = get_safe_token(timer); return timer_timeleft(state->timer); @@ -1023,7 +1023,7 @@ attotime timer_starttime(emu_timer *which) } -attotime timer_device_starttime(const device_config *timer) +attotime timer_device_starttime(running_device *timer) { timer_state *state = get_safe_token(timer); return timer_starttime(state->timer); @@ -1041,7 +1041,7 @@ attotime timer_firetime(emu_timer *which) } -attotime timer_device_firetime(const device_config *timer) +attotime timer_device_firetime(running_device *timer) { timer_state *state = get_safe_token(timer); return timer_firetime(state->timer); @@ -1055,9 +1055,9 @@ attotime timer_device_firetime(const device_config *timer) static TIMER_CALLBACK( periodic_timer_device_timer_callback ) { - const device_config *timer = (const device_config *)ptr; + running_device *timer = (running_device *)ptr; timer_state *state = get_safe_token(timer); - timer_config *config = (timer_config *)timer->inline_config; + timer_config *config = (timer_config *)timer->baseconfig().inline_config; /* call the real callback */ config->callback(timer, state->ptr, state->param); @@ -1073,12 +1073,12 @@ static TIMER_CALLBACK( periodic_timer_device_timer_callback ) static TIMER_CALLBACK( scanline_timer_device_timer_callback ) { int next_vpos; - const device_config *timer = (const device_config *)ptr; + running_device *timer = (running_device *)ptr; timer_state *state = get_safe_token(timer); - timer_config *config = (timer_config *)timer->inline_config; + timer_config *config = (timer_config *)timer->baseconfig().inline_config; /* get the screen device and verify it */ - const device_config *screen = timer->machine->device(config->screen); + running_device *screen = timer->machine->device(config->screen); assert(screen != NULL); /* first time, start with the first scanline, but do not call the callback */ @@ -1166,13 +1166,13 @@ static DEVICE_START( timer ) /* validate some basic stuff */ assert(device != NULL); - assert(device->static_config == NULL); - assert(device->inline_config != NULL); + assert(device->baseconfig().static_config == NULL); + assert(device->baseconfig().inline_config != NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); /* get and validate the configuration */ - config = (timer_config *)device->inline_config; + config = (timer_config *)device->baseconfig().inline_config; assert(config->type == TIMER_TYPE_PERIODIC || config->type == TIMER_TYPE_SCANLINE || config->type == TIMER_TYPE_GENERIC); /* copy the pointer parameter */ diff --git a/src/emu/timer.h b/src/emu/timer.h index 3c01ff312e2..d48540d71bc 100644 --- a/src/emu/timer.h +++ b/src/emu/timer.h @@ -57,7 +57,7 @@ enum /* macros for a timer callback functions */ #define TIMER_CALLBACK(name) void name(running_machine *machine, void *ptr, int param) -#define TIMER_DEVICE_CALLBACK(name) void name(const device_config *timer, void *ptr, INT32 param) +#define TIMER_DEVICE_CALLBACK(name) void name(running_device *timer, void *ptr, INT32 param) @@ -67,7 +67,7 @@ enum /* a timer callback looks like this */ typedef void (*timer_fired_func)(running_machine *machine, void *ptr, INT32 param); -typedef void (*timer_device_fired_func)(const device_config *timer, void *ptr, INT32 param); +typedef void (*timer_device_fired_func)(running_device *timer, void *ptr, INT32 param); /*------------------------------------------------- @@ -193,11 +193,11 @@ emu_timer *_timer_alloc_internal(running_machine *machine, timer_fired_func call /* adjust the time when this timer will fire and disable any periodic firings */ void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param); -void timer_device_adjust_oneshot(const device_config *timer, attotime duration, INT32 param); +void timer_device_adjust_oneshot(running_device *timer, attotime duration, INT32 param); /* adjust the time when this timer will fire and specify a period for subsequent firings */ void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param, attotime period); -void timer_device_adjust_periodic(const device_config *timer, attotime start_delay, INT32 param, attotime period); +void timer_device_adjust_periodic(running_device *timer, attotime start_delay, INT32 param, attotime period); @@ -215,31 +215,31 @@ void _timer_pulse_internal(running_machine *machine, attotime period, void *ptr, /* reset the timing on a timer */ void timer_reset(emu_timer *which, attotime duration); -void timer_device_reset(const device_config *timer); +void timer_device_reset(running_device *timer); /* enable/disable a timer */ int timer_enable(emu_timer *which, int enable); -int timer_device_enable(const device_config *timer, int enable); +int timer_device_enable(running_device *timer, int enable); /* determine if a timer is enabled */ int timer_enabled(emu_timer *which); -int timer_device_enabled(const device_config *timer); +int timer_device_enabled(running_device *timer); /* returns the callback parameter of a timer */ int timer_get_param(emu_timer *which); -int timer_device_get_param(const device_config *timer); +int timer_device_get_param(running_device *timer); /* changes the callback parameter of a timer */ void timer_set_param(emu_timer *which, int param); -void timer_device_set_param(const device_config *timer, int param); +void timer_device_set_param(running_device *timer, int param); /* returns the callback pointer of a timer */ void *timer_get_ptr(emu_timer *which); -void *timer_device_get_ptr(const device_config *timer); +void *timer_device_get_ptr(running_device *timer); /* changes the callback pointer of a timer */ void timer_set_ptr(emu_timer *which, void *ptr); -void timer_device_set_ptr(const device_config *timer, void *ptr); +void timer_device_set_ptr(running_device *timer, void *ptr); @@ -247,22 +247,22 @@ void timer_device_set_ptr(const device_config *timer, void *ptr); /* return the time since the last trigger */ attotime timer_timeelapsed(emu_timer *which); -attotime timer_device_timeelapsed(const device_config *timer); +attotime timer_device_timeelapsed(running_device *timer); /* return the time until the next trigger */ attotime timer_timeleft(emu_timer *which); -attotime timer_device_timeleft(const device_config *timer); +attotime timer_device_timeleft(running_device *timer); /* return the current time */ attotime timer_get_time(running_machine *machine); /* return the time when this timer started counting */ attotime timer_starttime(emu_timer *which); -attotime timer_device_starttime(const device_config *timer); +attotime timer_device_starttime(running_device *timer); /* return the time when this timer will fire next */ attotime timer_firetime(emu_timer *which); -attotime timer_device_firetime(const device_config *timer); +attotime timer_device_firetime(running_device *timer); /* ----- timer device interface ----- */ diff --git a/src/emu/ui.c b/src/emu/ui.c index 9a630a4d55b..bd789ef613a 100644 --- a/src/emu/ui.c +++ b/src/emu/ui.c @@ -117,8 +117,8 @@ static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *st static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval); static INT32 slider_flicker(running_machine *machine, void *arg, astring *string, INT32 newval); static INT32 slider_beam(running_machine *machine, void *arg, astring *string, INT32 newval); -static char *slider_get_screen_desc(const device_config *screen); -static char *slider_get_laserdisc_desc(const device_config *screen); +static char *slider_get_screen_desc(running_device *screen); +static char *slider_get_laserdisc_desc(running_device *screen); #ifdef MAME_DEBUG static INT32 slider_crossscale(running_machine *machine, void *arg, astring *string, INT32 newval); static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *string, INT32 newval); @@ -962,8 +962,8 @@ static astring &warnings_string(running_machine *machine, astring &string) astring &game_info_astring(running_machine *machine, astring &string) { int scrcount = video_screen_count(machine->config); - const device_config *scandevice; - const device_config *device; + running_device *scandevice; + running_device *device; int found_sound = FALSE; int count; @@ -988,7 +988,7 @@ astring &game_info_astring(running_machine *machine, astring &string) /* if more than one, prepend a #x in front of the CPU name */ if (count > 1) string.catprintf("%d" UTF8_MULTIPLY, count); - string.cat(cpu_get_name(device)); + string.cat(device_get_name(device)); /* display clock in kHz or MHz */ if (clock >= 1000000) @@ -998,7 +998,7 @@ astring &game_info_astring(running_machine *machine, astring &string) } /* loop over all sound chips */ - for (device = sound_first(machine->config); device != NULL; device = scandevice) + for (device = sound_first(machine); device != NULL; device = scandevice) { /* append the Sound: string */ if (!found_sound) @@ -1034,11 +1034,9 @@ astring &game_info_astring(running_machine *machine, astring &string) string.cat("None\n"); else { - const device_config *screen; - - for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen)) + for (running_device *screen = video_screen_first(machine); screen != NULL; screen = video_screen_next(screen)) { - const screen_config *scrconfig = (const screen_config *)screen->inline_config; + const screen_config *scrconfig = (const screen_config *)screen->baseconfig().inline_config; if (scrcount > 1) { @@ -1416,7 +1414,7 @@ static slider_state *slider_init(running_machine *machine) { const input_field_config *field; const input_port_config *port; - const device_config *device; + running_device *device; slider_state *listhead = NULL; slider_state **tailptr = &listhead; astring string; @@ -1464,9 +1462,9 @@ static slider_state *slider_init(running_machine *machine) } /* add screen parameters */ - for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device)) + for (device = video_screen_first(machine); device != NULL; device = video_screen_next(device)) { - const screen_config *scrconfig = (const screen_config *)device->inline_config; + const screen_config *scrconfig = (const screen_config *)device->baseconfig().inline_config; int defxscale = floor(scrconfig->xscale * 1000.0f + 0.5f); int defyscale = floor(scrconfig->yscale * 1000.0f + 0.5f); int defxoffset = floor(scrconfig->xoffset * 1000.0f + 0.5f); @@ -1507,9 +1505,9 @@ static slider_state *slider_init(running_machine *machine) tailptr = &(*tailptr)->next; } - for (device = machine->config->devicelist.first(LASERDISC); device != NULL; device = device->typenext()) + for (device = machine->devicelist.first(LASERDISC); device != NULL; device = device->typenext()) { - const laserdisc_config *config = (const laserdisc_config *)device->inline_config; + const laserdisc_config *config = (const laserdisc_config *)device->baseconfig().inline_config; if (config->overupdate != NULL) { int defxscale = floor(config->overscalex * 1000.0f + 0.5f); @@ -1534,9 +1532,9 @@ static slider_state *slider_init(running_machine *machine) } } - for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device)) + for (device = video_screen_first(machine); device != NULL; device = video_screen_next(device)) { - const screen_config *scrconfig = (const screen_config *)device->inline_config; + const screen_config *scrconfig = (const screen_config *)device->baseconfig().inline_config; if (scrconfig->type == SCREEN_TYPE_VECTOR) { /* add flicker control */ @@ -1627,7 +1625,7 @@ static INT32 slider_adjuster(running_machine *machine, void *arg, astring *strin static INT32 slider_overclock(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *cpu = (const device_config *)arg; + running_device *cpu = (running_device *)arg; if (newval != SLIDER_NOCHANGE) cpu_set_clockscale(cpu, (float)newval * 0.001f); if (string != NULL) @@ -1642,8 +1640,8 @@ static INT32 slider_overclock(running_machine *machine, void *arg, astring *stri static INT32 slider_refresh(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *screen = (const device_config *)arg; - const screen_config *scrconfig = (const screen_config *)screen->inline_config; + running_device *screen = (running_device *)arg; + const screen_config *scrconfig = (const screen_config *)screen->baseconfig().inline_config; double defrefresh = ATTOSECONDS_TO_HZ(scrconfig->refresh); double refresh; @@ -1669,7 +1667,7 @@ static INT32 slider_refresh(running_machine *machine, void *arg, astring *string static INT32 slider_brightness(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *screen = (const device_config *)arg; + running_device *screen = (running_device *)arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; @@ -1692,7 +1690,7 @@ static INT32 slider_brightness(running_machine *machine, void *arg, astring *str static INT32 slider_contrast(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *screen = (const device_config *)arg; + running_device *screen = (running_device *)arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; @@ -1714,7 +1712,7 @@ static INT32 slider_contrast(running_machine *machine, void *arg, astring *strin static INT32 slider_gamma(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *screen = (const device_config *)arg; + running_device *screen = (running_device *)arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; @@ -1737,7 +1735,7 @@ static INT32 slider_gamma(running_machine *machine, void *arg, astring *string, static INT32 slider_xscale(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *screen = (const device_config *)arg; + running_device *screen = (running_device *)arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; @@ -1760,7 +1758,7 @@ static INT32 slider_xscale(running_machine *machine, void *arg, astring *string, static INT32 slider_yscale(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *screen = (const device_config *)arg; + running_device *screen = (running_device *)arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; @@ -1783,7 +1781,7 @@ static INT32 slider_yscale(running_machine *machine, void *arg, astring *string, static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *screen = (const device_config *)arg; + running_device *screen = (running_device *)arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; @@ -1806,7 +1804,7 @@ static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *screen = (const device_config *)arg; + running_device *screen = (running_device *)arg; render_container *container = render_container_get_screen(screen); render_container_user_settings settings; @@ -1829,7 +1827,7 @@ static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string static INT32 slider_overxscale(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *laserdisc = (const device_config *)arg; + running_device *laserdisc = (running_device *)arg; laserdisc_config settings; laserdisc_get_config(laserdisc, &settings); @@ -1851,7 +1849,7 @@ static INT32 slider_overxscale(running_machine *machine, void *arg, astring *str static INT32 slider_overyscale(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *laserdisc = (const device_config *)arg; + running_device *laserdisc = (running_device *)arg; laserdisc_config settings; laserdisc_get_config(laserdisc, &settings); @@ -1873,7 +1871,7 @@ static INT32 slider_overyscale(running_machine *machine, void *arg, astring *str static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *laserdisc = (const device_config *)arg; + running_device *laserdisc = (running_device *)arg; laserdisc_config settings; laserdisc_get_config(laserdisc, &settings); @@ -1895,7 +1893,7 @@ static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *st static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval) { - const device_config *laserdisc = (const device_config *)arg; + running_device *laserdisc = (running_device *)arg; laserdisc_config settings; laserdisc_get_config(laserdisc, &settings); @@ -1945,7 +1943,7 @@ static INT32 slider_beam(running_machine *machine, void *arg, astring *string, I description for a given screen -------------------------------------------------*/ -static char *slider_get_screen_desc(const device_config *screen) +static char *slider_get_screen_desc(running_device *screen) { int screen_count = video_screen_count(screen->machine->config); static char descbuf[256]; @@ -1964,9 +1962,9 @@ static char *slider_get_screen_desc(const device_config *screen) description for a given laseridsc -------------------------------------------------*/ -static char *slider_get_laserdisc_desc(const device_config *laserdisc) +static char *slider_get_laserdisc_desc(running_device *laserdisc) { - int ldcount = laserdisc->machine->config->devicelist.count(LASERDISC); + int ldcount = laserdisc->machine->devicelist.count(LASERDISC); static char descbuf[256]; if (ldcount > 1) diff --git a/src/emu/validity.c b/src/emu/validity.c index b8da081f52b..9a6d19fb174 100644 --- a/src/emu/validity.c +++ b/src/emu/validity.c @@ -564,17 +564,17 @@ static int validate_cpu(int drivnum, const machine_config *config) { const game_driver *driver = drivers[drivnum]; cpu_validity_check_func cpu_validity_check; - const device_config *device; + const device_config *devconfig; int error = FALSE; /* loop over all the CPUs */ - for (device = cpu_first(config); device != NULL; device = cpu_next(device)) + for (devconfig = cpu_first(config); devconfig != NULL; devconfig = cpu_next(devconfig)) { - const cpu_config *cpuconfig = (const cpu_config *)device->inline_config; + const cpu_config *cpuconfig = (const cpu_config *)devconfig->inline_config; /* check the CPU for incompleteness */ - if (device_get_info_fct(device, CPUINFO_FCT_RESET) == NULL || - device_get_info_fct(device, CPUINFO_FCT_EXECUTE) == NULL) + if (devconfig->get_config_fct(CPUINFO_FCT_RESET) == NULL || + devconfig->get_config_fct(CPUINFO_FCT_EXECUTE) == NULL) { mame_printf_error("%s: %s uses an incomplete CPU\n", driver->source_file, driver->name); error = TRUE; @@ -582,8 +582,8 @@ static int validate_cpu(int drivnum, const machine_config *config) } /* check for CPU-specific validity check */ - cpu_validity_check = (cpu_validity_check_func) device_get_info_fct(device, CPUINFO_FCT_VALIDITY_CHECK); - if (cpu_validity_check != NULL && (*cpu_validity_check)(driver, device->static_config)) + cpu_validity_check = (cpu_validity_check_func) devconfig->get_config_fct(CPUINFO_FCT_VALIDITY_CHECK); + if (cpu_validity_check != NULL && (*cpu_validity_check)(driver, devconfig->static_config)) error = TRUE; /* validate the interrupts */ @@ -591,39 +591,39 @@ static int validate_cpu(int drivnum, const machine_config *config) { if (video_screen_count(config) == 0) { - mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt, but the driver is screenless !\n", driver->source_file, driver->name, device->tag.cstr()); + mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt, but the driver is screenless !\n", driver->source_file, driver->name, devconfig->tag.cstr()); error = TRUE; } else if (cpuconfig->vblank_interrupt_screen != NULL && cpuconfig->vblank_interrupts_per_frame != 0) { - mame_printf_error("%s: %s cpu '%s' has a new VBLANK interrupt handler with >1 interrupts!\n", driver->source_file, driver->name, device->tag.cstr()); + mame_printf_error("%s: %s cpu '%s' has a new VBLANK interrupt handler with >1 interrupts!\n", driver->source_file, driver->name, devconfig->tag.cstr()); error = TRUE; } else if (cpuconfig->vblank_interrupt_screen != NULL && config->devicelist.find(cpuconfig->vblank_interrupt_screen) == NULL) { - mame_printf_error("%s: %s cpu '%s' VBLANK interrupt with a non-existant screen tag (%s)!\n", driver->source_file, driver->name, device->tag.cstr(), cpuconfig->vblank_interrupt_screen); + mame_printf_error("%s: %s cpu '%s' VBLANK interrupt with a non-existant screen tag (%s)!\n", driver->source_file, driver->name, devconfig->tag.cstr(), cpuconfig->vblank_interrupt_screen); error = TRUE; } else if (cpuconfig->vblank_interrupt_screen == NULL && cpuconfig->vblank_interrupts_per_frame == 0) { - mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt handler with 0 interrupts!\n", driver->source_file, driver->name, device->tag.cstr()); + mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt handler with 0 interrupts!\n", driver->source_file, driver->name, devconfig->tag.cstr()); error = TRUE; } } else if (cpuconfig->vblank_interrupts_per_frame != 0) { - mame_printf_error("%s: %s cpu '%s' has no VBLANK interrupt handler but a non-0 interrupt count is given!\n", driver->source_file, driver->name, device->tag.cstr()); + mame_printf_error("%s: %s cpu '%s' has no VBLANK interrupt handler but a non-0 interrupt count is given!\n", driver->source_file, driver->name, devconfig->tag.cstr()); error = TRUE; } if (cpuconfig->timed_interrupt != NULL && cpuconfig->timed_interrupt_period == 0) { - mame_printf_error("%s: %s cpu '%s' has a timer interrupt handler with 0 period!\n", driver->source_file, driver->name, device->tag.cstr()); + mame_printf_error("%s: %s cpu '%s' has a timer interrupt handler with 0 period!\n", driver->source_file, driver->name, devconfig->tag.cstr()); error = TRUE; } else if (cpuconfig->timed_interrupt == NULL && cpuconfig->timed_interrupt_period != 0) { - mame_printf_error("%s: %s cpu '%s' has a no timer interrupt handler but has a non-0 period given!\n", driver->source_file, driver->name, device->tag.cstr()); + mame_printf_error("%s: %s cpu '%s' has a no timer interrupt handler but has a non-0 period given!\n", driver->source_file, driver->name, devconfig->tag.cstr()); error = TRUE; } } @@ -640,19 +640,19 @@ static int validate_cpu(int drivnum, const machine_config *config) static int validate_display(int drivnum, const machine_config *config) { const game_driver *driver = drivers[drivnum]; - const device_config *device; + const device_config *devconfig; int palette_modes = FALSE; int error = FALSE; /* loop over screens */ - for (device = video_screen_first(config); device != NULL; device = video_screen_next(device)) + for (devconfig = video_screen_first(config); devconfig != NULL; devconfig = video_screen_next(devconfig)) { - const screen_config *scrconfig = (const screen_config *)device->inline_config; + const screen_config *scrconfig = (const screen_config *)devconfig->inline_config; /* sanity check dimensions */ if ((scrconfig->width <= 0) || (scrconfig->height <= 0)) { - mame_printf_error("%s: %s screen '%s' has invalid display dimensions\n", driver->source_file, driver->name, device->tag.cstr()); + mame_printf_error("%s: %s screen '%s' has invalid display dimensions\n", driver->source_file, driver->name, devconfig->tag.cstr()); error = TRUE; } @@ -664,7 +664,7 @@ static int validate_display(int drivnum, const machine_config *config) (scrconfig->visarea.max_x >= scrconfig->width) || (scrconfig->visarea.max_y >= scrconfig->height)) { - mame_printf_error("%s: %s screen '%s' has an invalid display area\n", driver->source_file, driver->name, device->tag.cstr()); + mame_printf_error("%s: %s screen '%s' has an invalid display area\n", driver->source_file, driver->name, devconfig->tag.cstr()); error = TRUE; } @@ -673,7 +673,7 @@ static int validate_display(int drivnum, const machine_config *config) scrconfig->format != BITMAP_FORMAT_RGB15 && scrconfig->format != BITMAP_FORMAT_RGB32) { - mame_printf_error("%s: %s screen '%s' has unsupported format\n", driver->source_file, driver->name, device->tag.cstr()); + mame_printf_error("%s: %s screen '%s' has unsupported format\n", driver->source_file, driver->name, devconfig->tag.cstr()); error = TRUE; } if (scrconfig->format == BITMAP_FORMAT_INDEXED16) @@ -683,7 +683,7 @@ static int validate_display(int drivnum, const machine_config *config) /* check for zero frame rate */ if (scrconfig->refresh == 0) { - mame_printf_error("%s: %s screen '%s' has a zero refresh rate\n", driver->source_file, driver->name, device->tag.cstr()); + mame_printf_error("%s: %s screen '%s' has a zero refresh rate\n", driver->source_file, driver->name, devconfig->tag.cstr()); error = TRUE; } } @@ -1249,28 +1249,27 @@ static int validate_devices(int drivnum, const machine_config *config, const iop { int error = FALSE; const game_driver *driver = drivers[drivnum]; - const device_config *device; - for (device = config->devicelist.first(); device != NULL; device = device->next) + for (const device_config *devconfig = config->devicelist.first(); devconfig != NULL; devconfig = devconfig->next) { - device_validity_check_func validity_check = (device_validity_check_func) device_get_info_fct(device, DEVINFO_FCT_VALIDITY_CHECK); + device_validity_check_func validity_check = (device_validity_check_func) devconfig->get_config_fct(DEVINFO_FCT_VALIDITY_CHECK); int detected_overlap = DETECT_OVERLAPPING_MEMORY ? FALSE : TRUE; - const device_config *scandevice; + const device_config *scanconfig; int spacenum; /* validate the device tag */ - error |= validate_tag(driver, device_get_info_string(device, DEVINFO_STR_NAME), device->tag); + error |= validate_tag(driver, devconfig->get_config_string(DEVINFO_STR_NAME), devconfig->tag); /* look for duplicates */ - for (scandevice = config->devicelist.first(); scandevice != device; scandevice = scandevice->next) - if (strcmp(scandevice->tag, device->tag) == 0) + for (scanconfig = config->devicelist.first(); scanconfig != devconfig; scanconfig = scanconfig->next) + if (strcmp(scanconfig->tag, devconfig->tag) == 0) { - mame_printf_warning("%s: %s has multiple devices with the tag '%s'\n", driver->source_file, driver->name, device->tag.cstr()); + mame_printf_warning("%s: %s has multiple devices with the tag '%s'\n", driver->source_file, driver->name, devconfig->tag.cstr()); break; } /* call the device-specific validity check */ - if (validity_check != NULL && (*validity_check)(driver, device)) + if (validity_check != NULL && (*validity_check)(driver, devconfig)) error = TRUE; /* loop over all address spaces */ @@ -1278,14 +1277,14 @@ static int validate_devices(int drivnum, const machine_config *config, const iop { #define SPACE_SHIFT(a) ((addr_shift < 0) ? ((a) << -addr_shift) : ((a) >> addr_shift)) #define SPACE_SHIFT_END(a) ((addr_shift < 0) ? (((a) << -addr_shift) | ((1 << -addr_shift) - 1)) : ((a) >> addr_shift)) - int databus_width = device_get_databus_width(device, spacenum); - int addr_shift = device_get_addrbus_shift(device, spacenum); + int databus_width = device_get_databus_width(devconfig, spacenum); + int addr_shift = device_get_addrbus_shift(devconfig, spacenum); int alignunit = databus_width/8; address_map_entry *entry; address_map *map; /* construct the maps */ - map = address_map_alloc(device, driver, spacenum, NULL); + map = address_map_alloc(devconfig, driver, spacenum, NULL); /* if this is an empty map, just skip it */ if (map->entrylist == NULL) @@ -1297,12 +1296,12 @@ static int validate_devices(int drivnum, const machine_config *config, const iop /* validate the global map parameters */ if (map->spacenum != spacenum) { - mame_printf_error("%s: %s device '%s' space %d has address space %d handlers!\n", driver->source_file, driver->name, device->tag.cstr(), spacenum, map->spacenum); + mame_printf_error("%s: %s device '%s' space %d has address space %d handlers!\n", driver->source_file, driver->name, devconfig->tag.cstr(), spacenum, map->spacenum); error = TRUE; } if (map->databits != databus_width) { - mame_printf_error("%s: %s device '%s' uses wrong memory handlers for %s space! (width = %d, memory = %08x)\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], databus_width, map->databits); + mame_printf_error("%s: %s device '%s' uses wrong memory handlers for %s space! (width = %d, memory = %08x)\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], databus_width, map->databits); error = TRUE; } @@ -1321,7 +1320,7 @@ static int validate_devices(int drivnum, const machine_config *config, const iop ((entry->read.type != AMH_NONE && scan->read.type != AMH_NONE) || (entry->write.type != AMH_NONE && scan->write.type != AMH_NONE))) { - mame_printf_warning("%s: %s '%s' %s space has overlapping memory (%X-%X,%d,%d) vs (%X-%X,%d,%d)\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->read.type, entry->write.type, scan->addrstart, scan->addrend, scan->read.type, scan->write.type); + mame_printf_warning("%s: %s '%s' %s space has overlapping memory (%X-%X,%d,%d) vs (%X-%X,%d,%d)\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->read.type, entry->write.type, scan->addrstart, scan->addrend, scan->read.type, scan->write.type); detected_overlap = TRUE; break; } @@ -1344,7 +1343,7 @@ static int validate_devices(int drivnum, const machine_config *config, const iop /* if this is a program space, auto-assign implicit ROM entries */ if (entry->read.type == AMH_ROM && entry->region == NULL) { - entry->region = device->tag; + entry->region = devconfig->tag; entry->rgnoffs = entry->addrstart; } @@ -1359,7 +1358,7 @@ static int validate_devices(int drivnum, const machine_config *config, const iop /* stop if we hit an empty */ if (rgninfo->entries[rgnnum].tag == NULL) { - mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X references non-existant region '%s'\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region); + mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X references non-existant region '%s'\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region); error = TRUE; break; } @@ -1370,7 +1369,7 @@ static int validate_devices(int drivnum, const machine_config *config, const iop offs_t length = rgninfo->entries[rgnnum].length; if (entry->rgnoffs + (byteend - bytestart + 1) > length) { - mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X extends beyond region '%s' size (%X)\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region, length); + mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X extends beyond region '%s' size (%X)\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region, length); error = TRUE; } break; @@ -1382,7 +1381,7 @@ static int validate_devices(int drivnum, const machine_config *config, const iop if ((entry->read.type == AMH_DEVICE_HANDLER && entry->read.tag != NULL && config->devicelist.find(entry->read.tag) == NULL) || (entry->write.type == AMH_DEVICE_HANDLER && entry->write.tag != NULL && config->devicelist.find(entry->write.tag) == NULL)) { - mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant device '%s'\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], entry->write.tag); + mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant device '%s'\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], entry->write.tag); error = TRUE; } @@ -1390,7 +1389,7 @@ static int validate_devices(int drivnum, const machine_config *config, const iop if ((entry->read.type == AMH_PORT && entry->read.tag != NULL && portlist.find(entry->read.tag) == NULL) || (entry->write.type == AMH_PORT && entry->write.tag != NULL && portlist.find(entry->write.tag) == NULL)) { - mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant port tag '%s'\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], entry->read.tag); + mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant port tag '%s'\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], entry->read.tag); error = TRUE; } @@ -1405,12 +1404,12 @@ static int validate_devices(int drivnum, const machine_config *config, const iop /* if there are base or size members, check that they are within bounds */ if (entry->baseptroffs_plus1 != 0 && (entry->baseptroffs_plus1 - 1) >= config->driver_data_size) { - mame_printf_error("%s: %s device '%s' %s space memory map has an out of bounds AM_BASE_MEMBER entry\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum]); + mame_printf_error("%s: %s device '%s' %s space memory map has an out of bounds AM_BASE_MEMBER entry\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum]); error = TRUE; } if (entry->sizeptroffs_plus1 != 0 && (entry->sizeptroffs_plus1 - 1) >= config->driver_data_size) { - mame_printf_error("%s: %s device '%s' %s space memory map has an out of bounds AM_SIZE_MEMBER entry\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum]); + mame_printf_error("%s: %s device '%s' %s space memory map has an out of bounds AM_SIZE_MEMBER entry\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum]); error = TRUE; } } diff --git a/src/emu/video.c b/src/emu/video.c index 2adf3d0ed6b..edfcc9044e7 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -176,7 +176,7 @@ static const UINT8 skiptable[FRAMESKIP_LEVELS][FRAMESKIP_LEVELS] = static void video_exit(running_machine *machine); static void init_buffered_spriteram(running_machine *machine); -static void realloc_screen_bitmaps(const device_config *screen); +static void realloc_screen_bitmaps(running_device *screen); static STATE_POSTLOAD( video_screen_postload ); /* global rendering */ @@ -195,7 +195,7 @@ static void recompute_speed(running_machine *machine, attotime emutime); static void update_refresh_speed(running_machine *machine); /* screen snapshots */ -static void create_snapshot_bitmap(const device_config *screen); +static void create_snapshot_bitmap(running_device *screen); static file_error mame_fopen_next(running_machine *machine, const char *pathoption, const char *extension, mame_file **file); /* movie recording */ @@ -204,7 +204,7 @@ static void video_avi_record_frame(running_machine *machine); /* burn-in generation */ static void video_update_burnin(running_machine *machine); -static void video_finalize_burnin(const device_config *screen); +static void video_finalize_burnin(running_device *screen); /* software rendering */ static void rgb888_draw_primitives(const render_primitive *primlist, void *dstdata, UINT32 width, UINT32 height, UINT32 pitch); @@ -220,7 +220,7 @@ static void rgb888_draw_primitives(const render_primitive *primlist, void *dstda in device is, in fact, a screen -------------------------------------------------*/ -INLINE screen_state *get_safe_token(const device_config *device) +INLINE screen_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -454,10 +454,10 @@ static void init_buffered_spriteram(running_machine *machine) of a screen -------------------------------------------------*/ -void video_screen_configure(const device_config *screen, int width, int height, const rectangle *visarea, attoseconds_t frame_period) +void video_screen_configure(running_device *screen, int width, int height, const rectangle *visarea, attoseconds_t frame_period) { screen_state *state = get_safe_token(screen); - screen_config *config = (screen_config *)screen->inline_config; + screen_config *config = (screen_config *)screen->baseconfig().inline_config; /* validate arguments */ assert(width > 0); @@ -509,10 +509,10 @@ void video_screen_configure(const device_config *screen, int width, int height, bitmaps as necessary -------------------------------------------------*/ -static void realloc_screen_bitmaps(const device_config *screen) +static void realloc_screen_bitmaps(running_device *screen) { screen_state *state = get_safe_token(screen); - screen_config *config = (screen_config *)screen->inline_config; + screen_config *config = (screen_config *)screen->baseconfig().inline_config; if (config->type != SCREEN_TYPE_VECTOR) { int curwidth = 0, curheight = 0; @@ -574,7 +574,7 @@ static void realloc_screen_bitmaps(const device_config *screen) of a screen -------------------------------------------------*/ -void video_screen_set_visarea(const device_config *screen, int min_x, int max_x, int min_y, int max_y) +void video_screen_set_visarea(running_device *screen, int min_x, int max_x, int min_y, int max_y) { screen_state *state = get_safe_token(screen); rectangle visarea; @@ -600,7 +600,7 @@ void video_screen_set_visarea(const device_config *screen, int min_x, int max_x, including the specified scanline -------------------------------------------------*/ -int video_screen_update_partial(const device_config *screen, int scanline) +int video_screen_update_partial(running_device *screen, int scanline) { screen_state *state = get_safe_token(screen); rectangle clip = state->visarea; @@ -672,7 +672,7 @@ int video_screen_update_partial(const device_config *screen, int scanline) beam position -------------------------------------------------*/ -void video_screen_update_now(const device_config *screen) +void video_screen_update_now(running_device *screen) { screen_state *state = get_safe_token(screen); int current_vpos = video_screen_get_vpos(screen); @@ -699,7 +699,7 @@ void video_screen_update_now(const device_config *screen) screen -------------------------------------------------*/ -int video_screen_get_vpos(const device_config *screen) +int video_screen_get_vpos(running_device *screen) { screen_state *state = get_safe_token(screen); attoseconds_t delta = attotime_to_attoseconds(attotime_sub(timer_get_time(screen->machine), state->vblank_start_time)); @@ -722,7 +722,7 @@ int video_screen_get_vpos(const device_config *screen) screen -------------------------------------------------*/ -int video_screen_get_hpos(const device_config *screen) +int video_screen_get_hpos(running_device *screen) { screen_state *state = get_safe_token(screen); attoseconds_t delta = attotime_to_attoseconds(attotime_sub(timer_get_time(screen->machine), state->vblank_start_time)); @@ -748,7 +748,7 @@ int video_screen_get_hpos(const device_config *screen) state of a given screen -------------------------------------------------*/ -int video_screen_get_vblank(const device_config *screen) +int video_screen_get_vblank(running_device *screen) { screen_state *state = get_safe_token(screen); @@ -764,7 +764,7 @@ int video_screen_get_vblank(const device_config *screen) state of a given screen -------------------------------------------------*/ -int video_screen_get_hblank(const device_config *screen) +int video_screen_get_hblank(running_device *screen) { screen_state *state = get_safe_token(screen); int hpos = video_screen_get_hpos(screen); @@ -776,7 +776,7 @@ int video_screen_get_hblank(const device_config *screen) video_screen_get_width - returns the width of a given screen -------------------------------------------------*/ -int video_screen_get_width(const device_config *screen) +int video_screen_get_width(running_device *screen) { screen_state *state = get_safe_token(screen); return state->width; @@ -787,7 +787,7 @@ int video_screen_get_width(const device_config *screen) video_screen_get_height - returns the height of a given screen -------------------------------------------------*/ -int video_screen_get_height(const device_config *screen) +int video_screen_get_height(running_device *screen) { screen_state *state = get_safe_token(screen); return state->height; @@ -798,7 +798,7 @@ int video_screen_get_height(const device_config *screen) video_screen_get_visible_area - returns the visible area of a given screen -------------------------------------------------*/ -const rectangle *video_screen_get_visible_area(const device_config *screen) +const rectangle *video_screen_get_visible_area(running_device *screen) { screen_state *state = get_safe_token(screen); return &state->visarea; @@ -811,7 +811,7 @@ const rectangle *video_screen_get_visible_area(const device_config *screen) at the given hpos,vpos -------------------------------------------------*/ -attotime video_screen_get_time_until_pos(const device_config *screen, int vpos, int hpos) +attotime video_screen_get_time_until_pos(running_device *screen, int vpos, int hpos) { screen_state *state = get_safe_token(screen); attoseconds_t curdelta = attotime_to_attoseconds(attotime_sub(timer_get_time(screen->machine), state->vblank_start_time)); @@ -845,7 +845,7 @@ attotime video_screen_get_time_until_pos(const device_config *screen, int vpos, the next VBLANK period start -------------------------------------------------*/ -attotime video_screen_get_time_until_vblank_start(const device_config *screen) +attotime video_screen_get_time_until_vblank_start(running_device *screen) { return video_screen_get_time_until_pos(screen, video_screen_get_visible_area(screen)->max_y + 1, 0); } @@ -858,7 +858,7 @@ attotime video_screen_get_time_until_vblank_start(const device_config *screen) or the end of the next VBLANK -------------------------------------------------*/ -attotime video_screen_get_time_until_vblank_end(const device_config *screen) +attotime video_screen_get_time_until_vblank_end(running_device *screen) { attotime ret; screen_state *state = get_safe_token(screen); @@ -882,7 +882,7 @@ attotime video_screen_get_time_until_vblank_end(const device_config *screen) the next VBLANK period start -------------------------------------------------*/ -attotime video_screen_get_time_until_update(const device_config *screen) +attotime video_screen_get_time_until_update(running_device *screen) { if (screen->machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK) return video_screen_get_time_until_vblank_end(screen); @@ -897,7 +897,7 @@ attotime video_screen_get_time_until_update(const device_config *screen) scanline -------------------------------------------------*/ -attotime video_screen_get_scan_period(const device_config *screen) +attotime video_screen_get_scan_period(running_device *screen) { screen_state *state = get_safe_token(screen); return attotime_make(0, state->scantime); @@ -910,7 +910,7 @@ attotime video_screen_get_scan_period(const device_config *screen) complete frame -------------------------------------------------*/ -attotime video_screen_get_frame_period(const device_config *screen) +attotime video_screen_get_frame_period(running_device *screen) { attotime ret; @@ -936,7 +936,7 @@ attotime video_screen_get_frame_period(const device_config *screen) emulated machine -------------------------------------------------*/ -UINT64 video_screen_get_frame_number(const device_config *screen) +UINT64 video_screen_get_frame_number(running_device *screen) { screen_state *state = get_safe_token(screen); return state->frame_number; @@ -948,7 +948,7 @@ UINT64 video_screen_get_frame_number(const device_config *screen) VBLANK callback for a specific screen -------------------------------------------------*/ -void video_screen_register_vblank_callback(const device_config *screen, vblank_state_changed_func vblank_callback, void *param) +void video_screen_register_vblank_callback(running_device *screen, vblank_state_changed_func vblank_callback, void *param) { screen_state *state = get_safe_token(screen); int i, found; @@ -990,7 +990,7 @@ void video_screen_register_vblank_callback(const device_config *screen, vblank_s static DEVICE_START( video_screen ) { - const device_config *screen = device; + running_device *screen = device; screen_state *state = get_safe_token(screen); render_container_user_settings settings; render_container *container; @@ -998,8 +998,8 @@ static DEVICE_START( video_screen ) /* validate some basic stuff */ assert(screen != NULL); - assert(screen->static_config == NULL); - assert(screen->inline_config != NULL); + assert(screen->baseconfig().static_config == NULL); + assert(screen->baseconfig().inline_config != NULL); assert(screen->machine != NULL); assert(screen->machine->config != NULL); @@ -1008,7 +1008,7 @@ static DEVICE_START( video_screen ) assert(container != NULL); /* get and validate the configuration */ - config = (screen_config *)screen->inline_config; + config = (screen_config *)screen->baseconfig().inline_config; assert(config->width > 0); assert(config->height > 0); assert(config->refresh > 0); @@ -1092,7 +1092,7 @@ static DEVICE_START( video_screen ) static STATE_POSTLOAD( video_screen_postload ) { - const device_config *screen = (const device_config *)param; + running_device *screen = (running_device *)param; realloc_screen_bitmaps(screen); global.movie_next_frame_time = timer_get_time(machine); } @@ -1105,7 +1105,7 @@ static STATE_POSTLOAD( video_screen_postload ) static DEVICE_STOP( video_screen ) { - const device_config *screen = device; + running_device *screen = device; screen_state *state = get_safe_token(screen); if (state->texture[0] != NULL) @@ -1166,7 +1166,7 @@ DEVICE_GET_INFO( video_screen ) static TIMER_CALLBACK( vblank_begin_callback ) { int i; - const device_config *screen = (const device_config *)ptr; + running_device *screen = (running_device *)ptr; screen_state *state = get_safe_token(screen); /* reset the starting VBLANK time */ @@ -1200,7 +1200,7 @@ static TIMER_CALLBACK( vblank_begin_callback ) static TIMER_CALLBACK( vblank_end_callback ) { int i; - const device_config *screen = (const device_config *)ptr; + running_device *screen = (running_device *)ptr; screen_state *state = get_safe_token(screen); /* call the screen specific callbacks */ @@ -1235,7 +1235,7 @@ static TIMER_CALLBACK( screenless_update_callback ) static TIMER_CALLBACK( scanline0_callback ) { - const device_config *screen = (const device_config *)ptr; + running_device *screen = (running_device *)ptr; screen_state *state = get_safe_token(screen); /* reset partial updates */ @@ -1253,7 +1253,7 @@ static TIMER_CALLBACK( scanline0_callback ) static TIMER_CALLBACK( scanline_update_callback ) { - const device_config *screen = (const device_config *)ptr; + running_device *screen = (running_device *)ptr; screen_state *state = get_safe_token(screen); int scanline = param; @@ -1350,22 +1350,22 @@ void video_frame_update(running_machine *machine, int debug) static int finish_screen_updates(running_machine *machine) { - const device_config *screen; + running_device *screen; int anything_changed = FALSE; /* finish updating the screens */ - for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen)) + for (screen = video_screen_first(machine); screen != NULL; screen = video_screen_next(screen)) video_screen_update_partial(screen, video_screen_get_visible_area(screen)->max_y); /* now add the quads for all the screens */ - for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen)) + for (screen = video_screen_first(machine); screen != NULL; screen = video_screen_next(screen)) { screen_state *state = get_safe_token(screen); /* only update if live */ if (render_is_live_screen(screen)) { - const screen_config *config = (const screen_config *)screen->inline_config; + const screen_config *config = (const screen_config *)screen->baseconfig().inline_config; /* only update if empty and not a vector game; otherwise assume the driver did it directly */ if (config->type != SCREEN_TYPE_VECTOR && (machine->config->video_attributes & VIDEO_SELF_RENDER) == 0) @@ -1405,7 +1405,7 @@ static int finish_screen_updates(running_machine *machine) } /* draw any crosshairs */ - for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen)) + for (screen = video_screen_first(machine); screen != NULL; screen = video_screen_next(screen)) crosshair_render(screen); return anything_changed; @@ -1872,12 +1872,12 @@ static void update_refresh_speed(running_machine *machine) { attoseconds_t min_frame_period = ATTOSECONDS_PER_SECOND; UINT32 original_speed = original_speed_setting(); - const device_config *screen; + running_device *screen; UINT32 target_speed; /* find the screen with the shortest frame period (max refresh rate) */ /* note that we first check the token since this can get called before all screens are created */ - for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen)) + for (screen = video_screen_first(machine); screen != NULL; screen = video_screen_next(screen)) if (screen->token != NULL) { screen_state *state = get_safe_token(screen); @@ -1987,7 +1987,7 @@ static void recompute_speed(running_machine *machine, attotime emutime) to the given file handle -------------------------------------------------*/ -void video_screen_save_snapshot(running_machine *machine, const device_config *screen, mame_file *fp) +void video_screen_save_snapshot(running_machine *machine, running_device *screen, mame_file *fp) { png_info pnginfo = { 0 }; const rgb_t *palette; @@ -2024,7 +2024,7 @@ void video_screen_save_snapshot(running_machine *machine, const device_config *s void video_save_active_screen_snapshots(running_machine *machine) { mame_file *fp; - const device_config *screen; + running_device *screen; /* validate */ assert(machine != NULL); @@ -2034,7 +2034,7 @@ void video_save_active_screen_snapshots(running_machine *machine) if (global.snap_native) { /* write one snapshot per visible screen */ - for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen)) + for (screen = video_screen_first(machine); screen != NULL; screen = video_screen_next(screen)) if (render_is_live_screen(screen)) { file_error filerr = mame_fopen_next(machine, SEARCHPATH_SCREENSHOT, "png", &fp); @@ -2065,7 +2065,7 @@ void video_save_active_screen_snapshots(running_machine *machine) given screen -------------------------------------------------*/ -static void create_snapshot_bitmap(const device_config *screen) +static void create_snapshot_bitmap(running_device *screen) { const render_primitive_list *primlist; INT32 width, height; @@ -2074,7 +2074,7 @@ static void create_snapshot_bitmap(const device_config *screen) /* select the appropriate view in our dummy target */ if (global.snap_native && screen != NULL) { - view_index = screen->machine->config->devicelist.index(VIDEO_SCREEN, screen->tag.cstr()); + view_index = screen->machine->devicelist.index(VIDEO_SCREEN, screen->tag.cstr()); assert(view_index != -1); render_target_set_view(global.snap_target, view_index); } @@ -2463,10 +2463,10 @@ void video_avi_add_sound(running_machine *machine, const INT16 *sound, int numsa #undef rand static void video_update_burnin(running_machine *machine) { - const device_config *screen; + running_device *screen; /* iterate over screens and update the burnin for the ones that care */ - for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen)) + for (screen = video_screen_first(machine); screen != NULL; screen = video_screen_next(screen)) { screen_state *state = get_safe_token(screen); if (state->burnin != NULL) @@ -2532,7 +2532,7 @@ static void video_update_burnin(running_machine *machine) bitmaps for all screens -------------------------------------------------*/ -static void video_finalize_burnin(const device_config *screen) +static void video_finalize_burnin(running_device *screen) { screen_state *state = get_safe_token(screen); if (state->burnin != NULL) diff --git a/src/emu/video.h b/src/emu/video.h index 9c2a8dd8ed0..774cb9f16c1 100644 --- a/src/emu/video.h +++ b/src/emu/video.h @@ -48,7 +48,7 @@ enum #define video_screen_first(config) (config)->devicelist.first(VIDEO_SCREEN) #define video_screen_next(previous) (previous)->typenext() -#define video_screen_get_format(screen) (((screen_config *)(screen)->inline_config)->format) +#define video_screen_get_format(screen) (((screen_config *)(screen)->baseconfig().inline_config)->format) /* allocates a bitmap that has the same dimensions and format as the passed in screen */ #define video_screen_auto_bitmap_alloc(screen) auto_bitmap_alloc(screen->machine, video_screen_get_width(screen), video_screen_get_height(screen), video_screen_get_format(screen)) @@ -90,7 +90,7 @@ struct _screen_config in the VBLANK state -------------------------------------------------*/ -typedef void (*vblank_state_changed_func)(const device_config *device, void *param, int vblank_state); +typedef void (*vblank_state_changed_func)(running_device *device, void *param, int vblank_state); @@ -159,57 +159,57 @@ void video_init(running_machine *machine); /* ----- screen management ----- */ /* set the resolution of a screen */ -void video_screen_configure(const device_config *screen, int width, int height, const rectangle *visarea, attoseconds_t refresh); +void video_screen_configure(running_device *screen, int width, int height, const rectangle *visarea, attoseconds_t refresh); /* set the visible area of a screen; this is a subset of video_screen_configure */ -void video_screen_set_visarea(const device_config *screen, int min_x, int max_x, int min_y, int max_y); +void video_screen_set_visarea(running_device *screen, int min_x, int max_x, int min_y, int max_y); /* force a partial update of the screen up to and including the requested scanline */ -int video_screen_update_partial(const device_config *screen, int scanline); +int video_screen_update_partial(running_device *screen, int scanline); /* force an update from the last beam position up to the current beam position */ -void video_screen_update_now(const device_config *screen); +void video_screen_update_now(running_device *screen); /* return the current vertical or horizontal position of the beam for a screen */ -int video_screen_get_vpos(const device_config *screen); -int video_screen_get_hpos(const device_config *screen); +int video_screen_get_vpos(running_device *screen); +int video_screen_get_hpos(running_device *screen); /* return the current vertical or horizontal blanking state for a screen */ -int video_screen_get_vblank(const device_config *screen); -int video_screen_get_hblank(const device_config *screen); +int video_screen_get_vblank(running_device *screen); +int video_screen_get_hblank(running_device *screen); /* return the current width for a screen */ -int video_screen_get_width(const device_config *screen); +int video_screen_get_width(running_device *screen); /* return the current height for a screen */ -int video_screen_get_height(const device_config *screen); +int video_screen_get_height(running_device *screen); /* return the current visible area for a screen */ -const rectangle *video_screen_get_visible_area(const device_config *screen); +const rectangle *video_screen_get_visible_area(running_device *screen); /* return the time when the beam will reach a particular H,V position */ -attotime video_screen_get_time_until_pos(const device_config *screen, int vpos, int hpos); +attotime video_screen_get_time_until_pos(running_device *screen, int vpos, int hpos); /* return the time when the beam will reach the start of VBLANK */ -attotime video_screen_get_time_until_vblank_start(const device_config *screen); +attotime video_screen_get_time_until_vblank_start(running_device *screen); /* return the time when the beam will reach the end of VBLANK */ -attotime video_screen_get_time_until_vblank_end(const device_config *screen); +attotime video_screen_get_time_until_vblank_end(running_device *screen); /* return the time when the VIDEO_UPDATE function will be called */ -attotime video_screen_get_time_until_update(const device_config *screen); +attotime video_screen_get_time_until_update(running_device *screen); /* return the amount of time the beam takes to draw one scan line */ -attotime video_screen_get_scan_period(const device_config *screen); +attotime video_screen_get_scan_period(running_device *screen); /* return the amount of time the beam takes to draw one complete frame */ -attotime video_screen_get_frame_period(const device_config *screen); +attotime video_screen_get_frame_period(running_device *screen); /* return the current frame number -- this is always increasing */ -UINT64 video_screen_get_frame_number(const device_config *screen); +UINT64 video_screen_get_frame_number(running_device *screen); /* registers a VBLANK callback for the given screen */ -void video_screen_register_vblank_callback(const device_config *screen, vblank_state_changed_func vblank_callback, void *param); +void video_screen_register_vblank_callback(running_device *screen, vblank_state_changed_func vblank_callback, void *param); /* ----- video screen device interface ----- */ @@ -256,7 +256,7 @@ void video_set_fastforward(int fastforward); /* ----- snapshots ----- */ /* save a snapshot of a given screen */ -void video_screen_save_snapshot(running_machine *machine, const device_config *screen, mame_file *fp); +void video_screen_save_snapshot(running_machine *machine, running_device *screen, mame_file *fp); /* save a snapshot of all the active screens */ void video_save_active_screen_snapshots(running_machine *machine); diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c index 2726e577b98..e311cd8cc98 100644 --- a/src/emu/video/mc6845.c +++ b/src/emu/video/mc6845.c @@ -74,7 +74,7 @@ struct _mc6845_t int device_type; const mc6845_interface *intf; - const device_config *screen; + running_device *screen; /* register file */ UINT8 horiz_char_total; /* 0x00 */ @@ -142,7 +142,7 @@ mc6845_interface mc6845_null_interface = { 0 }; /* makes sure that the passed in device is the right type */ -INLINE mc6845_t *get_safe_token(const device_config *device) +INLINE mc6845_t *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -166,7 +166,7 @@ static STATE_POSTLOAD( mc6845_state_save_postload ) static TIMER_CALLBACK( on_update_address_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; mc6845_t *mc6845 = get_safe_token(device); int addr = (param >> 8); int strobe = (param & 0xff); @@ -182,7 +182,7 @@ static TIMER_CALLBACK( on_update_address_cb ) } } -INLINE void call_on_update_address(const device_config *device, int strobe) +INLINE void call_on_update_address(running_device *device, int strobe) { mc6845_t *mc6845 = get_safe_token(device); @@ -548,7 +548,7 @@ static void update_vsync_changed_timers(mc6845_t *mc6845) static TIMER_CALLBACK( upd_adr_timer_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; /* fire a update address strobe */ call_on_update_address(device, 0); @@ -557,7 +557,7 @@ static TIMER_CALLBACK( upd_adr_timer_cb ) static TIMER_CALLBACK( de_changed_timer_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; mc6845_t *mc6845 = get_safe_token(device); /* call the callback function -- we know it exists */ @@ -569,7 +569,7 @@ static TIMER_CALLBACK( de_changed_timer_cb ) static TIMER_CALLBACK( cur_on_timer_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; mc6845_t *mc6845 = get_safe_token(device); /* call the callback function -- we know it exists */ @@ -579,7 +579,7 @@ static TIMER_CALLBACK( cur_on_timer_cb ) static TIMER_CALLBACK( cur_off_timer_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; mc6845_t *mc6845 = get_safe_token(device); /* call the callback function -- we know it exists */ @@ -591,7 +591,7 @@ static TIMER_CALLBACK( cur_off_timer_cb ) static TIMER_CALLBACK( vsync_on_timer_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; mc6845_t *mc6845 = get_safe_token(device); /* call the callback function -- we know it exists */ @@ -601,7 +601,7 @@ static TIMER_CALLBACK( vsync_on_timer_cb ) static TIMER_CALLBACK( vsync_off_timer_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; mc6845_t *mc6845 = get_safe_token(device); /* call the callback function -- we know it exists */ @@ -613,7 +613,7 @@ static TIMER_CALLBACK( vsync_off_timer_cb ) static TIMER_CALLBACK( hsync_on_timer_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; mc6845_t *mc6845 = get_safe_token(device); /* call the callback function -- we know it exists */ @@ -623,7 +623,7 @@ static TIMER_CALLBACK( hsync_on_timer_cb ) static TIMER_CALLBACK( hsync_off_timer_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; mc6845_t *mc6845 = get_safe_token(device); /* call the callback function -- we know it exists */ @@ -634,7 +634,7 @@ static TIMER_CALLBACK( hsync_off_timer_cb ) -UINT16 mc6845_get_ma(const device_config *device) +UINT16 mc6845_get_ma(running_device *device) { UINT16 ret; mc6845_t *mc6845 = get_safe_token(device); @@ -664,7 +664,7 @@ UINT16 mc6845_get_ma(const device_config *device) } -UINT8 mc6845_get_ra(const device_config *device) +UINT8 mc6845_get_ra(running_device *device) { UINT8 ret; mc6845_t *mc6845 = get_safe_token(device); @@ -688,7 +688,7 @@ UINT8 mc6845_get_ra(const device_config *device) static TIMER_CALLBACK( light_pen_latch_timer_cb ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; mc6845_t *mc6845 = get_safe_token(device); mc6845->light_pen_addr = mc6845_get_ma(device); @@ -696,7 +696,7 @@ static TIMER_CALLBACK( light_pen_latch_timer_cb ) } -void mc6845_assert_light_pen_input(const device_config *device) +void mc6845_assert_light_pen_input(running_device *device) { int y, x; int char_x; @@ -729,7 +729,7 @@ void mc6845_assert_light_pen_input(const device_config *device) } -void mc6845_set_clock(const device_config *device, int clock) +void mc6845_set_clock(running_device *device, int clock) { mc6845_t *mc6845 = get_safe_token(device); @@ -744,7 +744,7 @@ void mc6845_set_clock(const device_config *device, int clock) } -void mc6845_set_hpixels_per_column(const device_config *device, int hpixels_per_column) +void mc6845_set_hpixels_per_column(running_device *device, int hpixels_per_column) { mc6845_t *mc6845 = get_safe_token(device); @@ -790,7 +790,7 @@ static void update_cursor_state(mc6845_t *mc6845) } -void mc6845_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) +void mc6845_update(running_device *device, bitmap_t *bitmap, const rectangle *cliprect) { mc6845_t *mc6845 = get_safe_token(device); assert(bitmap != NULL); @@ -854,14 +854,14 @@ void mc6845_update(const device_config *device, bitmap_t *bitmap, const rectangl /* device interface */ -static void common_start(const device_config *device, int device_type) +static void common_start(running_device *device, int device_type) { mc6845_t *mc6845 = get_safe_token(device); /* validate arguments */ assert(device != NULL); - mc6845->intf = (const mc6845_interface *)device->static_config; + mc6845->intf = (const mc6845_interface *)device->baseconfig().static_config; mc6845->device_type = device_type; if (mc6845->intf != NULL) diff --git a/src/emu/video/mc6845.h b/src/emu/video/mc6845.h index 73c34365220..c1fef2be436 100644 --- a/src/emu/video/mc6845.h +++ b/src/emu/video/mc6845.h @@ -25,21 +25,21 @@ /* callback definitions */ -typedef void * (*mc6845_begin_update_func)(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); -#define MC6845_BEGIN_UPDATE(name) void *name(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) +typedef void * (*mc6845_begin_update_func)(running_device *device, bitmap_t *bitmap, const rectangle *cliprect); +#define MC6845_BEGIN_UPDATE(name) void *name(running_device *device, bitmap_t *bitmap, const rectangle *cliprect) -typedef void (*mc6845_update_row_func)(const device_config *device, bitmap_t *bitmap, +typedef void (*mc6845_update_row_func)(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param); -#define MC6845_UPDATE_ROW(name) void name(const device_config *device, bitmap_t *bitmap, \ +#define MC6845_UPDATE_ROW(name) void name(running_device *device, bitmap_t *bitmap, \ const rectangle *cliprect, UINT16 ma, UINT8 ra, \ UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) -typedef void (*mc6845_end_update_func)(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, void *param); -#define MC6845_END_UPDATE(name) void name(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, void *param) +typedef void (*mc6845_end_update_func)(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, void *param); +#define MC6845_END_UPDATE(name) void name(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, void *param) -typedef void (*mc6845_on_update_addr_changed_func)(const device_config *device, int address, int strobe); -#define MC6845_ON_UPDATE_ADDR_CHANGED(name) void name(const device_config *device, int address, int strobe) +typedef void (*mc6845_on_update_addr_changed_func)(running_device *device, int address, int strobe); +#define MC6845_ON_UPDATE_ADDR_CHANGED(name) void name(running_device *device, int address, int strobe) /* interface */ typedef struct _mc6845_interface mc6845_interface; @@ -106,23 +106,23 @@ READ8_DEVICE_HANDLER( mc6845_register_r ); WRITE8_DEVICE_HANDLER( mc6845_register_w ); /* return the current value on the MA0-MA13 pins */ -UINT16 mc6845_get_ma(const device_config *device); +UINT16 mc6845_get_ma(running_device *device); /* return the current value on the RA0-RA4 pins */ -UINT8 mc6845_get_ra(const device_config *device); +UINT8 mc6845_get_ra(running_device *device); /* simulates the LO->HI clocking of the light pen pin (pin 3) */ -void mc6845_assert_light_pen_input(const device_config *device); +void mc6845_assert_light_pen_input(running_device *device); /* set the clock (pin 21) of the chip */ -void mc6845_set_clock(const device_config *device, int clock); +void mc6845_set_clock(running_device *device, int clock); /* set number of pixels per video memory address */ -void mc6845_set_hpixels_per_column(const device_config *device, int hpixels_per_column); +void mc6845_set_hpixels_per_column(running_device *device, int hpixels_per_column); /* updates the screen -- this will call begin_update(), followed by update_row() reapeatedly and after all row updating is complete, end_update() */ -void mc6845_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); +void mc6845_update(running_device *device, bitmap_t *bitmap, const rectangle *cliprect); #endif diff --git a/src/emu/video/s2636.c b/src/emu/video/s2636.c index 8347e211253..6e1c600aae5 100644 --- a/src/emu/video/s2636.c +++ b/src/emu/video/s2636.c @@ -113,7 +113,7 @@ struct _s2636_state * *************************************/ -INLINE s2636_state *get_safe_token( const device_config *device ) +INLINE s2636_state *get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -122,11 +122,11 @@ INLINE s2636_state *get_safe_token( const device_config *device ) return (s2636_state *)device->token; } -INLINE const s2636_interface *get_interface( const device_config *device ) +INLINE const s2636_interface *get_interface( running_device *device ) { assert(device != NULL); assert((device->type == S2636)); - return (const s2636_interface *) device->static_config; + return (const s2636_interface *) device->baseconfig().static_config; } @@ -190,7 +190,7 @@ static void draw_sprite( UINT8 *gfx, int color, int y, int x, int expand, int or * *************************************/ -static int check_collision( const device_config *device, int spriteno1, int spriteno2, const rectangle *cliprect ) +static int check_collision( running_device *device, int spriteno1, int spriteno2, const rectangle *cliprect ) { s2636_state *s2636 = get_safe_token(device); int checksum = 0; @@ -254,7 +254,7 @@ static int check_collision( const device_config *device, int spriteno1, int spri * *************************************/ -bitmap_t *s2636_update( const device_config *device, const rectangle *cliprect ) +bitmap_t *s2636_update( running_device *device, const rectangle *cliprect ) { s2636_state *s2636 = get_safe_token(device); UINT8 collision = 0; @@ -342,7 +342,7 @@ static DEVICE_START( s2636 ) { s2636_state *s2636 = get_safe_token(device); const s2636_interface *intf = get_interface(device); - const device_config *screen = device->machine->device(intf->screen); + running_device *screen = device->machine->device(intf->screen); int width = video_screen_get_width(screen); int height = video_screen_get_height(screen); diff --git a/src/emu/video/s2636.h b/src/emu/video/s2636.h index d0702ce4f42..22018ad8ee1 100644 --- a/src/emu/video/s2636.h +++ b/src/emu/video/s2636.h @@ -59,7 +59,7 @@ DEVICE_GET_INFO( s2636 ); D0-D2 of each pixel is the pixel color D3 indicates whether the S2636 drew this pixel - 0 = not drawn, 1 = drawn */ -bitmap_t *s2636_update( const device_config *device, const rectangle *cliprect ); +bitmap_t *s2636_update( running_device *device, const rectangle *cliprect ); WRITE8_DEVICE_HANDLER( s2636_work_ram_w ); READ8_DEVICE_HANDLER( s2636_work_ram_r ); diff --git a/src/emu/video/saa5050.c b/src/emu/video/saa5050.c index 8addaedcf90..3a45b48a25d 100644 --- a/src/emu/video/saa5050.c +++ b/src/emu/video/saa5050.c @@ -34,7 +34,7 @@ typedef struct _saa5050_state saa5050_state; struct _saa5050_state { - const device_config *screen; + running_device *screen; int gfxnum; int x, y; int size; @@ -56,7 +56,7 @@ struct _saa5050_state * *************************************/ -INLINE saa5050_state *get_safe_token( const device_config *device ) +INLINE saa5050_state *get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -65,11 +65,11 @@ INLINE saa5050_state *get_safe_token( const device_config *device ) return (saa5050_state *)device->token; } -INLINE const saa5050_interface *get_interface( const device_config *device ) +INLINE const saa5050_interface *get_interface( running_device *device ) { assert(device != NULL); assert((device->type == SAA5050)); - return (const saa5050_interface *) device->static_config; + return (const saa5050_interface *) device->baseconfig().static_config; } /************************************* @@ -198,7 +198,7 @@ READ8_DEVICE_HANDLER( saa5050_videoram_r ) /* this should probably be put at the end of saa5050 update, but p2000t in MESS does not seem to currently support it. Hence, we leave it independent for the moment */ -void saa5050_frame_advance( const device_config *device ) +void saa5050_frame_advance( running_device *device ) { saa5050_state *saa5050 = get_safe_token(device); @@ -207,7 +207,7 @@ void saa5050_frame_advance( const device_config *device ) saa5050->frame_count = 0; } -void saa5050_update( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ) +void saa5050_update( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ) { saa5050_state *saa5050 = get_safe_token(device); int code, colour; diff --git a/src/emu/video/saa5050.h b/src/emu/video/saa5050.h index d0f772e2e1c..28fb330b527 100644 --- a/src/emu/video/saa5050.h +++ b/src/emu/video/saa5050.h @@ -47,8 +47,8 @@ DEVICE_GET_INFO( saa5050 ); DEVICE I/O FUNCTIONS ***************************************************************************/ -void saa5050_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); -void saa5050_frame_advance(const device_config *device); +void saa5050_update(running_device *device, bitmap_t *bitmap, const rectangle *cliprect); +void saa5050_frame_advance(running_device *device); GFXDECODE_EXTERN( saa5050 ); PALETTE_INIT( saa5050 ); diff --git a/src/emu/video/tms34061.c b/src/emu/video/tms34061.c index f9a6f6e5c62..71f2e1b2d7a 100644 --- a/src/emu/video/tms34061.c +++ b/src/emu/video/tms34061.c @@ -35,7 +35,7 @@ struct tms34061_data UINT8 * shiftreg; emu_timer * timer; struct tms34061_interface intf; - const device_config *screen; + running_device *screen; }; diff --git a/src/emu/video/tms9927.c b/src/emu/video/tms9927.c index 16d4403f466..29a77b26fe4 100644 --- a/src/emu/video/tms9927.c +++ b/src/emu/video/tms9927.c @@ -35,7 +35,7 @@ struct _tms9927_state { /* driver-controlled state */ const tms9927_interface *intf; - const device_config *screen; + running_device *screen; const UINT8 *selfload; /* live state */ @@ -60,7 +60,7 @@ tms9927_interface tms9927_null_interface = { 0 }; /* makes sure that the passed in device is the right type */ -INLINE tms9927_state *get_safe_token(const device_config *device) +INLINE tms9927_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -75,7 +75,7 @@ static STATE_POSTLOAD( tms9927_state_save_postload ) } -static void generic_access(const device_config *device, offs_t offset) +static void generic_access(running_device *device, offs_t offset) { tms9927_state *tms = get_safe_token(device); @@ -175,21 +175,21 @@ READ8_DEVICE_HANDLER( tms9927_r ) } -int tms9927_screen_reset(const device_config *device) +int tms9927_screen_reset(running_device *device) { tms9927_state *tms = get_safe_token(device); return tms->reset; } -int tms9927_upscroll_offset(const device_config *device) +int tms9927_upscroll_offset(running_device *device) { tms9927_state *tms = get_safe_token(device); return tms->start_datarow; } -int tms9927_cursor_bounds(const device_config *device, rectangle *bounds) +int tms9927_cursor_bounds(running_device *device, rectangle *bounds) { tms9927_state *tms = get_safe_token(device); int cursorx = CURSOR_CHAR_ADDRESS(tms); @@ -260,7 +260,7 @@ static DEVICE_START( tms9927 ) /* validate arguments */ assert(device != NULL); - tms->intf = (const tms9927_interface *)device->static_config; + tms->intf = (const tms9927_interface *)device->baseconfig().static_config; if (tms->intf != NULL) { diff --git a/src/emu/video/tms9927.h b/src/emu/video/tms9927.h index f4c02cad898..1f721b82682 100644 --- a/src/emu/video/tms9927.h +++ b/src/emu/video/tms9927.h @@ -51,9 +51,9 @@ WRITE8_DEVICE_HANDLER( tms9927_w ); READ8_DEVICE_HANDLER( tms9927_r ); /* other queries */ -int tms9927_screen_reset(const device_config *device); -int tms9927_upscroll_offset(const device_config *device); -int tms9927_cursor_bounds(const device_config *device, rectangle *bounds); +int tms9927_screen_reset(running_device *device); +int tms9927_upscroll_offset(running_device *device); +int tms9927_cursor_bounds(running_device *device, rectangle *bounds); diff --git a/src/emu/video/tms9928a.c b/src/emu/video/tms9928a.c index d0eb541e8cc..954335fc39f 100644 --- a/src/emu/video/tms9928a.c +++ b/src/emu/video/tms9928a.c @@ -100,17 +100,17 @@ static const rgb_t TMS9928A_palette[16] = /* ** Forward declarations of internal functions. */ -static void draw_mode0 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_mode1 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_mode2 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_mode12 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_mode3 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_mode23 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_modebogus (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); -static void draw_sprites (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode0 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode1 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode2 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode12 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode3 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_mode23 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_modebogus (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect); +static void draw_sprites (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect); static void change_register (running_machine *machine, int reg, UINT8 data); -static void (*const ModeHandlers[])(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) = { +static void (*const ModeHandlers[])(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) = { draw_mode0, draw_mode1, draw_mode2, draw_mode12, draw_mode3, draw_modebogus, draw_mode23, draw_modebogus @@ -451,7 +451,7 @@ int TMS9928A_interrupt(running_machine *machine) { return b; } -static void draw_mode1 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode1 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { int pattern,x,y,yy,xx,name,charcode; UINT8 fg,bg,*patternptr; rectangle rt; @@ -486,7 +486,7 @@ static void draw_mode1 (const device_config *screen, bitmap_t *bitmap, const rec } } -static void draw_mode12 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode12 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { int pattern,x,y,yy,xx,name,charcode; UINT8 fg,bg,*patternptr; const pen_t *pens; @@ -521,7 +521,7 @@ static void draw_mode12 (const device_config *screen, bitmap_t *bitmap, const re } } -static void draw_mode0 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode0 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { int pattern,x,y,yy,xx,name,charcode,colour; UINT8 fg,bg,*patternptr; const pen_t *pens; @@ -547,7 +547,7 @@ static void draw_mode0 (const device_config *screen, bitmap_t *bitmap, const rec } } -static void draw_mode2 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode2 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { int colour,name,x,y,yy,pattern,xx,charcode; UINT8 fg,bg; const pen_t *pens; @@ -577,7 +577,7 @@ static void draw_mode2 (const device_config *screen, bitmap_t *bitmap, const rec } } -static void draw_mode3 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode3 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { int x,y,yy,yyy,name,charcode; UINT8 fg,bg,*patternptr; const pen_t *pens; @@ -607,7 +607,7 @@ static void draw_mode3 (const device_config *screen, bitmap_t *bitmap, const rec } } -static void draw_mode23 (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_mode23 (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { int x,y,yy,yyy,name,charcode; UINT8 fg,bg,*patternptr; const pen_t *pens; @@ -638,7 +638,7 @@ static void draw_mode23 (const device_config *screen, bitmap_t *bitmap, const re } } -static void draw_modebogus (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_modebogus (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { UINT8 fg,bg; int x,y,n,xx; const pen_t *pens; @@ -667,7 +667,7 @@ static void draw_modebogus (const device_config *screen, bitmap_t *bitmap, const ** ** This code should be optimized. One day. */ -static void draw_sprites (const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) { +static void draw_sprites (running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { UINT8 *attributeptr,*patternptr,c; int p,x,y,size,i,j,large,yy,xx,limit[192], illegalsprite,illegalspriteline; diff --git a/src/emu/video/v9938.c b/src/emu/video/v9938.c index 3e885050eab..69262c850aa 100644 --- a/src/emu/video/v9938.c +++ b/src/emu/video/v9938.c @@ -50,7 +50,7 @@ typedef struct { UINT16 pal_ind16[16]; UINT16 pal_ind256[256]; /* render screen */ - const device_config *screen; + running_device *screen; /* render bitmap */ bitmap_t *bitmap; /* Command unit */ @@ -478,7 +478,7 @@ WRITE8_HANDLER (v9938_1_command_w) ***************************************************************************/ -void v9938_init (running_machine *machine, int which, const device_config *screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine *, int) ) +void v9938_init (running_machine *machine, int which, running_device *screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine *, int) ) { vdp = &vdps[which]; diff --git a/src/emu/video/v9938.h b/src/emu/video/v9938.h index 5872b9a9325..45d4bc5e380 100644 --- a/src/emu/video/v9938.h +++ b/src/emu/video/v9938.h @@ -14,7 +14,7 @@ #define RENDER_LOW (1) #define RENDER_AUTO (2) -void v9938_init (running_machine *machine, int which, const device_config *screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine *, int) ); +void v9938_init (running_machine *machine, int which, running_device *screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine *, int) ); void v9938_reset (int which); int v9938_interrupt (running_machine *machine, int which); void v9938_set_sprite_limit (int which, int); diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h index e2ff3fce926..07c9f115691 100644 --- a/src/emu/video/vooddefs.h +++ b/src/emu/video/vooddefs.h @@ -1669,9 +1669,9 @@ struct _banshee_info struct _voodoo_state { UINT8 index; /* index of board */ - const device_config *device; /* pointer to our containing device */ - const device_config *screen; /* the screen we are acting on */ - const device_config *cpu; /* the CPU we interact with */ + running_device *device; /* pointer to our containing device */ + running_device *screen; /* the screen we are acting on */ + running_device *cpu; /* the CPU we interact with */ UINT8 type; /* type of system */ UINT8 chipmask; /* mask for which chips are available */ UINT32 freq; /* operating frequency */ diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c index 64ad5299459..802c16f649a 100644 --- a/src/emu/video/voodoo.c +++ b/src/emu/video/voodoo.c @@ -270,7 +270,7 @@ static const raster_info predef_raster_table[] = in device is, in fact, a voodoo device -------------------------------------------------*/ -INLINE voodoo_state *get_safe_token(const device_config *device) +INLINE voodoo_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -287,7 +287,7 @@ INLINE voodoo_state *get_safe_token(const device_config *device) * *************************************/ -int voodoo_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect) +int voodoo_update(running_device *device, bitmap_t *bitmap, const rectangle *cliprect) { voodoo_state *v = get_safe_token(device); int changed = v->fbi.video_changed; @@ -424,21 +424,21 @@ int voodoo_update(const device_config *device, bitmap_t *bitmap, const rectangle * *************************************/ -int voodoo_get_type(const device_config *device) +int voodoo_get_type(running_device *device) { voodoo_state *v = get_safe_token(device); return v->type; } -int voodoo_is_stalled(const device_config *device) +int voodoo_is_stalled(running_device *device) { voodoo_state *v = get_safe_token(device); return (v->pci.stall_state != NOT_STALLED); } -void voodoo_set_init_enable(const device_config *device, UINT32 newval) +void voodoo_set_init_enable(running_device *device, UINT32 newval) { voodoo_state *v = get_safe_token(device); v->pci.init_enable = newval; @@ -613,7 +613,7 @@ static STATE_POSTLOAD( voodoo_postload ) } -static void init_save_state(const device_config *device) +static void init_save_state(running_device *device) { voodoo_state *v = get_safe_token(device); int index, subindex; @@ -4440,7 +4440,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w ) static DEVICE_START( voodoo ) { - const voodoo_config *config = (const voodoo_config *)device->inline_config; + const voodoo_config *config = (const voodoo_config *)device->baseconfig().inline_config; voodoo_state *v = get_safe_token(device); const raster_info *info; void *fbmem, *tmumem[2]; @@ -4448,8 +4448,8 @@ static DEVICE_START( voodoo ) int val; /* validate some basic stuff */ - assert(device->static_config == NULL); - assert(device->inline_config != NULL); + assert(device->baseconfig().static_config == NULL); + assert(device->baseconfig().inline_config != NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); @@ -4538,7 +4538,7 @@ static DEVICE_START( voodoo ) } /* set the type, and initialize the chip mask */ - v->index = device->machine->config->devicelist.index(device->type, device->tag); + v->index = device->machine->devicelist.index(device->type, device->tag); v->screen = device->machine->device(config->screen); assert_always(v->screen != NULL, "Unable to find screen attached to voodoo"); v->cpu = device->machine->device(config->cputag); @@ -4645,9 +4645,9 @@ static DEVICE_RESET( voodoo ) device definition -------------------------------------------------*/ -INLINE const char *get_voodoo_name(const device_config *device) +INLINE const char *get_voodoo_name(const device_config *devconfig) { - const voodoo_config *config = (device != NULL) ? (const voodoo_config *)device->inline_config : NULL; + const voodoo_config *config = (devconfig != NULL) ? (const voodoo_config *)devconfig->inline_config : NULL; switch (config->type) { default: diff --git a/src/emu/video/voodoo.h b/src/emu/video/voodoo.h index 551a5fde608..28dc5bee7ef 100644 --- a/src/emu/video/voodoo.h +++ b/src/emu/video/voodoo.h @@ -32,8 +32,8 @@ enum TYPE DEFINITIONS ***************************************************************************/ -typedef void (*voodoo_vblank_func)(const device_config *device, int state); -typedef void (*voodoo_stall_func)(const device_config *device, int state); +typedef void (*voodoo_vblank_func)(running_device *device, int state); +typedef void (*voodoo_stall_func)(running_device *device, int state); typedef struct _voodoo_config voodoo_config; @@ -94,10 +94,10 @@ struct _voodoo_config FUNCTION PROTOTYPES ***************************************************************************/ -int voodoo_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); -int voodoo_get_type(const device_config *device); -int voodoo_is_stalled(const device_config *device); -void voodoo_set_init_enable(const device_config *device, UINT32 newval); +int voodoo_update(running_device *device, bitmap_t *bitmap, const rectangle *cliprect); +int voodoo_get_type(running_device *device); +int voodoo_is_stalled(running_device *device); +void voodoo_set_init_enable(running_device *device, UINT32 newval); READ32_DEVICE_HANDLER( voodoo_r ); WRITE32_DEVICE_HANDLER( voodoo_w ); diff --git a/src/emu/watchdog.c b/src/emu/watchdog.c index 6d0e91b827c..209dee1e5f3 100644 --- a/src/emu/watchdog.c +++ b/src/emu/watchdog.c @@ -84,7 +84,7 @@ static TIMER_CALLBACK( watchdog_callback ) timers -------------------------------------------------*/ -static void on_vblank(const device_config *screen, void *param, int vblank_state) +static void on_vblank(running_device *screen, void *param, int vblank_state) { /* VBLANK starting */ if (vblank_state && watchdog_enabled) diff --git a/src/ldplayer/ldplayer.c b/src/ldplayer/ldplayer.c index 0a84537e554..34ee75fb118 100644 --- a/src/ldplayer/ldplayer.c +++ b/src/ldplayer/ldplayer.c @@ -72,7 +72,7 @@ static emu_timer *pr8210_bit_timer; static UINT32 pr8210_command_buffer_in, pr8210_command_buffer_out; static UINT8 pr8210_command_buffer[10]; -static void (*execute_command)(const device_config *laserdisc, int command); +static void (*execute_command)(running_device *laserdisc, int command); @@ -87,7 +87,7 @@ static void free_string(running_machine *machine) } -static chd_file *get_disc(const device_config *device) +static chd_file *get_disc(running_device *device) { mame_file *image_file = NULL; chd_file *image_chd = NULL; @@ -152,7 +152,7 @@ static chd_file *get_disc(const device_config *device) * *************************************/ -static void process_commands(const device_config *laserdisc) +static void process_commands(running_device *laserdisc) { input_port_value controls = input_port_read(laserdisc->machine, "controls"); int number; @@ -227,7 +227,7 @@ static void process_commands(const device_config *laserdisc) static TIMER_CALLBACK( vsync_update ) { - const device_config *laserdisc = machine->config->devicelist.first(LASERDISC); + running_device *laserdisc = machine->devicelist.first(LASERDISC); int vblank_scanline; attotime target; @@ -250,7 +250,7 @@ static MACHINE_START( ldplayer ) static TIMER_CALLBACK( autoplay ) { - const device_config *laserdisc = machine->config->devicelist.first(LASERDISC); + running_device *laserdisc = machine->devicelist.first(LASERDISC); /* start playing */ (*execute_command)(laserdisc, CMD_PLAY); @@ -284,7 +284,7 @@ INLINE void pr8210_add_command(UINT8 command) static TIMER_CALLBACK( pr8210_bit_off_callback ) { - const device_config *laserdisc = (const device_config *)ptr; + running_device *laserdisc = (running_device *)ptr; /* deassert the control line */ laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, CLEAR_LINE); @@ -294,7 +294,7 @@ static TIMER_CALLBACK( pr8210_bit_off_callback ) static TIMER_CALLBACK( pr8210_bit_callback ) { attotime duration = ATTOTIME_IN_MSEC(30); - const device_config *laserdisc = (const device_config *)ptr; + running_device *laserdisc = (running_device *)ptr; UINT8 bitsleft = param >> 16; UINT8 data = param; @@ -323,7 +323,7 @@ static TIMER_CALLBACK( pr8210_bit_callback ) static MACHINE_START( pr8210 ) { - const device_config *laserdisc = machine->config->devicelist.first(LASERDISC); + running_device *laserdisc = machine->devicelist.first(LASERDISC); MACHINE_START_CALL(ldplayer); pr8210_bit_timer = timer_alloc(machine, pr8210_bit_callback, (void *)laserdisc); } @@ -336,7 +336,7 @@ static MACHINE_RESET( pr8210 ) } -static void pr8210_execute(const device_config *laserdisc, int command) +static void pr8210_execute(running_device *laserdisc, int command) { static const UINT8 digits[10] = { 0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d, 0x03, 0x13 }; @@ -452,7 +452,7 @@ static void pr8210_execute(const device_config *laserdisc, int command) * *************************************/ -static void ldv1000_execute(const device_config *laserdisc, int command) +static void ldv1000_execute(running_device *laserdisc, int command) { static const UINT8 digits[10] = { 0x3f, 0x0f, 0x8f, 0x4f, 0x2f, 0xaf, 0x6f, 0x1f, 0x9f, 0x5f }; switch (command) diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c index 637d5744c0e..b33d92d3cfa 100644 --- a/src/mame/audio/atarijsa.c +++ b/src/mame/audio/atarijsa.c @@ -49,15 +49,15 @@ static UINT8 *bank_source_data; static UINT8 speech_data; static UINT8 last_ctl; -static const device_config *jsacpu; +static running_device *jsacpu; static const char *test_port; static UINT16 test_mask; -static const device_config *pokey; -static const device_config *ym2151; -static const device_config *tms5220; -static const device_config *oki6295; -static const device_config *oki6295_l, *oki6295_r; +static running_device *pokey; +static running_device *ym2151; +static running_device *tms5220; +static running_device *oki6295; +static running_device *oki6295_l, *oki6295_r; static UINT8 overall_volume; static UINT8 pokey_volume; diff --git a/src/mame/audio/blockade.c b/src/mame/audio/blockade.c index 2f73816519e..4dffa55f1eb 100644 --- a/src/mame/audio/blockade.c +++ b/src/mame/audio/blockade.c @@ -44,7 +44,7 @@ WRITE8_DEVICE_HANDLER( blockade_sound_freq_w ) WRITE8_HANDLER( blockade_env_on_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); if (BLOCKADE_LOG) mame_printf_debug("Boom Start\n"); sample_start(samples, 0,0,0); return; diff --git a/src/mame/audio/cage.c b/src/mame/audio/cage.c index 8c514e251d9..d7d36136127 100644 --- a/src/mame/audio/cage.c +++ b/src/mame/audio/cage.c @@ -33,7 +33,7 @@ * *************************************/ -static const device_config *cage_cpu; +static running_device *cage_cpu; static attotime cage_cpu_h1_clock_period; static UINT8 cpu_to_cage_ready; @@ -45,10 +45,10 @@ static attotime serial_period_per_word; static UINT8 dma_enabled; static UINT8 dma_timer_enabled; -static const device_config *dma_timer; +static running_device *dma_timer; static UINT8 cage_timer_enabled[2]; -static const device_config *timer[2]; +static running_device *timer[2]; static UINT32 *tms32031_io_regs; @@ -57,7 +57,7 @@ static UINT16 cage_control; static UINT32 *speedup_ram; -static const device_config *dmadac[DAC_BUFFER_CHANNELS]; +static running_device *dmadac[DAC_BUFFER_CHANNELS]; diff --git a/src/mame/audio/carnival.c b/src/mame/audio/carnival.c index 1d5fd793b43..8a2790123ae 100644 --- a/src/mame/audio/carnival.c +++ b/src/mame/audio/carnival.c @@ -127,7 +127,7 @@ static int psgData = 0; WRITE8_HANDLER( carnival_audio_1_w ) { static int port1State = 0; - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); int bitsChanged; int bitsGoneHigh; int bitsGoneLow; @@ -206,7 +206,7 @@ WRITE8_HANDLER( carnival_audio_1_w ) WRITE8_HANDLER( carnival_audio_2_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); int bitsChanged; int bitsGoneHigh; int bitsGoneLow; diff --git a/src/mame/audio/cchasm.c b/src/mame/audio/cchasm.c index 5d1ea24f94f..be49d90a6d8 100644 --- a/src/mame/audio/cchasm.c +++ b/src/mame/audio/cchasm.c @@ -14,7 +14,7 @@ static int sound_flags; static int coin_flag; -static const device_config *ctc; +static running_device *ctc; WRITE8_HANDLER( cchasm_reset_coin_flag_w ) { diff --git a/src/mame/audio/cclimber.c b/src/mame/audio/cclimber.c index b212ac6c379..17268988b00 100644 --- a/src/mame/audio/cclimber.c +++ b/src/mame/audio/cclimber.c @@ -27,7 +27,7 @@ static void cclimber_play_sample(running_machine *machine, int start,int freq,in int len; int romlen = memory_region_length(machine, "samples"); const UINT8 *rom = memory_region(machine, "samples"); - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); if (!rom) return; diff --git a/src/mame/audio/cinemat.c b/src/mame/audio/cinemat.c index 953d3dcc010..d75cfd351e5 100644 --- a/src/mame/audio/cinemat.c +++ b/src/mame/audio/cinemat.c @@ -165,7 +165,7 @@ static const samples_interface spacewar_samples_interface = static void spacewar_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); /* Explosion - rising edge */ if (SOUNDVAL_RISING_EDGE(0x01)) @@ -245,7 +245,7 @@ static const samples_interface barrier_samples_interface = static void barrier_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); /* Player die - rising edge */ if (SOUNDVAL_RISING_EDGE(0x01)) @@ -299,7 +299,7 @@ static const samples_interface speedfrk_samples_interface = static void speedfrk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); /* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */ if (SOUNDVAL_FALLING_EDGE(0x08)) @@ -365,7 +365,7 @@ static const samples_interface starhawk_samples_interface = static void starhawk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); /* explosion - falling edge */ if (SOUNDVAL_FALLING_EDGE(0x01)) @@ -442,7 +442,7 @@ static const samples_interface sundance_samples_interface = static void sundance_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); /* bong - falling edge */ if (SOUNDVAL_FALLING_EDGE(0x01)) @@ -516,7 +516,7 @@ static void tailg_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_ /* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */ if (SOUNDVAL_FALLING_EDGE(0x10)) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); /* update the shift register (actually just a simple mux) */ current_shift = (current_shift & ~(1 << (sound_val & 7))) | (((sound_val >> 3) & 1) << (sound_val & 7)); @@ -602,7 +602,7 @@ static const samples_interface warrior_samples_interface = static void warrior_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); /* normal level - 0=on, 1=off */ if (SOUNDVAL_FALLING_EDGE(0x01)) @@ -674,7 +674,7 @@ static const samples_interface armora_samples_interface = static void armora_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x10)) @@ -776,7 +776,7 @@ static const samples_interface ripoff_samples_interface = static void ripoff_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); /* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x02)) @@ -864,7 +864,7 @@ static const samples_interface starcas_samples_interface = static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); UINT32 target_pitch; /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ @@ -978,7 +978,7 @@ static const samples_interface solarq_samples_interface = static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); static float target_volume, current_volume; /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ @@ -1119,7 +1119,7 @@ static const samples_interface boxingb_samples_interface = static void boxingb_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ if (SOUNDVAL_RISING_EDGE(0x10)) @@ -1251,7 +1251,7 @@ static const samples_interface wotw_samples_interface = static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); UINT32 target_pitch; /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ @@ -1365,7 +1365,7 @@ static const samples_interface wotwc_samples_interface = static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); UINT32 target_pitch; /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ diff --git a/src/mame/audio/crbaloon.c b/src/mame/audio/crbaloon.c index 6910caf740e..3320ce92547 100644 --- a/src/mame/audio/crbaloon.c +++ b/src/mame/audio/crbaloon.c @@ -42,13 +42,13 @@ WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_enable ) } -void crbaloon_audio_set_explosion_enable(const device_config *sn, int enabled) +void crbaloon_audio_set_explosion_enable(running_device *sn, int enabled) { sn76477_enable_w(sn, enabled); } -void crbaloon_audio_set_breath_enable(const device_config *sn, int enabled) +void crbaloon_audio_set_breath_enable(running_device *sn, int enabled) { /* changes slf_res to 10k (middle of two 10k resistors) it also puts a tantal capacitor against GND on the output, @@ -57,7 +57,7 @@ void crbaloon_audio_set_breath_enable(const device_config *sn, int enabled) } -void crbaloon_audio_set_appear_enable(const device_config *sn, int enabled) +void crbaloon_audio_set_appear_enable(running_device *sn, int enabled) { /* APPEAR is connected to MIXER B */ sn76477_mixer_b_w(sn, enabled); diff --git a/src/mame/audio/cyberbal.c b/src/mame/audio/cyberbal.c index ad8d4fcc756..8792f400fed 100644 --- a/src/mame/audio/cyberbal.c +++ b/src/mame/audio/cyberbal.c @@ -154,7 +154,7 @@ WRITE16_HANDLER( cyberbal_sound_68k_w ) WRITE16_HANDLER( cyberbal_sound_68k_dac_w ) { cyberbal_state *state = (cyberbal_state *)space->machine->driver_data; - const device_config *dac = devtag_get_device(space->machine, (offset & 8) ? "dac2" : "dac1"); + running_device *dac = devtag_get_device(space->machine, (offset & 8) ? "dac2" : "dac1"); dac_data_16_w(dac, (((data >> 3) & 0x800) | ((data >> 2) & 0x7ff)) << 4); if (state->fast_68k_int) diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c index 44869f6e6dd..91d197d3213 100644 --- a/src/mame/audio/dcs.c +++ b/src/mame/audio/dcs.c @@ -284,7 +284,7 @@ struct _dsio_denver_state typedef struct _dcs_state dcs_state; struct _dcs_state { - const device_config *cpu; + running_device *cpu; const address_space *program; const address_space *data; UINT8 rev; @@ -295,10 +295,10 @@ struct _dcs_state UINT8 channels; UINT16 size; UINT16 incs; - const device_config *dmadac[6]; - const device_config *reg_timer; - const device_config *sport_timer; - const device_config *internal_timer; + running_device *dmadac[6]; + running_device *reg_timer; + running_device *sport_timer; + running_device *internal_timer; INT32 ireg; UINT16 ireg_base; UINT16 control_regs[32]; @@ -323,8 +323,8 @@ struct _dcs_state UINT16 progflags; void (*output_full_cb)(running_machine *, int); void (*input_empty_cb)(running_machine *, int); - UINT16 (*fifo_data_r)(const device_config *device); - UINT16 (*fifo_status_r)(const device_config *device); + UINT16 (*fifo_data_r)(running_device *device); + UINT16 (*fifo_status_r)(running_device *device); /* timers */ UINT8 timer_enable; @@ -350,7 +350,7 @@ struct _hle_transfer_state INT32 writes_left; UINT16 sum; INT32 fifo_entries; - const device_config *watchdog; + running_device *watchdog; }; @@ -409,12 +409,12 @@ static WRITE16_HANDLER( output_latch_w ); static READ16_HANDLER( output_control_r ); static WRITE16_HANDLER( output_control_w ); -static void timer_enable_callback(const device_config *device, int enable); +static void timer_enable_callback(running_device *device, int enable); static TIMER_DEVICE_CALLBACK( internal_timer_callback ); static TIMER_DEVICE_CALLBACK( dcs_irq ); static TIMER_DEVICE_CALLBACK( sport0_irq ); static void recompute_sample_rate(running_machine *machine); -static void sound_tx_callback(const device_config *device, int port, INT32 data); +static void sound_tx_callback(running_device *device, int port, INT32 data); static READ16_HANDLER( dcs_polling_r ); static WRITE16_HANDLER( dcs_polling_w ); @@ -1493,7 +1493,7 @@ void dcs_set_io_callbacks(void (*output_full_cb)(running_machine *, int), void ( } -void dcs_set_fifo_callbacks(UINT16 (*fifo_data_r)(const device_config *device), UINT16 (*fifo_status_r)(const device_config *device)) +void dcs_set_fifo_callbacks(UINT16 (*fifo_data_r)(running_device *device), UINT16 (*fifo_status_r)(running_device *device)) { dcs.fifo_data_r = fifo_data_r; dcs.fifo_status_r = fifo_status_r; @@ -1793,7 +1793,7 @@ static void reset_timer(running_machine *machine) } -static void timer_enable_callback(const device_config *device, int enable) +static void timer_enable_callback(running_device *device, int enable) { dcs.timer_enable = enable; dcs.timer_ignore = 0; @@ -2009,7 +2009,7 @@ static void recompute_sample_rate(running_machine *machine) } -static void sound_tx_callback(const device_config *device, int port, INT32 data) +static void sound_tx_callback(running_device *device, int port, INT32 data) { /* check if it's for SPORT1 */ if (port != 1) diff --git a/src/mame/audio/dcs.h b/src/mame/audio/dcs.h index 1c46be99b7c..72558e4521d 100644 --- a/src/mame/audio/dcs.h +++ b/src/mame/audio/dcs.h @@ -16,7 +16,7 @@ void dcs_init(running_machine *machine); void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset); void dcs_set_auto_ack(int state); -void dcs_set_fifo_callbacks(UINT16 (*fifo_data_r)(const device_config *device), UINT16 (*fifo_status_r)(const device_config *device)); +void dcs_set_fifo_callbacks(UINT16 (*fifo_data_r)(running_device *device), UINT16 (*fifo_status_r)(running_device *device)); void dcs_set_io_callbacks(void (*output_full_cb)(running_machine *, int), void (*input_empty_cb)(running_machine *, int)); int dcs_data_r(void); diff --git a/src/mame/audio/depthch.c b/src/mame/audio/depthch.c index 041dc31c942..d8c2e35faca 100644 --- a/src/mame/audio/depthch.c +++ b/src/mame/audio/depthch.c @@ -56,7 +56,7 @@ enum WRITE8_HANDLER( depthch_audio_w ) { static int port1State = 0; - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); int bitsChanged; int bitsGoneHigh; int bitsGoneLow; diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c index a264c4c914d..6e10674014a 100644 --- a/src/mame/audio/exidy.c +++ b/src/mame/audio/exidy.c @@ -50,7 +50,7 @@ enum static UINT8 riot_irq_state; /* 6532 variables */ -static const device_config *riot; +static running_device *riot; /* 6840 variables */ struct sh6840_timer_channel @@ -113,7 +113,7 @@ static double freq_to_step; static WRITE_LINE_DEVICE_HANDLER( update_irq_state ) { - const device_config *pia = devtag_get_device(device->machine, "pia1"); + running_device *pia = devtag_get_device(device->machine, "pia1"); cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, (pia6821_get_irq_b(pia) | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE); } @@ -452,7 +452,7 @@ DEVICE_GET_INFO( exidy_sound ) * *************************************/ -static void r6532_irq(const device_config *device, int state) +static void r6532_irq(running_device *device, int state) { riot_irq_state = (state == ASSERT_LINE) ? 1 : 0; update_irq_state(device, 0); @@ -466,7 +466,7 @@ static WRITE8_DEVICE_HANDLER( r6532_porta_w ) if (has_tms5220) { - const device_config *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = devtag_get_device(device->machine, "tms"); logerror("(%f)%s:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), riot6532_porta_out_get(riot)); tms5220_data_w(tms, 0, data); } @@ -476,7 +476,7 @@ static READ8_DEVICE_HANDLER( r6532_porta_r ) { if (has_tms5220) { - const device_config *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = devtag_get_device(device->machine, "tms"); logerror("(%f)%s:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), tms5220_status_r(tms, 0)); return tms5220_status_r(tms, 0); } @@ -488,7 +488,7 @@ static WRITE8_DEVICE_HANDLER( r6532_portb_w ) { if (has_tms5220) { - const device_config *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = devtag_get_device(device->machine, "tms"); tms5220_rsq_w(tms, data & 0x01); tms5220_wsq_w(tms, (data >> 1) & 0x01); @@ -501,7 +501,7 @@ static READ8_DEVICE_HANDLER( r6532_portb_r ) UINT8 newdata = riot6532_portb_in_get(device); if (has_tms5220) { - const device_config *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = devtag_get_device(device->machine, "tms"); newdata &= ~0x0c; if (tms5220_readyq_r(tms)) newdata |= 0x04; if (tms5220_intq_r(tms)) newdata |= 0x08; @@ -911,7 +911,7 @@ static UINT8 victory_sound_response_ack_clk; /* 7474 @ F4 */ READ8_HANDLER( victory_sound_response_r ) { - const device_config *pia1 = devtag_get_device(space->machine, "pia1"); + running_device *pia1 = devtag_get_device(space->machine, "pia1"); UINT8 ret = pia6821_get_output_b(pia1); if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", cpu_get_previouspc(space->cpu), ret); @@ -924,7 +924,7 @@ READ8_HANDLER( victory_sound_response_r ) READ8_HANDLER( victory_sound_status_r ) { - const device_config *pia1 = devtag_get_device(space->machine, "pia1"); + running_device *pia1 = devtag_get_device(space->machine, "pia1"); UINT8 ret = (pia6821_ca1_r(pia1, 0) << 7) | (pia6821_cb1_r(pia1, 0) << 6); if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", cpu_get_previouspc(space->cpu), ret); @@ -935,7 +935,7 @@ READ8_HANDLER( victory_sound_status_r ) static TIMER_CALLBACK( delayed_command_w ) { - const device_config *pia1 = devtag_get_device(machine, "pia1"); + running_device *pia1 = devtag_get_device(machine, "pia1"); pia6821_set_input_a(pia1, param, 0); pia6821_ca1_w(pia1, 0, 0); } @@ -996,7 +996,7 @@ static DEVICE_START( victory_sound ) static DEVICE_RESET( victory_sound ) { - const device_config *pia1 = devtag_get_device(device->machine, "pia1"); + running_device *pia1 = devtag_get_device(device->machine, "pia1"); DEVICE_RESET_CALL(common_sh_reset); device_reset(pia1); diff --git a/src/mame/audio/gorf.c b/src/mame/audio/gorf.c index 4c7acba9b90..96ef520400e 100644 --- a/src/mame/audio/gorf.c +++ b/src/mame/audio/gorf.c @@ -116,7 +116,7 @@ static int plural = 0; READ8_HANDLER( gorf_speech_r ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); int Phoneme,Intonation; int i = 0; @@ -182,6 +182,6 @@ READ8_HANDLER( gorf_speech_r ) CUSTOM_INPUT( gorf_speech_status_r ) { - const device_config *samples = devtag_get_device(field->port->machine, "samples"); + running_device *samples = devtag_get_device(field->port->machine, "samples"); return !sample_playing(samples, 0); } diff --git a/src/mame/audio/gottlieb.c b/src/mame/audio/gottlieb.c index 64addf15578..1f5df525e96 100644 --- a/src/mame/audio/gottlieb.c +++ b/src/mame/audio/gottlieb.c @@ -41,9 +41,9 @@ static int score_sample; static int random_offset; -static void gottlieb1_sh_w(const device_config *riot, UINT8 data); +static void gottlieb1_sh_w(running_device *riot, UINT8 data); static void gottlieb2_sh_w(const address_space *space, UINT8 data); -static void trigger_sample(const device_config *samples, UINT8 data); +static void trigger_sample(running_device *samples, UINT8 data); @@ -55,7 +55,7 @@ static void trigger_sample(const device_config *samples, UINT8 data); WRITE8_HANDLER( gottlieb_sh_w ) { - const device_config *riot = devtag_get_device(space->machine, "riot"); + running_device *riot = devtag_get_device(space->machine, "riot"); /* identify rev1 boards by the presence of a 6532 RIOT device */ if (riot != NULL) @@ -72,9 +72,9 @@ WRITE8_HANDLER( gottlieb_sh_w ) * *************************************/ -static void gottlieb1_sh_w(const device_config *riot, UINT8 data) +static void gottlieb1_sh_w(running_device *riot, UINT8 data) { - const device_config *samples = devtag_get_device(riot->machine, "samples"); + running_device *samples = devtag_get_device(riot->machine, "samples"); int pa7 = (data & 0x0f) != 0xf; int pa0_5 = ~data & 0x3f; @@ -124,7 +124,7 @@ static const riot6532_interface gottlieb_riot6532_intf = * *************************************/ -static void play_sample(const device_config *samples, const char *phonemes) +static void play_sample(running_device *samples, const char *phonemes) { if (strcmp(phonemes, " HEH3LOOW AH1EH3I3YMTERI2NDAHN") == 0) /* Q-Bert - Hello, I am turned on */ sample_start(samples, 0, 42, 0); @@ -141,7 +141,7 @@ static void play_sample(const device_config *samples, const char *phonemes) } -static void trigger_sample(const device_config *samples, UINT8 data) +static void trigger_sample(running_device *samples, UINT8 data) { /* Reactor samples */ if (strcmp(samples->machine->gamedrv->name, "reactor") == 0) @@ -196,7 +196,7 @@ static void trigger_sample(const device_config *samples, UINT8 data) #ifdef UNUSED_FUNCTION void gottlieb_knocker(running_machine *machine) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); if (!strcmp(machine->gamedrv->name,"reactor")) /* reactor */ { } @@ -244,7 +244,7 @@ logerror("Votrax: intonation %d, phoneme %02x %s\n",data >> 6,data & 0x3f,Phonem { if (votrax_queuepos > 1) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); int last = -1; int i; char phonemes[200]; @@ -497,7 +497,7 @@ static WRITE8_HANDLER( speech_control_w ) { /* bit 3 selects which of the two 8913 to enable */ /* bit 4 goes to the 8913 BC1 pin */ - const device_config *ay = devtag_get_device(space->machine, (data & 0x08) ? "ay1" : "ay2"); + running_device *ay = devtag_get_device(space->machine, (data & 0x08) ? "ay1" : "ay2"); ay8910_data_address_w(ay, data >> 4, *psg_latch); } @@ -506,14 +506,14 @@ static WRITE8_HANDLER( speech_control_w ) /* bit 6 = speech chip DATA PRESENT pin; high then low to make the chip read data */ if ((previous & 0x40) == 0 && (data & 0x40) != 0) { - const device_config *sp = devtag_get_device(space->machine, "spsnd"); + running_device *sp = devtag_get_device(space->machine, "spsnd"); sp0250_w(sp, 0, *sp0250_latch); } /* bit 7 goes to the speech chip RESET pin */ if ((previous ^ data) & 0x80) { - const device_config *sp = devtag_get_device(space->machine, "spsnd"); + running_device *sp = devtag_get_device(space->machine, "spsnd"); device_reset(sp); } } diff --git a/src/mame/audio/gridlee.c b/src/mame/audio/gridlee.c index 7603341afc3..a338706d296 100644 --- a/src/mame/audio/gridlee.c +++ b/src/mame/audio/gridlee.c @@ -91,7 +91,7 @@ DEVICE_GET_INFO( gridlee_sound ) WRITE8_HANDLER( gridlee_sound_w ) { static UINT8 sound_data[24]; - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); stream_update(gridlee_stream); diff --git a/src/mame/audio/invinco.c b/src/mame/audio/invinco.c index 3c1d27bbe81..ecaf12d1159 100644 --- a/src/mame/audio/invinco.c +++ b/src/mame/audio/invinco.c @@ -66,7 +66,7 @@ enum WRITE8_HANDLER( invinco_audio_w ) { static int port2State = 0; - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); int bitsChanged; //int bitsGoneHigh; int bitsGoneLow; diff --git a/src/mame/audio/irem.c b/src/mame/audio/irem.c index 236361314af..803e33c6926 100644 --- a/src/mame/audio/irem.c +++ b/src/mame/audio/irem.c @@ -183,7 +183,7 @@ static WRITE8_HANDLER( m62_adpcm_w ) { irem_z80_state *state = (irem_z80_state *)space->machine->driver_data; - const device_config *adpcm = (offset & 1) ? state->adpcm2 : state->adpcm1; + running_device *adpcm = (offset & 1) ? state->adpcm2 : state->adpcm1; if (adpcm != NULL) msm5205_data_w(adpcm, data); } @@ -196,7 +196,7 @@ static WRITE8_HANDLER( m62_adpcm_w ) * *************************************/ -static void adpcm_int(const device_config *device) +static void adpcm_int(running_device *device) { irem_z80_state *state = (irem_z80_state *)device->machine->driver_data; diff --git a/src/mame/audio/jaguar.c b/src/mame/audio/jaguar.c index aee2d9a023b..528df3a6fb5 100644 --- a/src/mame/audio/jaguar.c +++ b/src/mame/audio/jaguar.c @@ -212,7 +212,7 @@ static void update_gpu_irq(running_machine *machine) } -void jaguar_external_int(const device_config *device, int state) +void jaguar_external_int(running_device *device, int state) { if (state != CLEAR_LINE) gpu_irq_state |= 1; diff --git a/src/mame/audio/jedi.c b/src/mame/audio/jedi.c index f0bfddacfbf..cd256a63b40 100644 --- a/src/mame/audio/jedi.c +++ b/src/mame/audio/jedi.c @@ -147,7 +147,7 @@ static WRITE8_HANDLER( speech_strobe_w ) if ((new_speech_strobe_state != state->speech_strobe_state) && new_speech_strobe_state) { - const device_config *tms = devtag_get_device(space->machine, "tms"); + running_device *tms = devtag_get_device(space->machine, "tms"); tms5220_data_w(tms, 0, *state->speech_data); } state->speech_strobe_state = new_speech_strobe_state; diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c index 3341f3f376f..42ff3b96f3f 100644 --- a/src/mame/audio/leland.c +++ b/src/mame/audio/leland.c @@ -514,7 +514,7 @@ static TIMER_CALLBACK( dma_timer_callback ); static DEVICE_START( common_sh_start ) { running_machine *machine = device->machine; - const address_space *dmaspace = memory_find_address_space(devtag_get_device(machine, "audiocpu"), ADDRESS_SPACE_PROGRAM); + const address_space *dmaspace = machine->device("audiocpu")->space(AS_PROGRAM); int i; /* determine which sound hardware is installed */ diff --git a/src/mame/audio/m72.c b/src/mame/audio/m72.c index 608ed6e3f50..6519d0a5c01 100644 --- a/src/mame/audio/m72.c +++ b/src/mame/audio/m72.c @@ -115,7 +115,7 @@ SOUND_RESET( m72 ) setvector_callback(machine, NULL, VECTOR_INIT); } -void m72_ym2151_irq_handler(const device_config *device, int irq) +void m72_ym2151_irq_handler(running_device *device, int irq) { if (irq) timer_call_after_resynch(device->machine, NULL, YM2151_ASSERT,setvector_callback); diff --git a/src/mame/audio/m72.h b/src/mame/audio/m72.h index 0bd6c4ecdae..b06c4005813 100644 --- a/src/mame/audio/m72.h +++ b/src/mame/audio/m72.h @@ -6,7 +6,7 @@ SOUND_START( m72 ); SOUND_RESET( m72 ); -void m72_ym2151_irq_handler(const device_config *device, int irq); +void m72_ym2151_irq_handler(running_device *device, int irq); WRITE8_HANDLER( m72_sound_command_byte_w ); WRITE16_HANDLER( m72_sound_command_w ); WRITE8_HANDLER( m72_sound_irq_ack_w ); diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c index c9225373454..a0e22cf5932 100644 --- a/src/mame/audio/mario.c +++ b/src/mame/audio/mario.c @@ -466,7 +466,7 @@ static void set_ea(const address_space *space, int ea) static SOUND_START( mario ) { mario_state *state = (mario_state *)machine->driver_data; - const device_config *audiocpu = devtag_get_device(machine, "audiocpu"); + running_device *audiocpu = devtag_get_device(machine, "audiocpu"); #if USE_8039 UINT8 *SND = memory_region(machine, "audiocpu"); diff --git a/src/mame/audio/mcr.c b/src/mame/audio/mcr.c index f9e0f3c9eb7..7ec5245f1f2 100644 --- a/src/mame/audio/mcr.c +++ b/src/mame/audio/mcr.c @@ -53,7 +53,7 @@ static UINT8 mcr_sound_config; static UINT16 dacval; /* SSIO-specific globals */ -static const device_config *ssio_sound_cpu; +static running_device *ssio_sound_cpu; static UINT8 ssio_data[4]; static UINT8 ssio_status; static UINT8 ssio_14024_count; @@ -67,19 +67,19 @@ static read8_space_func ssio_custom_input[5]; static write8_space_func ssio_custom_output[2]; /* Chip Squeak Deluxe-specific globals */ -static const device_config *csdeluxe_sound_cpu; +static running_device *csdeluxe_sound_cpu; static UINT8 csdeluxe_status; /* Turbo Chip Squeak-specific globals */ -static const device_config *turbocs_sound_cpu; +static running_device *turbocs_sound_cpu; static UINT8 turbocs_status; /* Sounds Good-specific globals */ -static const device_config *soundsgood_sound_cpu; +static running_device *soundsgood_sound_cpu; static UINT8 soundsgood_status; /* Squawk n' Talk-specific globals */ -static const device_config *squawkntalk_sound_cpu; +static running_device *squawkntalk_sound_cpu; static UINT8 squawkntalk_tms_command; static UINT8 squawkntalk_tms_strobes; @@ -321,8 +321,8 @@ static TIMER_CALLBACK( ssio_delayed_data_w ) static void ssio_update_volumes(running_machine *machine) { - const device_config *ay0 = devtag_get_device(machine, "ssio.1"); - const device_config *ay1 = devtag_get_device(machine, "ssio.2"); + running_device *ay0 = devtag_get_device(machine, "ssio.1"); + running_device *ay1 = devtag_get_device(machine, "ssio.2"); ay8910_set_volume(ay0, 0, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][0]]); ay8910_set_volume(ay0, 1, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][1]]); ay8910_set_volume(ay0, 2, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][2]]); @@ -519,7 +519,7 @@ static WRITE_LINE_DEVICE_HANDLER( csdeluxe_irq ) static TIMER_CALLBACK( csdeluxe_delayed_data_w ) { - const device_config *pia = devtag_get_device(machine, "csdpia"); + running_device *pia = devtag_get_device(machine, "csdpia"); pia6821_portb_w(pia, 0, param & 0x0f); pia6821_ca1_w(pia, 0, ~param & 0x10); @@ -657,7 +657,7 @@ static WRITE_LINE_DEVICE_HANDLER( soundsgood_irq ) static TIMER_CALLBACK( soundsgood_delayed_data_w ) { - const device_config *pia = devtag_get_device(machine, "sgpia"); + running_device *pia = devtag_get_device(machine, "sgpia"); pia6821_portb_w(pia, 0, (param >> 1) & 0x0f); pia6821_ca1_w(pia, 0, ~param & 0x01); @@ -761,7 +761,7 @@ static WRITE_LINE_DEVICE_HANDLER( turbocs_irq ) static TIMER_CALLBACK( turbocs_delayed_data_w ) { - const device_config *pia = devtag_get_device(machine, "tcspia"); + running_device *pia = devtag_get_device(machine, "tcspia"); pia6821_portb_w(pia, 0, (param >> 1) & 0x0f); pia6821_ca1_w(pia, 0, ~param & 0x01); @@ -858,7 +858,7 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_porta2_w ) static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w ) { - const device_config *tms = devtag_get_device(device->machine, "sntspeech"); + running_device *tms = devtag_get_device(device->machine, "sntspeech"); /* bits 0-1 select read/write strobes on the TMS5200 */ data &= 0x03; @@ -889,8 +889,8 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w ) static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq ) { - const device_config *pia0 = devtag_get_device(device->machine, "sntpia0"); - const device_config *pia1 = devtag_get_device(device->machine, "sntpia1"); + running_device *pia0 = devtag_get_device(device->machine, "sntpia0"); + running_device *pia1 = devtag_get_device(device->machine, "sntpia1"); int combined_state = pia6821_get_irq_a(pia0) | pia6821_get_irq_b(pia0) | pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1); cpu_set_input_line(squawkntalk_sound_cpu, M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); @@ -898,7 +898,7 @@ static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq ) static TIMER_CALLBACK( squawkntalk_delayed_data_w ) { - const device_config *pia0 = devtag_get_device(machine, "sntpia0"); + running_device *pia0 = devtag_get_device(machine, "sntpia0"); pia6821_porta_w(pia0, 0, ~param & 0x0f); pia6821_cb1_w(pia0, 0, ~param & 0x10); diff --git a/src/mame/audio/meadows.c b/src/mame/audio/meadows.c index 66d95311a71..1df49538c19 100644 --- a/src/mame/audio/meadows.c +++ b/src/mame/audio/meadows.c @@ -60,7 +60,7 @@ SAMPLES_START( meadows_sh_start ) /************************************/ void meadows_sh_update(running_machine *machine) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); int preset, amp; if (latched_0c01 != meadows_0c01 || latched_0c03 != meadows_0c03) diff --git a/src/mame/audio/micro3d.c b/src/mame/audio/micro3d.c index 0626cbaf70a..d93eaa72fcc 100644 --- a/src/mame/audio/micro3d.c +++ b/src/mame/audio/micro3d.c @@ -185,7 +185,7 @@ void micro3d_noise_sh_w(running_machine *machine, UINT8 data) if (~data & 8) { - const device_config *device = devtag_get_device(machine, data & 4 ? "noise_2" : "noise_1"); + running_device *device = devtag_get_device(machine, data & 4 ? "noise_2" : "noise_1"); noise_state *nstate = (noise_state *)device->token; if (state->dac_data != nstate->dac[data & 3]) @@ -210,7 +210,7 @@ void micro3d_noise_sh_w(running_machine *machine, UINT8 data) } } -INLINE noise_state *get_safe_token(const device_config *device) +INLINE noise_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -398,7 +398,7 @@ WRITE8_HANDLER( micro3d_sound_io_w ) } case 0x03: { - const device_config *upd = devtag_get_device(space->machine, "upd7759"); + running_device *upd = devtag_get_device(space->machine, "upd7759"); upd7759_set_bank_base(upd, (data & 0x4) ? 0x20000 : 0); upd7759_reset_w(upd, (data & 0x10) ? 0 : 1); break; diff --git a/src/mame/audio/mw8080bw.c b/src/mame/audio/mw8080bw.c index 9471bfd460f..e4d2a1762c3 100644 --- a/src/mame/audio/mw8080bw.c +++ b/src/mame/audio/mw8080bw.c @@ -577,7 +577,7 @@ MACHINE_DRIVER_START( maze_audio ) MACHINE_DRIVER_END -void maze_write_discrete(const device_config *device, UINT8 maze_tone_timing_state) +void maze_write_discrete(running_device *device, UINT8 maze_tone_timing_state) { /* controls need to be active low */ int controls = ~input_port_read(device->machine, "IN0") & 0xff; diff --git a/src/mame/audio/n8080.c b/src/mame/audio/n8080.c index 6674255be37..2d4095557f8 100644 --- a/src/mame/audio/n8080.c +++ b/src/mame/audio/n8080.c @@ -69,7 +69,7 @@ static const sn76477_interface spacefev_sn76477_interface = }; -static void spacefev_update_SN76477_status( const device_config *sn ) +static void spacefev_update_SN76477_status( running_device *sn ) { n8080_state *state = (n8080_state *)sn->machine->driver_data; double dblR0 = RES_M(1.0); @@ -99,7 +99,7 @@ static void spacefev_update_SN76477_status( const device_config *sn ) } -static void sheriff_update_SN76477_status( const device_config *sn ) +static void sheriff_update_SN76477_status( running_device *sn ) { n8080_state *state = (n8080_state *)sn->machine->driver_data; if (state->mono_flop[1]) @@ -121,7 +121,7 @@ static void sheriff_update_SN76477_status( const device_config *sn ) } -static void update_SN76477_status( const device_config *device ) +static void update_SN76477_status( running_device *device ) { n8080_state *state = (n8080_state *)device->machine->driver_data; if (state->n8080_hardware == 1) @@ -135,7 +135,7 @@ static void update_SN76477_status( const device_config *device ) } -static void start_mono_flop( const device_config *sn, int n, attotime expire ) +static void start_mono_flop( running_device *sn, int n, attotime expire ) { n8080_state *state = (n8080_state *)sn->machine->driver_data; state->mono_flop[n] = 1; @@ -146,7 +146,7 @@ static void start_mono_flop( const device_config *sn, int n, attotime expire ) } -static void stop_mono_flop( const device_config *sn, int n ) +static void stop_mono_flop( running_device *sn, int n ) { n8080_state *state = (n8080_state *)sn->machine->driver_data; state->mono_flop[n] = 0; @@ -165,7 +165,7 @@ static TIMER_CALLBACK( stop_mono_flop_callback ) static void spacefev_sound_pins_changed( running_machine *machine ) { - const device_config *sn = devtag_get_device(machine, "snsnd"); + running_device *sn = devtag_get_device(machine, "snsnd"); n8080_state *state = (n8080_state *)machine->driver_data; UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins; @@ -198,7 +198,7 @@ static void spacefev_sound_pins_changed( running_machine *machine ) static void sheriff_sound_pins_changed( running_machine *machine ) { - const device_config *sn = devtag_get_device(machine, "snsnd"); + running_device *sn = devtag_get_device(machine, "snsnd"); n8080_state *state = (n8080_state *)machine->driver_data; UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins; @@ -437,7 +437,7 @@ static WRITE8_HANDLER( helifire_sound_ctrl_w ) static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer ) { - const device_config *sn = devtag_get_device(timer->machine, "snsnd"); + running_device *sn = devtag_get_device(timer->machine, "snsnd"); n8080_state *state = (n8080_state *)timer->machine->driver_data; double voltage = 0; diff --git a/src/mame/audio/namco52.c b/src/mame/audio/namco52.c index 062836dbc49..7d8311d290e 100644 --- a/src/mame/audio/namco52.c +++ b/src/mame/audio/namco52.c @@ -52,8 +52,8 @@ typedef struct _namco_52xx_state namco_52xx_state; struct _namco_52xx_state { - const device_config *cpu; - const device_config *discrete; + running_device *cpu; + running_device *discrete; int basenode; devcb_resolved_read8 romread; devcb_resolved_read8 si; @@ -61,7 +61,7 @@ struct _namco_52xx_state UINT32 address; }; -INLINE namco_52xx_state *get_safe_token(const device_config *device) +INLINE namco_52xx_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -74,7 +74,7 @@ INLINE namco_52xx_state *get_safe_token(const device_config *device) static TIMER_CALLBACK( namco_52xx_latch_callback ) { - namco_52xx_state *state = get_safe_token((const device_config *)ptr); + namco_52xx_state *state = get_safe_token((running_device *)ptr); state->latched_cmd = param; } @@ -135,7 +135,7 @@ static WRITE8_HANDLER( namco_52xx_O_w ) static TIMER_CALLBACK( namco_52xx_irq_clear ) { - namco_52xx_state *state = get_safe_token((const device_config *)ptr); + namco_52xx_state *state = get_safe_token((running_device *)ptr); cpu_set_input_line(state->cpu, 0, CLEAR_LINE); } @@ -161,7 +161,7 @@ WRITE8_DEVICE_HANDLER( namco_52xx_write ) static TIMER_CALLBACK( external_clock_pulse ) { - namco_52xx_state *state = get_safe_token((const device_config *)ptr); + namco_52xx_state *state = get_safe_token((running_device *)ptr); mb88_external_clock_w(state->cpu, 1); mb88_external_clock_w(state->cpu, 0); } @@ -201,12 +201,12 @@ ROM_END static DEVICE_START( namco_52xx ) { - namco_52xx_interface *intf = (namco_52xx_interface *)device->static_config; + namco_52xx_interface *intf = (namco_52xx_interface *)device->baseconfig().static_config; namco_52xx_state *state = get_safe_token(device); astring tempstring; /* find our CPU */ - state->cpu = devtag_get_device(device->machine, device_build_tag(tempstring, device, "mcu")); + state->cpu = device->subdevice("mcu"); assert(state->cpu != NULL); /* find the attached discrete sound device */ diff --git a/src/mame/audio/namco54.c b/src/mame/audio/namco54.c index 162c53c0929..6a795a77d68 100644 --- a/src/mame/audio/namco54.c +++ b/src/mame/audio/namco54.c @@ -54,13 +54,13 @@ typedef struct _namco_54xx_state namco_54xx_state; struct _namco_54xx_state { - const device_config *cpu; - const device_config *discrete; + running_device *cpu; + running_device *discrete; int basenode; UINT8 latched_cmd; }; -INLINE namco_54xx_state *get_safe_token(const device_config *device) +INLINE namco_54xx_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -73,7 +73,7 @@ INLINE namco_54xx_state *get_safe_token(const device_config *device) static TIMER_CALLBACK( namco_54xx_latch_callback ) { - namco_54xx_state *state = get_safe_token((const device_config *)ptr); + namco_54xx_state *state = get_safe_token((running_device *)ptr); state->latched_cmd = param; } @@ -113,7 +113,7 @@ static WRITE8_HANDLER( namco_54xx_R1_w ) static TIMER_CALLBACK( namco_54xx_irq_clear ) { - namco_54xx_state *state = get_safe_token((const device_config *)ptr); + namco_54xx_state *state = get_safe_token((running_device *)ptr); cpu_set_input_line(state->cpu, 0, CLEAR_LINE); } @@ -165,12 +165,12 @@ ROM_END static DEVICE_START( namco_54xx ) { - namco_54xx_config *config = (namco_54xx_config *)device->inline_config; + namco_54xx_config *config = (namco_54xx_config *)device->baseconfig().inline_config; namco_54xx_state *state = get_safe_token(device); astring tempstring; /* find our CPU */ - state->cpu = devtag_get_device(device->machine, device_build_tag(tempstring, device, "mcu")); + state->cpu = device->subdevice("mcu"); assert(state->cpu != NULL); /* find the attached discrete sound device */ diff --git a/src/mame/audio/namcoc7x.c b/src/mame/audio/namcoc7x.c index 09bc1ada53b..555c12f1828 100644 --- a/src/mame/audio/namcoc7x.c +++ b/src/mame/audio/namcoc7x.c @@ -80,7 +80,7 @@ void namcoc7x_sound_write16(UINT16 command, UINT32 offset) void namcoc7x_on_driver_init(running_machine *machine) { UINT8 *pROM = (UINT8 *)memory_region(machine, "c7x"); - const device_config *cpu; + running_device *cpu; // clear the two 16-bits magic values at the start of the rom // (prevents external init routines from getting called - they assume a diff --git a/src/mame/audio/polyplay.c b/src/mame/audio/polyplay.c index 7d1b0b6bed2..8a26617defb 100644 --- a/src/mame/audio/polyplay.c +++ b/src/mame/audio/polyplay.c @@ -48,7 +48,7 @@ void polyplay_set_channel2(int active) void polyplay_play_channel1(running_machine *machine, int data) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); if (data) { freq1 = 2457600 / 16 / data / 8; sample_set_volume(samples, 0, channel_playing1 * 1.0); @@ -62,7 +62,7 @@ void polyplay_play_channel1(running_machine *machine, int data) void polyplay_play_channel2(running_machine *machine, int data) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); if (data) { freq2 = 2457600 / 16 / data / 8; sample_set_volume(samples, 1, channel_playing2 * 1.0); diff --git a/src/mame/audio/pulsar.c b/src/mame/audio/pulsar.c index 0f7bc0b2b4c..0a9ac0e8400 100644 --- a/src/mame/audio/pulsar.c +++ b/src/mame/audio/pulsar.c @@ -88,7 +88,7 @@ static int port1State = 0; WRITE8_HANDLER( pulsar_audio_1_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); int bitsChanged; //int bitsGoneHigh; int bitsGoneLow; @@ -139,7 +139,7 @@ WRITE8_HANDLER( pulsar_audio_1_w ) WRITE8_HANDLER( pulsar_audio_2_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); static int port2State = 0; int bitsChanged; int bitsGoneHigh; diff --git a/src/mame/audio/qix.c b/src/mame/audio/qix.c index 0068664241a..bc7e5c1926b 100644 --- a/src/mame/audio/qix.c +++ b/src/mame/audio/qix.c @@ -101,7 +101,7 @@ static WRITE8_DEVICE_HANDLER( sndpia_2_warning_w ) static TIMER_CALLBACK( deferred_sndpia1_porta_w ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; pia6821_porta_w(device, 0, param); } diff --git a/src/mame/audio/redalert.c b/src/mame/audio/redalert.c index 2ddc0753683..84579bbe809 100644 --- a/src/mame/audio/redalert.c +++ b/src/mame/audio/redalert.c @@ -309,8 +309,8 @@ static READ8_DEVICE_HANDLER( demoneye_ay8910_latch_2_r ) static WRITE8_DEVICE_HANDLER( demoneye_ay8910_data_w ) { - const device_config *ay1 = devtag_get_device(device->machine, "ay1"); - const device_config *ay2 = devtag_get_device(device->machine, "ay2"); + running_device *ay1 = devtag_get_device(device->machine, "ay1"); + running_device *ay2 = devtag_get_device(device->machine, "ay2"); switch (ay8910_latch_1 & 0x03) { diff --git a/src/mame/audio/scramble.c b/src/mame/audio/scramble.c index 93aeeb7f3f2..5c306cdac34 100644 --- a/src/mame/audio/scramble.c +++ b/src/mame/audio/scramble.c @@ -79,7 +79,7 @@ READ8_DEVICE_HANDLER( frogger_portB_r ) WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w ) { - const device_config *target = devtag_get_device(device->machine, "konami_7474"); + running_device *target = devtag_get_device(device->machine, "konami_7474"); /* the complement of bit 3 is connected to the flip-flop's clock */ ttl7474_clock_w(target, ~data & 0x08); @@ -91,7 +91,7 @@ WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w ) WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w ) { - const device_config *target = devtag_get_device(device->machine, "konami_7474"); + running_device *target = devtag_get_device(device->machine, "konami_7474"); /* the complement of bit 3 is connected to the flip-flop's clock */ ttl7474_clock_w(target, ~data & 0x08); @@ -100,7 +100,7 @@ WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w ) static IRQ_CALLBACK(scramble_sh_irq_callback) { - const device_config *target = devtag_get_device(device->machine, "konami_7474"); + running_device *target = devtag_get_device(device->machine, "konami_7474"); /* interrupt acknowledge clears the flip-flop -- we need to pulse the CLR line because MAME's core never clears this @@ -114,7 +114,7 @@ static IRQ_CALLBACK(scramble_sh_irq_callback) return 0xff; } -void scramble_sh_7474_callback(const device_config *device) +void scramble_sh_7474_callback(running_device *device) { /* the Q bar is connected to the Z80's INT line. But since INT is complemented, */ /* we need to complement Q bar */ @@ -132,7 +132,7 @@ READ8_DEVICE_HANDLER( hotshock_soundlatch_r ) return soundlatch_r(cputag_get_address_space(device->machine, "audiocpu", ADDRESS_SPACE_PROGRAM),0); } -static void filter_w(const device_config *device, int data) +static void filter_w(running_device *device, int data) { int C; @@ -243,7 +243,7 @@ static UINT8 speech_cnt; static TIMER_CALLBACK( ad2083_step ) { - const device_config *tms = devtag_get_device(machine, "tms"); + running_device *tms = devtag_get_device(machine, "tms"); /* only 16 bytes needed ... The original dump is bad. This * is what is needed to get speech to work. The prom data has @@ -278,7 +278,7 @@ static TIMER_CALLBACK( ad2083_step ) timer_set(machine, ATTOTIME_IN_HZ(AD2083_TMS5110_CLOCK / 2),NULL,1,ad2083_step); } -static int ad2083_speech_rom_read_bit(const device_config *device) +static int ad2083_speech_rom_read_bit(running_device *device) { UINT8 *ROM = memory_region(device->machine, "tms5110"); int bit; diff --git a/src/mame/audio/segag80r.c b/src/mame/audio/segag80r.c index d30db660d48..3046109cd66 100644 --- a/src/mame/audio/segag80r.c +++ b/src/mame/audio/segag80r.c @@ -244,7 +244,7 @@ WRITE8_HANDLER( astrob_sound_w ) { 120.0f, 82.0f, 62.0f, 56.0f, 47.0f, 39.0f, 33.0f, 27.0f, 24.0f, 22.0f }; - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); float freq_factor; UINT8 diff = data ^ sound_state[offset]; @@ -476,7 +476,7 @@ static SOUND_START( 005 ) static WRITE8_DEVICE_HANDLER( sega005_sound_a_w ) { - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); UINT8 diff = data ^ sound_state[0]; sound_state[0] = data; @@ -704,7 +704,7 @@ static SOUND_START( spaceod ) WRITE8_HANDLER( spaceod_sound_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); UINT8 diff = data ^ sound_state[offset]; sound_state[offset] = data; @@ -889,7 +889,7 @@ static SOUND_START( monsterb ) static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w ) { - const device_config *tms = devtag_get_device(device->machine, "music"); + running_device *tms = devtag_get_device(device->machine, "music"); int enable_val; /* Lower four data lines get decoded into 13 control lines */ @@ -910,7 +910,7 @@ static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w ) static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w ) { - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); UINT8 diff = data ^ sound_state[1]; sound_state[1] = data; diff --git a/src/mame/audio/segag80v.c b/src/mame/audio/segag80v.c index c08a8efa178..14c7f1a6fef 100644 --- a/src/mame/audio/segag80v.c +++ b/src/mame/audio/segag80v.c @@ -137,7 +137,7 @@ d0 crafts joining WRITE8_HANDLER( elim1_sh_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); data ^= 0xff; /* Play fireball sample */ @@ -171,7 +171,7 @@ WRITE8_HANDLER( elim1_sh_w ) WRITE8_HANDLER( elim2_sh_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); data ^= 0xff; /* Play thrust sample */ @@ -198,7 +198,7 @@ WRITE8_HANDLER( elim2_sh_w ) WRITE8_HANDLER( zektor1_sh_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); data ^= 0xff; @@ -233,7 +233,7 @@ WRITE8_HANDLER( zektor1_sh_w ) WRITE8_HANDLER( zektor2_sh_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); data ^= 0xff; /* Play thrust sample */ @@ -261,7 +261,7 @@ WRITE8_HANDLER( zektor2_sh_w ) WRITE8_HANDLER( spacfury1_sh_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); data ^= 0xff; /* craft growing */ @@ -298,7 +298,7 @@ WRITE8_HANDLER( spacfury1_sh_w ) WRITE8_HANDLER( spacfury2_sh_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); data ^= 0xff; /* craft joining */ diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c index 7f796448676..77d0a0eed66 100644 --- a/src/mame/audio/segasnd.c +++ b/src/mame/audio/segasnd.c @@ -81,7 +81,7 @@ typedef struct _usb_state usb_state; struct _usb_state { sound_stream * stream; /* output stream */ - const device_config *cpu; /* CPU index of the 8035 */ + running_device *cpu; /* CPU index of the 8035 */ UINT8 in_latch; /* input latch */ UINT8 out_latch; /* output latch */ UINT8 last_p2_value; /* current P2 output value */ @@ -192,7 +192,7 @@ static WRITE8_HANDLER( speech_p2_w ) * *************************************/ -static void speech_drq_w(const device_config *device, int level) +static void speech_drq_w(running_device *device, int level) { speech_drq = (level == ASSERT_LINE); } diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c index 9807edb48a1..c0ce83596ec 100644 --- a/src/mame/audio/seibu.c +++ b/src/mame/audio/seibu.c @@ -253,7 +253,7 @@ WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w ) /***************************************************************************/ -static const device_config *sound_cpu; +static running_device *sound_cpu; enum { @@ -312,17 +312,17 @@ WRITE8_HANDLER( seibu_rst18_ack_w ) update_irq_lines(space->machine, RST18_CLEAR); } -void seibu_ym3812_irqhandler(const device_config *device, int linestate) +void seibu_ym3812_irqhandler(running_device *device, int linestate) { update_irq_lines(device->machine, linestate ? RST10_ASSERT : RST10_CLEAR); } -void seibu_ym2151_irqhandler(const device_config *device, int linestate) +void seibu_ym2151_irqhandler(running_device *device, int linestate) { update_irq_lines(device->machine, linestate ? RST10_ASSERT : RST10_CLEAR); } -void seibu_ym2203_irqhandler(const device_config *device, int linestate) +void seibu_ym2203_irqhandler(running_device *device, int linestate) { update_irq_lines(device->machine, linestate ? RST10_ASSERT : RST10_CLEAR); } diff --git a/src/mame/audio/seibu.h b/src/mame/audio/seibu.h index 621f698a872..25ddbeef89f 100644 --- a/src/mame/audio/seibu.h +++ b/src/mame/audio/seibu.h @@ -47,9 +47,9 @@ WRITE8_HANDLER( seibu_rst10_ack_w ); WRITE8_HANDLER( seibu_rst18_ack_w ); WRITE8_HANDLER( seibu_bank_w ); WRITE8_HANDLER( seibu_coin_w ); -void seibu_ym3812_irqhandler(const device_config *device, int linestate); -void seibu_ym2151_irqhandler(const device_config *device, int linestate); -void seibu_ym2203_irqhandler(const device_config *device, int linestate); +void seibu_ym3812_irqhandler(running_device *device, int linestate); +void seibu_ym2151_irqhandler(running_device *device, int linestate); +void seibu_ym2203_irqhandler(running_device *device, int linestate); READ8_HANDLER( seibu_soundlatch_r ); READ8_HANDLER( seibu_main_data_pending_r ); WRITE8_HANDLER( seibu_main_data_w ); diff --git a/src/mame/audio/senjyo.c b/src/mame/audio/senjyo.c index 3ba5a0caa68..edc43e63c32 100644 --- a/src/mame/audio/senjyo.c +++ b/src/mame/audio/senjyo.c @@ -46,7 +46,7 @@ Z80CTC_INTERFACE( senjyo_ctc_intf ) WRITE8_HANDLER( senjyo_volume_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); single_volume = data & 0x0f; sample_set_volume(samples,0,single_volume / 15.0); } @@ -54,7 +54,7 @@ WRITE8_HANDLER( senjyo_volume_w ) static TIMER_CALLBACK( senjyo_sh_update ) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); /* ctc2 timer single tone generator frequency */ attotime period = z80ctc_getperiod (devtag_get_device(machine, "z80ctc"), 2); diff --git a/src/mame/audio/snk6502.c b/src/mame/audio/snk6502.c index fbc0dc061a1..70cd2e08d23 100644 --- a/src/mame/audio/snk6502.c +++ b/src/mame/audio/snk6502.c @@ -652,7 +652,7 @@ int snk6502_music0_playing(void) WRITE8_HANDLER( sasuke_sound_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); switch (offset) { case 0: @@ -718,7 +718,7 @@ WRITE8_HANDLER( sasuke_sound_w ) WRITE8_HANDLER( satansat_sound_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); switch (offset) { case 0: @@ -781,7 +781,7 @@ WRITE8_HANDLER( satansat_sound_w ) WRITE8_HANDLER( vanguard_sound_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); switch (offset) { case 0: @@ -1034,7 +1034,7 @@ static void snk6502_speech_w(running_machine *machine, UINT8 data, const UINT16 if ((data & HD38880_CTP) && (data & HD38880_CMV)) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); data &= HD68880_SYBS; switch (hd38880_cmd) @@ -1053,7 +1053,7 @@ static void snk6502_speech_w(running_machine *machine, UINT8 data, const UINT16 { if (table[i] && table[i] == hd38880_addr) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); sample_start(samples, 0, start + i, 0); break; } diff --git a/src/mame/audio/spacefb.c b/src/mame/audio/spacefb.c index c0a35f94954..e32b943a353 100644 --- a/src/mame/audio/spacefb.c +++ b/src/mame/audio/spacefb.c @@ -36,7 +36,7 @@ READ8_HANDLER( spacefb_audio_t1_r ) WRITE8_HANDLER( spacefb_port_1_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); cputag_set_input_line(space->machine, "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/audio/starwars.c b/src/mame/audio/starwars.c index 471e3a22e8e..c56a3f62da6 100644 --- a/src/mame/audio/starwars.c +++ b/src/mame/audio/starwars.c @@ -16,7 +16,7 @@ static UINT8 sound_data; /* data for the sound cpu */ static UINT8 main_data; /* data for the main cpu */ -static const device_config *riot; +static running_device *riot; SOUND_START( starwars ) diff --git a/src/mame/audio/t5182.c b/src/mame/audio/t5182.c index 8fe6ff6f623..f3400ea590f 100644 --- a/src/mame/audio/t5182.c +++ b/src/mame/audio/t5182.c @@ -166,7 +166,7 @@ static int irqstate; static TIMER_CALLBACK( setirq_callback ) { - const device_config *cpu; + running_device *cpu; switch(param) { @@ -219,7 +219,7 @@ static WRITE8_HANDLER( t5182_cpu_irq_ack_w ) timer_call_after_resynch(space->machine, NULL, CPU_CLEAR,setirq_callback); } -static void t5182_ym2151_irq_handler(const device_config *device, int irq) +static void t5182_ym2151_irq_handler(running_device *device, int irq) { if (irq) timer_call_after_resynch(device->machine, NULL, YM2151_ASSERT,setirq_callback); diff --git a/src/mame/audio/taitosnd.c b/src/mame/audio/taitosnd.c index 6def548c9d3..aa40708e6eb 100644 --- a/src/mame/audio/taitosnd.c +++ b/src/mame/audio/taitosnd.c @@ -34,15 +34,15 @@ struct _tc0140syt_state UINT8 nmi_enabled; /* 1 if slave cpu has nmi's enabled */ UINT8 nmi_req; /* 1 if slave cpu has a pending nmi */ - const device_config *mastercpu; /* this is the maincpu */ - const device_config *slavecpu; /* this is the audiocpu */ + running_device *mastercpu; /* this is the maincpu */ + running_device *slavecpu; /* this is the audiocpu */ }; /***************************************************************************** INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0140syt_state *get_safe_token( const device_config *device ) +INLINE tc0140syt_state *get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -51,18 +51,18 @@ INLINE tc0140syt_state *get_safe_token( const device_config *device ) return (tc0140syt_state *)device->token; } -INLINE const tc0140syt_interface *get_interface( const device_config *device ) +INLINE const tc0140syt_interface *get_interface( running_device *device ) { assert(device != NULL); assert((device->type == TC0140SYT)); - return (const tc0140syt_interface *) device->static_config; + return (const tc0140syt_interface *) device->baseconfig().static_config; } /***************************************************************************** DEVICE HANDLERS *****************************************************************************/ -static void interrupt_controller( const device_config *device ) +static void interrupt_controller( running_device *device ) { tc0140syt_state *tc0140syt = get_safe_token(device); diff --git a/src/mame/audio/targ.c b/src/mame/audio/targ.c index 11d1313d8cc..846f299b507 100644 --- a/src/mame/audio/targ.c +++ b/src/mame/audio/targ.c @@ -45,7 +45,7 @@ static const INT16 sine_wave[32] = -static void adjust_sample(const device_config *samples, UINT8 freq) +static void adjust_sample(running_device *samples, UINT8 freq) { tone_freq = freq; @@ -61,7 +61,7 @@ static void adjust_sample(const device_config *samples, UINT8 freq) WRITE8_HANDLER( targ_audio_1_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); /* CPU music */ if ((data & 0x01) != (port_1_last & 0x01)) @@ -114,7 +114,7 @@ WRITE8_HANDLER( targ_audio_2_w ) { if ((data & 0x01) && !(port_2_last & 0x01)) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); UINT8 *prom = memory_region(space->machine, "targ"); tone_pointer = (tone_pointer + 1) & 0x0f; @@ -128,7 +128,7 @@ WRITE8_HANDLER( targ_audio_2_w ) WRITE8_HANDLER( spectar_audio_2_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); adjust_sample(samples, data); } @@ -147,7 +147,7 @@ static const char *const sample_names[] = static void common_audio_start(running_machine *machine, int freq) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); max_freq = freq; tone_freq = 0; diff --git a/src/mame/audio/timeplt.c b/src/mame/audio/timeplt.c index 0af8e117201..567623616af 100644 --- a/src/mame/audio/timeplt.c +++ b/src/mame/audio/timeplt.c @@ -87,7 +87,7 @@ static READ8_DEVICE_HANDLER( timeplt_portB_r ) * *************************************/ -static void filter_w( const device_config *device, int data ) +static void filter_w( running_device *device, int data ) { int C = 0; diff --git a/src/mame/audio/toaplan2.c b/src/mame/audio/toaplan2.c index 73442bf5751..a8686a8f8fd 100644 --- a/src/mame/audio/toaplan2.c +++ b/src/mame/audio/toaplan2.c @@ -71,7 +71,7 @@ static const UINT8 fixeight_cmd_snd[128] = /*78*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static void play_oki_sound(const device_config *device, int game_sound, int data) +static void play_oki_sound(running_device *device, int game_sound, int data) { int status = okim6295_r(device,0); @@ -98,13 +98,13 @@ static void play_oki_sound(const device_config *device, int game_sound, int data } } -void dogyuun_okisnd_w(const device_config *device, int data) +void dogyuun_okisnd_w(running_device *device, int data) { /* Need a board to determine the sound commands */ // popmessage("Writing %04x to Sound CPU",data); } -void kbash_okisnd_w(const device_config *device, int data) +void kbash_okisnd_w(running_device *device, int data) { // popmessage("Writing %04x to Sound CPU",data); @@ -118,7 +118,7 @@ void kbash_okisnd_w(const device_config *device, int data) } } -void fixeight_okisnd_w(const device_config *device, int data) +void fixeight_okisnd_w(running_device *device, int data) { // popmessage("Writing %04x to Sound CPU",data); @@ -132,7 +132,7 @@ void fixeight_okisnd_w(const device_config *device, int data) } } -void batsugun_okisnd_w(const device_config *device, int data) +void batsugun_okisnd_w(running_device *device, int data) { // popmessage("Writing %04x to Sound CPU",data); diff --git a/src/mame/audio/turbo.c b/src/mame/audio/turbo.c index f928297cdb2..1d83b090223 100644 --- a/src/mame/audio/turbo.c +++ b/src/mame/audio/turbo.c @@ -19,7 +19,7 @@ * *************************************/ -static void turbo_update_samples(turbo_state *state, const device_config *samples) +static void turbo_update_samples(turbo_state *state, running_device *samples) { /* accelerator sounds */ /* BSEL == 3 --> off */ @@ -40,7 +40,7 @@ static int last_sound_a; static TIMER_CALLBACK( update_sound_a ) { - const device_config *discrete = devtag_get_device(machine, "discrete"); + running_device *discrete = devtag_get_device(machine, "discrete"); int data = param; /* missing short crash sample, but I've never seen it triggered */ @@ -72,7 +72,7 @@ if (!((data >> 4) & 1)) mame_printf_debug("/TRIG4\n"); WRITE8_DEVICE_HANDLER( turbo_sound_a_w ) { - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[0]; state->sound_state[0] = data; @@ -121,7 +121,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w ) WRITE8_DEVICE_HANDLER( turbo_sound_b_w ) { - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[1]; state->sound_state[1] = data; @@ -144,7 +144,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_b_w ) WRITE8_DEVICE_HANDLER( turbo_sound_c_w ) { - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; /* OSEL1-2 */ @@ -303,7 +303,7 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w ) } -INLINE void subroc3d_update_volume(const device_config *samples, int leftchan, UINT8 dis, UINT8 dir) +INLINE void subroc3d_update_volume(running_device *samples, int leftchan, UINT8 dis, UINT8 dir) { float volume = (float)(15 - dis) / 16.0f; float lvol, rvol; @@ -325,7 +325,7 @@ INLINE void subroc3d_update_volume(const device_config *samples, int leftchan, U WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w ) { - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[1]; state->sound_state[1] = data; @@ -381,7 +381,7 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w ) WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w ) { - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[2]; state->sound_state[2] = data; @@ -496,7 +496,7 @@ MACHINE_DRIVER_END * *************************************/ -static void buckrog_update_samples(turbo_state *state, const device_config *samples) +static void buckrog_update_samples(turbo_state *state, running_device *samples) { /* accelerator sounds */ if (sample_playing(samples, 5)) @@ -506,7 +506,7 @@ static void buckrog_update_samples(turbo_state *state, const device_config *samp WRITE8_DEVICE_HANDLER( buckrog_sound_a_w ) { - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[0]; state->sound_state[0] = data; @@ -532,7 +532,7 @@ WRITE8_DEVICE_HANDLER( buckrog_sound_a_w ) WRITE8_DEVICE_HANDLER( buckrog_sound_b_w ) { - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); turbo_state *state = (turbo_state *)device->machine->driver_data; UINT8 diff = data ^ state->sound_state[1]; state->sound_state[1] = data; diff --git a/src/mame/audio/tx1.c b/src/mame/audio/tx1.c index 8a5a22dd6df..10a7379c289 100644 --- a/src/mame/audio/tx1.c +++ b/src/mame/audio/tx1.c @@ -412,8 +412,8 @@ WRITE8_DEVICE_HANDLER( bb_ym2_a_w ) WRITE8_DEVICE_HANDLER( bb_ym2_b_w ) { - const device_config *ym1 = devtag_get_device(device->machine, "ym1"); - const device_config *ym2 = devtag_get_device(device->machine, "ym2"); + running_device *ym1 = devtag_get_device(device->machine, "ym1"); + running_device *ym2 = devtag_get_device(device->machine, "ym2"); double gain; stream_update(stream); diff --git a/src/mame/audio/vicdual.c b/src/mame/audio/vicdual.c index 8cdcfb0712c..e44fe4cedb3 100644 --- a/src/mame/audio/vicdual.c +++ b/src/mame/audio/vicdual.c @@ -132,7 +132,7 @@ MACHINE_DRIVER_END static TIMER_CALLBACK( frogs_croak_callback ) { - const device_config *samples = devtag_get_device(machine, "samples"); + running_device *samples = devtag_get_device(machine, "samples"); sample_stop(samples, 2); } @@ -145,8 +145,8 @@ MACHINE_START( frogs_audio ) WRITE8_HANDLER( frogs_audio_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *samples = devtag_get_device(space->machine, "samples"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); static int last_croak = 0; static int last_buzzz = 0; int new_croak = data & 0x08; @@ -462,7 +462,7 @@ MACHINE_DRIVER_END WRITE8_HANDLER( headon_audio_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); if (discrete == NULL) return; discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x01); @@ -477,7 +477,7 @@ WRITE8_HANDLER( headon_audio_w ) WRITE8_HANDLER( invho2_audio_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); if (discrete == NULL) return; discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x10); diff --git a/src/mame/audio/williams.c b/src/mame/audio/williams.c index ec5bd328f9b..13577c2a4e0 100644 --- a/src/mame/audio/williams.c +++ b/src/mame/audio/williams.c @@ -52,8 +52,8 @@ static UINT8 williams_sound_int_state; static UINT8 audio_talkback; static UINT8 audio_sync; -static const device_config *sound_cpu; -static const device_config *soundalt_cpu; +static running_device *sound_cpu; +static running_device *soundalt_cpu; @@ -63,8 +63,8 @@ static const device_config *soundalt_cpu; static void init_audio_state(running_machine *machine); -static void cvsd_ym2151_irq(const device_config *device, int state); -static void adpcm_ym2151_irq(const device_config *device, int state); +static void cvsd_ym2151_irq(running_device *device, int state); +static void adpcm_ym2151_irq(running_device *device, int state); static WRITE_LINE_DEVICE_HANDLER( cvsd_irqa ); static WRITE_LINE_DEVICE_HANDLER( cvsd_irqb ); @@ -406,7 +406,7 @@ static void init_audio_state(running_machine *machine) CVSD IRQ GENERATION CALLBACKS ****************************************************************************/ -static void cvsd_ym2151_irq(const device_config *device, int state) +static void cvsd_ym2151_irq(running_device *device, int state) { pia6821_ca1_w(devtag_get_device(device->machine, "cvsdpia"), 0, !state); } @@ -429,7 +429,7 @@ static WRITE_LINE_DEVICE_HANDLER( cvsd_irqb ) ADPCM IRQ GENERATION CALLBACKS ****************************************************************************/ -static void adpcm_ym2151_irq(const device_config *device, int state) +static void adpcm_ym2151_irq(running_device *device, int state) { cpu_set_input_line(sound_cpu, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); } @@ -472,7 +472,7 @@ static WRITE8_DEVICE_HANDLER( cvsd_clock_set_w ) static TIMER_CALLBACK( williams_cvsd_delayed_data_w ) { - const device_config *pia = devtag_get_device(machine, "cvsdpia"); + running_device *pia = devtag_get_device(machine, "cvsdpia"); pia6821_portb_w(pia, 0, param & 0xff); pia6821_cb1_w(pia, 0, (param >> 8) & 1); pia6821_cb2_w(pia, 0, (param >> 9) & 1); diff --git a/src/mame/audio/wow.c b/src/mame/audio/wow.c index c53e4d82e54..9435b2e6723 100644 --- a/src/mame/audio/wow.c +++ b/src/mame/audio/wow.c @@ -108,7 +108,7 @@ static int plural; READ8_HANDLER( wow_speech_r ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); int Phoneme,Intonation; int i = 0; @@ -177,6 +177,6 @@ READ8_HANDLER( wow_speech_r ) CUSTOM_INPUT( wow_speech_status_r ) { - const device_config *samples = devtag_get_device(field->port->machine, "samples"); + running_device *samples = devtag_get_device(field->port->machine, "samples"); return !sample_playing(samples, 0); } diff --git a/src/mame/audio/zaxxon.c b/src/mame/audio/zaxxon.c index 498f3709091..7d233fae338 100644 --- a/src/mame/audio/zaxxon.c +++ b/src/mame/audio/zaxxon.c @@ -114,7 +114,7 @@ MACHINE_DRIVER_END WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w ) { zaxxon_state *state = (zaxxon_state *)device->machine->driver_data; - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); UINT8 diff = data ^ state->sound_state[0]; state->sound_state[0] = data; @@ -150,7 +150,7 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w ) WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w ) { zaxxon_state *state = (zaxxon_state *)device->machine->driver_data; - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); UINT8 diff = data ^ state->sound_state[1]; state->sound_state[1] = data; @@ -168,7 +168,7 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w ) WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w ) { zaxxon_state *state = (zaxxon_state *)device->machine->driver_data; - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); UINT8 diff = data ^ state->sound_state[2]; state->sound_state[2] = data; @@ -226,7 +226,7 @@ MACHINE_DRIVER_END WRITE8_DEVICE_HANDLER( congo_sound_b_w ) { zaxxon_state *state = (zaxxon_state *)device->machine->driver_data; - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); UINT8 diff = data ^ state->sound_state[1]; state->sound_state[1] = data; @@ -240,7 +240,7 @@ WRITE8_DEVICE_HANDLER( congo_sound_b_w ) WRITE8_DEVICE_HANDLER( congo_sound_c_w ) { zaxxon_state *state = (zaxxon_state *)device->machine->driver_data; - const device_config *samples = devtag_get_device(device->machine, "samples"); + running_device *samples = devtag_get_device(device->machine, "samples"); UINT8 diff = data ^ state->sound_state[2]; state->sound_state[2] = data; diff --git a/src/mame/drivers/1945kiii.c b/src/mame/drivers/1945kiii.c index cac613d2314..9c8f201b31e 100644 --- a/src/mame/drivers/1945kiii.c +++ b/src/mame/drivers/1945kiii.c @@ -73,8 +73,8 @@ struct _k3_state tilemap_t *bg_tilemap; /* devices */ - const device_config *oki1; - const device_config *oki2; + running_device *oki1; + running_device *oki2; }; diff --git a/src/mame/drivers/2mindril.c b/src/mame/drivers/2mindril.c index 9b249b63a8a..d0cb8ee7c6f 100644 --- a/src/mame/drivers/2mindril.c +++ b/src/mame/drivers/2mindril.c @@ -75,7 +75,7 @@ struct __2mindril_state UINT16 defender_sensor, shutter_sensor; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; @@ -417,7 +417,7 @@ static INTERRUPT_GEN( drill_interrupt ) } /* WRONG,it does something with 60000c & 700002,likely to be called when the player throws the ball.*/ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { // _2mindril_state *state = (_2mindril_state *)machine->driver_data; // cpu_set_input_line(state->maincpu, 5, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/39in1.c b/src/mame/drivers/39in1.c index 6a233b20717..10990e6a19d 100644 --- a/src/mame/drivers/39in1.c +++ b/src/mame/drivers/39in1.c @@ -29,7 +29,7 @@ static UINT32* ram; -static const device_config *dmadac[2]; +static running_device *dmadac[2]; static void pxa255_dma_irq_check(running_machine* machine); static READ32_HANDLER( pxa255_dma_r ); @@ -838,7 +838,7 @@ static READ32_HANDLER( pxa255_gpio_r ) static WRITE32_HANDLER( pxa255_gpio_w ) { - const device_config *device; + running_device *device; switch(PXA255_GPIO_BASE_ADDR | (offset << 2)) { case PXA255_GPLR0: @@ -1431,7 +1431,7 @@ static void pxa255_start(running_machine* machine) //pxa255_t* pxa255 = pxa255_get_safe_token( device ); - //pxa255->iface = device->static_config; + //pxa255->iface = device->baseconfig().static_config; for(index = 0; index < 16; index++) { diff --git a/src/mame/drivers/86lions.c b/src/mame/drivers/86lions.c index 97447b7f68d..dcdeeba695f 100644 --- a/src/mame/drivers/86lions.c +++ b/src/mame/drivers/86lions.c @@ -76,13 +76,13 @@ static READ8_HANDLER( test_r ) static READ8_HANDLER(lions_via_r) { - const device_config *via_0 = devtag_get_device(space->machine, "via6522_0"); + running_device *via_0 = devtag_get_device(space->machine, "via6522_0"); return via_r(via_0, offset); } static WRITE8_HANDLER(lions_via_w) { - const device_config *via_0 = devtag_get_device(space->machine, "via6522_0"); + running_device *via_0 = devtag_get_device(space->machine, "via6522_0"); via_w(via_0, offset, data); } diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c index 6b2e3227499..ce10fbe9113 100644 --- a/src/mame/drivers/88games.c +++ b/src/mame/drivers/88games.c @@ -81,7 +81,7 @@ static WRITE8_HANDLER( k88games_sh_irqtrigger_w ) static WRITE8_HANDLER( speech_control_w ) { _88games_state *state = (_88games_state *)space->machine->driver_data; - const device_config *upd; + running_device *upd; state->speech_chip = (data & 4) ? 1 : 0; upd = state->speech_chip ? state->upd_2 : state->upd_1; @@ -93,7 +93,7 @@ static WRITE8_HANDLER( speech_control_w ) static WRITE8_HANDLER( speech_msg_w ) { _88games_state *state = (_88games_state *)space->machine->driver_data; - const device_config *upd = state->speech_chip ? state->upd_2 : state->upd_1; + running_device *upd = state->speech_chip ? state->upd_2 : state->upd_1; upd7759_port_w(upd, 0, data); } diff --git a/src/mame/drivers/actfancr.c b/src/mame/drivers/actfancr.c index 617ca146931..867de4afad8 100644 --- a/src/mame/drivers/actfancr.c +++ b/src/mame/drivers/actfancr.c @@ -263,7 +263,7 @@ GFXDECODE_END /******************************************************************************/ -static void sound_irq(const device_config *device, int linestate) +static void sound_irq(running_device *device, int linestate) { actfancr_state *state = (actfancr_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, linestate); /* IRQ */ diff --git a/src/mame/drivers/adp.c b/src/mame/drivers/adp.c index 54644473d48..826561debe9 100644 --- a/src/mame/drivers/adp.c +++ b/src/mame/drivers/adp.c @@ -159,8 +159,8 @@ struct _adp_state UINT8 register_active; /* devices */ - const device_config *maincpu; - const device_config *duart; + running_device *maincpu; + running_device *duart; }; @@ -170,13 +170,13 @@ struct _adp_state ***************************************************************************/ -static void duart_irq_handler( const device_config *device, UINT8 vector ) +static void duart_irq_handler( running_device *device, UINT8 vector ) { adp_state *state = (adp_state *)device->machine->driver_data; cpu_set_input_line_and_vector(state->maincpu, 4, HOLD_LINE, vector); }; -static void duart_tx( const device_config *device, int channel, UINT8 data ) +static void duart_tx( running_device *device, int channel, UINT8 data ) { if (channel == 0) { @@ -190,7 +190,7 @@ static void microtouch_tx( running_machine *machine, UINT8 data ) duart68681_rx_data(state->duart, 0, data); } -static UINT8 duart_input( const device_config *device ) +static UINT8 duart_input( running_device *device ) { return input_port_read(device->machine, "DSW1"); } diff --git a/src/mame/drivers/aerofgt.c b/src/mame/drivers/aerofgt.c index 2c84ca0856f..8aa6a27b522 100644 --- a/src/mame/drivers/aerofgt.c +++ b/src/mame/drivers/aerofgt.c @@ -1276,7 +1276,7 @@ static GFXDECODE_START( wbbc97 ) GFXDECODE_ENTRY( "gfx2", 0, wbbc97_spritelayout, 1024, 64 ) /* colors 1024-2047 in 4 banks */ GFXDECODE_END -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { aerofgt_state *state = (aerofgt_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/ajax.c b/src/mame/drivers/ajax.c index 995d4aaa83a..63cc7187583 100644 --- a/src/mame/drivers/ajax.c +++ b/src/mame/drivers/ajax.c @@ -151,7 +151,7 @@ static WRITE8_HANDLER( sound_bank_w ) k007232_set_bank(state->k007232_2, bank_A, bank_B); } -static void volume_callback0(const device_config *device, int v) +static void volume_callback0(running_device *device, int v) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); @@ -163,7 +163,7 @@ static WRITE8_DEVICE_HANDLER( k007232_extvol_w ) k007232_set_volume(device, 0, (data & 0x0f) * 0x11/2, (data & 0x0f) * 0x11/2); } -static void volume_callback1(const device_config *device, int v) +static void volume_callback1(running_device *device, int v) { /* channel B volume/pan */ k007232_set_volume(device, 1, (v & 0x0f) * 0x11/2, (v >> 4) * 0x11/2); diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c index 5abffca8ca1..edb903b8b32 100644 --- a/src/mame/drivers/alg.c +++ b/src/mame/drivers/alg.c @@ -28,7 +28,7 @@ #include "machine/6526cia.h" -static const device_config *laserdisc; +static running_device *laserdisc; static emu_timer *serial_timer; static UINT8 serial_timer_active; static UINT16 input_select; @@ -43,7 +43,7 @@ static TIMER_CALLBACK( response_timer ); * *************************************/ -static int get_lightgun_pos(const device_config *screen, int player, int *x, int *y) +static int get_lightgun_pos(running_device *screen, int player, int *x, int *y) { const rectangle *visarea = video_screen_get_visible_area(screen); diff --git a/src/mame/drivers/aliens.c b/src/mame/drivers/aliens.c index 6d112b27a8f..e0cf7bc6336 100644 --- a/src/mame/drivers/aliens.c +++ b/src/mame/drivers/aliens.c @@ -201,7 +201,7 @@ INPUT_PORTS_END ***************************************************************************/ -static void volume_callback( const device_config *device, int v ) +static void volume_callback( running_device *device, int v ) { k007232_set_volume(device, 0, (v & 0x0f) * 0x11, 0); k007232_set_volume(device, 1, 0, (v >> 4) * 0x11); diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c index 40ab4cd9b92..c61b84ed153 100644 --- a/src/mame/drivers/alpha68k.c +++ b/src/mame/drivers/alpha68k.c @@ -1831,7 +1831,7 @@ static const ym2203_interface ym2203_config = } }; -static void YM3812_irq( const device_config *device, int param ) +static void YM3812_irq( running_device *device, int param ) { alpha68k_state *state = (alpha68k_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, (param) ? HOLD_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c index 2424a2a4c1f..cdcdbda091c 100644 --- a/src/mame/drivers/amspdwy.c +++ b/src/mame/drivers/amspdwy.c @@ -239,7 +239,7 @@ GFXDECODE_END ***************************************************************************/ -static void irq_handler( const device_config *device, int irq ) +static void irq_handler( running_device *device, int irq ) { amspdwy_state *state = (amspdwy_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/angelkds.c b/src/mame/drivers/angelkds.c index 83b703b53d2..c5f8f542b9d 100644 --- a/src/mame/drivers/angelkds.c +++ b/src/mame/drivers/angelkds.c @@ -514,7 +514,7 @@ static READ8_HANDLER( angelkds_sub_sound_r ) } -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { angelkds_state *state = (angelkds_state *)device->machine->driver_data; cpu_set_input_line(state->subcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/appoooh.c b/src/mame/drivers/appoooh.c index c2d7b145fcb..e5e5a62db64 100644 --- a/src/mame/drivers/appoooh.c +++ b/src/mame/drivers/appoooh.c @@ -169,7 +169,7 @@ Language #include "sound/sn76496.h" -static void appoooh_adpcm_int(const device_config *device) +static void appoooh_adpcm_int(running_device *device) { appoooh_state *state = (appoooh_state *)device->machine->driver_data; diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c index 64f0cd9ae36..db5f4084de6 100644 --- a/src/mame/drivers/aquarium.c +++ b/src/mame/drivers/aquarium.c @@ -326,7 +326,7 @@ static GFXDECODE_START( aquarium ) GFXDECODE_ENTRY( "gfx4", 0, char5bpplayout, 0x400, 32 ) GFXDECODE_END -static void irq_handler( const device_config *device, int irq ) +static void irq_handler( running_device *device, int irq ) { aquarium_state *state = (aquarium_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0 , irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/arcadecl.c b/src/mame/drivers/arcadecl.c index 40b2e9be9cc..26ce4c23c65 100644 --- a/src/mame/drivers/arcadecl.c +++ b/src/mame/drivers/arcadecl.c @@ -88,7 +88,7 @@ static void update_interrupts(running_machine *machine) } -static void scanline_update(const device_config *screen, int scanline) +static void scanline_update(running_device *screen, int scanline) { /* generate 32V signals */ if ((scanline & 32) == 0) diff --git a/src/mame/drivers/argus.c b/src/mame/drivers/argus.c index 5474bcd6994..29634bd2121 100644 --- a/src/mame/drivers/argus.c +++ b/src/mame/drivers/argus.c @@ -141,7 +141,7 @@ static INTERRUPT_GEN( argus_interrupt ) } /* Handler called by the YM2203 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c index 97248ecd9b3..7c6ca799321 100644 --- a/src/mame/drivers/aristmk4.c +++ b/src/mame/drivers/aristmk4.c @@ -163,7 +163,7 @@ static UINT8 rtc_get_reg(running_machine *machine,int address_register) // datain static WRITE8_HANDLER(mkiv_datain_pia_w) { - const device_config *pia_0 = devtag_get_device(space->machine, "pia6821_0"); + running_device *pia_0 = devtag_get_device(space->machine, "pia6821_0"); //logerror("CPU ===> PIA: %02X\n", data); pia6821_w(pia_0, offset, data); diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c index 1083625359f..e1e0ca5074b 100644 --- a/src/mame/drivers/artmagic.c +++ b/src/mame/drivers/artmagic.c @@ -62,7 +62,7 @@ static void update_irq_state(running_machine *machine) } -static void m68k_gen_int(const device_config *device, int state) +static void m68k_gen_int(running_device *device, int state) { tms_irq = state; update_irq_state(device->machine); diff --git a/src/mame/drivers/ashnojoe.c b/src/mame/drivers/ashnojoe.c index 4bc2be2c1e2..8bcc306ff9b 100644 --- a/src/mame/drivers/ashnojoe.c +++ b/src/mame/drivers/ashnojoe.c @@ -274,7 +274,7 @@ static GFXDECODE_START( ashnojoe ) GFXDECODE_END -static void ym2203_irq_handler( const device_config *device, int irq ) +static void ym2203_irq_handler( running_device *device, int irq ) { ashnojoe_state *state = (ashnojoe_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); @@ -307,7 +307,7 @@ static const ym2203_interface ym2203_config = ym2203_irq_handler }; -static void ashnojoe_vclk_cb( const device_config *device ) +static void ashnojoe_vclk_cb( running_device *device ) { ashnojoe_state *state = (ashnojoe_state *)device->machine->driver_data; if (state->msm5205_vclk_toggle == 0) diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c index 49e8c0dc155..e2cac2cd8ff 100644 --- a/src/mame/drivers/astinvad.c +++ b/src/mame/drivers/astinvad.c @@ -55,10 +55,10 @@ struct _astinvad_state UINT8 flip_yoffs; UINT8 color_latch; - const device_config *maincpu; - const device_config *ppi8255_0; - const device_config *ppi8255_1; - const device_config *samples; + running_device *maincpu; + running_device *ppi8255_0; + running_device *ppi8255_1; + running_device *samples; }; diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c index 63411ce2eb6..870399e804c 100644 --- a/src/mame/drivers/astrocde.c +++ b/src/mame/drivers/astrocde.c @@ -207,7 +207,7 @@ static WRITE8_HANDLER( seawolf2_lamps_w ) static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40 { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); UINT8 rising_bits = data & ~port_1_last; port_1_last = data; @@ -222,7 +222,7 @@ static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40 static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41 { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); UINT8 rising_bits = data & ~port_2_last; port_2_last = data; diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c index 04b9b2b4676..0fb4b2aa02c 100644 --- a/src/mame/drivers/asuka.c +++ b/src/mame/drivers/asuka.c @@ -258,7 +258,7 @@ static WRITE8_DEVICE_HANDLER( sound_bankswitch_2151_w ) -static void asuka_msm5205_vck( const device_config *device ) +static void asuka_msm5205_vck( running_device *device ) { asuka_state *state = (asuka_state *)device->machine->driver_data; @@ -731,7 +731,7 @@ GFXDECODE_END SOUND **************************************************************/ -static void irq_handler(const device_config *device, int irq) +static void irq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c index 07e53198124..a5430288e7c 100644 --- a/src/mame/drivers/atarisy2.c +++ b/src/mame/drivers/atarisy2.c @@ -188,7 +188,7 @@ static void update_interrupts(running_machine *machine) * *************************************/ -static void scanline_update(const device_config *screen, int scanline) +static void scanline_update(running_device *screen, int scanline) { atarisy2_state *state = (atarisy2_state *)screen->machine->driver_data; if (scanline <= video_screen_get_height(screen)) @@ -692,7 +692,7 @@ static WRITE8_HANDLER( tms5220_strobe_w ) atarisy2_state *state = (atarisy2_state *)space->machine->driver_data; if (!(offset & 1) && state->tms5220_data_strobe && state->has_tms5220) { - const device_config *tms = devtag_get_device(space->machine, "tms"); + running_device *tms = devtag_get_device(space->machine, "tms"); tms5220_data_w(tms, 0, state->tms5220_data); } state->tms5220_data_strobe = offset & 1; diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c index e08ee22ee9d..6a6b51327e1 100644 --- a/src/mame/drivers/backfire.c +++ b/src/mame/drivers/backfire.c @@ -169,8 +169,8 @@ static void draw_sprites(running_machine *machine,bitmap_t *bitmap,const rectang static VIDEO_UPDATE(backfire) { - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); - const device_config *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); /* screen 1 uses pf1 as the forground and pf3 as the background */ /* screen 2 uses pf2 as the foreground and pf4 as the background */ @@ -445,7 +445,7 @@ static GFXDECODE_START( backfire ) GFXDECODE_END -static void sound_irq_gen(const device_config *device, int state) +static void sound_irq_gen(running_device *device, int state) { logerror("sound irq\n"); } diff --git a/src/mame/drivers/badlands.c b/src/mame/drivers/badlands.c index 8cc78bf728a..a1df39b1f5b 100644 --- a/src/mame/drivers/badlands.c +++ b/src/mame/drivers/badlands.c @@ -184,7 +184,7 @@ static void update_interrupts(running_machine *machine) } -static void scanline_update(const device_config *screen, int scanline) +static void scanline_update(running_device *screen, int scanline) { const address_space *space = cputag_get_address_space(screen->machine, "audiocpu", ADDRESS_SPACE_PROGRAM); @@ -689,7 +689,7 @@ static void update_interrupts_bootleg(running_machine *machine) } -static void scanline_update_bootleg(const device_config *screen, int scanline) +static void scanline_update_bootleg(running_device *screen, int scanline) { /* sound IRQ is on 32V */ // if (scanline & 32) diff --git a/src/mame/drivers/bagman.c b/src/mame/drivers/bagman.c index cd3366039a3..701bebfd804 100644 --- a/src/mame/drivers/bagman.c +++ b/src/mame/drivers/bagman.c @@ -72,7 +72,7 @@ static int speech_rom_address = 0; static UINT8 ls259_buf[8] = {0,0,0,0,0,0,0,0}; -static void start_talking (const device_config *tms) +static void start_talking (running_device *tms) { speech_rom_address = 0x0; tms5110_ctl_w(tms,0,TMS5110_CMD_SPEAK); @@ -81,7 +81,7 @@ static void start_talking (const device_config *tms) tms5110_pdc_w(tms,0,0); } -static void reset_talking (const device_config *tms) +static void reset_talking (running_device *tms) { /*To be extremely accurate there should be a delays between each of the function calls below. In real they happen with the frequency of 160 kHz. @@ -104,7 +104,7 @@ static void reset_talking (const device_config *tms) } -static int bagman_speech_rom_read_bit(const device_config *device) +static int bagman_speech_rom_read_bit(running_device *device) { UINT8 *ROM = memory_region(device->machine, "speech"); int bit_no = (ls259_buf[0]<<2) | (ls259_buf[1]<<1) | (ls259_buf[2]<<0); @@ -151,7 +151,7 @@ static WRITE8_HANDLER( bagman_ls259_w ) if (offset==3) { - const device_config *tms = devtag_get_device(space->machine, "tms"); + running_device *tms = devtag_get_device(space->machine, "tms"); if (ls259_buf[3] == 0) /* 1->0 transition */ { reset_talking(tms); diff --git a/src/mame/drivers/battlane.c b/src/mame/drivers/battlane.c index 89f5013a607..f7a33d30f5f 100644 --- a/src/mame/drivers/battlane.c +++ b/src/mame/drivers/battlane.c @@ -256,7 +256,7 @@ GFXDECODE_END * *************************************/ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { battlane_state *state = (battlane_state *)device->machine->driver_data; cpu_set_input_line(state->maincpu, M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c index 43618a1c810..5d01e2a82f7 100644 --- a/src/mame/drivers/battlera.c +++ b/src/mame/drivers/battlera.c @@ -97,7 +97,7 @@ ADDRESS_MAP_END static int msm5205next; -static void battlera_adpcm_int(const device_config *device) +static void battlera_adpcm_int(running_device *device) { static int toggle; diff --git a/src/mame/drivers/bbusters.c b/src/mame/drivers/bbusters.c index 48d0c054061..865be66c8a5 100644 --- a/src/mame/drivers/bbusters.c +++ b/src/mame/drivers/bbusters.c @@ -634,7 +634,7 @@ GFXDECODE_END /******************************************************************************/ -static void sound_irq( const device_config *device, int irq ) +static void sound_irq( running_device *device, int irq ) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/beaminv.c b/src/mame/drivers/beaminv.c index 23acac9056f..6087d76d942 100644 --- a/src/mame/drivers/beaminv.c +++ b/src/mame/drivers/beaminv.c @@ -69,7 +69,7 @@ struct _beaminv_state UINT8 controller_select; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c index 34e686a79bd..4eece457c3c 100644 --- a/src/mame/drivers/berzerk.c +++ b/src/mame/drivers/berzerk.c @@ -468,7 +468,7 @@ static VIDEO_UPDATE( berzerk ) static WRITE8_HANDLER( berzerk_audio_w ) { - const device_config *device; + running_device *device; int clock_divisor; switch (offset) @@ -525,7 +525,7 @@ static WRITE8_HANDLER( berzerk_audio_w ) static READ8_HANDLER( berzerk_audio_r ) { - const device_config *device = devtag_get_device(space->machine, "speech"); + running_device *device = devtag_get_device(space->machine, "speech"); return ((offset == 4) && !s14001a_bsy_r(device)) ? 0x40 : 0x00; } diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c index 0bb1a299220..3b494c4fff6 100644 --- a/src/mame/drivers/bfm_sc2.c +++ b/src/mame/drivers/bfm_sc2.c @@ -698,8 +698,8 @@ static WRITE8_HANDLER( volume_override_w ) if ( old != volume_override ) { - const device_config *ym = devtag_get_device(space->machine, "ymsnd"); - const device_config *upd = devtag_get_device(space->machine, "upd"); + running_device *ym = devtag_get_device(space->machine, "ymsnd"); + running_device *upd = devtag_get_device(space->machine, "upd"); float percent = volume_override? 1.0f : (32-global_volume)/32.0f; sound_set_output_gain(ym, 0, percent); @@ -812,8 +812,8 @@ static WRITE8_HANDLER( expansion_latch_w ) } { - const device_config *ym = devtag_get_device(space->machine, "ymsnd"); - const device_config *upd = devtag_get_device(space->machine, "upd"); + running_device *ym = devtag_get_device(space->machine, "ymsnd"); + running_device *upd = devtag_get_device(space->machine, "upd"); float percent = volume_override ? 1.0f : (32-global_volume)/32.0f; sound_set_output_gain(ym, 0, percent); diff --git a/src/mame/drivers/bishi.c b/src/mame/drivers/bishi.c index cbde51b77e0..3cd6ea0a2c1 100644 --- a/src/mame/drivers/bishi.c +++ b/src/mame/drivers/bishi.c @@ -367,7 +367,7 @@ static INPUT_PORTS_START( bishi2p ) INPUT_PORTS_END -static void sound_irq_gen(const device_config *device, int state) +static void sound_irq_gen(running_device *device, int state) { bishi_state *bishi = (bishi_state *)device->machine->driver_data; if (state) diff --git a/src/mame/drivers/blktiger.c b/src/mame/drivers/blktiger.c index 66c9394e292..114a016482e 100644 --- a/src/mame/drivers/blktiger.c +++ b/src/mame/drivers/blktiger.c @@ -263,7 +263,7 @@ GFXDECODE_END /* handler called by the 2203 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { blktiger_state *state = (blktiger_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/blockout.c b/src/mame/drivers/blockout.c index c262c132a34..10e0dcd3d23 100644 --- a/src/mame/drivers/blockout.c +++ b/src/mame/drivers/blockout.c @@ -235,7 +235,7 @@ INPUT_PORTS_END *************************************/ /* handler called by the 2151 emulator when the internal timers cause an IRQ */ -static void blockout_irq_handler(const device_config *device, int irq) +static void blockout_irq_handler(running_device *device, int irq) { blockout_state *state = (blockout_state *)device->machine->driver_data; cpu_set_input_line_and_vector(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xff); diff --git a/src/mame/drivers/bmcbowl.c b/src/mame/drivers/bmcbowl.c index 61a720baded..59cd7e1a2d5 100644 --- a/src/mame/drivers/bmcbowl.c +++ b/src/mame/drivers/bmcbowl.c @@ -216,13 +216,13 @@ static WRITE16_HANDLER( scroll_w ) static READ16_HANDLER(bmcbowl_via_r) { - const device_config *via_0 = devtag_get_device(space->machine, "via6522_0"); + running_device *via_0 = devtag_get_device(space->machine, "via6522_0"); return via_r(via_0, offset); } static WRITE16_HANDLER(bmcbowl_via_w) { - const device_config *via_0 = devtag_get_device(space->machine, "via6522_0"); + running_device *via_0 = devtag_get_device(space->machine, "via6522_0"); via_w(via_0, offset, data); } @@ -248,7 +248,7 @@ static WRITE8_DEVICE_HANDLER(via_ca2_out) } -static void via_irq(const device_config *device, int state) +static void via_irq(running_device *device, int state) { //used } diff --git a/src/mame/drivers/bnstars.c b/src/mame/drivers/bnstars.c index 77dc27b2994..3cb305a9a72 100644 --- a/src/mame/drivers/bnstars.c +++ b/src/mame/drivers/bnstars.c @@ -489,8 +489,8 @@ static VIDEO_START(bnstars) static VIDEO_UPDATE(bnstars) { - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); - const device_config *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); bitmap_fill(screen->machine->priority_bitmap,cliprect,0); diff --git a/src/mame/drivers/boogwing.c b/src/mame/drivers/boogwing.c index 3ff3ccc4b11..47d2bdf9f4f 100644 --- a/src/mame/drivers/boogwing.c +++ b/src/mame/drivers/boogwing.c @@ -277,7 +277,7 @@ GFXDECODE_END /**********************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } diff --git a/src/mame/drivers/bottom9.c b/src/mame/drivers/bottom9.c index 3691824301c..dfbd9dd41dc 100644 --- a/src/mame/drivers/bottom9.c +++ b/src/mame/drivers/bottom9.c @@ -276,13 +276,13 @@ INPUT_PORTS_END -static void volume_callback0( const device_config *device, int v ) +static void volume_callback0( running_device *device, int v ) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); } -static void volume_callback1( const device_config *device, int v ) +static void volume_callback1( running_device *device, int v ) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); diff --git a/src/mame/drivers/boxer.c b/src/mame/drivers/boxer.c index 6625e9bf6b9..53db509feb8 100644 --- a/src/mame/drivers/boxer.c +++ b/src/mame/drivers/boxer.c @@ -32,7 +32,7 @@ struct _boxer_state UINT8 pot_latch; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; /************************************* diff --git a/src/mame/drivers/brkthru.c b/src/mame/drivers/brkthru.c index 94bfe5dd25d..d8642ac3049 100644 --- a/src/mame/drivers/brkthru.c +++ b/src/mame/drivers/brkthru.c @@ -344,7 +344,7 @@ GFXDECODE_END *************************************/ /* handler called by the 3812 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int linestate ) +static void irqhandler( running_device *device, int linestate ) { brkthru_state *state = (brkthru_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, M6809_IRQ_LINE, linestate); diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c index bc8e3143bb7..9720f7f2e09 100644 --- a/src/mame/drivers/bublbobl.c +++ b/src/mame/drivers/bublbobl.c @@ -697,7 +697,7 @@ GFXDECODE_END *************************************/ // handler called by the 2203 emulator when the internal timers cause an IRQ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { bublbobl_state *state = (bublbobl_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c index 8d6aaff26cd..a64659fda22 100644 --- a/src/mame/drivers/cabal.c +++ b/src/mame/drivers/cabal.c @@ -462,7 +462,7 @@ static GFXDECODE_START( cabal ) GFXDECODE_END -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c index 80c80cf5c5a..917cd63ac5d 100644 --- a/src/mame/drivers/calchase.c +++ b/src/mame/drivers/calchase.c @@ -97,17 +97,17 @@ all files across to new HDD, boots up fine. #include "machine/pckeybrd.h" #include "machine/idectrl.h" -static void ide_interrupt(const device_config *device, int state); +static void ide_interrupt(running_device *device, int state); static UINT32 *bios_ram; static UINT32 *vga_vram; static struct { - const device_config *pit8254; - const device_config *pic8259_1; - const device_config *pic8259_2; - const device_config *dma8237_1; - const device_config *dma8237_2; + running_device *pit8254; + running_device *pic8259_1; + running_device *pic8259_2; + running_device *dma8237_1; + running_device *dma8237_2; } calchase_devices; @@ -240,7 +240,7 @@ static WRITE8_HANDLER( pc_dma_write_byte ) memory_write_byte(space, page_offset + offset, data); } -static void set_dma_channel(const device_config *device, int channel, int state) +static void set_dma_channel(running_device *device, int channel, int state) { if (!state) dma_channel = channel; } @@ -307,14 +307,14 @@ static WRITE32_DEVICE_HANDLER( fdc_w ) // Intel 82439TX System Controller (MXTC) static UINT8 mxtc_config_reg[256]; -static UINT8 mxtc_config_r(const device_config *busdevice, const device_config *device, int function, int reg) +static UINT8 mxtc_config_r(running_device *busdevice, running_device *device, int function, int reg) { // mame_printf_debug("MXTC: read %d, %02X\n", function, reg); return mxtc_config_reg[reg]; } -static void mxtc_config_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT8 data) +static void mxtc_config_w(running_device *busdevice, running_device *device, int function, int reg, UINT8 data) { // mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", cpuexec_describe_context(machine), function, reg, data); @@ -347,7 +347,7 @@ static void intel82439tx_init(void) mxtc_config_reg[0x65] = 0x02; } -static UINT32 intel82439tx_pci_r(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 mem_mask) +static UINT32 intel82439tx_pci_r(running_device *busdevice, running_device *device, int function, int reg, UINT32 mem_mask) { UINT32 r = 0; if (ACCESSING_BITS_24_31) @@ -369,7 +369,7 @@ static UINT32 intel82439tx_pci_r(const device_config *busdevice, const device_co return r; } -static void intel82439tx_pci_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82439tx_pci_w(running_device *busdevice, running_device *device, int function, int reg, UINT32 data, UINT32 mem_mask) { if (ACCESSING_BITS_24_31) { @@ -392,19 +392,19 @@ static void intel82439tx_pci_w(const device_config *busdevice, const device_conf // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) static UINT8 piix4_config_reg[4][256]; -static UINT8 piix4_config_r(const device_config *busdevice, const device_config *device, int function, int reg) +static UINT8 piix4_config_r(running_device *busdevice, running_device *device, int function, int reg) { // mame_printf_debug("PIIX4: read %d, %02X\n", function, reg); return piix4_config_reg[function][reg]; } -static void piix4_config_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT8 data) +static void piix4_config_w(running_device *busdevice, running_device *device, int function, int reg, UINT8 data) { // mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", cpuexec_describe_context(machine), function, reg, data); piix4_config_reg[function][reg] = data; } -static UINT32 intel82371ab_pci_r(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 mem_mask) +static UINT32 intel82371ab_pci_r(running_device *busdevice, running_device *device, int function, int reg, UINT32 mem_mask) { UINT32 r = 0; if (ACCESSING_BITS_24_31) @@ -426,7 +426,7 @@ static UINT32 intel82371ab_pci_r(const device_config *busdevice, const device_co return r; } -static void intel82371ab_pci_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82371ab_pci_w(running_device *busdevice, running_device *device, int function, int reg, UINT32 data, UINT32 mem_mask) { if (ACCESSING_BITS_24_31) { @@ -635,7 +635,7 @@ static void keyboard_interrupt(running_machine *machine, int state) pic8259_set_irq_line(calchase_devices.pic8259_1, 1, state); } -static void ide_interrupt(const device_config *device, int state) +static void ide_interrupt(running_device *device, int state) { pic8259_set_irq_line(calchase_devices.pic8259_2, 6, state); } diff --git a/src/mame/drivers/capbowl.c b/src/mame/drivers/capbowl.c index 11428701af3..1d543f23e6b 100644 --- a/src/mame/drivers/capbowl.c +++ b/src/mame/drivers/capbowl.c @@ -199,7 +199,7 @@ static WRITE8_HANDLER( capbowl_sndcmd_w ) * *************************************/ -static void firqhandler( const device_config *device, int irq ) +static void firqhandler( running_device *device, int irq ) { capbowl_state *state = (capbowl_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 1, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c index 32807e8f2d0..554aef8ad25 100644 --- a/src/mame/drivers/cave.c +++ b/src/mame/drivers/cave.c @@ -127,7 +127,7 @@ static INTERRUPT_GEN( cave_interrupt ) } /* Called by the YMZ280B to set the IRQ state */ -static void sound_irq_gen( const device_config *device, int state ) +static void sound_irq_gen( running_device *device, int state ) { cave_state *cave = (cave_state *)device->machine->driver_data; cave->sound_irq = (state != 0); @@ -1656,7 +1656,7 @@ static const ymz280b_interface ymz280b_intf = sound_irq_gen }; -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/cball.c b/src/mame/drivers/cball.c index 927429f2e86..4676e66887c 100644 --- a/src/mame/drivers/cball.c +++ b/src/mame/drivers/cball.c @@ -18,7 +18,7 @@ struct _cball_state tilemap_t* bg_tilemap; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c index 1270692bd20..87acc39ac32 100644 --- a/src/mame/drivers/cbuster.c +++ b/src/mame/drivers/cbuster.c @@ -270,7 +270,7 @@ GFXDECODE_END /******************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c index 439d8951716..26f02a6a497 100644 --- a/src/mame/drivers/centiped.c +++ b/src/mame/drivers/centiped.c @@ -1977,7 +1977,7 @@ ROM_END static DRIVER_INIT( caterplr ) { const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); - const device_config *device = devtag_get_device(machine, "pokey"); + running_device *device = devtag_get_device(machine, "pokey"); memory_install_readwrite8_device_handler(space, device, 0x1000, 0x100f, 0, 0, caterplr_AY8910_r, caterplr_AY8910_w); memory_install_read8_device_handler(space, device, 0x1780, 0x1780, 0, 0, caterplr_rand_r); } @@ -1986,7 +1986,7 @@ static DRIVER_INIT( caterplr ) static DRIVER_INIT( magworm ) { const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); - const device_config *device = devtag_get_device(machine, "pokey"); + running_device *device = devtag_get_device(machine, "pokey"); memory_install_write8_device_handler(space, device, 0x1001, 0x1001, 0, 0, ay8910_address_w); memory_install_readwrite8_device_handler(space, device, 0x1003, 0x1003, 0, 0, ay8910_r, ay8910_data_w); } diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c index 63350bdae9d..a65a563afce 100644 --- a/src/mame/drivers/cham24.c +++ b/src/mame/drivers/cham24.c @@ -251,7 +251,7 @@ static PALETTE_INIT( cham24 ) ppu2c0x_init_palette(machine, 0); } -static void ppu_irq( const device_config *device, int *ppu_regs ) +static void ppu_irq( running_device *device, int *ppu_regs ) { cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); } diff --git a/src/mame/drivers/chanbara.c b/src/mame/drivers/chanbara.c index 311665737f3..79bbccd5509 100644 --- a/src/mame/drivers/chanbara.c +++ b/src/mame/drivers/chanbara.c @@ -66,7 +66,7 @@ struct _chanbara_state UINT8 scroll, scrollhi; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; @@ -340,7 +340,7 @@ static WRITE8_DEVICE_HANDLER( chanbara_ay_out_1_w ) //if (data & 0xf8) printf("chanbara_ay_out_1_w unused bits set %02x\n", data & 0xf8); } -static void sound_irq( const device_config *device, int linestate ) +static void sound_irq( running_device *device, int linestate ) { chanbara_state *state = (chanbara_state *)device->machine->driver_data; cpu_set_input_line(state->maincpu, 0, linestate); diff --git a/src/mame/drivers/chinagat.c b/src/mame/drivers/chinagat.c index c2cb8319006..ba782643311 100644 --- a/src/mame/drivers/chinagat.c +++ b/src/mame/drivers/chinagat.c @@ -299,7 +299,7 @@ static READ8_HANDLER( saiyugb1_m5205_irq_r ) return 0; } -static void saiyugb1_m5205_irq_w( const device_config *device ) +static void saiyugb1_m5205_irq_w( running_device *device ) { ddragon_state *state = (ddragon_state *)device->machine->driver_data; state->adpcm_sound_irq = 1; @@ -492,7 +492,7 @@ static GFXDECODE_START( chinagat ) GFXDECODE_END -static void chinagat_irq_handler( const device_config *device, int irq ) +static void chinagat_irq_handler( running_device *device, int irq ) { ddragon_state *state = (ddragon_state *)device->machine->driver_data; cpu_set_input_line(state->snd_cpu, 0, irq ? ASSERT_LINE : CLEAR_LINE ); diff --git a/src/mame/drivers/chinsan.c b/src/mame/drivers/chinsan.c index 86b653e8bc6..7ac1d271cf7 100644 --- a/src/mame/drivers/chinsan.c +++ b/src/mame/drivers/chinsan.c @@ -523,7 +523,7 @@ GFXDECODE_END * *************************************/ -static void chin_adpcm_int( const device_config *device ) +static void chin_adpcm_int( running_device *device ) { chinsan_state *state = (chinsan_state *)device->machine->driver_data; diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c index 9ab366c06d2..176d660a454 100644 --- a/src/mame/drivers/chqflag.c +++ b/src/mame/drivers/chqflag.c @@ -290,7 +290,7 @@ INPUT_PORTS_END -static void chqflag_ym2151_irq_w( const device_config *device, int data ) +static void chqflag_ym2151_irq_w( running_device *device, int data ) { chqflag_state *state = (chqflag_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, data ? ASSERT_LINE : CLEAR_LINE); @@ -302,7 +302,7 @@ static const ym2151_interface ym2151_config = chqflag_ym2151_irq_w }; -static void volume_callback0( const device_config *device, int v ) +static void volume_callback0( running_device *device, int v ) { k007232_set_volume(device, 0, (v & 0x0f) * 0x11, 0); k007232_set_volume(device, 1, 0, (v >> 4) * 0x11); @@ -313,7 +313,7 @@ static WRITE8_DEVICE_HANDLER( k007232_extvolume_w ) k007232_set_volume(device, 1, (data & 0x0f) * 0x11/2, (data >> 4) * 0x11/2); } -static void volume_callback1( const device_config *device, int v ) +static void volume_callback1( running_device *device, int v ) { k007232_set_volume(device, 0, (v & 0x0f) * 0x11/2, (v >> 4) * 0x11/2); } diff --git a/src/mame/drivers/cinemat.c b/src/mame/drivers/cinemat.c index a53697ee18a..2f26d6dc66c 100644 --- a/src/mame/drivers/cinemat.c +++ b/src/mame/drivers/cinemat.c @@ -149,7 +149,7 @@ static WRITE8_HANDLER( mux_select_w ) * *************************************/ -static UINT8 joystick_read(const device_config *device) +static UINT8 joystick_read(running_device *device) { if (mame_get_phase(device->machine) != MAME_PHASE_RUNNING) return 0; diff --git a/src/mame/drivers/clayshoo.c b/src/mame/drivers/clayshoo.c index e6007f193e2..f0480db1005 100644 --- a/src/mame/drivers/clayshoo.c +++ b/src/mame/drivers/clayshoo.c @@ -96,7 +96,7 @@ static TIMER_CALLBACK( reset_analog_bit ) } -static attotime compute_duration( const device_config *device, int analog_pos ) +static attotime compute_duration( running_device *device, int analog_pos ) { /* the 58 comes from the length of the loop used to read the analog position */ diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c index d7729dd5499..276b9ee4a0d 100644 --- a/src/mame/drivers/cliffhgr.c +++ b/src/mame/drivers/cliffhgr.c @@ -83,7 +83,7 @@ Side 2 = 0x8F7DDD (or 0x880000 | ( 0x77 << 12 ) | 0x0DDD) #define CLIFF_ENABLE_SND_1 NODE_01 #define CLIFF_ENABLE_SND_2 NODE_02 -static const device_config *laserdisc; +static running_device *laserdisc; static int port_bank = 0; static int phillips_code = 0; diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c index 5fa8c5abbfc..4678cb567cb 100644 --- a/src/mame/drivers/cninja.c +++ b/src/mame/drivers/cninja.c @@ -53,7 +53,7 @@ Note about version levels using Mutant Fighter as the example: #include "sound/okim6295.h" static int cninja_scanline, cninja_irq_mask; -static const device_config *raster_irq_timer; +static running_device *raster_irq_timer; static UINT16 *cninja_ram; /**********************************************************************************/ @@ -717,12 +717,12 @@ static MACHINE_RESET( cninja ) cninja_irq_mask=0; } -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } -static void sound_irq2(const device_config *device, int state) +static void sound_irq2(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 0, state); } diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c index 42b46aa2ea8..7376feac1d8 100644 --- a/src/mame/drivers/cntsteer.c +++ b/src/mame/drivers/cntsteer.c @@ -51,9 +51,9 @@ struct _cntsteer_state int nmimask; // zerotrgt only /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *subcpu; + running_device *maincpu; + running_device *audiocpu; + running_device *subcpu; }; diff --git a/src/mame/drivers/compgolf.c b/src/mame/drivers/compgolf.c index e486c51f46d..3a4230a5dd4 100644 --- a/src/mame/drivers/compgolf.c +++ b/src/mame/drivers/compgolf.c @@ -201,7 +201,7 @@ GFXDECODE_END * *************************************/ -static void sound_irq(const device_config *device, int linestate) +static void sound_irq(running_device *device, int linestate) { cputag_set_input_line(device->machine, "maincpu", 0, linestate); } diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c index 74d7bb69f82..b3584139673 100644 --- a/src/mame/drivers/coolpool.c +++ b/src/mame/drivers/coolpool.c @@ -63,7 +63,7 @@ static UINT8 nvram_write_enable; * *************************************/ -static void amerdart_scanline(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void amerdart_scanline(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0xff00]; UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); @@ -90,7 +90,7 @@ static void amerdart_scanline(const device_config *screen, bitmap_t *bitmap, int } -static void coolpool_scanline(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void coolpool_scanline(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *vram = &vram_base[(params->rowaddr << 8) & 0x1ff00]; UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c index 91e5a8868c3..5d1e0d8b4cd 100644 --- a/src/mame/drivers/cosmic.c +++ b/src/mame/drivers/cosmic.c @@ -1618,7 +1618,7 @@ static DRIVER_INIT( devzone ) static DRIVER_INIT( nomnlnd ) { - const device_config *dac = devtag_get_device(machine, "dac"); + running_device *dac = devtag_get_device(machine, "dac"); memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5000, 0x5001, 0, 0, nomnlnd_port_0_1_r); memory_nop_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4800, 0x4800, 0, 0); memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4807, 0x4807, 0, 0, cosmic_background_enable_w); diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c index aeff0d20b13..885cce64193 100644 --- a/src/mame/drivers/cps1.c +++ b/src/mame/drivers/cps1.c @@ -2736,7 +2736,7 @@ GFXDECODE_END -static void cps1_irq_handler_mus(const device_config *device, int irq) +static void cps1_irq_handler_mus(running_device *device, int irq) { cps_state *state = (cps_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); @@ -2922,7 +2922,7 @@ static ADDRESS_MAP_START( sf2mdt_z80map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0xd000, 0xd7ff) AM_RAM ADDRESS_MAP_END -static void m5205_int1(const device_config *device) +static void m5205_int1(running_device *device) { // msm5205_data_w(device, sample_buffer1 & 0x0F); // sample_buffer1 >>= 4; @@ -2931,7 +2931,7 @@ static void m5205_int1(const device_config *device) // cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); } -static void m5205_int2(const device_config *device) +static void m5205_int2(running_device *device) { // msm5205_data_w(device, sample_buffer2 & 0x0F); // sample_buffer2 >>= 4; diff --git a/src/mame/drivers/crbaloon.c b/src/mame/drivers/crbaloon.c index 22a61fdc2bf..72000f7a2bf 100644 --- a/src/mame/drivers/crbaloon.c +++ b/src/mame/drivers/crbaloon.c @@ -159,8 +159,8 @@ static READ8_HANDLER( pc3259_r ) static WRITE8_HANDLER( port_sound_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); - const device_config *sn = devtag_get_device(space->machine, "snsnd"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); + running_device *sn = devtag_get_device(space->machine, "snsnd"); /* D0 - interrupt enable - also goes to PC3259 as /HTCTRL */ cpu_interrupt_enable(devtag_get_device(space->machine, "maincpu"), (data & 0x01) ? TRUE : FALSE); @@ -343,7 +343,7 @@ GFXDECODE_END static MACHINE_RESET( crballoon ) { const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO); - const device_config *discrete = devtag_get_device(machine, "discrete"); + running_device *discrete = devtag_get_device(machine, "discrete"); pc3092_reset(); port_sound_w(space, 0, 0); diff --git a/src/mame/drivers/crgolf.c b/src/mame/drivers/crgolf.c index 1311c148ca6..e29fb7edf4b 100644 --- a/src/mame/drivers/crgolf.c +++ b/src/mame/drivers/crgolf.c @@ -190,7 +190,7 @@ static READ8_HANDLER( sound_to_main_r ) * *************************************/ -static void vck_callback( const device_config *device ) +static void vck_callback( running_device *device ) { crgolf_state *state = (crgolf_state *)device->machine->driver_data; @@ -603,7 +603,7 @@ ROM_END static DRIVER_INIT( crgolfhi ) { - const device_config *msm = devtag_get_device(machine, "msm"); + running_device *msm = devtag_get_device(machine, "msm"); memory_install_write8_device_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), msm, 0xa000, 0xa003, 0, 0, crgolfhi_sample_w); } diff --git a/src/mame/drivers/crimfght.c b/src/mame/drivers/crimfght.c index 397a66eaf40..d3293863dbe 100644 --- a/src/mame/drivers/crimfght.c +++ b/src/mame/drivers/crimfght.c @@ -227,7 +227,7 @@ static const ym2151_interface ym2151_config = crimfght_snd_bankswitch_w }; -static void volume_callback( const device_config *device, int v ) +static void volume_callback( running_device *device, int v ) { k007232_set_volume(device, 0, (v & 0x0f) * 0x11, 0); k007232_set_volume(device, 1, 0, (v >> 4) * 0x11); diff --git a/src/mame/drivers/crospang.c b/src/mame/drivers/crospang.c index e1865cf0291..304065d5a64 100644 --- a/src/mame/drivers/crospang.c +++ b/src/mame/drivers/crospang.c @@ -273,7 +273,7 @@ static GFXDECODE_START( crospang ) GFXDECODE_END -static void irqhandler( const device_config *device, int linestate ) +static void irqhandler( running_device *device, int linestate ) { crospang_state *state = (crospang_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, linestate); diff --git a/src/mame/drivers/crshrace.c b/src/mame/drivers/crshrace.c index accae51bb5a..ad5b96dddac 100644 --- a/src/mame/drivers/crshrace.c +++ b/src/mame/drivers/crshrace.c @@ -428,7 +428,7 @@ GFXDECODE_END -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { crshrace_state *state = (crshrace_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c index 3f993bc24a6..1a69ef4d18a 100644 --- a/src/mame/drivers/crystal.c +++ b/src/mame/drivers/crystal.c @@ -337,7 +337,7 @@ static READ32_HANDLER(PIO_r) static WRITE32_HANDLER(PIO_w) { - const device_config *ds1302 = devtag_get_device(space->machine, "rtc"); + running_device *ds1302 = devtag_get_device(space->machine, "rtc"); UINT32 RST = data & 0x01000000; UINT32 CLK = data & 0x02000000; UINT32 DAT = data & 0x10000000; diff --git a/src/mame/drivers/cubeqst.c b/src/mame/drivers/cubeqst.c index cc4a2021f77..9c007ae7641 100644 --- a/src/mame/drivers/cubeqst.c +++ b/src/mame/drivers/cubeqst.c @@ -48,7 +48,7 @@ static int video_field; static UINT8 io_latch; static UINT8 reset_latch; -static const device_config *laserdisc; +static running_device *laserdisc; static rgb_t *colormap; @@ -454,7 +454,7 @@ static MACHINE_RESET( cubeqst ) */ /* Called by the sound CPU emulation */ -static void sound_dac_w(const device_config *device, UINT16 data) +static void sound_dac_w(running_device *device, UINT16 data) { static const char *const dacs[] = { diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c index 7a2a4863aea..ef72e744efb 100644 --- a/src/mame/drivers/cvs.c +++ b/src/mame/drivers/cvs.c @@ -245,7 +245,7 @@ static INTERRUPT_GEN( cvs_main_cpu_interrupt ) } -static void cvs_slave_cpu_interrupt( const device_config *cpu, int state ) +static void cvs_slave_cpu_interrupt( running_device *cpu, int state ) { cpu_set_input_line_vector(cpu, 0, 0x03); //cpu_set_input_line(cpu, 0, state ? ASSERT_LINE : CLEAR_LINE); @@ -437,7 +437,7 @@ static WRITE8_DEVICE_HANDLER( cvs_tms5110_pdc_w ) } -static int speech_rom_read_bit( const device_config *device ) +static int speech_rom_read_bit( running_device *device ) { cvs_state *state = (cvs_state *)device->machine->driver_data; running_machine *machine = device->machine; diff --git a/src/mame/drivers/dacholer.c b/src/mame/drivers/dacholer.c index efcdb1c9703..2bc55b3f7d6 100644 --- a/src/mame/drivers/dacholer.c +++ b/src/mame/drivers/dacholer.c @@ -45,7 +45,7 @@ struct _dacholer_state UINT8 snd_ack; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; @@ -406,7 +406,7 @@ static INTERRUPT_GEN( sound_irq ) } } -static void adpcm_int( const device_config *device ) +static void adpcm_int( running_device *device ) { dacholer_state *state = (dacholer_state *)device->machine->driver_data; if (state->snd_interrupt_enable == 1 || (state->snd_interrupt_enable == 0 && state->msm_toggle == 1)) diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c index 8ec1d46015b..510a0131a29 100644 --- a/src/mame/drivers/darius.c +++ b/src/mame/drivers/darius.c @@ -336,7 +336,7 @@ static void update_fm1( running_machine *machine ) static void update_psg0( running_machine *machine, int port ) { darius_state *state = (darius_state *)machine->driver_data; - const device_config *lvol = NULL, *rvol = NULL; + running_device *lvol = NULL, *rvol = NULL; int left, right; switch (port) @@ -359,7 +359,7 @@ static void update_psg0( running_machine *machine, int port ) static void update_psg1( running_machine *machine, int port ) { darius_state *state = (darius_state *)machine->driver_data; - const device_config *lvol = NULL, *rvol = NULL; + running_device *lvol = NULL, *rvol = NULL; int left, right; switch (port) @@ -513,7 +513,7 @@ static ADDRESS_MAP_START( darius_sound2_map, ADDRESS_SPACE_PROGRAM, 8 ) ADDRESS_MAP_END -static void darius_adpcm_int( const device_config *device ) +static void darius_adpcm_int( running_device *device ) { darius_state *state = (darius_state *)device->machine->driver_data; @@ -798,7 +798,7 @@ GFXDECODE_END **************************************************************/ /* handler called by the YM2203 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) /* assumes Z80 sandwiched between 68Ks */ +static void irqhandler( running_device *device, int irq ) /* assumes Z80 sandwiched between 68Ks */ { darius_state *state = (darius_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c index 4ebcc1a546b..7982b947d4c 100644 --- a/src/mame/drivers/darkseal.c +++ b/src/mame/drivers/darkseal.c @@ -229,7 +229,7 @@ GFXDECODE_END /******************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c index 780de106fe6..2377df1ce17 100644 --- a/src/mame/drivers/dassault.c +++ b/src/mame/drivers/dassault.c @@ -508,7 +508,7 @@ GFXDECODE_END /**********************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); } diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c index 68f50af2bcb..0401d53e8b2 100644 --- a/src/mame/drivers/dblewing.c +++ b/src/mame/drivers/dblewing.c @@ -601,7 +601,7 @@ static INPUT_PORTS_START( dblewing ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) INPUT_PORTS_END -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { /* bit 0 of dblewing_sound_irq specifies IRQ from sound chip */ if (state) diff --git a/src/mame/drivers/dbz.c b/src/mame/drivers/dbz.c index 1c3c4ea03af..ff851eb3cb8 100644 --- a/src/mame/drivers/dbz.c +++ b/src/mame/drivers/dbz.c @@ -113,7 +113,7 @@ static WRITE16_HANDLER( dbz_sound_cause_nmi ) cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); } -static void dbz_sound_irq( const device_config *device, int irq ) +static void dbz_sound_irq( running_device *device, int irq ) { dbz_state *state = (dbz_state *)device->machine->driver_data; diff --git a/src/mame/drivers/dcheese.c b/src/mame/drivers/dcheese.c index 1afa84e3f74..a61c6f898cd 100644 --- a/src/mame/drivers/dcheese.c +++ b/src/mame/drivers/dcheese.c @@ -47,7 +47,7 @@ * *************************************/ -static void update_irq_state( const device_config *cpu ) +static void update_irq_state( running_device *cpu ) { dcheese_state *state = (dcheese_state *)cpu->machine->driver_data; diff --git a/src/mame/drivers/ddayjlc.c b/src/mame/drivers/ddayjlc.c index 48c0d07e1ca..e5b61242037 100644 --- a/src/mame/drivers/ddayjlc.c +++ b/src/mame/drivers/ddayjlc.c @@ -78,7 +78,7 @@ struct _ddayjlc_state UINT8 prot_addr; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c index de66bcf4e7b..282aed5f1fd 100644 --- a/src/mame/drivers/ddenlovr.c +++ b/src/mame/drivers/ddenlovr.c @@ -7447,7 +7447,7 @@ static INTERRUPT_GEN( quizchq_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise quizchq would lock up. */ - if (device_get_info_int(device,CPUINFO_INT_INPUT_STATE + 0)) + if (device->get_config_int(CPUINFO_INT_INPUT_STATE + 0)) return; if ((++count % 60) == 0) @@ -7527,7 +7527,7 @@ static INTERRUPT_GEN( mmpanic_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise the game would lock up. */ - if (device_get_info_int(device,CPUINFO_INT_INPUT_STATE + 0)) + if (device->get_config_int(CPUINFO_INT_INPUT_STATE + 0)) return; if ((++count % 60) == 0) @@ -7599,7 +7599,7 @@ static INTERRUPT_GEN( hanakanz_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise quizchq would lock up. */ - if (device_get_info_int(device,CPUINFO_INT_INPUT_STATE + 0)) + if (device->get_config_int(CPUINFO_INT_INPUT_STATE + 0)) return; if ((++count % 60) == 0) @@ -7675,7 +7675,7 @@ static INTERRUPT_GEN( mjchuuka_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise quizchq would lock up. */ - if (device_get_info_int(device,CPUINFO_INT_INPUT_STATE + 0)) + if (device->get_config_int(CPUINFO_INT_INPUT_STATE + 0)) return; if ((++count % 60) == 0) @@ -7733,7 +7733,7 @@ static INTERRUPT_GEN( mjmyster_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise quizchq would lock up. */ - if (device_get_info_int(device,CPUINFO_INT_INPUT_STATE + 0)) + if (device->get_config_int(CPUINFO_INT_INPUT_STATE + 0)) return; switch( cpu_getiloops(device) ) @@ -7789,7 +7789,7 @@ static INTERRUPT_GEN( hginga_irq ) /* I haven't found a irq ack register, so I need this kludge to make sure I don't lose any interrupt generated by the blitter, otherwise hginga would lock up. */ - if (device_get_info_int(device,CPUINFO_INT_INPUT_STATE + 0)) + if (device->get_config_int(CPUINFO_INT_INPUT_STATE + 0)) return; if ((++count % 60) == 0) diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c index 1a891881e87..dbdfe186549 100644 --- a/src/mame/drivers/ddragon.c +++ b/src/mame/drivers/ddragon.c @@ -341,7 +341,7 @@ static WRITE8_HANDLER( ddragon2_sub_irq_w ) } -static void irq_handler( const device_config *device, int irq ) +static void irq_handler( running_device *device, int irq ) { ddragon_state *state = (ddragon_state *)device->machine->driver_data; cpu_set_input_line(state->snd_cpu, state->ym_irq , irq ? ASSERT_LINE : CLEAR_LINE ); @@ -436,7 +436,7 @@ static WRITE8_HANDLER( ddragon_spriteram_w ) static WRITE8_HANDLER( dd_adpcm_w ) { ddragon_state *state = (ddragon_state *)space->machine->driver_data; - const device_config *adpcm = (offset & 1) ? state->adpcm_2 : state->adpcm_1; + running_device *adpcm = (offset & 1) ? state->adpcm_2 : state->adpcm_1; int chip = (adpcm == state->adpcm_1) ? 0 : 1; switch (offset / 2) @@ -462,7 +462,7 @@ static WRITE8_HANDLER( dd_adpcm_w ) } -static void dd_adpcm_int( const device_config *device ) +static void dd_adpcm_int( running_device *device ) { ddragon_state *state = (ddragon_state *)device->machine->driver_data; int chip = (device == state->adpcm_1) ? 0 : 1; diff --git a/src/mame/drivers/ddragon3.c b/src/mame/drivers/ddragon3.c index 5670e162e2c..e3bf2a6f065 100644 --- a/src/mame/drivers/ddragon3.c +++ b/src/mame/drivers/ddragon3.c @@ -513,7 +513,7 @@ GFXDECODE_END * *************************************/ -static void dd3_ymirq_handler(const device_config *device, int irq) +static void dd3_ymirq_handler(running_device *device, int irq) { ddragon3_state *state = (ddragon3_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0 , irq ? ASSERT_LINE : CLEAR_LINE ); diff --git a/src/mame/drivers/dec0.c b/src/mame/drivers/dec0.c index 8c9fbf96323..c78a182011a 100644 --- a/src/mame/drivers/dec0.c +++ b/src/mame/drivers/dec0.c @@ -943,12 +943,12 @@ GFXDECODE_END /******************************************************************************/ -static void sound_irq(const device_config *device, int linestate) +static void sound_irq(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 0, linestate); /* IRQ */ } -static void sound_irq2(const device_config *device, int linestate) +static void sound_irq2(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 1, linestate); /* IRQ2 */ } @@ -966,7 +966,7 @@ static const ym3812_interface ym3812b_interface = /******************************************************************************/ -static void automat_vclk_cb(const device_config *device) +static void automat_vclk_cb(running_device *device) { if (automat_msm5205_vclk_toggle == 0) { diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c index e08947fe6ec..8720fe4592e 100644 --- a/src/mame/drivers/dec8.c +++ b/src/mame/drivers/dec8.c @@ -430,7 +430,7 @@ static WRITE8_HANDLER( dec8_sound_w ) cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); } -static void csilver_adpcm_int( const device_config *device ) +static void csilver_adpcm_int( running_device *device ) { dec8_state *state = (dec8_state *)device->machine->driver_data; state->toggle ^= 1; @@ -1930,7 +1930,7 @@ GFXDECODE_END /******************************************************************************/ /* handler called by the 3812 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int linestate ) +static void irqhandler( running_device *device, int linestate ) { dec8_state *state = (dec8_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, linestate); /* M6502_IRQ_LINE */ diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c index 037911948b8..4dc40c0c346 100644 --- a/src/mame/drivers/deco156.c +++ b/src/mame/drivers/deco156.c @@ -351,7 +351,7 @@ GFXDECODE_END /**********************************************************************************/ -static void sound_irq_gen(const device_config *device, int state) +static void sound_irq_gen(running_device *device, int state) { logerror("sound irq\n"); } diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c index 3f77baa358b..2d8923df27b 100644 --- a/src/mame/drivers/deco32.c +++ b/src/mame/drivers/deco32.c @@ -239,7 +239,7 @@ Notes: static UINT32 *deco32_ram; static int raster_enable; -static const device_config *raster_irq_timer; +static running_device *raster_irq_timer; static UINT8 nslasher_sound_irq; /**********************************************************************************/ @@ -372,7 +372,7 @@ static READ32_HANDLER( fghthist_control_r ) static WRITE32_HANDLER( fghthist_eeprom_w ) { if (ACCESSING_BITS_0_7) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(device, data & 0x10); eeprom_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); @@ -642,7 +642,7 @@ static WRITE32_HANDLER( nslasher_eeprom_w ) { if (ACCESSING_BITS_0_7) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(device, data & 0x10); eeprom_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); @@ -1596,12 +1596,12 @@ GFXDECODE_END /**********************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } -static void sound_irq_nslasher(const device_config *device, int state) +static void sound_irq_nslasher(running_device *device, int state) { /* bit 0 of nslasher_sound_irq specifies IRQ from sound chip */ if (state) diff --git a/src/mame/drivers/deco_ld.c b/src/mame/drivers/deco_ld.c index 917af01d617..dadc2aedc7d 100644 --- a/src/mame/drivers/deco_ld.c +++ b/src/mame/drivers/deco_ld.c @@ -107,7 +107,7 @@ Sound processor - 6502 #include "machine/laserdsc.h" static UINT8 vram_bank; -static const device_config *laserdisc; +static running_device *laserdisc; static UINT8 laserdisc_data; static VIDEO_UPDATE( rblaster ) diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c index 5b26a4b2df1..2de9d484bcc 100644 --- a/src/mame/drivers/deco_mlc.c +++ b/src/mame/drivers/deco_mlc.c @@ -109,7 +109,7 @@ VIDEO_EOF( mlc ); extern UINT32 *mlc_vram, *mlc_clip_ram; static UINT32 *mlc_ram, *irq_ram; -static const device_config *raster_irq_timer; +static running_device *raster_irq_timer; static int mainCpuIsArm; static int mlc_raster_table[9][256]; static UINT32 vbl_i; diff --git a/src/mame/drivers/deniam.c b/src/mame/drivers/deniam.c index 24560f01300..101d3ee42c1 100644 --- a/src/mame/drivers/deniam.c +++ b/src/mame/drivers/deniam.c @@ -213,7 +213,7 @@ static GFXDECODE_START( deniam ) GFXDECODE_END -static void irqhandler( const device_config *device, int linestate ) +static void irqhandler( running_device *device, int linestate ) { deniam_state *state = (deniam_state *)device->machine->driver_data; diff --git a/src/mame/drivers/destroyr.c b/src/mame/drivers/destroyr.c index 718f7117a2e..48ddb42ff06 100644 --- a/src/mame/drivers/destroyr.c +++ b/src/mame/drivers/destroyr.c @@ -29,7 +29,7 @@ struct _destroyr_state int noise; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/drivers/dietgo.c b/src/mame/drivers/dietgo.c index 90f11a0eef3..4fb4b690dde 100644 --- a/src/mame/drivers/dietgo.c +++ b/src/mame/drivers/dietgo.c @@ -162,7 +162,7 @@ static GFXDECODE_START( dietgo ) GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 512, 16 ) /* Sprites (16x16) */ GFXDECODE_END -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } diff --git a/src/mame/drivers/discoboy.c b/src/mame/drivers/discoboy.c index d5d80ed65a2..85a58c24ce3 100644 --- a/src/mame/drivers/discoboy.c +++ b/src/mame/drivers/discoboy.c @@ -60,7 +60,7 @@ struct _discoboy_state int adpcm_data; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; @@ -318,7 +318,7 @@ ADDRESS_MAP_END // state->adpcm_data = data; //} -static void splash_msm5205_int( const device_config *device ) +static void splash_msm5205_int( running_device *device ) { discoboy_state *state = (discoboy_state *)device->machine->driver_data; msm5205_data_w(device, state->adpcm_data >> 4); diff --git a/src/mame/drivers/diverboy.c b/src/mame/drivers/diverboy.c index c4ba7178206..38fbd387f56 100644 --- a/src/mame/drivers/diverboy.c +++ b/src/mame/drivers/diverboy.c @@ -62,7 +62,7 @@ struct _diverboy_state size_t spriteram_size; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c index 773798320e3..02d298f4620 100644 --- a/src/mame/drivers/djmain.c +++ b/src/mame/drivers/djmain.c @@ -246,7 +246,7 @@ static WRITE32_HANDLER( v_ctrl_w ) static READ32_HANDLER( v_rom_r ) { - const device_config *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = devtag_get_device(space->machine, "k056832"); UINT8 *mem8 = memory_region(space->machine, "gfx2"); int bank = k056832_word_r(k056832, 0x34/2, 0xffff); @@ -447,7 +447,7 @@ static INTERRUPT_GEN( vb_interrupt ) } -static void ide_interrupt(const device_config *device, int state) +static void ide_interrupt(running_device *device, int state) { if (state != CLEAR_LINE) { @@ -1437,7 +1437,7 @@ static STATE_POSTLOAD( djmain_postload ) static MACHINE_START( djmain ) { - const device_config *ide = devtag_get_device(machine, "ide"); + running_device *ide = devtag_get_device(machine, "ide"); if (ide != NULL && ide_master_password != NULL) ide_set_master_password(ide, ide_master_password); diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c index 232b561f6fb..856258f39f1 100644 --- a/src/mame/drivers/dlair.c +++ b/src/mame/drivers/dlair.c @@ -65,7 +65,7 @@ * *************************************/ -static const device_config *laserdisc; +static running_device *laserdisc; static UINT8 last_misc; static UINT8 laserdisc_type; @@ -82,7 +82,7 @@ static const UINT8 led_map[16] = * *************************************/ -static void dleuro_interrupt(const device_config *device, int state) +static void dleuro_interrupt(running_device *device, int state) { cputag_set_input_line(device->machine, "maincpu", 0, state); } @@ -94,7 +94,7 @@ static WRITE8_DEVICE_HANDLER( serial_transmit ) } -static int serial_receive(const device_config *device, int channel) +static int serial_receive(running_device *device, int channel) { /* if we still have data to send, do it now */ if (channel == 0 && laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE) @@ -209,10 +209,10 @@ static MACHINE_RESET( dlair ) static INTERRUPT_GEN( vblank_callback ) { /* also update the speaker on the European version */ - const device_config *beep = devtag_get_device(device->machine, "beep"); + running_device *beep = devtag_get_device(device->machine, "beep"); if (beep != NULL) { - const device_config *ctc = devtag_get_device(device->machine, "ctc"); + running_device *ctc = devtag_get_device(device->machine, "ctc"); beep_set_state(beep, 1); beep_set_frequency(beep, ATTOSECONDS_TO_HZ(z80ctc_getperiod(ctc, 0).attoseconds)); } diff --git a/src/mame/drivers/docastle.c b/src/mame/drivers/docastle.c index 052fb4d399a..621b29fa7f7 100644 --- a/src/mame/drivers/docastle.c +++ b/src/mame/drivers/docastle.c @@ -162,7 +162,7 @@ Dip locations verified with manual for docastle, dorunrun and dowild. /* Read/Write Handlers */ -static void idsoccer_adpcm_int( const device_config *device ) +static void idsoccer_adpcm_int( running_device *device ) { docastle_state *state = (docastle_state *)device->machine->driver_data; diff --git a/src/mame/drivers/dooyong.c b/src/mame/drivers/dooyong.c index 62d7b26990e..3fd6531aef3 100644 --- a/src/mame/drivers/dooyong.c +++ b/src/mame/drivers/dooyong.c @@ -732,7 +732,7 @@ static GFXDECODE_START( popbingo ) GFXDECODE_ENTRY( "gfx2", 0, popbingo_tilelayout, 256, 1 ) GFXDECODE_END -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/dorachan.c b/src/mame/drivers/dorachan.c index 3fa3f380d03..d8160951a3b 100644 --- a/src/mame/drivers/dorachan.c +++ b/src/mame/drivers/dorachan.c @@ -27,7 +27,7 @@ struct _dorachan_state UINT8 flip_screen; /* devices */ - const device_config *main_cpu; + running_device *main_cpu; }; diff --git a/src/mame/drivers/drmicro.c b/src/mame/drivers/drmicro.c index e363aca376c..6f75dc6b424 100644 --- a/src/mame/drivers/drmicro.c +++ b/src/mame/drivers/drmicro.c @@ -43,7 +43,7 @@ static WRITE8_HANDLER( nmi_enable_w ) } -static void pcm_w(const device_config *device) +static void pcm_w(running_device *device) { drmicro_state *state = (drmicro_state *)device->machine->driver_data; UINT8 *PCM = memory_region(device->machine, "adpcm"); diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c index 3adb8c0c8fa..f05229c0187 100644 --- a/src/mame/drivers/dynax.c +++ b/src/mame/drivers/dynax.c @@ -127,7 +127,7 @@ static INTERRUPT_GEN( sprtmtch_vblank_interrupt ) sprtmtch_update_irq(device->machine); } -static void sprtmtch_sound_callback(const device_config *device, int state) +static void sprtmtch_sound_callback(running_device *device, int state) { dynax_sound_irq = state; sprtmtch_update_irq(device->machine); @@ -201,7 +201,7 @@ static WRITE8_HANDLER( jantouki_sound_vblank_ack_w ) jantouki_sound_update_irq(space->machine); } -static void jantouki_sound_callback(const device_config *device, int state) +static void jantouki_sound_callback(running_device *device, int state) { dynax_sound_irq = state; jantouki_sound_update_irq(device->machine); @@ -348,7 +348,7 @@ static WRITE8_HANDLER( yarunara_palette_w ) case 0x1c: // RTC { - const device_config *rtc = devtag_get_device(space->machine, "rtc"); + running_device *rtc = devtag_get_device(space->machine, "rtc"); msm6242_w(rtc, offset, data); } return; @@ -398,7 +398,7 @@ static WRITE8_HANDLER( nanajign_palette_w ) static int msm5205next; static int resetkludge; -static void adpcm_int(const device_config *device) +static void adpcm_int(running_device *device) { static int toggle; @@ -412,7 +412,7 @@ static void adpcm_int(const device_config *device) cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); } } -static void adpcm_int_cpu1(const device_config *device) +static void adpcm_int_cpu1(running_device *device) { static int toggle; @@ -1426,7 +1426,7 @@ static READ8_HANDLER( tenkai_8000_r ) } else if ( (rombank == 0x10) && (offset < 0x10) ) { - const device_config *rtc = devtag_get_device(space->machine, "rtc"); + running_device *rtc = devtag_get_device(space->machine, "rtc"); return msm6242_r(rtc, offset); } else if (rombank == 0x12) @@ -1442,7 +1442,7 @@ static WRITE8_HANDLER( tenkai_8000_w ) { if ( (rombank == 0x10) && (offset < 0x10) ) { - const device_config *rtc = devtag_get_device(space->machine, "rtc"); + running_device *rtc = devtag_get_device(space->machine, "rtc"); msm6242_w(rtc, offset, data); return; } diff --git a/src/mame/drivers/egghunt.c b/src/mame/drivers/egghunt.c index de46cccf1e9..ababecbc8f4 100644 --- a/src/mame/drivers/egghunt.c +++ b/src/mame/drivers/egghunt.c @@ -63,7 +63,7 @@ struct _egghunt_state UINT8 gfx_banking; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c index 2f43e8dca08..c9e72464c1d 100644 --- a/src/mame/drivers/enigma2.c +++ b/src/mame/drivers/enigma2.c @@ -71,8 +71,8 @@ struct _enigma2_state emu_timer *interrupt_assert_timer; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c index 909c3156975..a792ba9227d 100644 --- a/src/mame/drivers/equites.c +++ b/src/mame/drivers/equites.c @@ -563,7 +563,7 @@ static WRITE8_HANDLER( equites_8155_portb_w ) equites_update_dac(space->machine); } -static void equites_msm5232_gate( const device_config *device, int state ) +static void equites_msm5232_gate( running_device *device, int state ) { } diff --git a/src/mame/drivers/esh.c b/src/mame/drivers/esh.c index cea6b9c4ff3..8a6858e0d0a 100644 --- a/src/mame/drivers/esh.c +++ b/src/mame/drivers/esh.c @@ -31,7 +31,7 @@ Todo: /* Misc variables */ -static const device_config *laserdisc; +static running_device *laserdisc; static UINT8 *tile_ram; static UINT8 *tile_control_ram; diff --git a/src/mame/drivers/esripsys.c b/src/mame/drivers/esripsys.c index 2111e634672..8fbfd323797 100644 --- a/src/mame/drivers/esripsys.c +++ b/src/mame/drivers/esripsys.c @@ -554,7 +554,7 @@ static READ8_HANDLER( tms5220_r ) if (offset == 0) { /* TMS5220 core returns status bits in D7-D6 */ - const device_config *tms = devtag_get_device(space->machine, "tms5220nl"); + running_device *tms = devtag_get_device(space->machine, "tms5220nl"); UINT8 status = tms5220_status_r(tms, 0); status = ((status & 0x80) >> 5) | ((status & 0x40) >> 5) | ((status & 0x20) >> 5); @@ -567,7 +567,7 @@ static READ8_HANDLER( tms5220_r ) /* TODO: Implement correctly using the state PROM */ static WRITE8_HANDLER( tms5220_w ) { - const device_config *tms = devtag_get_device(space->machine, "tms5220nl"); + running_device *tms = devtag_get_device(space->machine, "tms5220nl"); if (offset == 0) { tms_data = data; diff --git a/src/mame/drivers/exprraid.c b/src/mame/drivers/exprraid.c index 5b6d1d1dae5..797c29b8a41 100644 --- a/src/mame/drivers/exprraid.c +++ b/src/mame/drivers/exprraid.c @@ -439,7 +439,7 @@ GFXDECODE_END /* handler called by the 3812 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int linestate ) +static void irqhandler( running_device *device, int linestate ) { exprraid_state *state = (exprraid_state *)device->machine->driver_data; cpu_set_input_line_and_vector(state->slave, 0, linestate, 0xff); diff --git a/src/mame/drivers/exzisus.c b/src/mame/drivers/exzisus.c index a3f8af27635..b390c3ef6f3 100644 --- a/src/mame/drivers/exzisus.c +++ b/src/mame/drivers/exzisus.c @@ -281,7 +281,7 @@ GFXDECODE_END -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/f1gp.c b/src/mame/drivers/f1gp.c index 791ed68b77f..2427e8bb2e9 100644 --- a/src/mame/drivers/f1gp.c +++ b/src/mame/drivers/f1gp.c @@ -409,7 +409,7 @@ GFXDECODE_END -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { f1gp_state *state = (f1gp_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c index b10d78ca1f0..9556130a243 100644 --- a/src/mame/drivers/fantland.c +++ b/src/mame/drivers/fantland.c @@ -311,7 +311,7 @@ ADDRESS_MAP_END Born To Fight ***************************************************************************/ -static void borntofi_adpcm_start( const device_config *device, int voice ) +static void borntofi_adpcm_start( running_device *device, int voice ) { fantland_state *state = (fantland_state *)device->machine->driver_data; msm5205_reset_w(device, 0); @@ -320,7 +320,7 @@ static void borntofi_adpcm_start( const device_config *device, int voice ) // logerror("%s: adpcm start = %06x, stop = %06x\n", cpuexec_describe_context(device->machine), state->adpcm_addr[0][voice], state->adpcm_addr[1][voice]); } -static void borntofi_adpcm_stop( const device_config *device, int voice ) +static void borntofi_adpcm_stop( running_device *device, int voice ) { fantland_state *state = (fantland_state *)device->machine->driver_data; msm5205_reset_w(device, 1); @@ -332,7 +332,7 @@ static WRITE8_HANDLER( borntofi_msm5205_w ) fantland_state *state = (fantland_state *)space->machine->driver_data; int voice = offset / 8; int reg = offset % 8; - const device_config *msm; + running_device *msm; switch (voice) { @@ -363,7 +363,7 @@ static WRITE8_HANDLER( borntofi_msm5205_w ) } } -static void borntofi_adpcm_int( const device_config *device, int voice ) +static void borntofi_adpcm_int( running_device *device, int voice ) { fantland_state *state = (fantland_state *)device->machine->driver_data; UINT8 *rom; @@ -397,10 +397,10 @@ static void borntofi_adpcm_int( const device_config *device, int voice ) } } -static void borntofi_adpcm_int_0(const device_config *device) { borntofi_adpcm_int(device, 0); } -static void borntofi_adpcm_int_1(const device_config *device) { borntofi_adpcm_int(device, 1); } -static void borntofi_adpcm_int_2(const device_config *device) { borntofi_adpcm_int(device, 2); } -static void borntofi_adpcm_int_3(const device_config *device) { borntofi_adpcm_int(device, 3); } +static void borntofi_adpcm_int_0(running_device *device) { borntofi_adpcm_int(device, 0); } +static void borntofi_adpcm_int_1(running_device *device) { borntofi_adpcm_int(device, 1); } +static void borntofi_adpcm_int_2(running_device *device) { borntofi_adpcm_int(device, 2); } +static void borntofi_adpcm_int_3(running_device *device) { borntofi_adpcm_int(device, 3); } static ADDRESS_MAP_START( borntofi_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) @@ -898,7 +898,7 @@ static MACHINE_DRIVER_START( fantland ) MACHINE_DRIVER_END -static void galaxygn_sound_irq( const device_config *device, int line ) +static void galaxygn_sound_irq( running_device *device, int line ) { fantland_state *state = (fantland_state *)device->machine->driver_data; cpu_set_input_line_and_vector(state->audio_cpu, 0, line ? ASSERT_LINE : CLEAR_LINE, 0x80/4); @@ -1062,7 +1062,7 @@ MACHINE_DRIVER_END -static void wheelrun_ym3526_irqhandler( const device_config *device, int state ) +static void wheelrun_ym3526_irqhandler( running_device *device, int state ) { fantland_state *driver = (fantland_state *)device->machine->driver_data; cpu_set_input_line(driver->audio_cpu, INPUT_LINE_IRQ0, state); diff --git a/src/mame/drivers/fastlane.c b/src/mame/drivers/fastlane.c index 281e8ba0091..3d4c9ab8fd6 100644 --- a/src/mame/drivers/fastlane.c +++ b/src/mame/drivers/fastlane.c @@ -176,13 +176,13 @@ GFXDECODE_END ***************************************************************************/ -static void volume_callback0(const device_config *device, int v) +static void volume_callback0(running_device *device, int v) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); } -static void volume_callback1(const device_config *device, int v) +static void volume_callback1(running_device *device, int v) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c index 097d03cf0fd..c371d3cb50a 100644 --- a/src/mame/drivers/fcrash.c +++ b/src/mame/drivers/fcrash.c @@ -61,7 +61,7 @@ static WRITE8_HANDLER( fcrash_snd_bankswitch_w ) memory_set_bank(space->machine, "bank1", data & 0x07); } -static void m5205_int1( const device_config *device ) +static void m5205_int1( running_device *device ) { cps_state *state = (cps_state *)device->machine->driver_data; @@ -72,7 +72,7 @@ static void m5205_int1( const device_config *device ) cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); } -static void m5205_int2( const device_config *device ) +static void m5205_int2( running_device *device ) { cps_state *state = (cps_state *)device->machine->driver_data; diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c index f54a1c7bbd2..fa259ffa73a 100644 --- a/src/mame/drivers/firebeat.c +++ b/src/mame/drivers/firebeat.c @@ -470,7 +470,7 @@ static VIDEO_UPDATE(firebeat) { int chip; - if (screen == screen->machine->config->devicelist.find(VIDEO_SCREEN, 0)) + if (screen == screen->machine->devicelist.find(VIDEO_SCREEN, 0)) chip = 0; else chip = 1; @@ -599,7 +599,7 @@ static void GCU_w(running_machine *machine, int chip, UINT32 offset, UINT32 data COMBINE_DATA( &gcu[chip].visible_area ); if (ACCESSING_BITS_0_15) { - const device_config *screen = machine->config->devicelist.find(VIDEO_SCREEN, chip); + running_device *screen = machine->devicelist.find(VIDEO_SCREEN, chip); if (screen != NULL) { @@ -1733,7 +1733,7 @@ static READ8_DEVICE_HANDLER( soundram_r ) return 0; } -static void sound_irq_callback(const device_config *device, int state) +static void sound_irq_callback(running_device *device, int state) { } @@ -2153,7 +2153,7 @@ static int ibutton_w(UINT8 data) return r; } -static void security_w(const device_config *device, UINT8 data) +static void security_w(running_device *device, UINT8 data) { int r = ibutton_w(data); if (r >= 0) diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c index 9e33e72c933..53e31cd864d 100644 --- a/src/mame/drivers/firefox.c +++ b/src/mame/drivers/firefox.c @@ -57,7 +57,7 @@ fffe=reset e7cc /* FXXXXX for first field AXXXXX for second field */ -static const device_config *laserdisc; +static running_device *laserdisc; static int m_n_disc_lock; static int m_n_disc_data; static int m_n_disc_read_data; @@ -125,8 +125,8 @@ static WRITE8_HANDLER( firefox_disc_data_w ) static unsigned char *tileram; static unsigned char *tile_palette; static unsigned char *sprite_palette; -static const device_config *nvram_1c; -static const device_config *nvram_1d; +static running_device *nvram_1c; +static running_device *nvram_1d; static tilemap_t *bgtiles; static int control_num; @@ -304,7 +304,7 @@ static READ8_DEVICE_HANDLER( riot_porta_r ) static WRITE8_DEVICE_HANDLER( riot_porta_w ) { - const device_config *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = devtag_get_device(device->machine, "tms"); /* handle 5220 read */ tms5220_rsq_w(tms, (data>>1) & 1); @@ -420,7 +420,7 @@ static WRITE8_HANDLER( firefox_coin_counter_w ) -static void firq_gen(const device_config *device, int state) +static void firq_gen(running_device *device, int state) { if (state) cputag_set_input_line( device->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE ); diff --git a/src/mame/drivers/firetrap.c b/src/mame/drivers/firetrap.c index dcfcd1f2961..29feae3684f 100644 --- a/src/mame/drivers/firetrap.c +++ b/src/mame/drivers/firetrap.c @@ -197,7 +197,7 @@ static WRITE8_HANDLER( firetrap_sound_bankselect_w ) memory_set_bank(space->machine, "bank2", data & 0x01); } -static void firetrap_adpcm_int( const device_config *device ) +static void firetrap_adpcm_int( running_device *device ) { firetrap_state *state = (firetrap_state *)device->machine->driver_data; diff --git a/src/mame/drivers/firetrk.c b/src/mame/drivers/firetrk.c index 2dde3807f52..09af79d1fa6 100644 --- a/src/mame/drivers/firetrk.c +++ b/src/mame/drivers/firetrk.c @@ -39,7 +39,7 @@ static INPUT_CHANGED( service_mode_switch_changed ) static INPUT_CHANGED( firetrk_horn_changed ) { - const device_config *discrete = devtag_get_device(field->port->machine, "discrete"); + running_device *discrete = devtag_get_device(field->port->machine, "discrete"); discrete_sound_w(discrete, FIRETRUCK_HORN_EN, newval); } @@ -80,7 +80,7 @@ static TIMER_CALLBACK( periodic_callback ) static WRITE8_HANDLER( firetrk_output_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); /* BIT0 => START1 LAMP */ set_led_status(space->machine, 0, !(data & 0x01)); @@ -111,7 +111,7 @@ static WRITE8_HANDLER( firetrk_output_w ) static WRITE8_HANDLER( superbug_output_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); /* BIT0 => START LAMP */ set_led_status(space->machine, 0, offset & 0x01); @@ -131,7 +131,7 @@ static WRITE8_HANDLER( superbug_output_w ) static WRITE8_HANDLER( montecar_output_1_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); /* BIT0 => START LAMP */ set_led_status(space->machine, 0, !(data & 0x01)); @@ -158,7 +158,7 @@ static WRITE8_HANDLER( montecar_output_1_w ) static WRITE8_HANDLER( montecar_output_2_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); firetrk_flash = data & 0x80; diff --git a/src/mame/drivers/flkatck.c b/src/mame/drivers/flkatck.c index d5ee3fde102..ab05f50d4fa 100644 --- a/src/mame/drivers/flkatck.c +++ b/src/mame/drivers/flkatck.c @@ -183,7 +183,7 @@ static GFXDECODE_START( flkatck ) GFXDECODE_ENTRY( "gfx1", 0, gfxlayout, 0, 32 ) GFXDECODE_END -static void volume_callback0(const device_config *device, int v) +static void volume_callback0(running_device *device, int v) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); diff --git a/src/mame/drivers/flyball.c b/src/mame/drivers/flyball.c index 16d6891cd89..0178c722c9b 100644 --- a/src/mame/drivers/flyball.c +++ b/src/mame/drivers/flyball.c @@ -31,7 +31,7 @@ struct _flyball_state UINT8 potsense; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/drivers/fromanc2.c b/src/mame/drivers/fromanc2.c index e38c5e2b4a4..2d71376347c 100644 --- a/src/mame/drivers/fromanc2.c +++ b/src/mame/drivers/fromanc2.c @@ -495,7 +495,7 @@ GFXDECODE_END * *************************************/ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { fromanc2_state *state = (fromanc2_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/fromance.c b/src/mame/drivers/fromance.c index 701a097f9e9..7d7fcd20085 100644 --- a/src/mame/drivers/fromance.c +++ b/src/mame/drivers/fromance.c @@ -145,7 +145,7 @@ static WRITE8_HANDLER( fromance_adpcm_w ) } -static void fromance_adpcm_int( const device_config *device ) +static void fromance_adpcm_int( running_device *device ) { fromance_state *state = (fromance_state *)device->machine->driver_data; diff --git a/src/mame/drivers/funkyjet.c b/src/mame/drivers/funkyjet.c index dde1f5c40db..615f0a69fdf 100644 --- a/src/mame/drivers/funkyjet.c +++ b/src/mame/drivers/funkyjet.c @@ -277,7 +277,7 @@ GFXDECODE_END /******************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } diff --git a/src/mame/drivers/fuukifg2.c b/src/mame/drivers/fuukifg2.c index 646a61d89ab..8a7ad00644c 100644 --- a/src/mame/drivers/fuukifg2.c +++ b/src/mame/drivers/fuukifg2.c @@ -373,7 +373,7 @@ GFXDECODE_END ***************************************************************************/ -static void soundirq( const device_config *device, int state ) +static void soundirq( running_device *device, int state ) { fuuki16_state *fuuki16 = (fuuki16_state *)device->machine->driver_data; cpu_set_input_line(fuuki16->audiocpu, 0, state); diff --git a/src/mame/drivers/fuukifg3.c b/src/mame/drivers/fuukifg3.c index 41bf84c1f51..6b2a2057c8a 100644 --- a/src/mame/drivers/fuukifg3.c +++ b/src/mame/drivers/fuukifg3.c @@ -536,7 +536,7 @@ static MACHINE_RESET( fuuki32 ) } -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { fuuki32_state *state = (fuuki32_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/gaelco3d.c b/src/mame/drivers/gaelco3d.c index f9b639d6c88..29cc9c950e6 100644 --- a/src/mame/drivers/gaelco3d.c +++ b/src/mame/drivers/gaelco3d.c @@ -164,14 +164,14 @@ static offs_t tms_offset_xor; static UINT8 analog_ports[4]; static UINT8 framenum; -static const device_config *adsp_autobuffer_timer; +static running_device *adsp_autobuffer_timer; static UINT16 *adsp_control_regs; static UINT16 *adsp_fastram_base; static UINT8 adsp_ireg; static offs_t adsp_ireg_base, adsp_incs, adsp_size; -static const device_config *dmadac[SOUND_CHANNELS]; +static running_device *dmadac[SOUND_CHANNELS]; -static void adsp_tx_callback(const device_config *device, int port, INT32 data); +static void adsp_tx_callback(running_device *device, int port, INT32 data); /************************************* @@ -429,7 +429,7 @@ static WRITE32_HANDLER( tms_m68k_ram_w ) } -static void iack_w(const device_config *device, UINT8 state, offs_t addr) +static void iack_w(running_device *device, UINT8 state, offs_t addr) { if (LOG) logerror("iack_w(%d) - %06X\n", state, addr); @@ -597,7 +597,7 @@ static TIMER_DEVICE_CALLBACK( adsp_autobuffer_irq ) } -static void adsp_tx_callback(const device_config *device, int port, INT32 data) +static void adsp_tx_callback(running_device *device, int port, INT32 data) { /* check if it's for SPORT1 */ if (port != 1) diff --git a/src/mame/drivers/gaiden.c b/src/mame/drivers/gaiden.c index 38737409ad1..e155b0a9b23 100644 --- a/src/mame/drivers/gaiden.c +++ b/src/mame/drivers/gaiden.c @@ -835,7 +835,7 @@ static GFXDECODE_START( drgnbowl ) GFXDECODE_END /* handler called by the 2203 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { gaiden_state *state = (gaiden_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/galastrm.c b/src/mame/drivers/galastrm.c index 1757570475f..a4f98ca6b33 100644 --- a/src/mame/drivers/galastrm.c +++ b/src/mame/drivers/galastrm.c @@ -131,7 +131,7 @@ popmessage(t); if (ACCESSING_BITS_0_7) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(device, data & 0x40); eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/drivers/galaxia.c b/src/mame/drivers/galaxia.c index 6d1212fc460..7835488df19 100644 --- a/src/mame/drivers/galaxia.c +++ b/src/mame/drivers/galaxia.c @@ -38,9 +38,9 @@ static VIDEO_UPDATE( galaxia ) bitmap_t *s2636_1_bitmap; bitmap_t *s2636_2_bitmap; - const device_config *s2636_0 = devtag_get_device(screen->machine, "s2636_0"); - const device_config *s2636_1 = devtag_get_device(screen->machine, "s2636_1"); - const device_config *s2636_2 = devtag_get_device(screen->machine, "s2636_2"); + running_device *s2636_0 = devtag_get_device(screen->machine, "s2636_0"); + running_device *s2636_1 = devtag_get_device(screen->machine, "s2636_1"); + running_device *s2636_2 = devtag_get_device(screen->machine, "s2636_2"); count = 0; diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c index 099a5a61419..9788cdc533c 100644 --- a/src/mame/drivers/galaxian.c +++ b/src/mame/drivers/galaxian.c @@ -423,7 +423,7 @@ static READ8_DEVICE_HANDLER( konami_sound_timer_r ) static WRITE8_HANDLER( konami_sound_filter_w ) { - const device_config *discrete = devtag_get_device(space->machine, "konami"); + running_device *discrete = devtag_get_device(space->machine, "konami"); static const char *const ayname[2] = { "8910.0", "8910.1" }; int which, chan; @@ -803,7 +803,7 @@ static WRITE8_DEVICE_HANDLER( scorpion_protection_w ) static READ8_HANDLER( scorpion_digitalker_intr_r ) { - const device_config *digitalker = devtag_get_device(space->machine, "digitalker"); + running_device *digitalker = devtag_get_device(space->machine, "digitalker"); return digitalker_0_intr_r(digitalker); } diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c index 93a7ead376b..53047d60634 100644 --- a/src/mame/drivers/galpani2.c +++ b/src/mame/drivers/galpani2.c @@ -80,7 +80,7 @@ static MACHINE_RESET( galpani2 ) cpuexec_boost_interleave(machine, attotime_zero, ATTOTIME_IN_USEC(50)); //initial mcu xchk } -static void galpani2_write_kaneko(const device_config *device) +static void galpani2_write_kaneko(running_device *device) { const address_space *dstspace = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM); int i,x,tpattidx; diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c index ee928c9eb90..de6cd8553b6 100644 --- a/src/mame/drivers/galpanic.c +++ b/src/mame/drivers/galpanic.c @@ -137,7 +137,7 @@ VIDEO_UPDATE( comad ); static VIDEO_EOF( galpanic ) { - const device_config *pandora = devtag_get_device(machine, "pandora"); + running_device *pandora = devtag_get_device(machine, "pandora"); pandora_eof(pandora); } @@ -163,7 +163,7 @@ static INTERRUPT_GEN( galhustl_interrupt ) static WRITE16_HANDLER( galpanic_6295_bankswitch_w ) { - const device_config *pandora = devtag_get_device(space->machine, "pandora"); + running_device *pandora = devtag_get_device(space->machine, "pandora"); if (ACCESSING_BITS_8_15) { @@ -189,7 +189,7 @@ static WRITE16_HANDLER( galpania_6295_bankswitch_w ) #ifdef UNUSED_FUNCTION static WRITE16_HANDLER( galpania_misc_w ) { - const device_config *pandora = devtag_get_device(machine, "pandora"); + running_device *pandora = devtag_get_device(machine, "pandora"); if (ACCESSING_BITS_0_7) { diff --git a/src/mame/drivers/galspnbl.c b/src/mame/drivers/galspnbl.c index babb6309dc5..2ac479aacdd 100644 --- a/src/mame/drivers/galspnbl.c +++ b/src/mame/drivers/galspnbl.c @@ -188,7 +188,7 @@ GFXDECODE_END -static void irqhandler( const device_config *device, int linestate ) +static void irqhandler( running_device *device, int linestate ) { galspnbl_state *state = (galspnbl_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, linestate); diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c index 396076da16d..ddba1a330c7 100644 --- a/src/mame/drivers/gamecstl.c +++ b/src/mame/drivers/gamecstl.c @@ -73,17 +73,17 @@ #include "machine/pckeybrd.h" #include "machine/idectrl.h" -static void ide_interrupt(const device_config *device, int state); +static void ide_interrupt(running_device *device, int state); static UINT32 *cga_ram; static UINT32 *bios_ram; static struct { - const device_config *pit8254; - const device_config *pic8259_1; - const device_config *pic8259_2; - const device_config *dma8237_1; - const device_config *dma8237_2; + running_device *pit8254; + running_device *pic8259_1; + running_device *pic8259_2; + running_device *dma8237_1; + running_device *dma8237_2; } gamecstl_devices; @@ -175,14 +175,14 @@ static WRITE32_DEVICE_HANDLER(at32_dma8237_2_w) // Intel 82439TX System Controller (MXTC) static UINT8 mxtc_config_reg[256]; -static UINT8 mxtc_config_r(const device_config *busdevice, const device_config *device, int function, int reg) +static UINT8 mxtc_config_r(running_device *busdevice, running_device *device, int function, int reg) { // mame_printf_debug("MXTC: read %d, %02X\n", function, reg); return mxtc_config_reg[reg]; } -static void mxtc_config_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT8 data) +static void mxtc_config_w(running_device *busdevice, running_device *device, int function, int reg, UINT8 data) { // mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", cpuexec_describe_context(busdevice->machine), function, reg, data); @@ -215,7 +215,7 @@ static void intel82439tx_init(void) mxtc_config_reg[0x65] = 0x02; } -static UINT32 intel82439tx_pci_r(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 mem_mask) +static UINT32 intel82439tx_pci_r(running_device *busdevice, running_device *device, int function, int reg, UINT32 mem_mask) { UINT32 r = 0; if (ACCESSING_BITS_24_31) @@ -237,7 +237,7 @@ static UINT32 intel82439tx_pci_r(const device_config *busdevice, const device_co return r; } -static void intel82439tx_pci_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82439tx_pci_w(running_device *busdevice, running_device *device, int function, int reg, UINT32 data, UINT32 mem_mask) { if (ACCESSING_BITS_24_31) { @@ -260,19 +260,19 @@ static void intel82439tx_pci_w(const device_config *busdevice, const device_conf // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) static UINT8 piix4_config_reg[4][256]; -static UINT8 piix4_config_r(const device_config *busdevice, const device_config *device, int function, int reg) +static UINT8 piix4_config_r(running_device *busdevice, running_device *device, int function, int reg) { // mame_printf_debug("PIIX4: read %d, %02X\n", function, reg); return piix4_config_reg[function][reg]; } -static void piix4_config_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT8 data) +static void piix4_config_w(running_device *busdevice, running_device *device, int function, int reg, UINT8 data) { // mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", cpuexec_describe_context(busdevice->machine), function, reg, data); piix4_config_reg[function][reg] = data; } -static UINT32 intel82371ab_pci_r(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 mem_mask) +static UINT32 intel82371ab_pci_r(running_device *busdevice, running_device *device, int function, int reg, UINT32 mem_mask) { UINT32 r = 0; if (ACCESSING_BITS_24_31) @@ -294,7 +294,7 @@ static UINT32 intel82371ab_pci_r(const device_config *busdevice, const device_co return r; } -static void intel82371ab_pci_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82371ab_pci_w(running_device *busdevice, running_device *device, int function, int reg, UINT32 data, UINT32 mem_mask) { if (ACCESSING_BITS_24_31) { @@ -447,7 +447,7 @@ static WRITE8_HANDLER( pc_dma_write_byte ) memory_write_byte(space, page_offset + offset, data); } -static void set_dma_channel(const device_config *device, int channel, int state) +static void set_dma_channel(running_device *device, int channel, int state) { if (!state) dma_channel = channel; } @@ -718,7 +718,7 @@ static void keyboard_interrupt(running_machine *machine, int state) pic8259_set_irq_line( gamecstl_devices.pic8259_1, 1, state); } -static void ide_interrupt(const device_config *device, int state) +static void ide_interrupt(running_device *device, int state) { pic8259_set_irq_line( gamecstl_devices.pic8259_2, 6, state); } diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c index 2e0f0df9843..54704802942 100644 --- a/src/mame/drivers/gaplus.c +++ b/src/mame/drivers/gaplus.c @@ -215,8 +215,8 @@ static WRITE8_HANDLER( gaplus_sreset_w ) static WRITE8_HANDLER( gaplus_freset_w ) { - const device_config *io58xx = devtag_get_device(space->machine, "58xx"); - const device_config *io56xx = devtag_get_device(space->machine, "56xx"); + running_device *io58xx = devtag_get_device(space->machine, "58xx"); + running_device *io56xx = devtag_get_device(space->machine, "56xx"); int bit = !BIT(offset, 11); logerror("%04x: freset %d\n",cpu_get_pc(space->cpu), bit); @@ -234,8 +234,8 @@ static MACHINE_RESET( gaplus ) static TIMER_CALLBACK( namcoio_run ) { - const device_config *io58xx = devtag_get_device(machine, "58xx"); - const device_config *io56xx = devtag_get_device(machine, "56xx"); + running_device *io58xx = devtag_get_device(machine, "58xx"); + running_device *io56xx = devtag_get_device(machine, "56xx"); switch (param) { @@ -250,8 +250,8 @@ static TIMER_CALLBACK( namcoio_run ) static INTERRUPT_GEN( gaplus_interrupt_1 ) { - const device_config *io58xx = devtag_get_device(device->machine, "58xx"); - const device_config *io56xx = devtag_get_device(device->machine, "56xx"); + running_device *io58xx = devtag_get_device(device->machine, "58xx"); + running_device *io56xx = devtag_get_device(device->machine, "56xx"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c index b814bdf124b..cad0413ec7d 100644 --- a/src/mame/drivers/gauntlet.c +++ b/src/mame/drivers/gauntlet.c @@ -142,7 +142,7 @@ static void update_interrupts(running_machine *machine) } -static void scanline_update(const device_config *screen, int scanline) +static void scanline_update(running_device *screen, int scanline) { const address_space *space = cputag_get_address_space(screen->machine, "audiocpu", ADDRESS_SPACE_PROGRAM); @@ -247,7 +247,7 @@ static READ8_HANDLER( switch_6502_r ) static WRITE8_HANDLER( sound_ctl_w ) { - const device_config *tms = devtag_get_device(space->machine, "tms"); + running_device *tms = devtag_get_device(space->machine, "tms"); switch (offset & 7) { case 0: /* music reset, bit D7, low reset */ diff --git a/src/mame/drivers/gbusters.c b/src/mame/drivers/gbusters.c index e8206833657..a7538d1275b 100644 --- a/src/mame/drivers/gbusters.c +++ b/src/mame/drivers/gbusters.c @@ -245,7 +245,7 @@ INPUT_PORTS_END ***************************************************************************/ -static void volume_callback( const device_config *device, int v ) +static void volume_callback( running_device *device, int v ) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); diff --git a/src/mame/drivers/gcpinbal.c b/src/mame/drivers/gcpinbal.c index 050b5f9c26b..18860749aca 100644 --- a/src/mame/drivers/gcpinbal.c +++ b/src/mame/drivers/gcpinbal.c @@ -202,7 +202,7 @@ static WRITE16_HANDLER( ioc_w ) /* Controlled through ioc? */ -static void gcp_adpcm_int( const device_config *device ) +static void gcp_adpcm_int( running_device *device ) { gcpinbal_state *state = (gcpinbal_state *)device->machine->driver_data; diff --git a/src/mame/drivers/gijoe.c b/src/mame/drivers/gijoe.c index f17f0cf2c0d..90d6079ee8f 100644 --- a/src/mame/drivers/gijoe.c +++ b/src/mame/drivers/gijoe.c @@ -159,7 +159,7 @@ static READ16_HANDLER( sound_status_r ) return soundlatch2_r(space, 0); } -static void sound_nmi( const device_config *device ) +static void sound_nmi( running_device *device ) { gijoe_state *state = (gijoe_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c index 4eec3536f4c..ce302b39992 100644 --- a/src/mame/drivers/gladiatr.c +++ b/src/mame/drivers/gladiatr.c @@ -284,7 +284,7 @@ static WRITE8_DEVICE_HANDLER( gladiator_int_control_w ) /* bit 0 : ?? */ } /* YM2203 IRQ */ -static void gladiator_ym_irq(const device_config *device, int irq) +static void gladiator_ym_irq(running_device *device, int irq) { /* NMI IRQ is not used by gladiator sound program */ cputag_set_input_line(device->machine, "sub", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/go2000.c b/src/mame/drivers/go2000.c index 7c488947a74..6726b0ededb 100644 --- a/src/mame/drivers/go2000.c +++ b/src/mame/drivers/go2000.c @@ -43,7 +43,7 @@ struct _go2000_state // UINT16 * paletteram; // currently this uses generic palette handling /* devices */ - const device_config *soundcpu; + running_device *soundcpu; }; diff --git a/src/mame/drivers/goal92.c b/src/mame/drivers/goal92.c index 2003a5f09d1..0a81cdc815e 100644 --- a/src/mame/drivers/goal92.c +++ b/src/mame/drivers/goal92.c @@ -210,7 +210,7 @@ static INPUT_PORTS_START( goal92 ) INPUT_PORTS_END /* handler called by the 2203 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { /* NMI writes to MSM ports *only*! -AS */ //goal92_state *state = (goal92_state *)device->machine->driver_data; @@ -227,7 +227,7 @@ static const ym2203_interface ym2203_config = irqhandler }; -static void goal92_adpcm_int( const device_config *device ) +static void goal92_adpcm_int( running_device *device ) { goal92_state *state = (goal92_state *)device->machine->driver_data; msm5205_data_w(device, state->msm5205next); diff --git a/src/mame/drivers/gotcha.c b/src/mame/drivers/gotcha.c index 6fc568db377..83acb7d6c79 100644 --- a/src/mame/drivers/gotcha.c +++ b/src/mame/drivers/gotcha.c @@ -235,7 +235,7 @@ GFXDECODE_END -static void irqhandler( const device_config *device, int linestate ) +static void irqhandler( running_device *device, int linestate ) { gotcha_state *state = (gotcha_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, linestate); diff --git a/src/mame/drivers/gottlieb.c b/src/mame/drivers/gottlieb.c index d63d8cb2f70..bcee76f7575 100644 --- a/src/mame/drivers/gottlieb.c +++ b/src/mame/drivers/gottlieb.c @@ -225,7 +225,7 @@ VBlank duration: 1/VSYNC * (16/256) = 1017.6 us static UINT8 joystick_select; static UINT8 track[2]; -static const device_config *laserdisc; +static running_device *laserdisc; static emu_timer *laserdisc_bit_timer; static emu_timer *laserdisc_philips_timer; static UINT8 laserdisc_select; @@ -270,7 +270,7 @@ static MACHINE_START( gottlieb ) state_save_register_global_array(machine, track); /* see if we have a laserdisc */ - laserdisc = machine->config->devicelist.first(LASERDISC); + laserdisc = machine->devicelist.first(LASERDISC); if (laserdisc != NULL) { /* attach to the I/O ports */ @@ -612,7 +612,7 @@ static void audio_handle_zero_crossing(attotime zerotime, int logit) } -static void laserdisc_audio_process(const device_config *device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1) +static void laserdisc_audio_process(running_device *device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1) { int logit = LOG_AUDIO_DECODE && input_code_pressed(device->machine, KEYCODE_L); attotime time_per_sample = ATTOTIME_IN_HZ(samplerate); diff --git a/src/mame/drivers/gpworld.c b/src/mame/drivers/gpworld.c index d19e8e14fa2..4a34a99b154 100644 --- a/src/mame/drivers/gpworld.c +++ b/src/mame/drivers/gpworld.c @@ -56,7 +56,7 @@ static UINT8* tile_RAM; static UINT8* sprite_RAM; static UINT8* palette_RAM; -static const device_config *laserdisc; +static running_device *laserdisc; /* VIDEO GOODS */ diff --git a/src/mame/drivers/gradius3.c b/src/mame/drivers/gradius3.c index 9be674c8d9f..dcb0adda50d 100644 --- a/src/mame/drivers/gradius3.c +++ b/src/mame/drivers/gradius3.c @@ -270,7 +270,7 @@ static INPUT_PORTS_START( gradius3 ) INPUT_PORTS_END -static void volume_callback(const device_config *device, int v) +static void volume_callback(running_device *device, int v) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); diff --git a/src/mame/drivers/grchamp.c b/src/mame/drivers/grchamp.c index 536991c5378..09e4f06ac01 100644 --- a/src/mame/drivers/grchamp.c +++ b/src/mame/drivers/grchamp.c @@ -244,7 +244,7 @@ static WRITE8_HANDLER( led_board_w ) static WRITE8_HANDLER( cpu1_outputs_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); grchamp_state *state = (grchamp_state *)space->machine->driver_data; UINT8 diff = data ^ state->cpu1_out[offset]; state->cpu1_out[offset] = data; diff --git a/src/mame/drivers/gstream.c b/src/mame/drivers/gstream.c index f3e8c504c5f..e885ac8dbfe 100644 --- a/src/mame/drivers/gstream.c +++ b/src/mame/drivers/gstream.c @@ -144,8 +144,8 @@ struct _gstream_state int oki_bank_0, oki_bank_1; /* devices */ - const device_config *oki_1; - const device_config *oki_2; + running_device *oki_1; + running_device *oki_2; }; diff --git a/src/mame/drivers/gstriker.c b/src/mame/drivers/gstriker.c index 315b7deda2b..d1996556497 100644 --- a/src/mame/drivers/gstriker.c +++ b/src/mame/drivers/gstriker.c @@ -267,7 +267,7 @@ GFXDECODE_END /*** MORE SOUND RELATED ******************************************************/ -static void gs_ym2610_irq(const device_config *device, int irq) +static void gs_ym2610_irq(running_device *device, int irq) { if (irq) cputag_set_input_line(device->machine, "audiocpu", 0, ASSERT_LINE); diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c index 2de2794efbd..08199a869e3 100644 --- a/src/mame/drivers/gticlub.c +++ b/src/mame/drivers/gticlub.c @@ -257,12 +257,12 @@ static WRITE32_HANDLER( paletteram32_w ) palette_set_color_rgb(space->machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0)); } -static void voodoo_vblank_0(const device_config *device, int param) +static void voodoo_vblank_0(running_device *device, int param) { cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, param ? ASSERT_LINE : CLEAR_LINE); } -static void voodoo_vblank_1(const device_config *device, int param) +static void voodoo_vblank_1(running_device *device, int param) { cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ1, param ? ASSERT_LINE : CLEAR_LINE); } @@ -280,7 +280,7 @@ static VIDEO_UPDATE( hangplt ) if (strcmp(screen->tag, "lscreen") == 0) { - const device_config *voodoo = devtag_get_device(screen->machine, "voodoo0"); + running_device *voodoo = devtag_get_device(screen->machine, "voodoo0"); // K001604_draw_back_layer(bitmap, cliprect); @@ -290,7 +290,7 @@ static VIDEO_UPDATE( hangplt ) } else if (strcmp(screen->tag, "rscreen") == 0) { - const device_config *voodoo = devtag_get_device(screen->machine, "voodoo1"); + running_device *voodoo = devtag_get_device(screen->machine, "voodoo1"); // K001604_draw_back_layer(bitmap, cliprect); @@ -324,8 +324,8 @@ static const eeprom_interface eeprom_intf = static READ8_HANDLER( sysreg_r ) { static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" }; - const device_config *adc1038 = devtag_get_device(space->machine, "adc1038"); - const device_config *eeprom = devtag_get_device(space->machine, "eeprom"); + running_device *adc1038 = devtag_get_device(space->machine, "adc1038"); + running_device *eeprom = devtag_get_device(space->machine, "eeprom"); switch (offset) { @@ -359,8 +359,8 @@ static READ8_HANDLER( sysreg_r ) static WRITE8_HANDLER( sysreg_w ) { - const device_config *adc1038 = devtag_get_device(space->machine, "adc1038"); - const device_config *eeprom = devtag_get_device(space->machine, "eeprom"); + running_device *adc1038 = devtag_get_device(space->machine, "adc1038"); + running_device *eeprom = devtag_get_device(space->machine, "eeprom"); switch (offset) { @@ -715,7 +715,7 @@ static const k056800_interface gticlub_k056800_interface = }; -static int adc1038_input_callback( const device_config *device, int input ) +static int adc1038_input_callback( running_device *device, int input ) { int value = 0; switch (input) diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c index e534c9b8805..22734865acd 100644 --- a/src/mame/drivers/gunbustr.c +++ b/src/mame/drivers/gunbustr.c @@ -114,7 +114,7 @@ popmessage(t); if (ACCESSING_BITS_0_7) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(device, data & 0x40); eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/drivers/gunpey.c b/src/mame/drivers/gunpey.c index 5fca3b1c447..1ac164cfb4e 100644 --- a/src/mame/drivers/gunpey.c +++ b/src/mame/drivers/gunpey.c @@ -189,7 +189,7 @@ ADDRESS_MAP_END /***************************************************************************************/ -static void sound_irq_gen(const device_config *device, int state) +static void sound_irq_gen(running_device *device, int state) { logerror("sound irq\n"); } diff --git a/src/mame/drivers/gyruss.c b/src/mame/drivers/gyruss.c index 2694157bf2f..5d5672a3401 100644 --- a/src/mame/drivers/gyruss.c +++ b/src/mame/drivers/gyruss.c @@ -105,7 +105,7 @@ static WRITE8_HANDLER( gyruss_irq_clear_w ) cpu_set_input_line(state->audiocpu_2, 0, CLEAR_LINE); } -static void filter_w( const device_config *device, int chip, int data ) +static void filter_w( running_device *device, int chip, int data ) { int i; diff --git a/src/mame/drivers/hcastle.c b/src/mame/drivers/hcastle.c index f9ba4e8266c..1b5d0429d10 100644 --- a/src/mame/drivers/hcastle.c +++ b/src/mame/drivers/hcastle.c @@ -154,13 +154,13 @@ GFXDECODE_END /*****************************************************************************/ -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { // hcastle_state *state = (hcastle_state *)device->machine->driver_data; // cputag_set_input_line(state->audiocpu, 0, linestate); } -static void volume_callback(const device_config *device, int v) +static void volume_callback(running_device *device, int v) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); diff --git a/src/mame/drivers/hnayayoi.c b/src/mame/drivers/hnayayoi.c index 62ec0ae9ccc..b406fbab91e 100644 --- a/src/mame/drivers/hnayayoi.c +++ b/src/mame/drivers/hnayayoi.c @@ -499,7 +499,7 @@ INPUT_PORTS_END -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { popmessage("irq"); // cputag_set_input_line(device->machine, "maincpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c index ba7e8882d83..044eea7b56b 100644 --- a/src/mame/drivers/hornet.c +++ b/src/mame/drivers/hornet.c @@ -568,12 +568,12 @@ static WRITE32_HANDLER(K037122_reg_w) COMBINE_DATA( K037122_reg[chip] + offset ); } -static void voodoo_vblank_0(const device_config *device, int param) +static void voodoo_vblank_0(running_device *device, int param) { cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE); } -static void voodoo_vblank_1(const device_config *device, int param) +static void voodoo_vblank_1(running_device *device, int param) { cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ1, ASSERT_LINE); } @@ -592,7 +592,7 @@ static VIDEO_START( hornet_2board ) static VIDEO_UPDATE( hornet ) { - const device_config *voodoo = devtag_get_device(screen->machine, "voodoo0"); + running_device *voodoo = devtag_get_device(screen->machine, "voodoo0"); voodoo_update(voodoo, bitmap, cliprect); @@ -607,7 +607,7 @@ static VIDEO_UPDATE( hornet_2board ) { if (strcmp(screen->tag, "lscreen") == 0) { - const device_config *voodoo = devtag_get_device(screen->machine, "voodoo0"); + running_device *voodoo = devtag_get_device(screen->machine, "voodoo0"); voodoo_update(voodoo, bitmap, cliprect); /* TODO: tilemaps per screen */ @@ -615,7 +615,7 @@ static VIDEO_UPDATE( hornet_2board ) } else if (strcmp(screen->tag, "rscreen") == 0) { - const device_config *voodoo = devtag_get_device(screen->machine, "voodoo1"); + running_device *voodoo = devtag_get_device(screen->machine, "voodoo1"); voodoo_update(voodoo, bitmap, cliprect); /* TODO: tilemaps per screen */ @@ -633,8 +633,8 @@ static READ8_HANDLER( sysreg_r ) { UINT8 r = 0; static const char *const portnames[] = { "IN0", "IN1", "IN2" }; - const device_config *adc12138 = devtag_get_device(space->machine, "adc12138"); - const device_config *eeprom = devtag_get_device(space->machine, "eeprom"); + running_device *adc12138 = devtag_get_device(space->machine, "adc12138"); + running_device *eeprom = devtag_get_device(space->machine, "eeprom"); switch (offset) { @@ -667,7 +667,7 @@ static READ8_HANDLER( sysreg_r ) static WRITE8_HANDLER( sysreg_w ) { - const device_config *adc12138 = devtag_get_device(space->machine, "adc12138"); + running_device *adc12138 = devtag_get_device(space->machine, "adc12138"); switch (offset) { @@ -1074,7 +1074,7 @@ static MACHINE_RESET( hornet ) memory_set_bankptr(machine, "bank5", usr5); } -static double adc12138_input_callback( const device_config *device, UINT8 input ) +static double adc12138_input_callback( running_device *device, UINT8 input ) { return (double)0.0; } @@ -1253,7 +1253,7 @@ MACHINE_DRIVER_END static void jamma_jvs_cmd_exec(running_machine *machine); -static void jamma_jvs_w(const device_config *device, UINT8 data) +static void jamma_jvs_w(running_device *device, UINT8 data) { if (jvs_sdata_ptr == 0 && data != 0xe0) return; diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c index 46a557f403c..f8d9f594911 100644 --- a/src/mame/drivers/hvyunit.c +++ b/src/mame/drivers/hvyunit.c @@ -295,7 +295,7 @@ static VIDEO_START(hvyunit) static VIDEO_UPDATE(hvyunit) { - const device_config *pandora = devtag_get_device(screen->machine, "pandora"); + running_device *pandora = devtag_get_device(screen->machine, "pandora"); tilemap_set_scrollx( bg_tilemap,0, ((port0_data&0x40)<<2)+ hu_scrollx + SX_POS); //TODO tilemap_set_scrolly( bg_tilemap,0, ((port0_data&0x80)<<1)+ hu_scrolly + SY_POS); // TODO @@ -309,7 +309,7 @@ static VIDEO_UPDATE(hvyunit) static VIDEO_EOF(hvyunit) { - const device_config *pandora = devtag_get_device(machine, "pandora"); + running_device *pandora = devtag_get_device(machine, "pandora"); pandora_eof(pandora); } diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c index b2ff2fd9d82..e116609d729 100644 --- a/src/mame/drivers/hyprduel.c +++ b/src/mame/drivers/hyprduel.c @@ -621,7 +621,7 @@ GFXDECODE_END Sound Communication ***************************************************************************/ -static void sound_irq( const device_config *device, int state ) +static void sound_irq( running_device *device, int state ) { hyprduel_state *hyprduel = (hyprduel_state *)device->machine->driver_data; cpu_set_input_line(hyprduel->subcpu, 1, HOLD_LINE); diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c index d38cbfbb608..faad08e5151 100644 --- a/src/mame/drivers/igs011.c +++ b/src/mame/drivers/igs011.c @@ -2607,7 +2607,7 @@ MACHINE_DRIVER_END -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { // cputag_set_input_line(machine, "maincpu", 3, state); } diff --git a/src/mame/drivers/imolagp.c b/src/mame/drivers/imolagp.c index 47ab849cc23..6273f6db742 100644 --- a/src/mame/drivers/imolagp.c +++ b/src/mame/drivers/imolagp.c @@ -104,7 +104,7 @@ struct _imolagp_state int oldsteer; /* devices */ - const device_config *slavecpu; + running_device *slavecpu; }; diff --git a/src/mame/drivers/inufuku.c b/src/mame/drivers/inufuku.c index e402184a75a..37a5b82725a 100644 --- a/src/mame/drivers/inufuku.c +++ b/src/mame/drivers/inufuku.c @@ -296,7 +296,7 @@ GFXDECODE_END ******************************************************************************/ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { inufuku_state *state = (inufuku_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/istellar.c b/src/mame/drivers/istellar.c index 57406242708..f47091c12f9 100644 --- a/src/mame/drivers/istellar.c +++ b/src/mame/drivers/istellar.c @@ -29,7 +29,7 @@ Todo: /* Misc variables */ -static const device_config *laserdisc; +static running_device *laserdisc; static UINT8 *tile_ram; static UINT8 *tile_control_ram; diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c index 8ec13df6e43..57eb175b761 100644 --- a/src/mame/drivers/itech32.c +++ b/src/mame/drivers/itech32.c @@ -4005,7 +4005,7 @@ static DRIVER_INIT( wcbowln ) /* PIC 16C54 labeled as ITBWL-3 */ static void install_timekeeper(running_machine *machine) { - const device_config *device = devtag_get_device(machine, "m48t02"); + running_device *device = devtag_get_device(machine, "m48t02"); memory_install_readwrite32_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), device, 0x681000, 0x6817ff, 0, 0, timekeeper_32be_r, timekeeper_32be_w); } diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c index 9d6cdebf452..64aeac15611 100644 --- a/src/mame/drivers/itech8.c +++ b/src/mame/drivers/itech8.c @@ -647,7 +647,7 @@ static WRITE8_HANDLER( itech8_nmi_ack_w ) } -static void generate_sound_irq(const device_config *device, int state) +static void generate_sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "soundcpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c index ccc9d1b2df0..79c1cd16215 100644 --- a/src/mame/drivers/jangou.c +++ b/src/mame/drivers/jangou.c @@ -55,10 +55,10 @@ struct _jangou_state UINT8 nsc_latch, z80_latch; /* devices */ - const device_config *cpu_0; - const device_config *cpu_1; - const device_config *cvsd; - const device_config *nsc; + running_device *cpu_0; + running_device *cpu_1; + running_device *cvsd; + running_device *nsc; }; @@ -327,7 +327,7 @@ static WRITE8_HANDLER( adpcm_w ) state->adpcm_byte = data; } -static void jngolady_vclk_cb( const device_config *device ) +static void jngolady_vclk_cb( running_device *device ) { jangou_state *state = (jangou_state *)device->machine->driver_data; diff --git a/src/mame/drivers/jantotsu.c b/src/mame/drivers/jantotsu.c index 57c506bd093..8d32a13a56f 100644 --- a/src/mame/drivers/jantotsu.c +++ b/src/mame/drivers/jantotsu.c @@ -286,7 +286,7 @@ static WRITE8_DEVICE_HANDLER( jan_adpcm_w ) } } -static void jan_adpcm_int( const device_config *device ) +static void jan_adpcm_int( running_device *device ) { jantotsu_state *state = (jantotsu_state *)device->machine->driver_data; diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c index 376f42d3027..ffb48a0b3bd 100644 --- a/src/mame/drivers/jpmimpct.c +++ b/src/mame/drivers/jpmimpct.c @@ -819,7 +819,7 @@ INPUT_PORTS_END * *************************************/ -static void jpmimpct_tms_irq(const device_config *device, int state) +static void jpmimpct_tms_irq(running_device *device, int state) { tms_irq = state; update_irqs(device->machine); diff --git a/src/mame/drivers/junofrst.c b/src/mame/drivers/junofrst.c index 7b2e23261b1..53c864482b4 100644 --- a/src/mame/drivers/junofrst.c +++ b/src/mame/drivers/junofrst.c @@ -115,7 +115,7 @@ static READ8_DEVICE_HANDLER( junofrst_portA_r ) static WRITE8_DEVICE_HANDLER( junofrst_portB_w ) { timeplt_state *state = (timeplt_state *)device->machine->driver_data; - const device_config *filter[3] = { state->filter_0_0, state->filter_0_1, state->filter_0_2 }; + running_device *filter[3] = { state->filter_0_0, state->filter_0_1, state->filter_0_2 }; int i; for (i = 0; i < 3; i++) diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c index 11b16de6467..814f4d2f297 100644 --- a/src/mame/drivers/kaneko16.c +++ b/src/mame/drivers/kaneko16.c @@ -1763,7 +1763,7 @@ static WRITE8_DEVICE_HANDLER( kaneko16_eeprom_reset_w ) { // FIXME: the device line cannot be directly put in the interface due to inverse value! // we might want to define a "reversed" set_cs_line handler - const device_config *eeprom = devtag_get_device(device->machine, "eeprom"); + running_device *eeprom = devtag_get_device(device->machine, "eeprom"); // reset line asserted: reset. eeprom_set_cs_line(eeprom, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE ); } diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c index c15fa29631e..6982260ec3c 100644 --- a/src/mame/drivers/karnov.c +++ b/src/mame/drivers/karnov.c @@ -743,7 +743,7 @@ static INTERRUPT_GEN( karnov_interrupt ) cpu_set_input_line(device, 7, HOLD_LINE); /* VBL */ } -static void sound_irq( const device_config *device, int linestate ) +static void sound_irq( running_device *device, int linestate ) { karnov_state *state = (karnov_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, linestate); /* IRQ */ diff --git a/src/mame/drivers/kchamp.c b/src/mame/drivers/kchamp.c index fb45b919f2d..1e8e654484e 100644 --- a/src/mame/drivers/kchamp.c +++ b/src/mame/drivers/kchamp.c @@ -353,7 +353,7 @@ static INTERRUPT_GEN( kc_interrupt ) cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); } -static void msmint( const device_config *device ) +static void msmint( running_device *device ) { kchamp_state *state = (kchamp_state *)device->machine->driver_data; diff --git a/src/mame/drivers/kickgoal.c b/src/mame/drivers/kickgoal.c index 78bf4bc8493..88e0c9b0db3 100644 --- a/src/mame/drivers/kickgoal.c +++ b/src/mame/drivers/kickgoal.c @@ -116,7 +116,7 @@ Hollywood Action //static int state->melody; //static int kickgoal_snd_bank; -static void kickgoal_play(const device_config *device, int melody, int data) +static void kickgoal_play(running_device *device, int melody, int data) { int status = okim6295_r(device,0); diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c index 0618909e8f0..d0a5cd84228 100644 --- a/src/mame/drivers/kinst.c +++ b/src/mame/drivers/kinst.c @@ -157,7 +157,7 @@ static const UINT8 *control_map; static MACHINE_START( kinst ) { - const device_config *ide = devtag_get_device(machine, "ide"); + running_device *ide = devtag_get_device(machine, "ide"); UINT8 *features = ide_get_features(ide); if (strncmp(machine->gamedrv->name, "kinst2", 6) != 0) @@ -265,7 +265,7 @@ static INTERRUPT_GEN( irq0_start ) } -static void ide_interrupt(const device_config *device, int state) +static void ide_interrupt(running_device *device, int state) { cputag_set_input_line(device->machine, "maincpu", 1, state); } diff --git a/src/mame/drivers/klax.c b/src/mame/drivers/klax.c index 1db2578e2f8..a548e63953b 100644 --- a/src/mame/drivers/klax.c +++ b/src/mame/drivers/klax.c @@ -37,7 +37,7 @@ static void update_interrupts(running_machine *machine) } -static void scanline_update(const device_config *screen, int scanline) +static void scanline_update(running_device *screen, int scanline) { /* generate 32V signals */ if ((scanline & 32) == 0 && !(input_port_read(screen->machine, "P1") & 0x800)) diff --git a/src/mame/drivers/konamigv.c b/src/mame/drivers/konamigv.c index 85209066edd..50692018045 100644 --- a/src/mame/drivers/konamigv.c +++ b/src/mame/drivers/konamigv.c @@ -314,7 +314,7 @@ static MACHINE_RESET( konamigv ) cdda_set_cdrom(devtag_get_device(machine, "cdda"), am53cf96_get_device(SCSI_ID_4)); } -static void spu_irq(const device_config *device, UINT32 data) +static void spu_irq(running_device *device, UINT32 data) { psx_irq_set(device->machine, data); } diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c index 4275b781d80..d84c2d817dd 100644 --- a/src/mame/drivers/konamigx.c +++ b/src/mame/drivers/konamigx.c @@ -851,7 +851,7 @@ static WRITE32_HANDLER( sound020_w ) /* National Semiconductor ADC0834 4-channel serial ADC emulation */ -static double adc0834_callback( const device_config *device, UINT8 input ) +static double adc0834_callback( running_device *device, UINT8 input ) { switch (input) { @@ -3494,7 +3494,7 @@ static MACHINE_START( konamigx ) static MACHINE_RESET(konamigx) { - const device_config *k054539_2 = devtag_get_device(machine, "konami2"); + running_device *k054539_2 = devtag_get_device(machine, "konami2"); int i; konamigx_wrport1_0 = konamigx_wrport1_1 = 0; diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c index 8aa750215e4..9b1c8de755e 100644 --- a/src/mame/drivers/ksys573.c +++ b/src/mame/drivers/ksys573.c @@ -1586,7 +1586,7 @@ static MACHINE_RESET( konami573 ) flash_bank = -1; } -static void spu_irq(const device_config *device, UINT32 data) +static void spu_irq(running_device *device, UINT32 data) { psx_irq_set(device->machine, data); } @@ -1661,7 +1661,7 @@ todo: static READ32_HANDLER( ge765pwbba_r ) { - const device_config *upd4701 = devtag_get_device(space->machine, "upd4701"); + running_device *upd4701 = devtag_get_device(space->machine, "upd4701"); UINT32 data = 0; switch (offset) @@ -1699,7 +1699,7 @@ static READ32_HANDLER( ge765pwbba_r ) static WRITE32_HANDLER( ge765pwbba_w ) { - const device_config *upd4701 = devtag_get_device(space->machine, "upd4701"); + running_device *upd4701 = devtag_get_device(space->machine, "upd4701"); switch (offset) { case 0x04: @@ -2816,7 +2816,7 @@ static DRIVER_INIT( hyperbbc ) /* ADC0834 Interface */ -static double analogue_inputs_callback( const device_config *device, UINT8 input ) +static double analogue_inputs_callback( running_device *device, UINT8 input ) { switch (input) { diff --git a/src/mame/drivers/kungfur.c b/src/mame/drivers/kungfur.c index f16332b47dc..1a51f3bb66c 100644 --- a/src/mame/drivers/kungfur.c +++ b/src/mame/drivers/kungfur.c @@ -256,7 +256,7 @@ static const ppi8255_interface ppi8255_intf[2] = } }; -static void kfr_adpcm1_int(const device_config *device) +static void kfr_adpcm1_int(running_device *device) { static UINT8 trigger,adpcm_data; @@ -282,7 +282,7 @@ static void kfr_adpcm1_int(const device_config *device) } -static void kfr_adpcm2_int(const device_config *device) +static void kfr_adpcm2_int(running_device *device) { static UINT8 trigger,adpcm_data; diff --git a/src/mame/drivers/laserbat.c b/src/mame/drivers/laserbat.c index d5c65b12685..d21e677e210 100644 --- a/src/mame/drivers/laserbat.c +++ b/src/mame/drivers/laserbat.c @@ -599,7 +599,7 @@ static WRITE_LINE_DEVICE_HANDLER( zaccaria_irq0b ) static READ8_DEVICE_HANDLER( zaccaria_port0a_r ) { laserbat_state *state = (laserbat_state *)device->machine->driver_data; - const device_config *ay = (state->active_8910 == 0) ? state->ay1 : state->ay2; + running_device *ay = (state->active_8910 == 0) ? state->ay1 : state->ay2; return ay8910_r(ay, 0); } diff --git a/src/mame/drivers/lastduel.c b/src/mame/drivers/lastduel.c index a1b36f4ad9a..f499c8d752d 100644 --- a/src/mame/drivers/lastduel.c +++ b/src/mame/drivers/lastduel.c @@ -440,7 +440,7 @@ GFXDECODE_END /******************************************************************************/ /* handler called by the 2203 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { lastduel_state *state = (lastduel_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c index 5f0483cf5f8..62e6d34c638 100644 --- a/src/mame/drivers/lastfght.c +++ b/src/mame/drivers/lastfght.c @@ -84,7 +84,7 @@ struct _lastfght_state UINT16 c00006; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/drivers/lemmings.c b/src/mame/drivers/lemmings.c index e3f6c3d7528..814feaa33d5 100644 --- a/src/mame/drivers/lemmings.c +++ b/src/mame/drivers/lemmings.c @@ -244,7 +244,7 @@ GFXDECODE_END /******************************************************************************/ -static void sound_irq( const device_config *device, int state ) +static void sound_irq( running_device *device, int state ) { lemmings_state *lemmings = (lemmings_state *)device->machine->driver_data; cpu_set_input_line(lemmings->audiocpu, 0, state); diff --git a/src/mame/drivers/lethal.c b/src/mame/drivers/lethal.c index e9c6a7d2802..206e44a37c3 100644 --- a/src/mame/drivers/lethal.c +++ b/src/mame/drivers/lethal.c @@ -243,7 +243,7 @@ static READ8_HANDLER( sound_status_r ) return 0xf; } -static void sound_nmi( const device_config *device ) +static void sound_nmi( running_device *device ) { lethal_state *state = (lethal_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); diff --git a/src/mame/drivers/lgp.c b/src/mame/drivers/lgp.c index 11e9c5a8200..3c6250e58af 100644 --- a/src/mame/drivers/lgp.c +++ b/src/mame/drivers/lgp.c @@ -73,7 +73,7 @@ Dumping Notes: #define SOUND_PCB_CLOCK (6000000) /* Misc variables */ -static const device_config *laserdisc; +static running_device *laserdisc; static UINT8 *tile_ram; static UINT8 *tile_control_ram; diff --git a/src/mame/drivers/lkage.c b/src/mame/drivers/lkage.c index 70de75348d5..f827b6390c7 100644 --- a/src/mame/drivers/lkage.c +++ b/src/mame/drivers/lkage.c @@ -335,7 +335,7 @@ static GFXDECODE_START( lkage ) GFXDECODE_ENTRY( "gfx1", 0x0000, sprite_layout, 0, 16 ) GFXDECODE_END -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/lockon.c b/src/mame/drivers/lockon.c index 98a60a83448..4d622a0459c 100644 --- a/src/mame/drivers/lockon.c +++ b/src/mame/drivers/lockon.c @@ -423,7 +423,7 @@ static WRITE8_HANDLER( sound_vol ) flt_volume_set_volume(devtag_get_device(space->machine, "f2203.3r"), rgain); } -static void ym2203_irq(const device_config *device, int irq) +static void ym2203_irq(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE ); } diff --git a/src/mame/drivers/lordgun.c b/src/mame/drivers/lordgun.c index 702810fc153..cf06410b2bc 100644 --- a/src/mame/drivers/lordgun.c +++ b/src/mame/drivers/lordgun.c @@ -90,7 +90,7 @@ static WRITE8_DEVICE_HANDLER(fake2_w) static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w ) { - const device_config *eeprom = devtag_get_device(device->machine, "eeprom"); + running_device *eeprom = devtag_get_device(device->machine, "eeprom"); static UINT8 old; int i; @@ -400,7 +400,7 @@ static const ppi8255_interface ppi8255_intf[2] = } }; -static void soundirq(const device_config *device, int state) +static void soundirq(running_device *device, int state) { cputag_set_input_line(device->machine, "soundcpu", 0, state); } diff --git a/src/mame/drivers/lsasquad.c b/src/mame/drivers/lsasquad.c index a504267354a..ca365767bd8 100644 --- a/src/mame/drivers/lsasquad.c +++ b/src/mame/drivers/lsasquad.c @@ -503,7 +503,7 @@ GFXDECODE_END -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/lucky74.c b/src/mame/drivers/lucky74.c index 24520ee6563..0f0fea3566a 100644 --- a/src/mame/drivers/lucky74.c +++ b/src/mame/drivers/lucky74.c @@ -1122,7 +1122,7 @@ static SOUND_START( lucky74 ) lucky74_adpcm_busy_line = 0x01; /* free and ready */ } -static void lucky74_adpcm_int(const device_config *device) +static void lucky74_adpcm_int(running_device *device) { if (lucky74_adpcm_reg[05] == 0x01) /* register 0x05 (bit 0 activated), trigger the sample */ { diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c index 54c50ac74a1..127bfb533e3 100644 --- a/src/mame/drivers/m107.c +++ b/src/mame/drivers/m107.c @@ -418,7 +418,7 @@ GFXDECODE_END /***************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { if (state) timer_call_after_resynch(device->machine, NULL, YM2151_ASSERT,setvector_callback); diff --git a/src/mame/drivers/m14.c b/src/mame/drivers/m14.c index 7e285444174..25e034dbb00 100644 --- a/src/mame/drivers/m14.c +++ b/src/mame/drivers/m14.c @@ -66,7 +66,7 @@ struct _m14_state UINT8 hop_mux; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/drivers/m63.c b/src/mame/drivers/m63.c index f9d4fd51cc6..d8fd66d41dd 100644 --- a/src/mame/drivers/m63.c +++ b/src/mame/drivers/m63.c @@ -142,10 +142,10 @@ struct _m63_state INT16 *samplebuf; /* sound devices */ - const device_config *soundcpu; - const device_config *ay1; - const device_config *ay2; - const device_config *samples; + running_device *soundcpu; + running_device *ay1; + running_device *ay2; + running_device *samples; }; diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c index 97a122bb0d5..737ff54a20e 100644 --- a/src/mame/drivers/m72.c +++ b/src/mame/drivers/m72.c @@ -321,7 +321,7 @@ INLINE DRIVER_INIT( m72_8751 ) const address_space *program = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); const address_space *io = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO); const address_space *sndio = cputag_get_address_space(machine, "soundcpu", ADDRESS_SPACE_IO); - const device_config *dac = devtag_get_device(machine, "dac"); + running_device *dac = devtag_get_device(machine, "dac"); protection_ram = auto_alloc_array(machine, UINT16, 0x10000/2); memory_install_read_bank(program, 0xb0000, 0xbffff, 0, 0, "bank1"); diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c index 4a419dbb6fd..5a8b42428cf 100644 --- a/src/mame/drivers/m92.c +++ b/src/mame/drivers/m92.c @@ -897,7 +897,7 @@ GFXDECODE_END /***************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { if (state) timer_call_after_resynch(device->machine, NULL, YM2151_ASSERT, setvector_callback); diff --git a/src/mame/drivers/macrossp.c b/src/mame/drivers/macrossp.c index 9c52a7adc78..eef7bdf6064 100644 --- a/src/mame/drivers/macrossp.c +++ b/src/mame/drivers/macrossp.c @@ -584,7 +584,7 @@ GFXDECODE_END /*** MACHINE DRIVER **********************************************************/ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { logerror("ES5506 irq %d\n",irq); diff --git a/src/mame/drivers/madmotor.c b/src/mame/drivers/madmotor.c index 4019382a511..9235766daad 100644 --- a/src/mame/drivers/madmotor.c +++ b/src/mame/drivers/madmotor.c @@ -219,7 +219,7 @@ GFXDECODE_END /******************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } diff --git a/src/mame/drivers/magmax.c b/src/mame/drivers/magmax.c index 7ffb75ec859..10928c4e966 100644 --- a/src/mame/drivers/magmax.c +++ b/src/mame/drivers/magmax.c @@ -116,9 +116,9 @@ static MACHINE_RESET( magmax ) static WRITE8_DEVICE_HANDLER( ay8910_portA_0_w ) { -const device_config *ay1 = devtag_get_device(device->machine, "ay1"); -const device_config *ay2 = devtag_get_device(device->machine, "ay2"); -const device_config *ay3 = devtag_get_device(device->machine, "ay3"); +running_device *ay1 = devtag_get_device(device->machine, "ay1"); +running_device *ay2 = devtag_get_device(device->machine, "ay2"); +running_device *ay3 = devtag_get_device(device->machine, "ay3"); float percent; /*There are three AY8910 chips and four(!) separate amplifiers on the board diff --git a/src/mame/drivers/mainevt.c b/src/mame/drivers/mainevt.c index 0d2edd06b5a..844ee6403bb 100644 --- a/src/mame/drivers/mainevt.c +++ b/src/mame/drivers/mainevt.c @@ -388,7 +388,7 @@ INPUT_PORTS_END /*****************************************************************************/ -static void volume_callback(const device_config *device, int v) +static void volume_callback(running_device *device, int v) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); diff --git a/src/mame/drivers/mappy.c b/src/mame/drivers/mappy.c index 4008af0dba1..6863393e45b 100644 --- a/src/mame/drivers/mappy.c +++ b/src/mame/drivers/mappy.c @@ -587,8 +587,8 @@ static WRITE8_DEVICE_HANDLER( mappy_snd_sharedram_w ) static WRITE8_HANDLER( superpac_latch_w ) { - const device_config *namcoio_1 = devtag_get_device(space->machine, "namcoio_1"); - const device_config *namcoio_2 = devtag_get_device(space->machine, "namcoio_2"); + running_device *namcoio_1 = devtag_get_device(space->machine, "namcoio_1"); + running_device *namcoio_2 = devtag_get_device(space->machine, "namcoio_2"); int bit = offset & 1; switch (offset & 0x0e) @@ -631,8 +631,8 @@ static WRITE8_HANDLER( superpac_latch_w ) static WRITE8_HANDLER( phozon_latch_w ) { - const device_config *namcoio_1 = devtag_get_device(space->machine, "namcoio_1"); - const device_config *namcoio_2 = devtag_get_device(space->machine, "namcoio_2"); + running_device *namcoio_1 = devtag_get_device(space->machine, "namcoio_1"); + running_device *namcoio_2 = devtag_get_device(space->machine, "namcoio_2"); int bit = offset & 1; switch (offset & 0x0e) @@ -679,8 +679,8 @@ static WRITE8_HANDLER( phozon_latch_w ) static WRITE8_HANDLER( mappy_latch_w ) { - const device_config *namcoio_1 = devtag_get_device(space->machine, "namcoio_1"); - const device_config *namcoio_2 = devtag_get_device(space->machine, "namcoio_2"); + running_device *namcoio_1 = devtag_get_device(space->machine, "namcoio_1"); + running_device *namcoio_2 = devtag_get_device(space->machine, "namcoio_2"); int bit = offset & 1; switch (offset & 0x0e) @@ -757,8 +757,8 @@ static MACHINE_RESET( mappy ) static TIMER_CALLBACK( superpac_io_run ) { - const device_config *io56xx_1 = devtag_get_device(machine, "namcoio_1"); - const device_config *io56xx_2 = devtag_get_device(machine, "namcoio_2"); + running_device *io56xx_1 = devtag_get_device(machine, "namcoio_1"); + running_device *io56xx_2 = devtag_get_device(machine, "namcoio_2"); switch (param) { @@ -773,8 +773,8 @@ static TIMER_CALLBACK( superpac_io_run ) static INTERRUPT_GEN( superpac_interrupt_1 ) { - const device_config *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); - const device_config *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); + running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); + running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); @@ -788,8 +788,8 @@ static INTERRUPT_GEN( superpac_interrupt_1 ) static TIMER_CALLBACK( pacnpal_io_run ) { - const device_config *io56xx = devtag_get_device(machine, "namcoio_1"); - const device_config *io59xx = devtag_get_device(machine, "namcoio_2"); + running_device *io56xx = devtag_get_device(machine, "namcoio_1"); + running_device *io59xx = devtag_get_device(machine, "namcoio_2"); switch (param) { @@ -804,8 +804,8 @@ static TIMER_CALLBACK( pacnpal_io_run ) static INTERRUPT_GEN( pacnpal_interrupt_1 ) { - const device_config *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); - const device_config *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); + running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); + running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); @@ -819,8 +819,8 @@ static INTERRUPT_GEN( pacnpal_interrupt_1 ) static TIMER_CALLBACK( phozon_io_run ) { - const device_config *io58xx = devtag_get_device(machine, "namcoio_1"); - const device_config *io56xx = devtag_get_device(machine, "namcoio_2"); + running_device *io58xx = devtag_get_device(machine, "namcoio_1"); + running_device *io56xx = devtag_get_device(machine, "namcoio_2"); switch (param) { @@ -835,8 +835,8 @@ static TIMER_CALLBACK( phozon_io_run ) static INTERRUPT_GEN( phozon_interrupt_1 ) { - const device_config *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); - const device_config *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); + running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); + running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); @@ -850,8 +850,8 @@ static INTERRUPT_GEN( phozon_interrupt_1 ) static TIMER_CALLBACK( mappy_io_run ) { - const device_config *io58xx_1 = devtag_get_device(machine, "namcoio_1"); - const device_config *io58xx_2 = devtag_get_device(machine, "namcoio_2"); + running_device *io58xx_1 = devtag_get_device(machine, "namcoio_1"); + running_device *io58xx_2 = devtag_get_device(machine, "namcoio_2"); switch (param) { @@ -866,8 +866,8 @@ static TIMER_CALLBACK( mappy_io_run ) static INTERRUPT_GEN( mappy_interrupt_1 ) { - const device_config *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); - const device_config *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); + running_device *namcoio_1 = devtag_get_device(device->machine, "namcoio_1"); + running_device *namcoio_2 = devtag_get_device(device->machine, "namcoio_2"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); @@ -2258,7 +2258,7 @@ static DRIVER_INIT( grobda ) However, removing the 15XX from the board causes sound to disappear completely, so the DAC might be built-in after all. */ - const device_config *dac = devtag_get_device(machine, "dac"); + running_device *dac = devtag_get_device(machine, "dac"); memory_install_write8_device_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), dac, 0x0002, 0x0002, 0, 0, grobda_DAC_w ); } diff --git a/src/mame/drivers/mastboy.c b/src/mame/drivers/mastboy.c index 0962652d67b..107a8d6a2aa 100644 --- a/src/mame/drivers/mastboy.c +++ b/src/mame/drivers/mastboy.c @@ -609,7 +609,7 @@ static WRITE8_HANDLER( backupram_enable_w ) static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit0_w ) { - const device_config *adpcm = devtag_get_device(space->machine, "msm"); + running_device *adpcm = devtag_get_device(space->machine, "msm"); mastboy_m5205_sambit0 = data & 1; msm5205_playmode_w(adpcm, (1 << 2) | (mastboy_m5205_sambit1 << 1) | (mastboy_m5205_sambit0) ); @@ -619,7 +619,7 @@ static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit0_w ) static WRITE8_HANDLER( msm5205_mastboy_m5205_sambit1_w ) { - const device_config *adpcm = devtag_get_device(space->machine, "msm"); + running_device *adpcm = devtag_get_device(space->machine, "msm"); mastboy_m5205_sambit1 = data & 1; @@ -639,7 +639,7 @@ static WRITE8_HANDLER( mastboy_msm5205_data_w ) mastboy_m5205_next = data; } -static void mastboy_adpcm_int(const device_config *device) +static void mastboy_adpcm_int(running_device *device) { msm5205_data_w(device, mastboy_m5205_next); mastboy_m5205_next >>= 4; diff --git a/src/mame/drivers/matmania.c b/src/mame/drivers/matmania.c index f5ad5ae119b..f8afaee4b74 100644 --- a/src/mame/drivers/matmania.c +++ b/src/mame/drivers/matmania.c @@ -312,7 +312,7 @@ MACHINE_DRIVER_END /* handler called by the 3526 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 1, linestate); } diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c index eff7da9decd..0cca78091fa 100644 --- a/src/mame/drivers/maxaflex.c +++ b/src/mame/drivers/maxaflex.c @@ -31,7 +31,7 @@ static UINT8 portA_in,portA_out,ddrA; static UINT8 portB_in,portB_out,ddrB; static UINT8 portC_in,portC_out,ddrC; static UINT8 tdr,tcr; -static const device_config *mcu_timer; +static running_device *mcu_timer; /* Port A: 0 (in) DSW diff --git a/src/mame/drivers/maygay1b.c b/src/mame/drivers/maygay1b.c index 56fe4026fb3..4a8df976888 100644 --- a/src/mame/drivers/maygay1b.c +++ b/src/mame/drivers/maygay1b.c @@ -30,7 +30,7 @@ static struct { - const device_config *duart68681; + running_device *duart68681; } maygaym1_devices; static UINT8 lamppos; @@ -462,7 +462,7 @@ static MACHINE_RESET( m1 ) /////////////////////////////////////////////////////////////////////////// -static void duart_irq_handler(const device_config *device, UINT8 state) +static void duart_irq_handler(running_device *device, UINT8 state) { cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, state?ASSERT_LINE:CLEAR_LINE); LOG(("6809 irq%d \n",state)); @@ -698,7 +698,7 @@ static WRITE8_HANDLER( reel56_w ) awp_draw_reel(5); } -static UINT8 m1_duart_r (const device_config *device) +static UINT8 m1_duart_r (running_device *device) { return (optic_pattern); } diff --git a/src/mame/drivers/maygayv1.c b/src/mame/drivers/maygayv1.c index 3e6c353ff48..657e17d2932 100644 --- a/src/mame/drivers/maygayv1.c +++ b/src/mame/drivers/maygayv1.c @@ -193,7 +193,7 @@ static const UINT32 banks[4] = { 0, 0x40000/2, 0x20000/2, 0x60000/2 }; static struct { - const device_config *duart68681; + running_device *duart68681; } maygayv1_devices; #define DRAM_BANK_SEL (banks[(VREG(DSBA) >> 7) & 3]) @@ -893,7 +893,7 @@ INPUT_PORTS_END ***************************************************************************/ -static void duart_irq_handler(const device_config *device, UINT8 vector) +static void duart_irq_handler(running_device *device, UINT8 vector) { cputag_set_input_line_and_vector(device->machine, "maincpu", 5, ASSERT_LINE, vector); // cputag_set_input_line(device->machine, "maincpu", 5, state ? ASSERT_LINE : CLEAR_LINE); @@ -901,7 +901,7 @@ static void duart_irq_handler(const device_config *device, UINT8 vector) static int d68681_val; -static void duart_tx(const device_config *device, int channel, UINT8 data) +static void duart_tx(running_device *device, int channel, UINT8 data) { if (channel == 0) { @@ -920,12 +920,12 @@ static const duart68681_config maygayv1_duart68681_config = }; -static int data_to_i8031(const device_config *device) +static int data_to_i8031(running_device *device) { return d68681_val; } -static void data_from_i8031(const device_config *device, int data) +static void data_from_i8031(running_device *device, int data) { duart68681_rx_data(maygayv1_devices.duart68681, 0, data); } diff --git a/src/mame/drivers/mcatadv.c b/src/mame/drivers/mcatadv.c index 370530f379b..eaf1dc43894 100644 --- a/src/mame/drivers/mcatadv.c +++ b/src/mame/drivers/mcatadv.c @@ -418,7 +418,7 @@ GFXDECODE_END /* Stolen from Psikyo.c */ -static void sound_irq( const device_config *device, int irq ) +static void sound_irq( running_device *device, int irq ) { cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/mcr.c b/src/mame/drivers/mcr.c index 9b74b5e6591..c2eca5411ea 100644 --- a/src/mame/drivers/mcr.c +++ b/src/mame/drivers/mcr.c @@ -413,7 +413,7 @@ static WRITE8_HANDLER( kroozr_op4_w ) static WRITE8_HANDLER( journey_op4_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); /* if we're not playing the sample yet, start it */ if (!sample_playing(samples, 0)) @@ -534,7 +534,7 @@ static READ8_HANDLER( nflfoot_ip2_r ) static WRITE8_HANDLER( nflfoot_op4_w ) { - const device_config *sio = devtag_get_device(space->machine, "ipu_sio"); + running_device *sio = devtag_get_device(space->machine, "ipu_sio"); /* bit 7 = J3-7 on IPU board = /RXDA on SIO */ logerror("%04X:op4_w(%d%d%d)\n", cpu_get_pc(space->cpu), (data >> 7) & 1, (data >> 6) & 1, (data >> 5) & 1); diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c index 31ade74edae..80b37659071 100644 --- a/src/mame/drivers/mediagx.c +++ b/src/mame/drivers/mediagx.c @@ -117,14 +117,14 @@ static UINT8 ad1847_regs[16]; static UINT32 ad1847_sample_counter = 0; static UINT32 ad1847_sample_rate; -static const device_config *dmadac[2]; +static running_device *dmadac[2]; static struct { - const device_config *pit8254; - const device_config *pic8259_1; - const device_config *pic8259_2; - const device_config *dma8237_1; - const device_config *dma8237_2; + running_device *pit8254; + running_device *pic8259_1; + running_device *pic8259_2; + running_device *dma8237_1; + running_device *dma8237_2; } mediagx_devices; @@ -157,7 +157,7 @@ static struct { #define DC_CFIFO_DIAG 0x7c/4 -static void ide_interrupt(const device_config *device, int state); +static void ide_interrupt(running_device *device, int state); @@ -614,7 +614,7 @@ static WRITE32_HANDLER( parallel_port_w ) } } -static UINT32 cx5510_pci_r(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 mem_mask) +static UINT32 cx5510_pci_r(running_device *busdevice, running_device *device, int function, int reg, UINT32 mem_mask) { // mame_printf_debug("CX5510: PCI read %d, %02X, %08X\n", function, reg, mem_mask); @@ -626,7 +626,7 @@ static UINT32 cx5510_pci_r(const device_config *busdevice, const device_config * return cx5510_regs[reg/4]; } -static void cx5510_pci_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void cx5510_pci_w(running_device *busdevice, running_device *device, int function, int reg, UINT32 data, UINT32 mem_mask) { // mame_printf_debug("CX5510: PCI write %d, %02X, %08X, %08X\n", function, reg, data, mem_mask); COMBINE_DATA(cx5510_regs + (reg/4)); @@ -801,7 +801,7 @@ static WRITE8_HANDLER( pc_dma_write_byte ) memory_write_byte(space, page_offset + offset, data); } -static void set_dma_channel(const device_config *device, int channel, int state) +static void set_dma_channel(running_device *device, int channel, int state) { if (!state) dma_channel = channel; } @@ -1105,7 +1105,7 @@ static void keyboard_interrupt(running_machine *machine, int state) pic8259_set_irq_line(mediagx_devices.pic8259_1, 1, state); } -static void ide_interrupt(const device_config *device, int state) +static void ide_interrupt(running_device *device, int state) { pic8259_set_irq_line(mediagx_devices.pic8259_2, 6, state); } diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c index 487f2586720..ea7a8a93609 100644 --- a/src/mame/drivers/megadriv.c +++ b/src/mame/drivers/megadriv.c @@ -95,8 +95,8 @@ static int megadrive_irq6_pending = 0; static int megadrive_irq4_pending = 0; /* 32x! */ -static const device_config *_32x_master_cpu; -static const device_config *_32x_slave_cpu; +static running_device *_32x_master_cpu; +static running_device *_32x_slave_cpu; static int _32x_is_connected; static int sh2_are_running; @@ -129,12 +129,12 @@ static UINT16 *_32x_display_dram, *_32x_access_dram; static UINT16* _32x_palette; static UINT16* _32x_palette_lookup; /* SegaCD! */ -static const device_config *_segacd_68k_cpu; +static running_device *_segacd_68k_cpu; /* SVP (virtua racing) */ -static const device_config *_svp_cpu; +static running_device *_svp_cpu; -static const device_config *_genesis_snd_z80_cpu; +static running_device *_genesis_snd_z80_cpu; int segac2_bg_pal_lookup[4]; int segac2_sp_pal_lookup[4]; @@ -163,10 +163,10 @@ static int megadrive_region_pal; static int megadrive_max_hposition; -static const device_config* frame_timer; -static const device_config* scanline_timer; -static const device_config* irq6_on_timer; -static const device_config* irq4_on_timer; +static running_device* frame_timer; +static running_device* scanline_timer; +static running_device* irq6_on_timer; +static running_device* irq4_on_timer; static bitmap_t* render_bitmap; //emu_timer* vblankirq_off_timer; @@ -5680,7 +5680,7 @@ INLINE UINT16 get_hposition(void) static int irq4counter; -static const device_config* render_timer; +static running_device* render_timer; static TIMER_DEVICE_CALLBACK( render_timer_callback ) { @@ -6239,7 +6239,7 @@ static IRQ_CALLBACK(genesis_int_callback) return (0x60+irqline*4)/4; // vector address } -static int megadriv_tas_callback(const device_config *device) +static int megadriv_tas_callback(running_device *device) { return 0; // writeback not allowed } @@ -6427,7 +6427,7 @@ static WRITE8_HANDLER( z80_unmapped_w ) /* sets the megadrive z80 to it's normal ports / map */ void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine, const char* tag) { - const device_config *ym = devtag_get_device(machine, "ymsnd"); + running_device *ym = devtag_get_device(machine, "ymsnd"); /* INIT THE PORTS *********************************************************************************************/ memory_install_readwrite8_handler(cputag_get_address_space(machine, tag, ADDRESS_SPACE_IO), 0x0000, 0xffff, 0, 0, z80_unmapped_port_r, z80_unmapped_port_w); diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c index 0c1e3bbde22..62400a462ad 100644 --- a/src/mame/drivers/megasys1.c +++ b/src/mame/drivers/megasys1.c @@ -371,7 +371,7 @@ ADDRESS_MAP_END */ /* YM2151 IRQ */ -static void megasys1_sound_irq(const device_config *device, int irq) +static void megasys1_sound_irq(running_device *device, int irq) { if (irq) cputag_set_input_line(device->machine, "soundcpu", 4, HOLD_LINE); @@ -1611,7 +1611,7 @@ MACHINE_DRIVER_END ***************************************************************************/ -static void irq_handler(const device_config *device, int irq) +static void irq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } @@ -3778,8 +3778,8 @@ static WRITE16_DEVICE_HANDLER( okim6295_both_w ) static DRIVER_INIT( jitsupro ) { - const device_config *oki1 = devtag_get_device(machine, "oki1"); - const device_config *oki2 = devtag_get_device(machine, "oki2"); + running_device *oki1 = devtag_get_device(machine, "oki1"); + running_device *oki2 = devtag_get_device(machine, "oki2"); UINT16 *RAM = (UINT16 *) memory_region(machine, "maincpu"); astyanax_rom_decode(machine, "maincpu"); // Code diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c index 3317a15d128..a0e914d3ee2 100644 --- a/src/mame/drivers/megatech.c +++ b/src/mame/drivers/megatech.c @@ -488,8 +488,8 @@ static VIDEO_START(mtnew) //attotime_never static VIDEO_UPDATE(mtnew) { - const device_config *megadriv_screen = devtag_get_device(screen->machine, "megadriv"); - const device_config *menu_screen = devtag_get_device(screen->machine, "menu"); + running_device *megadriv_screen = devtag_get_device(screen->machine, "megadriv"); + running_device *menu_screen = devtag_get_device(screen->machine, "menu"); if (screen == megadriv_screen) { diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c index cb1334c8c6e..7137371f567 100644 --- a/src/mame/drivers/merit.c +++ b/src/mame/drivers/merit.c @@ -1095,7 +1095,7 @@ INPUT_PORTS_END static VIDEO_UPDATE( merit ) { - const device_config *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c index e6ae2a81ccd..41641e69519 100644 --- a/src/mame/drivers/meritm.c +++ b/src/mame/drivers/meritm.c @@ -120,7 +120,7 @@ Not all regional versions are available for each Megatouch series #define UART_CLK XTAL_18_432MHz static UINT8* meritm_ram; -static const device_config *meritm_z80pio[2]; +static running_device *meritm_z80pio[2]; /************************************* diff --git a/src/mame/drivers/metalmx.c b/src/mame/drivers/metalmx.c index 2cb652339e7..fb1e5983312 100644 --- a/src/mame/drivers/metalmx.c +++ b/src/mame/drivers/metalmx.c @@ -504,7 +504,7 @@ static WRITE32_HANDLER( host_vram_w ) COMBINE_DATA(state->gsp_vram + offset * 2); } -static void tms_interrupt(const device_config *device, int state) +static void tms_interrupt(running_device *device, int state) { cputag_set_input_line(device->machine, "maincpu", 4, state ? HOLD_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/metlclsh.c b/src/mame/drivers/metlclsh.c index 0c23f876182..c91c0878b17 100644 --- a/src/mame/drivers/metlclsh.c +++ b/src/mame/drivers/metlclsh.c @@ -260,7 +260,7 @@ GFXDECODE_END ***************************************************************************/ -static void metlclsh_irqhandler(const device_config *device, int linestate) +static void metlclsh_irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, linestate); } diff --git a/src/mame/drivers/metro.c b/src/mame/drivers/metro.c index d6621f66d87..39053c6d580 100644 --- a/src/mame/drivers/metro.c +++ b/src/mame/drivers/metro.c @@ -319,7 +319,7 @@ static INTERRUPT_GEN( dokyusei_interrupt ) } } -static void ymf278b_interrupt(const device_config *device, int active) +static void ymf278b_interrupt(running_device *device, int active) { cputag_set_input_line(device->machine, "maincpu", 2, active); } @@ -335,7 +335,7 @@ static void ymf278b_interrupt(const device_config *device, int active) static UINT16 metro_soundstatus; static int porta, portb, busy_sndcpu; -static int metro_io_callback(const device_config *device, int ioline, int state) +static int metro_io_callback(running_device *device, int ioline, int state) { const address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM); @@ -441,7 +441,7 @@ static WRITE8_HANDLER( metro_portb_w ) { if (!BIT(data,2)) { - const device_config *ym = devtag_get_device(space->machine, "ymsnd"); + running_device *ym = devtag_get_device(space->machine, "ymsnd"); ym2413_w(ym,BIT(data,1),porta); } portb = data; @@ -480,7 +480,7 @@ static WRITE8_HANDLER( daitorid_portb_w ) if (BIT(portb,6) && !BIT(data,6)) /* clock 1->0 */ { - const device_config *ym = devtag_get_device(space->machine, "ymsnd"); + running_device *ym = devtag_get_device(space->machine, "ymsnd"); if (!BIT(data,2)) { /* write */ @@ -510,7 +510,7 @@ static WRITE8_HANDLER( daitorid_portb_w ) portb = data; } -static void metro_sound_irq_handler(const device_config *device, int state) +static void metro_sound_irq_handler(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", UPD7810_INTF2, state ? ASSERT_LINE : CLEAR_LINE); } @@ -1231,7 +1231,7 @@ ADDRESS_MAP_END static int gakusai_oki_bank_lo, gakusai_oki_bank_hi; -static void gakusai_oki_bank_set(const device_config *device) +static void gakusai_oki_bank_set(running_device *device) { int bank = (gakusai_oki_bank_lo & 7) + (gakusai_oki_bank_hi & 1) * 8; okim6295_set_bank_base(device, bank * 0x40000); @@ -1660,7 +1660,7 @@ static WRITE8_HANDLER( blzntrnd_sh_bankswitch_w ) memory_set_bankptr(space->machine, "bank1", &RAM[bankaddress]); } -static void blzntrnd_irqhandler(const device_config *device, int irq) +static void blzntrnd_irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/midas.c b/src/mame/drivers/midas.c index 185d077b5c0..75e7f1ee743 100644 --- a/src/mame/drivers/midas.c +++ b/src/mame/drivers/midas.c @@ -420,7 +420,7 @@ static INPUT_PORTS_START( livequiz ) INPUT_PORTS_END -static void livequiz_irqhandler(const device_config *device, int state) +static void livequiz_irqhandler(running_device *device, int state) { logerror("YMZ280 is generating an interrupt. State=%08x\n",state); } diff --git a/src/mame/drivers/midvunit.c b/src/mame/drivers/midvunit.c index 81d5f873973..bfa346eda17 100644 --- a/src/mame/drivers/midvunit.c +++ b/src/mame/drivers/midvunit.c @@ -41,7 +41,7 @@ static UINT8 adc_shift; static UINT16 last_port0; static UINT8 shifter_state; -static const device_config *timer[2]; +static running_device *timer[2]; static double timer_rate; static UINT32 *tms32031_control; @@ -459,7 +459,7 @@ static WRITE32_HANDLER( midvplus_misc_w ) * *************************************/ -static void midvplus_xf1_w(const device_config *device, UINT8 val) +static void midvplus_xf1_w(running_device *device, UINT8 val) { static int lastval; // mame_printf_debug("xf1_w = %d\n", val); diff --git a/src/mame/drivers/missb2.c b/src/mame/drivers/missb2.c index cdd7c40ac5e..dec67322e65 100644 --- a/src/mame/drivers/missb2.c +++ b/src/mame/drivers/missb2.c @@ -335,7 +335,7 @@ GFXDECODE_END /* Sound Interfaces */ // Handler called by the 3526 emulator when the internal timers cause an IRQ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { logerror("YM3526 firing an IRQ\n"); // cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c index 936b57a1c90..3c02dc91124 100644 --- a/src/mame/drivers/mitchell.c +++ b/src/mame/drivers/mitchell.c @@ -1201,7 +1201,7 @@ GFXDECODE_END -static void spangbl_adpcm_int( const device_config *device ) +static void spangbl_adpcm_int( running_device *device ) { mitchell_state *state = (mitchell_state *)device->machine->driver_data; msm5205_data_w(device, state->sample_buffer & 0x0f); diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c index 6b1b465973d..5f3eba6e4bd 100644 --- a/src/mame/drivers/mlanding.c +++ b/src/mame/drivers/mlanding.c @@ -235,7 +235,7 @@ static WRITE8_DEVICE_HANDLER( sound_bankswitch_w ) memory_set_bankptr(device->machine, "bank1", memory_region(device->machine, "audiocpu") + ((data) & 0x03) * 0x4000 + 0x10000 ); } -static void ml_msm5205_vck(const device_config *device) +static void ml_msm5205_vck(running_device *device) { static UINT8 trigger; @@ -301,7 +301,7 @@ static WRITE16_HANDLER( ml_sub_reset_w ) static WRITE16_HANDLER( ml_to_sound_w ) { - const device_config *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); + running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); if (offset == 0) tc0140syt_port_w(tc0140syt, 0, data & 0xff); else if (offset == 1) @@ -313,7 +313,7 @@ static WRITE16_HANDLER( ml_to_sound_w ) static WRITE8_HANDLER( ml_sound_to_main_w ) { - const device_config *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); + running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); if (offset == 0) tc0140syt_slave_port_w(tc0140syt, 0, data & 0xff); else if (offset == 1) @@ -684,7 +684,7 @@ static INPUT_PORTS_START( mlanding ) PORT_BIT( 0x0fff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0x0800,0x07ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1) INPUT_PORTS_END -static void irq_handler(const device_config *device, int irq) +static void irq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c index 4eccd37d2df..4a5612c6571 100644 --- a/src/mame/drivers/model2.c +++ b/src/mame/drivers/model2.c @@ -72,7 +72,7 @@ static UINT16 *model2_soundram = NULL; static UINT32 model2_timervals[4], model2_timerorig[4]; static int model2_timerrun[4]; -static const device_config *model2_timers[4]; +static running_device *model2_timers[4]; static int model2_ctrlmode; static int analog_channel; @@ -92,7 +92,7 @@ static int dsp_type; static int copro_fifoin_rpos, copro_fifoin_wpos; static UINT32 copro_fifoin_data[COPRO_FIFOIN_SIZE]; static int copro_fifoin_num = 0; -static int copro_fifoin_pop(const device_config *device, UINT32 *result) +static int copro_fifoin_pop(running_device *device, UINT32 *result) { UINT32 r; @@ -130,7 +130,7 @@ static int copro_fifoin_pop(const device_config *device, UINT32 *result) return 1; } -static void copro_fifoin_push(const device_config *device, UINT32 data) +static void copro_fifoin_push(running_device *device, UINT32 data) { if (copro_fifoin_num == COPRO_FIFOIN_SIZE) { @@ -202,7 +202,7 @@ static UINT32 copro_fifoout_pop(const address_space *space) return r; } -static void copro_fifoout_push(const device_config *device, UINT32 data) +static void copro_fifoout_push(running_device *device, UINT32 data) { //if (copro_fifoout_wpos == copro_fifoout_rpos) if (copro_fifoout_num == COPRO_FIFOOUT_SIZE) @@ -408,7 +408,7 @@ static WRITE32_HANDLER( ctrl0_w ) { if(ACCESSING_BITS_0_7) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); model2_ctrlmode = data & 0x01; eeprom_write_bit(device, data & 0x20); eeprom_set_clock_line(device, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE); @@ -1737,7 +1737,7 @@ ADDRESS_MAP_END static int scsp_last_line = 0; -static void scsp_irq(const device_config *device, int irq) +static void scsp_irq(running_device *device, int irq) { if (irq > 0) { diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c index 5eb74578585..76891ef16ab 100644 --- a/src/mame/drivers/model3.c +++ b/src/mame/drivers/model3.c @@ -1369,7 +1369,7 @@ static WRITE64_HANDLER( model3_ctrl_w ) case 0: if (ACCESSING_BITS_56_63) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); int reg = (data >> 56) & 0xff; eeprom_write_bit(device, (reg & 0x20) ? 1 : 0); eeprom_set_clock_line(device, (reg & 0x80) ? ASSERT_LINE : CLEAR_LINE); @@ -4642,7 +4642,7 @@ ADDRESS_MAP_END static int scsp_last_line = 0; -static void scsp_irq(const device_config *device, int irq) +static void scsp_irq(running_device *device, int irq) { if (irq > 0) { diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c index 5193ef49c1b..9154c0eef41 100644 --- a/src/mame/drivers/mpu4.c +++ b/src/mame/drivers/mpu4.c @@ -454,13 +454,13 @@ static MACHINE_RESET( mpu4 ) /* 6809 IRQ handler */ static WRITE_LINE_DEVICE_HANDLER( cpu0_irq ) { - const device_config *pia3 = devtag_get_device(device->machine, "pia_ic3"); - const device_config *pia4 = devtag_get_device(device->machine, "pia_ic4"); - const device_config *pia5 = devtag_get_device(device->machine, "pia_ic5"); - const device_config *pia6 = devtag_get_device(device->machine, "pia_ic6"); - const device_config *pia7 = devtag_get_device(device->machine, "pia_ic7"); - const device_config *pia8 = devtag_get_device(device->machine, "pia_ic8"); - const device_config *ptm6840 = devtag_get_device(device->machine, "6840ptm"); + running_device *pia3 = devtag_get_device(device->machine, "pia_ic3"); + running_device *pia4 = devtag_get_device(device->machine, "pia_ic4"); + running_device *pia5 = devtag_get_device(device->machine, "pia_ic5"); + running_device *pia6 = devtag_get_device(device->machine, "pia_ic6"); + running_device *pia7 = devtag_get_device(device->machine, "pia_ic7"); + running_device *pia8 = devtag_get_device(device->machine, "pia_ic8"); + running_device *ptm6840 = devtag_get_device(device->machine, "6840ptm"); /* The PIA and PTM IRQ lines are all connected to a common PCB track, leading directly to the 6809 IRQ line. */ int combined_state = pia6821_get_irq_a(pia3) | pia6821_get_irq_b(pia3) | @@ -514,7 +514,7 @@ static WRITE8_DEVICE_HANDLER( ic2_o1_callback ) static WRITE8_DEVICE_HANDLER( ic2_o2_callback ) { - const device_config *pia = devtag_get_device(device->machine, "pia_ic3"); + running_device *pia = devtag_get_device(device->machine, "pia_ic3"); pia6821_ca1_w(pia, 0, data); /* copy output value to IC3 ca1 */ /* the output from timer2 is the input clock for timer3 */ @@ -756,7 +756,7 @@ static READ8_DEVICE_HANDLER( pia_ic5_porta_r ) static READ8_DEVICE_HANDLER( pia_ic5_portb_r ) { - const device_config *pia_ic5 = devtag_get_device(device->machine, "pia_ic5"); + running_device *pia_ic5 = devtag_get_device(device->machine, "pia_ic5"); LOG(("%s: IC5 PIA Read of Port B (coin input AUX2)\n",cpuexec_describe_context(device->machine))); coin_lockout_w(device->machine, 0, (pia6821_get_output_b(pia_ic5) & 0x01) ); coin_lockout_w(device->machine, 1, (pia6821_get_output_b(pia_ic5) & 0x02) ); @@ -796,7 +796,7 @@ BDIR BC1 | */ /* PSG function selected */ -static void update_ay(const device_config *device) +static void update_ay(running_device *device) { if (!pia6821_get_output_cb2(device)) { @@ -809,14 +809,14 @@ static void update_ay(const device_config *device) } case 0x01: { /* CA2 = 1 CB2 = 0? : Read from selected PSG register and make the register data available to Port A */ - const device_config *pia_ic6 = devtag_get_device(device->machine, "pia_ic6"); + running_device *pia_ic6 = devtag_get_device(device->machine, "pia_ic6"); LOG(("AY8913 address = %d \n",pia6821_get_output_a(pia_ic6)&0x0f)); break; } case 0x02: {/* CA2 = 0 CB2 = 1? : Write to selected PSG register and write data to Port A */ - const device_config *pia_ic6 = devtag_get_device(device->machine, "pia_ic6"); - const device_config *ay = devtag_get_device(device->machine, "ay8913"); + running_device *pia_ic6 = devtag_get_device(device->machine, "pia_ic6"); + running_device *ay = devtag_get_device(device->machine, "ay8913"); ay8910_data_w(ay, 0, pia6821_get_output_a(pia_ic6)); LOG(("AY Chip Write \n")); break; @@ -824,8 +824,8 @@ static void update_ay(const device_config *device) case 0x03: {/* CA2 = 1 CB2 = 1? : The register will now be selected and the user can read from or write to it. The register will remain selected until another is chosen.*/ - const device_config *pia_ic6 = devtag_get_device(device->machine, "pia_ic6"); - const device_config *ay = devtag_get_device(device->machine, "ay8913"); + running_device *pia_ic6 = devtag_get_device(device->machine, "pia_ic6"); + running_device *ay = devtag_get_device(device->machine, "ay8913"); ay8910_address_w(ay, 0, pia6821_get_output_a(pia_ic6)); LOG(("AY Chip Select \n")); break; @@ -1028,7 +1028,7 @@ static const pia6821_interface pia_ic7_intf = static READ8_DEVICE_HANDLER( pia_ic8_porta_r ) { static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "ORANGE1", "ORANGE2", "DIL1", "DIL2" }; - const device_config *pia_ic5 = devtag_get_device(device->machine, "pia_ic5"); + running_device *pia_ic5 = devtag_get_device(device->machine, "pia_ic5"); LOG_IC8(("%s: IC8 PIA Read of Port A (MUX input data)\n", cpuexec_describe_context(device->machine))); /* The orange inputs are polled twice as often as the black ones, for reasons of efficiency. @@ -1089,7 +1089,7 @@ static const pia6821_interface pia_ic8_intf = static WRITE8_DEVICE_HANDLER( pia_gb_porta_w ) { - const device_config *msm6376 = devtag_get_device(device->machine, "msm6376"); + running_device *msm6376 = devtag_get_device(device->machine, "msm6376"); LOG(("%s: GAMEBOARD: PIA Port A Set to %2x\n", cpuexec_describe_context(device->machine),data)); okim6376_w(msm6376, 0, data); diff --git a/src/mame/drivers/mpu4drvr.c b/src/mame/drivers/mpu4drvr.c index d09bb453747..fba62f30027 100644 --- a/src/mame/drivers/mpu4drvr.c +++ b/src/mame/drivers/mpu4drvr.c @@ -378,8 +378,8 @@ static WRITE8_DEVICE_HANDLER( vid_o1_callback ) if (data) { - const device_config *acia_0 = devtag_get_device(device->machine, "acia6850_0"); - const device_config *acia_1 = devtag_get_device(device->machine, "acia6850_1"); + running_device *acia_0 = devtag_get_device(device->machine, "acia6850_0"); + running_device *acia_1 = devtag_get_device(device->machine, "acia6850_1"); acia6850_tx_clock_in(acia_0); acia6850_rx_clock_in(acia_0); acia6850_tx_clock_in(acia_1); diff --git a/src/mame/drivers/mugsmash.c b/src/mame/drivers/mugsmash.c index 8ea7bcc50b8..c30c56bb995 100644 --- a/src/mame/drivers/mugsmash.c +++ b/src/mame/drivers/mugsmash.c @@ -388,7 +388,7 @@ static GFXDECODE_START( mugsmash ) GFXDECODE_ENTRY( "gfx2", 0, mugsmash2_layout, 0x100, 256 ) /* bg tiles */ GFXDECODE_END -static void irq_handler(const device_config *device, int irq) +static void irq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE ); } diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c index bd46404d0c4..b965eee61d7 100644 --- a/src/mame/drivers/multigam.c +++ b/src/mame/drivers/multigam.c @@ -294,7 +294,7 @@ static int multigam3_mmc3_4screen; static int multigam3_mmc3_last_bank; static UINT8* multigmc_mmc3_6000_ram; -static void multigam3_mmc3_scanline_cb( const device_config *device, int scanline, int vblank, int blanked ) +static void multigam3_mmc3_scanline_cb( running_device *device, int scanline, int vblank, int blanked ) { if (!vblank && !blanked) { @@ -308,7 +308,7 @@ static void multigam3_mmc3_scanline_cb( const device_config *device, int scanlin static WRITE8_HANDLER( multigam3_mmc3_rom_switch_w ) { - const device_config *ppu = devtag_get_device(space->machine, "ppu"); + running_device *ppu = devtag_get_device(space->machine, "ppu"); /* basically, a MMC3 mapper from the nes */ static int multigam3_mmc3_command; @@ -647,7 +647,7 @@ static PALETTE_INIT( multigam ) ppu2c0x_init_palette(machine, 0); } -static void ppu_irq( const device_config *device, int *ppu_regs ) +static void ppu_irq( running_device *device, int *ppu_regs ) { cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); } diff --git a/src/mame/drivers/mystwarr.c b/src/mame/drivers/mystwarr.c index 5e0a40ef261..370e74f6166 100644 --- a/src/mame/drivers/mystwarr.c +++ b/src/mame/drivers/mystwarr.c @@ -888,8 +888,8 @@ static MACHINE_START( mystwarr ) static MACHINE_RESET(mystwarr) { - const device_config *k054539_1 = devtag_get_device(machine, "konami1"); - const device_config *k054539_2 = devtag_get_device(machine, "konami2"); + running_device *k054539_1 = devtag_get_device(machine, "konami1"); + running_device *k054539_2 = devtag_get_device(machine, "konami2"); int i; // soften chorus(chip 0 channel 0-3), boost voice(chip 0 channel 4-7) @@ -905,7 +905,7 @@ static MACHINE_RESET(mystwarr) static MACHINE_RESET(dadandrn) { - const device_config *k054539_1 = devtag_get_device(machine, "konami1"); + running_device *k054539_1 = devtag_get_device(machine, "konami1"); int i; // boost voice(chip 0 channel 4-7) @@ -914,7 +914,7 @@ static MACHINE_RESET(dadandrn) static MACHINE_RESET(viostorm) { - const device_config *k054539_1 = devtag_get_device(machine, "konami1"); + running_device *k054539_1 = devtag_get_device(machine, "konami1"); int i; // boost voice(chip 0 channel 4-7) @@ -923,8 +923,8 @@ static MACHINE_RESET(viostorm) static MACHINE_RESET(metamrph) { - const device_config *k054539_1 = devtag_get_device(machine, "konami1"); - const device_config *k054539_2 = devtag_get_device(machine, "konami2"); + running_device *k054539_1 = devtag_get_device(machine, "konami1"); + running_device *k054539_2 = devtag_get_device(machine, "konami2"); int i; // boost voice(chip 0 channel 4-7) and soften other channels @@ -939,7 +939,7 @@ static MACHINE_RESET(metamrph) static MACHINE_RESET(martchmp) { - const device_config *k054539_1 = devtag_get_device(machine, "konami1"); + running_device *k054539_1 = devtag_get_device(machine, "konami1"); int i; k054539_init_flags(k054539_1, K054539_REVERSE_STEREO); @@ -950,7 +950,7 @@ static MACHINE_RESET(martchmp) static MACHINE_RESET(gaiapols) { - const device_config *k054539_1 = devtag_get_device(machine, "konami1"); + running_device *k054539_1 = devtag_get_device(machine, "konami1"); int i; // boost voice(chip 0 channel 5-7) diff --git a/src/mame/drivers/namcos1.c b/src/mame/drivers/namcos1.c index 39fd2ca45ca..7b5973f57de 100644 --- a/src/mame/drivers/namcos1.c +++ b/src/mame/drivers/namcos1.c @@ -1055,7 +1055,7 @@ GFXDECODE_END -static void namcos1_sound_interrupt( const device_config *device, int irq ) +static void namcos1_sound_interrupt( running_device *device, int irq ) { cputag_set_input_line(device->machine, "audiocpu", M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c index 308ce35f159..1ce00d52157 100644 --- a/src/mame/drivers/naomi.c +++ b/src/mame/drivers/naomi.c @@ -1484,7 +1484,7 @@ ADDRESS_MAP_END /* * Aica */ -static void aica_irq(const device_config *device, int irq) +static void aica_irq(running_device *device, int irq) { cputag_set_input_line(device->machine, "soundcpu", ARM7_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c index 0f632db1dc1..5182d8412e4 100644 --- a/src/mame/drivers/nbmj9195.c +++ b/src/mame/drivers/nbmj9195.c @@ -471,7 +471,7 @@ static WRITE8_HANDLER( tmpz84c011_1_dir_pe_w ) { pio_dir[9] = data; } /* CTC of main cpu, ch0 trigger is vblank */ static INTERRUPT_GEN( ctc0_trg1 ) { - const device_config *ctc = devtag_get_device(device->machine, "main_ctc"); + running_device *ctc = devtag_get_device(device->machine, "main_ctc"); z80ctc_trg1_w(ctc, 1); z80ctc_trg1_w(ctc, 0); } diff --git a/src/mame/drivers/nemesis.c b/src/mame/drivers/nemesis.c index b7a90f8e3e6..ca67ce7b223 100644 --- a/src/mame/drivers/nemesis.c +++ b/src/mame/drivers/nemesis.c @@ -262,7 +262,7 @@ static READ8_DEVICE_HANDLER( nemesis_portA_r ) bit 7: unused by this software version. Bubble Memory version uses this bit. */ - const device_config *vlm = devtag_get_device(device->machine, "vlm"); + running_device *vlm = devtag_get_device(device->machine, "vlm"); int res = (cputag_get_total_cycles(device->machine, "audiocpu") / 1024) & 0x2f; // this should be 0x0f, but it doesn't work res |= 0xd0; @@ -1598,7 +1598,7 @@ static const ay8910_interface ay8910_interface_2 = DEVCB_DEVICE_HANDLER("konami", k005289_control_B_w) }; -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { /* Interrupts _are_ generated, I wonder where they go.. */ /*cputag_set_input_line(device->machine, "audiocpu", 0, HOLD_LINE);*/ @@ -1614,7 +1614,7 @@ static const ym3812_interface ym3812_config = sound_irq }; -static void volume_callback(const device_config *device, int v) +static void volume_callback(running_device *device, int v) { k007232_set_volume(device,0,(v >> 4) * 0x11,0); k007232_set_volume(device,1,0,(v & 0x0f) * 0x11); diff --git a/src/mame/drivers/neogeo.c b/src/mame/drivers/neogeo.c index 33f8c2d3a64..1ddcd27d5ce 100644 --- a/src/mame/drivers/neogeo.c +++ b/src/mame/drivers/neogeo.c @@ -390,7 +390,7 @@ static void start_interrupt_timers( running_machine *machine ) * *************************************/ -static void audio_cpu_irq(const device_config *device, int assert) +static void audio_cpu_irq(running_device *device, int assert) { neogeo_state *state = (neogeo_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, assert ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/ninjakd2.c b/src/mame/drivers/ninjakd2.c index f4216ff055a..183d855a3a0 100644 --- a/src/mame/drivers/ninjakd2.c +++ b/src/mame/drivers/ninjakd2.c @@ -227,7 +227,7 @@ static SAMPLES_START( ninjakd2_init_samples ) static WRITE8_HANDLER( ninjakd2_pcm_play_w ) { - const device_config *samples = devtag_get_device(space->machine, "pcm"); + running_device *samples = devtag_get_device(space->machine, "pcm"); const UINT8* const rom = memory_region(space->machine, "pcm"); // only Ninja Kid II uses this @@ -874,7 +874,7 @@ GFXDECODE_END * *************************************/ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c index a7910d59d22..f353fd81625 100644 --- a/src/mame/drivers/ninjaw.c +++ b/src/mame/drivers/ninjaw.c @@ -396,7 +396,7 @@ static READ16_HANDLER( ninjaw_sound_r ) static WRITE8_HANDLER( ninjaw_pancontrol ) { ninjaw_state *state = (ninjaw_state *)space->machine->driver_data; - const device_config *flt = NULL; + running_device *flt = NULL; offset &= 3; switch (offset) @@ -646,7 +646,7 @@ GFXDECODE_END **************************************************************/ /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { ninjaw_state *state = (ninjaw_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/nmg5.c b/src/mame/drivers/nmg5.c index c1c6220f138..c1d2859a4ae 100644 --- a/src/mame/drivers/nmg5.c +++ b/src/mame/drivers/nmg5.c @@ -956,7 +956,7 @@ static GFXDECODE_START( pclubys ) GFXDECODE_END -static void soundirq(const device_config *device, int state) +static void soundirq(running_device *device, int state) { cputag_set_input_line(device->machine, "soundcpu", 0, state); } diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c index 3a1bd9124af..869bebbada9 100644 --- a/src/mame/drivers/nmk16.c +++ b/src/mame/drivers/nmk16.c @@ -3502,7 +3502,7 @@ static const ym2203_interface ym2203_nmk004_interface = NMK004_irq }; -static void ym2203_irqhandler(const device_config *device, int irq) +static void ym2203_irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } @@ -4837,7 +4837,7 @@ GFXDECODE_END ***************************************************************************/ -static void irq_handler(const device_config *device, int irq) +static void irq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/norautp.c b/src/mame/drivers/norautp.c index bf7c54e9e1b..aad1fdaeb4d 100644 --- a/src/mame/drivers/norautp.c +++ b/src/mame/drivers/norautp.c @@ -651,7 +651,7 @@ static WRITE8_DEVICE_HANDLER( soundlamps_w ) xxxx ---- * Discrete Sound Lines. */ - const device_config *discrete = devtag_get_device(device->machine, "discrete"); + running_device *discrete = devtag_get_device(device->machine, "discrete"); output_set_lamp_value(8, (data >> 0) & 1); /* DEAL / DRAW lamp */ output_set_lamp_value(9, (data >> 1) & 1); /* BET / COLLECT lamp */ diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c index cde132c3ec9..ad9c5f7a387 100644 --- a/src/mame/drivers/nwk-tr.c +++ b/src/mame/drivers/nwk-tr.c @@ -648,7 +648,7 @@ READ32_HANDLER(K001604_reg_r) -static void voodoo_vblank_0(const device_config *device, int param) +static void voodoo_vblank_0(running_device *device, int param) { cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE); } @@ -661,7 +661,7 @@ static VIDEO_START( nwktr ) static VIDEO_UPDATE( nwktr ) { - const device_config *voodoo = devtag_get_device(screen->machine, "voodoo"); + running_device *voodoo = devtag_get_device(screen->machine, "voodoo"); bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); @@ -678,7 +678,7 @@ static VIDEO_UPDATE( nwktr ) static READ32_HANDLER( sysreg_r ) { - const device_config *adc12138 = devtag_get_device(space->machine, "adc12138"); + running_device *adc12138 = devtag_get_device(space->machine, "adc12138"); UINT32 r = 0; if (offset == 0) { @@ -711,7 +711,7 @@ static READ32_HANDLER( sysreg_r ) static WRITE32_HANDLER( sysreg_w ) { - const device_config *adc12138 = devtag_get_device(space->machine, "adc12138"); + running_device *adc12138 = devtag_get_device(space->machine, "adc12138"); if( offset == 0 ) { if (ACCESSING_BITS_24_31) @@ -1011,7 +1011,7 @@ static const sharc_config sharc_cfg = }; -static double adc12138_input_callback( const device_config *device, UINT8 input ) +static double adc12138_input_callback( running_device *device, UINT8 input ) { int value = 0; switch (input) diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c index cb72353d753..2c446264987 100644 --- a/src/mame/drivers/nyny.c +++ b/src/mame/drivers/nyny.c @@ -113,8 +113,8 @@ static WRITE8_HANDLER( audio_2_command_w ); static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq ) { - const device_config *pia1 = devtag_get_device(device->machine, "pia1"); - const device_config *pia2 = devtag_get_device(device->machine, "pia2"); + running_device *pia1 = devtag_get_device(device->machine, "pia1"); + running_device *pia2 = devtag_get_device(device->machine, "pia2"); int combined_state = pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1) | pia6821_get_irq_b(pia2); cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE); @@ -136,7 +136,7 @@ static WRITE_LINE_DEVICE_HANDLER( main_cpu_firq ) static INTERRUPT_GEN( update_pia_1 ) { - const device_config *pia1 = devtag_get_device(device->machine, "pia1"); + running_device *pia1 = devtag_get_device(device->machine, "pia1"); /* update the different PIA pins from the input ports */ /* CA1 - copy of PA0 (COIN1) */ @@ -227,7 +227,7 @@ static const pia6821_interface pia_2_intf = static WRITE8_DEVICE_HANDLER(ic48_1_74123_output_changed) { - const device_config *pia2 = devtag_get_device(device->machine, "pia2"); + running_device *pia2 = devtag_get_device(device->machine, "pia2"); pia6821_ca1_w(pia2, 0, data); } @@ -420,7 +420,7 @@ static const mc6845_interface mc6845_intf = static VIDEO_UPDATE( nyny ) { - const device_config *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; @@ -501,8 +501,8 @@ static WRITE8_HANDLER( audio_2_command_w ) static READ8_HANDLER( nyny_pia_1_2_r ) { - const device_config *pia1 = devtag_get_device(space->machine, "pia1"); - const device_config *pia2 = devtag_get_device(space->machine, "pia2"); + running_device *pia1 = devtag_get_device(space->machine, "pia1"); + running_device *pia2 = devtag_get_device(space->machine, "pia2"); UINT8 ret = 0; /* the address bits are directly connected to the chip selects */ @@ -515,8 +515,8 @@ static READ8_HANDLER( nyny_pia_1_2_r ) static WRITE8_HANDLER( nyny_pia_1_2_w ) { - const device_config *pia1 = devtag_get_device(space->machine, "pia1"); - const device_config *pia2 = devtag_get_device(space->machine, "pia2"); + running_device *pia1 = devtag_get_device(space->machine, "pia1"); + running_device *pia2 = devtag_get_device(space->machine, "pia2"); /* the address bits are directly connected to the chip selects */ if (offset & 0x04) pia6821_w(pia1, offset & 0x03, data); diff --git a/src/mame/drivers/ojankohs.c b/src/mame/drivers/ojankohs.c index dd78ca031b7..7183ace02d6 100644 --- a/src/mame/drivers/ojankohs.c +++ b/src/mame/drivers/ojankohs.c @@ -102,7 +102,7 @@ static WRITE8_HANDLER( ojankohs_msm5205_w ) ojankohs_vclk_left = 2; } -static void ojankohs_adpcm_int(const device_config *device) +static void ojankohs_adpcm_int(running_device *device) { /* skip if we're reset */ if (!ojankohs_adpcm_reset) diff --git a/src/mame/drivers/oneshot.c b/src/mame/drivers/oneshot.c index c9885d2eff9..cb8d5a8274b 100644 --- a/src/mame/drivers/oneshot.c +++ b/src/mame/drivers/oneshot.c @@ -335,7 +335,7 @@ static GFXDECODE_START( oneshot ) GFXDECODE_ENTRY( "gfx1", 0, oneshot8x8_layout, 0x00, 4 ) /* sprites */ GFXDECODE_END -static void irq_handler(const device_config *device, int irq) +static void irq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/onetwo.c b/src/mame/drivers/onetwo.c index e586776be16..0f3bab1d845 100644 --- a/src/mame/drivers/onetwo.c +++ b/src/mame/drivers/onetwo.c @@ -266,7 +266,7 @@ static VIDEO_UPDATE( onetwo ) return 0; } -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 0, linestate); } diff --git a/src/mame/drivers/opwolf.c b/src/mame/drivers/opwolf.c index 3af95e5583a..d156c79e22d 100644 --- a/src/mame/drivers/opwolf.c +++ b/src/mame/drivers/opwolf.c @@ -466,7 +466,7 @@ static MACHINE_RESET( opwolf ) msm5205_reset_w(devtag_get_device(machine, "msm2"), 1); } -static void opwolf_msm5205_vck( const device_config *device ) +static void opwolf_msm5205_vck( running_device *device ) { opwolf_state *state = (opwolf_state *)device->machine->driver_data; int chip = (strcmp(device->tag, "msm1") == 0) ? 0 : 1; @@ -693,7 +693,7 @@ GFXDECODE_END /* handler called by the YM2151 emulator when the internal timers cause an IRQ */ -static void irq_handler( const device_config *device, int irq ) +static void irq_handler( running_device *device, int irq ) { opwolf_state *state = (opwolf_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/orbit.c b/src/mame/drivers/orbit.c index 2693fee2e89..426759d8df3 100644 --- a/src/mame/drivers/orbit.c +++ b/src/mame/drivers/orbit.c @@ -66,7 +66,7 @@ static INTERRUPT_GEN( orbit_interrupt ) static void update_misc_flags(running_machine *machine, UINT8 val) { - const device_config *discrete = devtag_get_device(machine, "discrete"); + running_device *discrete = devtag_get_device(machine, "discrete"); orbit_misc_flags = val; diff --git a/src/mame/drivers/othello.c b/src/mame/drivers/othello.c index 53a81b3b493..24811126b4b 100644 --- a/src/mame/drivers/othello.c +++ b/src/mame/drivers/othello.c @@ -97,7 +97,7 @@ static PALETTE_INIT( othello ) static VIDEO_UPDATE( othello ) { - const device_config *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; } diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c index a6efe65a295..2fc57c07e6c 100644 --- a/src/mame/drivers/othunder.c +++ b/src/mame/drivers/othunder.c @@ -631,7 +631,7 @@ GFXDECODE_END **************************************************************/ /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { othunder_state *state = (othunder_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/pachifev.c b/src/mame/drivers/pachifev.c index 2160ebf8928..f96ed2a54de 100644 --- a/src/mame/drivers/pachifev.c +++ b/src/mame/drivers/pachifev.c @@ -52,7 +52,7 @@ INPUT_PORTS_END static UINT32 adpcm_pos; //static UINT8 adpcm_idle; -static void pf_adpcm_int(const device_config *device) +static void pf_adpcm_int(running_device *device) { static UINT8 trigger,adpcm_data; diff --git a/src/mame/drivers/pcat_dyn.c b/src/mame/drivers/pcat_dyn.c index 499d3627f80..af7696b66cf 100644 --- a/src/mame/drivers/pcat_dyn.c +++ b/src/mame/drivers/pcat_dyn.c @@ -107,11 +107,11 @@ static VIDEO_UPDATE(pcat_dyn) } static struct { - const device_config *pit8253; - const device_config *pic8259_1; - const device_config *pic8259_2; - const device_config *dma8237_1; - const device_config *dma8237_2; + running_device *pit8253; + running_device *pic8259_1; + running_device *pic8259_2; + running_device *dma8237_1; + running_device *dma8237_2; } pcat_dyn_devices; /****************** @@ -194,7 +194,7 @@ static WRITE8_HANDLER( pc_dma_write_byte ) memory_write_byte(space, page_offset + offset, data); } -static void set_dma_channel(const device_config *device, int channel, int state) +static void set_dma_channel(running_device *device, int channel, int state) { if (!state) dma_channel = channel; } diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c index e643253fbe6..9bd838f56f4 100644 --- a/src/mame/drivers/pcat_nit.c +++ b/src/mame/drivers/pcat_nit.c @@ -172,11 +172,11 @@ static VIDEO_UPDATE(streetg2) } static struct { - const device_config *pit8253; - const device_config *pic8259_1; - const device_config *pic8259_2; - const device_config *dma8237_1; - const device_config *dma8237_2; + running_device *pit8253; + running_device *pic8259_1; + running_device *pic8259_2; + running_device *dma8237_1; + running_device *dma8237_2; } streetg2_devices; /****************** @@ -257,7 +257,7 @@ static WRITE8_HANDLER(dma_page_select_w) } } -static void set_dma_channel(const device_config *device, int channel, int state) +static void set_dma_channel(running_device *device, int channel, int state) { if (!state) dma_channel = channel; } diff --git a/src/mame/drivers/pcktgal.c b/src/mame/drivers/pcktgal.c index c094c958a16..d6c3a377b50 100644 --- a/src/mame/drivers/pcktgal.c +++ b/src/mame/drivers/pcktgal.c @@ -51,7 +51,7 @@ static WRITE8_HANDLER( pcktgal_sound_w ) static int msm5205next; -static void pcktgal_adpcm_int(const device_config *device) +static void pcktgal_adpcm_int(running_device *device) { static int toggle; diff --git a/src/mame/drivers/pcxt.c b/src/mame/drivers/pcxt.c index 526113dc07e..edfe7c77db1 100644 --- a/src/mame/drivers/pcxt.c +++ b/src/mame/drivers/pcxt.c @@ -316,11 +316,11 @@ static WRITE8_HANDLER( vga_vram_w ) /*end of Video HW file*/ static struct { - const device_config *pit8253; - const device_config *pic8259_1; - const device_config *pic8259_2; - const device_config *dma8237_1; - const device_config *dma8237_2; + running_device *pit8253; + running_device *pic8259_1; + running_device *pic8259_2; + running_device *dma8237_1; + running_device *dma8237_2; } filetto_devices; @@ -456,8 +456,8 @@ static READ8_DEVICE_HANDLER( port_c_r ) static WRITE8_DEVICE_HANDLER( port_b_w ) { port_b_data = data; -// const device_config *beep = devtag_get_device(device->machine, "beep"); -// const device_config *cvsd = devtag_get_device(device->machine, "cvsd"); +// running_device *beep = devtag_get_device(device->machine, "beep"); +// running_device *cvsd = devtag_get_device(device->machine, "cvsd"); // hc55516_digit_w(cvsd, data); // popmessage("%02x\n",data); // beep_set_state(beep, 0); @@ -619,7 +619,7 @@ static WRITE8_HANDLER(dma_page_select_w) } } -static void set_dma_channel(const device_config *device, int channel, int state) +static void set_dma_channel(running_device *device, int channel, int state) { if (!state) dma_channel = channel; } diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c index 966767489b4..853c00b1eb0 100644 --- a/src/mame/drivers/peplus.c +++ b/src/mame/drivers/peplus.c @@ -329,10 +329,10 @@ static WRITE8_DEVICE_HANDLER( peplus_crtc_mode_w ) static TIMER_CALLBACK(assert_lp_cb) { - mc6845_assert_light_pen_input((const device_config *) ptr); + mc6845_assert_light_pen_input((running_device *) ptr); } -static void handle_lightpen( const device_config *device ) +static void handle_lightpen( running_device *device ) { int x_val = input_port_read_safe(device->machine, "TOUCH_X",0x00); int y_val = input_port_read_safe(device->machine, "TOUCH_Y",0x00); diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c index e3f2ec1ac52..163bd4808c8 100644 --- a/src/mame/drivers/pgm.c +++ b/src/mame/drivers/pgm.c @@ -459,7 +459,7 @@ static WRITE8_HANDLER( z80_l3_w ) soundlatch3_w(space, 0, data); } -static void sound_irq( const device_config *device, int level ) +static void sound_irq( running_device *device, int level ) { pgm_state *state = (pgm_state *)device->machine->driver_data; cpu_set_input_line(state->soundcpu, 0, level); diff --git a/src/mame/drivers/photon2.c b/src/mame/drivers/photon2.c index a6d3daa563f..1275ac891d8 100644 --- a/src/mame/drivers/photon2.c +++ b/src/mame/drivers/photon2.c @@ -192,7 +192,7 @@ static READ8_HANDLER(photon2_fe_r) static WRITE8_HANDLER(photon2_fe_w) { - const device_config *speaker = devtag_get_device(space->machine, "speaker"); + running_device *speaker = devtag_get_device(space->machine, "speaker"); spectrum_port_fe = data; speaker_level_w(speaker, BIT(data,4)); diff --git a/src/mame/drivers/photoply.c b/src/mame/drivers/photoply.c index 865d377006f..7129b162673 100644 --- a/src/mame/drivers/photoply.c +++ b/src/mame/drivers/photoply.c @@ -103,11 +103,11 @@ static VIDEO_UPDATE(photoply) } static struct { - const device_config *pit8253; - const device_config *pic8259_1; - const device_config *pic8259_2; - const device_config *dma8237_1; - const device_config *dma8237_2; + running_device *pit8253; + running_device *pic8259_1; + running_device *pic8259_2; + running_device *dma8237_1; + running_device *dma8237_2; } photoply_devices; /****************** @@ -188,7 +188,7 @@ static WRITE8_HANDLER(dma_page_select_w) } } -static void set_dma_channel(const device_config *device, int channel, int state) +static void set_dma_channel(running_device *device, int channel, int state) { if (!state) dma_channel = channel; } diff --git a/src/mame/drivers/pipedrm.c b/src/mame/drivers/pipedrm.c index 0426c7fb10f..74e153b6cc4 100644 --- a/src/mame/drivers/pipedrm.c +++ b/src/mame/drivers/pipedrm.c @@ -556,7 +556,7 @@ GFXDECODE_END * *************************************/ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { fromance_state *state = (fromance_state *)device->machine->driver_data; cpu_set_input_line(state->subcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/pirates.c b/src/mame/drivers/pirates.c index f1ceea254d8..c2c2028457c 100644 --- a/src/mame/drivers/pirates.c +++ b/src/mame/drivers/pirates.c @@ -119,7 +119,7 @@ static WRITE16_HANDLER( pirates_out_w ) { if (ACCESSING_BITS_0_7) { - const device_config *eeprom = devtag_get_device(space->machine, "eeprom"); + running_device *eeprom = devtag_get_device(space->machine, "eeprom"); /* bits 0-2 control EEPROM */ eeprom_write_bit(eeprom, data & 0x04); diff --git a/src/mame/drivers/pkscram.c b/src/mame/drivers/pkscram.c index 11e49df026b..3e5c510f671 100644 --- a/src/mame/drivers/pkscram.c +++ b/src/mame/drivers/pkscram.c @@ -25,7 +25,7 @@ static UINT16* pkscramble_mdtilemap_ram; static UINT16* pkscramble_bgtilemap_ram; static tilemap_t *fg_tilemap, *md_tilemap, *bg_tilemap; -static const device_config *scanline_timer; +static running_device *scanline_timer; static WRITE16_HANDLER( pkscramble_fgtilemap_w ) { @@ -243,7 +243,7 @@ static GFXDECODE_START( pkscram ) GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 0x80 ) GFXDECODE_END -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { if(out & 0x10) cputag_set_input_line(device->machine, "maincpu", 2, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/playmark.c b/src/mame/drivers/playmark.c index 7d786d685ac..b35de70698d 100644 --- a/src/mame/drivers/playmark.c +++ b/src/mame/drivers/playmark.c @@ -88,7 +88,7 @@ static WRITE16_HANDLER( wbeachvl_coin_eeprom_w ) { if (ACCESSING_BITS_0_7) { - const device_config *eeprom = devtag_get_device(space->machine, "eeprom"); + running_device *eeprom = devtag_get_device(space->machine, "eeprom"); /* bits 0-3 are coin counters? (only 0 used?) */ coin_counter_w(space->machine, 0,data & 0x01); @@ -107,7 +107,7 @@ static WRITE16_HANDLER( hotmind_coin_eeprom_w ) { if (ACCESSING_BITS_0_7) { - const device_config *eeprom = devtag_get_device(space->machine, "eeprom"); + running_device *eeprom = devtag_get_device(space->machine, "eeprom"); coin_counter_w(space->machine, 0,data & 0x20); eeprom_set_cs_line(eeprom, (data & 1) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/drivers/plygonet.c b/src/mame/drivers/plygonet.c index 64ca9a44640..f68d0bbed36 100644 --- a/src/mame/drivers/plygonet.c +++ b/src/mame/drivers/plygonet.c @@ -369,7 +369,7 @@ static DIRECT_UPDATE_HANDLER( plygonet_dsp56k_direct_handler ) */ enum { BANK_GROUP_A, BANK_GROUP_B, INVALID_BANK_GROUP }; -static UINT8 dsp56k_bank_group(const device_config* cpu) +static UINT8 dsp56k_bank_group(running_device* cpu) { UINT16 portC = dsp56k_get_peripheral_memory(cpu, 0xffe3); @@ -382,7 +382,7 @@ static UINT8 dsp56k_bank_group(const device_config* cpu) return INVALID_BANK_GROUP; } -static UINT8 dsp56k_bank_num(const device_config* cpu, UINT8 bank_group) +static UINT8 dsp56k_bank_num(running_device* cpu, UINT8 bank_group) { UINT16 portC = dsp56k_get_peripheral_memory(cpu, 0xffe3); diff --git a/src/mame/drivers/policetr.c b/src/mame/drivers/policetr.c index 304454b5101..e2148491114 100644 --- a/src/mame/drivers/policetr.c +++ b/src/mame/drivers/policetr.c @@ -155,7 +155,7 @@ static WRITE32_HANDLER( control_w ) /* handle EEPROM I/O */ if (ACCESSING_BITS_16_23) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); eeprom_write_bit(device, data & 0x00800000); eeprom_set_cs_line(device, (data & 0x00200000) ? CLEAR_LINE : ASSERT_LINE); eeprom_set_clock_line(device, (data & 0x00400000) ? ASSERT_LINE : CLEAR_LINE); @@ -164,7 +164,7 @@ static WRITE32_HANDLER( control_w ) /* toggling BSMT off then on causes a reset */ if (!(old & 0x80000000) && (control_data & 0x80000000)) { - const device_config *device = devtag_get_device(space->machine, "bsmt"); + running_device *device = devtag_get_device(space->machine, "bsmt"); bsmt2000_data_w(device, bsmt_data_bank, 0, 0xffff); device_reset(device); } diff --git a/src/mame/drivers/polyplay.c b/src/mame/drivers/polyplay.c index 512d33cb8aa..1298ca9b1b5 100644 --- a/src/mame/drivers/polyplay.c +++ b/src/mame/drivers/polyplay.c @@ -97,7 +97,7 @@ static int channel2_const; /* timer handling */ static TIMER_DEVICE_CALLBACK( polyplay_timer_callback ); -static const device_config* polyplay_timer; +static running_device* polyplay_timer; static WRITE8_HANDLER( polyplay_start_timer2 ); static WRITE8_HANDLER( polyplay_sound_channel ); diff --git a/src/mame/drivers/powerins.c b/src/mame/drivers/powerins.c index b6d0601192d..e64777b76ab 100644 --- a/src/mame/drivers/powerins.c +++ b/src/mame/drivers/powerins.c @@ -336,7 +336,7 @@ static MACHINE_RESET( powerins ) oki_bank = -1; // samples bank "unitialised" } -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/prehisle.c b/src/mame/drivers/prehisle.c index 027248002ea..7fd989675c3 100644 --- a/src/mame/drivers/prehisle.c +++ b/src/mame/drivers/prehisle.c @@ -200,7 +200,7 @@ GFXDECODE_END /******************************************************************************/ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c index fe5d50a0cd9..dcb7f6b9416 100644 --- a/src/mame/drivers/psikyo.c +++ b/src/mame/drivers/psikyo.c @@ -388,7 +388,7 @@ ADDRESS_MAP_END ***************************************************************************/ -static void sound_irq( const device_config *device, int irq ) +static void sound_irq( running_device *device, int irq ) { psikyo_state *state = (psikyo_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); @@ -1199,7 +1199,7 @@ MACHINE_DRIVER_END ***************************************************************************/ -static void irqhandler( const device_config *device, int linestate ) +static void irqhandler( running_device *device, int linestate ) { psikyo_state *state = (psikyo_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, linestate ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/psikyo4.c b/src/mame/drivers/psikyo4.c index 04c6e503487..ad98b85e78b 100644 --- a/src/mame/drivers/psikyo4.c +++ b/src/mame/drivers/psikyo4.c @@ -685,7 +685,7 @@ static INPUT_PORTS_START( hotdebut ) INPUT_PORTS_END -static void irqhandler( const device_config *device, int linestate ) +static void irqhandler( running_device *device, int linestate ) { psikyo4_state *state = (psikyo4_state *)device->machine->driver_data; cpu_set_input_line(state->maincpu, 12, linestate ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c index b2e9c264b14..486258e180f 100644 --- a/src/mame/drivers/psikyosh.c +++ b/src/mame/drivers/psikyosh.c @@ -783,7 +783,7 @@ static INPUT_PORTS_START( mjgtaste ) INPUT_PORTS_END -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { psikyosh_state *state = (psikyosh_state *)device->machine->driver_data; cpu_set_input_line(state->maincpu, 12, linestate ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/psychic5.c b/src/mame/drivers/psychic5.c index 253b9467ded..ea2594d7c9f 100644 --- a/src/mame/drivers/psychic5.c +++ b/src/mame/drivers/psychic5.c @@ -662,7 +662,7 @@ GFXDECODE_END -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/pushman.c b/src/mame/drivers/pushman.c index 3c48b59708a..ddaeb1f1975 100644 --- a/src/mame/drivers/pushman.c +++ b/src/mame/drivers/pushman.c @@ -398,7 +398,7 @@ GFXDECODE_END /******************************************************************************/ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c index 6dbcf1d0474..f73a92825c5 100644 --- a/src/mame/drivers/qdrmfgp.c +++ b/src/mame/drivers/qdrmfgp.c @@ -87,7 +87,7 @@ static WRITE16_HANDLER( gp_control_w ) int vol = space->machine->generic.nvram.u16[0x10] & 0xff; if (vol) { - const device_config *k054539 = devtag_get_device(space->machine, "konami"); + running_device *k054539 = devtag_get_device(space->machine, "konami"); int i; double gain = vol / 90.0; @@ -117,7 +117,7 @@ static WRITE16_HANDLER( gp2_control_w ) int vol = space->machine->generic.nvram.u16[0x8] & 0xff; if (vol) { - const device_config *k054539 = devtag_get_device(space->machine, "konami"); + running_device *k054539 = devtag_get_device(space->machine, "konami"); int i; double gain = vol / 90.0; @@ -130,7 +130,7 @@ static WRITE16_HANDLER( gp2_control_w ) static READ16_HANDLER( v_rom_r ) { - const device_config *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = devtag_get_device(space->machine, "k056832"); UINT8 *mem8 = memory_region(space->machine, "gfx1"); int bank = k056832_word_r(k056832, 0x34/2, 0xffff); @@ -145,7 +145,7 @@ static READ16_HANDLER( v_rom_r ) static READ16_HANDLER( gp2_vram_r ) { - const device_config *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = devtag_get_device(space->machine, "k056832"); if (offset < 0x1000 / 2) return k056832_ram_word_r(k056832, offset * 2 + 1, mem_mask); @@ -155,7 +155,7 @@ static READ16_HANDLER( gp2_vram_r ) static READ16_HANDLER( gp2_vram_mirror_r ) { - const device_config *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = devtag_get_device(space->machine, "k056832"); if (offset < 0x1000 / 2) return k056832_ram_word_r(k056832, offset * 2, mem_mask); @@ -165,7 +165,7 @@ static READ16_HANDLER( gp2_vram_mirror_r ) static WRITE16_HANDLER( gp2_vram_w ) { - const device_config *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = devtag_get_device(space->machine, "k056832"); if (offset < 0x1000 / 2) k056832_ram_word_w(k056832, offset * 2 + 1, data, mem_mask); @@ -175,7 +175,7 @@ static WRITE16_HANDLER( gp2_vram_w ) static WRITE16_HANDLER( gp2_vram_mirror_w ) { - const device_config *k056832 = devtag_get_device(space->machine, "k056832"); + running_device *k056832 = devtag_get_device(space->machine, "k056832"); if (offset < 0x1000 / 2) k056832_ram_word_w(k056832, offset * 2, data, mem_mask); @@ -242,7 +242,7 @@ static WRITE16_DEVICE_HANDLER( ide_alt_w ) static READ16_HANDLER( gp2_ide_std_r ) { - const device_config *device = devtag_get_device(space->machine, "ide"); + running_device *device = devtag_get_device(space->machine, "ide"); if (offset & 0x01) { if (offset == 0x07) @@ -289,7 +289,7 @@ static INTERRUPT_GEN(qdrmfgp_interrupt) } } -static void ide_interrupt(const device_config *device, int state) +static void ide_interrupt(running_device *device, int state) { if (control & 0x0008) { @@ -315,7 +315,7 @@ static INTERRUPT_GEN(qdrmfgp2_interrupt) cpu_set_input_line(device, 4, HOLD_LINE); } -static void gp2_ide_interrupt(const device_config *device, int state) +static void gp2_ide_interrupt(running_device *device, int state) { if (control & 0x0010) { @@ -572,7 +572,7 @@ INPUT_PORTS_END * *************************************/ -static void sound_irq(const device_config *device) +static void sound_irq(running_device *device) { if (control & 0x0001) cputag_set_input_line(device->machine, "maincpu", 1, HOLD_LINE); diff --git a/src/mame/drivers/quakeat.c b/src/mame/drivers/quakeat.c index ab33a22329a..27c77b8e260 100644 --- a/src/mame/drivers/quakeat.c +++ b/src/mame/drivers/quakeat.c @@ -72,8 +72,8 @@ static VIDEO_UPDATE(quake) } static struct { - const device_config *pic8259_1; - const device_config *pic8259_2; + running_device *pic8259_1; + running_device *pic8259_2; } quakeat_devices; static ADDRESS_MAP_START( quake_map, ADDRESS_SPACE_PROGRAM, 32 ) diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c index e6e08d9c96e..9f5fafccb59 100644 --- a/src/mame/drivers/r2dtank.c +++ b/src/mame/drivers/r2dtank.c @@ -73,8 +73,8 @@ static WRITE_LINE_DEVICE_HANDLER( flipscreen_w ); static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq ) { - const device_config *pia0 = devtag_get_device(device->machine, "pia_main"); - const device_config *pia1 = devtag_get_device(device->machine, "pia_audio"); + running_device *pia0 = devtag_get_device(device->machine, "pia_main"); + running_device *pia1 = devtag_get_device(device->machine, "pia_audio"); int combined_state = pia6821_get_irq_a(pia0) | pia6821_get_irq_b(pia0) | pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1); @@ -206,7 +206,7 @@ static const ay8910_interface ay8910_2_interface = static WRITE8_DEVICE_HANDLER( ttl74123_output_changed ) { - const device_config *pia = devtag_get_device(device->machine, "pia_main"); + running_device *pia = devtag_get_device(device->machine, "pia_main"); pia6821_ca1_w(pia, 0, data); ttl74123_output = data; } @@ -383,7 +383,7 @@ static const mc6845_interface mc6845_intf = static VIDEO_UPDATE( r2dtank ) { - const device_config *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/drivers/rainbow.c b/src/mame/drivers/rainbow.c index 6242ca0ae9c..0436949a2c8 100644 --- a/src/mame/drivers/rainbow.c +++ b/src/mame/drivers/rainbow.c @@ -625,7 +625,7 @@ GFXDECODE_END /* handler called by the YM2151 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { rainbow_state *state = (rainbow_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/rampart.c b/src/mame/drivers/rampart.c index 99d38252c82..112bf50fc47 100644 --- a/src/mame/drivers/rampart.c +++ b/src/mame/drivers/rampart.c @@ -45,7 +45,7 @@ static void update_interrupts(running_machine *machine) } -static void scanline_update(const device_config *screen, int scanline) +static void scanline_update(running_device *screen, int scanline) { /* generate 32V signals */ if ((scanline & 32) == 0) diff --git a/src/mame/drivers/rastan.c b/src/mame/drivers/rastan.c index a53344ef374..9dbf250d29c 100644 --- a/src/mame/drivers/rastan.c +++ b/src/mame/drivers/rastan.c @@ -172,7 +172,7 @@ static WRITE8_DEVICE_HANDLER( rastan_bankswitch_w ) } -static void rastan_msm5205_vck( const device_config *device ) +static void rastan_msm5205_vck( running_device *device ) { rastan_state *state = (rastan_state *)device->machine->driver_data; if (state->adpcm_data != -1) @@ -344,7 +344,7 @@ GFXDECODE_END /* handler called by the YM2151 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { rastan_state *state = (rastan_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c index b5f7275b801..786d3823431 100644 --- a/src/mame/drivers/renegade.c +++ b/src/mame/drivers/renegade.c @@ -759,7 +759,7 @@ GFXDECODE_END /* handler called by the 3526 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", M6809_FIRQ_LINE, linestate); } diff --git a/src/mame/drivers/rohga.c b/src/mame/drivers/rohga.c index 5a1f3cd29ce..adc39e1e42d 100644 --- a/src/mame/drivers/rohga.c +++ b/src/mame/drivers/rohga.c @@ -725,7 +725,7 @@ GFXDECODE_END /**********************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c index a94906f7a56..cacbeb6b3a0 100644 --- a/src/mame/drivers/royalmah.c +++ b/src/mame/drivers/royalmah.c @@ -1105,7 +1105,7 @@ static READ8_HANDLER( mjvegasa_rom_io_r ) case 0x800e: case 0x800f: { - const device_config *rtc = devtag_get_device(space->machine, "rtc"); + running_device *rtc = devtag_get_device(space->machine, "rtc"); return msm6242_r(rtc, offset-0x8000); } } @@ -1142,7 +1142,7 @@ static WRITE8_HANDLER( mjvegasa_rom_io_w ) case 0x800e: case 0x800f: { - const device_config *rtc = devtag_get_device(space->machine, "rtc"); + running_device *rtc = devtag_get_device(space->machine, "rtc"); msm6242_w(rtc, offset-0x8000, data); return; } diff --git a/src/mame/drivers/rpunch.c b/src/mame/drivers/rpunch.c index 218fc17eeb8..0c900b130c4 100644 --- a/src/mame/drivers/rpunch.c +++ b/src/mame/drivers/rpunch.c @@ -144,7 +144,7 @@ WRITE16_HANDLER( rpunch_crtc_register_w ); * *************************************/ -static void ym2151_irq_gen(const device_config *device, int state) +static void ym2151_irq_gen(running_device *device, int state) { ym2151_irq = state; cputag_set_input_line(device->machine, "audiocpu", 0, (ym2151_irq | sound_busy) ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/safarir.c b/src/mame/drivers/safarir.c index afbe61f86d0..55267981e48 100644 --- a/src/mame/drivers/safarir.c +++ b/src/mame/drivers/safarir.c @@ -216,7 +216,7 @@ static UINT8 port_last2; static WRITE8_HANDLER( safarir_audio_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); UINT8 rising_bits = data & ~port_last; if (rising_bits == 0x12) sample_start(samples, CHANNEL_SOUND1, SAMPLE_SOUND1_1, 0); diff --git a/src/mame/drivers/sandscrp.c b/src/mame/drivers/sandscrp.c index 7fddc2ad6a1..85830db275a 100644 --- a/src/mame/drivers/sandscrp.c +++ b/src/mame/drivers/sandscrp.c @@ -121,7 +121,7 @@ static INTERRUPT_GEN( sandscrp_interrupt ) static VIDEO_EOF( sandscrp ) { - const device_config *pandora = devtag_get_device(machine, "pandora"); + running_device *pandora = devtag_get_device(machine, "pandora"); sprite_irq = 1; update_irq_state(machine); pandora_eof(pandora); @@ -412,7 +412,7 @@ GFXDECODE_END /* YM3014B + YM2203C */ -static void irq_handler(const device_config *device, int irq) +static void irq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c index 07ca88062b2..0e66e392148 100644 --- a/src/mame/drivers/seattle.c +++ b/src/mame/drivers/seattle.c @@ -433,7 +433,7 @@ static UINT32 *rombase; static galileo_data galileo; static widget_data widget; -static const device_config *voodoo_device; +static running_device *voodoo_device; static UINT8 voodoo_stalled; static UINT8 cpu_stalled_on_voodoo; static UINT32 cpu_stalled_offset; @@ -466,12 +466,12 @@ static UINT32 cmos_write_enabled; * *************************************/ -static void vblank_assert(const device_config *device, int state); +static void vblank_assert(running_device *device, int state); static void update_vblank_irq(running_machine *machine); static void galileo_reset(void); static TIMER_CALLBACK( galileo_timer_callback ); static void galileo_perform_dma(const address_space *space, int which); -static void voodoo_stall(const device_config *device, int stall); +static void voodoo_stall(running_device *device, int stall); static void widget_reset(running_machine *machine); static void update_widget_irq(running_machine *machine); @@ -581,7 +581,7 @@ static MACHINE_RESET( seattle ) * *************************************/ -static void ide_interrupt(const device_config *device, int state) +static void ide_interrupt(running_device *device, int state) { cputag_set_input_line(device->machine, "maincpu", IDE_IRQ_NUM, state); } @@ -607,7 +607,7 @@ static void ethernet_interrupt_machine(running_machine *machine, int state) update_widget_irq(machine); } -static void ethernet_interrupt(const device_config *device, int state) +static void ethernet_interrupt(running_device *device, int state) { ethernet_interrupt_machine(device->machine, state); } @@ -737,7 +737,7 @@ static WRITE32_HANDLER( vblank_clear_w ) } -static void vblank_assert(const device_config *device, int state) +static void vblank_assert(running_device *device, int state) { /* cache the raw state */ vblank_state = state; @@ -1318,7 +1318,7 @@ static WRITE32_HANDLER( seattle_voodoo_w ) } -static void voodoo_stall(const device_config *device, int stall) +static void voodoo_stall(running_device *device, int stall) { /* set the new state */ voodoo_stalled = stall; @@ -2767,7 +2767,7 @@ ROM_END static void init_common(running_machine *machine, int ioasic, int serialnum, int yearoffs, int config) { - const device_config *device; + running_device *device; /* initialize the subsystems */ midway_ioasic_init(machine, ioasic, serialnum, yearoffs, ioasic_irq); diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c index c8da4013a2c..f9429209d8d 100644 --- a/src/mame/drivers/segac2.c +++ b/src/mame/drivers/segac2.c @@ -428,7 +428,7 @@ static WRITE16_HANDLER( io_chip_w ) } if (sound_banks > 1) { - const device_config *upd = devtag_get_device(space->machine, "upd"); + running_device *upd = devtag_get_device(space->machine, "upd"); newbank = (data >> 2) & (sound_banks - 1); upd7759_set_bank_base(upd, newbank * 0x20000); } @@ -438,7 +438,7 @@ static WRITE16_HANDLER( io_chip_w ) case 0x1c/2: if (sound_banks > 1) { - const device_config *upd = devtag_get_device(space->machine, "upd"); + running_device *upd = devtag_get_device(space->machine, "upd"); upd7759_reset_w(upd, (data >> 1) & 1); } break; @@ -1312,7 +1312,7 @@ INPUT_PORTS_END Sound interfaces ******************************************************************************/ -static void segac2_irq2_interrupt(const device_config *device, int state) +static void segac2_irq2_interrupt(running_device *device, int state) { //printf("sound irq %d\n", state); cputag_set_input_line(device->machine, "maincpu", 2, state ? ASSERT_LINE : CLEAR_LINE); @@ -1821,7 +1821,7 @@ it should be, otherwise I don't see how the formula could be computed. static void segac2_common_init(running_machine* machine, int (*func)(int in)) { - const device_config *upd = devtag_get_device(machine, "upd"); + running_device *upd = devtag_get_device(machine, "upd"); DRIVER_INIT_CALL( megadriv_c2 ); diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c index a080d79c9b2..4faa59e600f 100644 --- a/src/mame/drivers/segae.c +++ b/src/mame/drivers/segae.c @@ -364,8 +364,8 @@ static void init_ports_systeme(running_machine *machine) /* INIT THE PORTS *********************************************************************************************/ const address_space *io = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO); - const device_config *sn1 = devtag_get_device(machine, "sn1"); - const device_config *sn2 = devtag_get_device(machine, "sn2"); + running_device *sn1 = devtag_get_device(machine, "sn1"); + running_device *sn2 = devtag_get_device(machine, "sn2"); memory_install_write8_device_handler(io, sn2, 0x7b, 0x7b, 0, 0, sn76496_w); memory_install_write8_device_handler(io, sn1, 0x7e, 0x7f, 0, 0, sn76496_w); diff --git a/src/mame/drivers/segag80v.c b/src/mame/drivers/segag80v.c index edb6ea5c2a9..75a1b85b422 100644 --- a/src/mame/drivers/segag80v.c +++ b/src/mame/drivers/segag80v.c @@ -1367,7 +1367,7 @@ static DRIVER_INIT( spacfury ) static DRIVER_INIT( zektor ) { const address_space *iospace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO); - const device_config *ay = devtag_get_device(machine, "aysnd"); + running_device *ay = devtag_get_device(machine, "aysnd"); /* configure security */ sega_security(82); diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c index b3b5c7da8d1..85062ea581e 100644 --- a/src/mame/drivers/segahang.c +++ b/src/mame/drivers/segahang.c @@ -375,7 +375,7 @@ static void sharrier_i8751_sim(running_machine *machine) * *************************************/ -static void sound_irq(const device_config *device, int irq) +static void sound_irq(running_device *device, int irq) { cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/segald.c b/src/mame/drivers/segald.c index 759bc14473c..50b3a824942 100644 --- a/src/mame/drivers/segald.c +++ b/src/mame/drivers/segald.c @@ -31,7 +31,7 @@ static UINT8* color_RAM; static UINT8* fix_RAM; static UINT8* out_RAM; -static const device_config *laserdisc; +static running_device *laserdisc; static UINT8 ldv1000_input_latch; static UINT8 ldv1000_output_latch; diff --git a/src/mame/drivers/segamsys.c b/src/mame/drivers/segamsys.c index 1bcd4f8ba8d..06b432425bb 100644 --- a/src/mame/drivers/segamsys.c +++ b/src/mame/drivers/segamsys.c @@ -1644,7 +1644,7 @@ static void megatech_set_genz80_as_sms_standard_ports(running_machine *machine, /* INIT THE PORTS *********************************************************************************************/ const address_space *io = cputag_get_address_space(machine, tag, ADDRESS_SPACE_IO); - const device_config *sn = devtag_get_device(machine, "snsnd"); + running_device *sn = devtag_get_device(machine, "snsnd"); memory_install_readwrite8_handler(io, 0x0000, 0xffff, 0, 0, z80_unmapped_port_r, z80_unmapped_port_w); diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c index 4d738ceac87..85f4bf992db 100644 --- a/src/mame/drivers/segaorun.c +++ b/src/mame/drivers/segaorun.c @@ -498,7 +498,7 @@ static TIMER_CALLBACK( scanline_callback ) * *************************************/ -static void outrun_reset(const device_config *device) +static void outrun_reset(running_device *device) { cputag_set_input_line(device->machine, "sub", INPUT_LINE_RESET, PULSE_LINE); } diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c index 6c11605c2b0..9ea710cecf4 100644 --- a/src/mame/drivers/segas16a.c +++ b/src/mame/drivers/segas16a.c @@ -358,7 +358,7 @@ static WRITE8_DEVICE_HANDLER( video_control_w ) D1 : Coin meter #2 D0 : Coin meter #1 */ - const device_config *mcu = devtag_get_device(device->machine, "mcu"); + running_device *mcu = devtag_get_device(device->machine, "mcu"); if (((video_control ^ data) & 0x0c) && lamp_changed_w) (*lamp_changed_w)(video_control ^ data, data); @@ -835,7 +835,7 @@ INLINE void maincpu_byte_w(running_machine *machine, offs_t offset, UINT8 data) static WRITE8_HANDLER( mcu_control_w ) { - const device_config *maincpu = devtag_get_device(space->machine, "maincpu"); + running_device *maincpu = devtag_get_device(space->machine, "maincpu"); int irqline; cpu_set_input_line(maincpu, INPUT_LINE_RESET, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c index 8ff16653c98..bf43c19dde1 100644 --- a/src/mame/drivers/segas16b.c +++ b/src/mame/drivers/segas16b.c @@ -1342,7 +1342,7 @@ static READ8_DEVICE_HANDLER( upd7759_status_r ) } -static void upd7759_generate_nmi(const device_config *device, int state) +static void upd7759_generate_nmi(running_device *device, int state) { if (state) cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE); diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c index 4cbba9bf670..9cc1562d81e 100644 --- a/src/mame/drivers/segas24.c +++ b/src/mame/drivers/segas24.c @@ -790,7 +790,7 @@ static UINT16 irq_timera; static UINT8 irq_timerb; static UINT8 irq_allow0, irq_allow1; static int irq_timer_pend0, irq_timer_pend1, irq_yms, irq_vblank, irq_sprite; -static const device_config *irq_timer, *irq_timer_clear; +static running_device *irq_timer, *irq_timer_clear; static TIMER_DEVICE_CALLBACK( irq_timer_cb ) { @@ -936,7 +936,7 @@ static INTERRUPT_GEN(irq_vbl) } } -static void irq_ym(const device_config *device, int irq) +static void irq_ym(running_device *device, int irq) { irq_yms = irq; cputag_set_input_line(device->machine, "maincpu", IRQ_YM2151+1, irq_yms && (irq_allow0 & (1 << IRQ_YM2151)) ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c index cd08a577c6a..a1cc583aeb3 100644 --- a/src/mame/drivers/segas32.c +++ b/src/mame/drivers/segas32.c @@ -375,7 +375,7 @@ static UINT8 *z80_shared_ram; /* V60 interrupt controller */ static UINT8 v60_irq_control[0x10]; -static const device_config *v60_irq_timer[2]; +static running_device *v60_irq_timer[2]; /* sound interrupt controller */ static UINT8 sound_irq_control[4]; @@ -391,7 +391,7 @@ static UINT8 analog_bank; static UINT8 analog_value[4]; static UINT8 sonic_last[6]; -static void (*system32_prot_vblank)(const device_config *device); +static void (*system32_prot_vblank)(running_device *device); @@ -689,7 +689,7 @@ static void common_io_chip_w(const address_space *space, int which, offs_t offse case 0x06/2: if (which == 0) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); eeprom_write_bit(device, data & 0x80); eeprom_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); eeprom_set_clock_line(device, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE); @@ -707,7 +707,7 @@ static void common_io_chip_w(const address_space *space, int which, offs_t offse else { /* multi-32 EEPROM access */ - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); eeprom_write_bit(device, data & 0x80); eeprom_set_cs_line(device, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); eeprom_set_clock_line(device, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE); @@ -1117,7 +1117,7 @@ static WRITE8_HANDLER( sound_int_control_hi_w ) } -static void ym3438_irq_handler(const device_config *device, int state) +static void ym3438_irq_handler(running_device *device, int state) { if (state) signal_sound_irq(device->machine, SOUND_IRQ_YM3438); @@ -3926,7 +3926,7 @@ static DRIVER_INIT( radr ) static DRIVER_INIT( scross ) { - const device_config *multipcm = devtag_get_device(machine, "sega"); + running_device *multipcm = devtag_get_device(machine, "sega"); segas32_common_init(analog_custom_io_r, analog_custom_io_w); memory_install_write8_device_handler(cputag_get_address_space(machine, "soundcpu", ADDRESS_SPACE_PROGRAM), multipcm, 0xb0, 0xbf, 0, 0, scross_bank_w); } diff --git a/src/mame/drivers/segaxbd.c b/src/mame/drivers/segaxbd.c index a47c9c5b40a..4244396ef71 100644 --- a/src/mame/drivers/segaxbd.c +++ b/src/mame/drivers/segaxbd.c @@ -390,7 +390,7 @@ static void sound_data_w(running_machine *machine, UINT8 data) } -static void sound_cpu_irq(const device_config *device, int state) +static void sound_cpu_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "soundcpu", 0, state); } @@ -410,7 +410,7 @@ static READ8_HANDLER( sound_data_r ) * *************************************/ -static void xboard_reset(const device_config *device) +static void xboard_reset(running_device *device) { cputag_set_input_line(device->machine, "sub", INPUT_LINE_RESET, PULSE_LINE); cpuexec_boost_interleave(device->machine, attotime_zero, ATTOTIME_IN_USEC(100)); diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c index dc399e8e552..013c6cd885c 100644 --- a/src/mame/drivers/segaybd.c +++ b/src/mame/drivers/segaybd.c @@ -55,7 +55,7 @@ static UINT8 timer_irq_state; static UINT16 *backupram; -static const device_config *interrupt_timer; +static running_device *interrupt_timer; @@ -211,7 +211,7 @@ static MACHINE_RESET( yboard ) * *************************************/ -static void sound_cpu_irq(const device_config *device, int state) +static void sound_cpu_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "soundcpu", 0, state); } diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c index 500ecff1de2..f48ad906278 100644 --- a/src/mame/drivers/seibuspi.c +++ b/src/mame/drivers/seibuspi.c @@ -890,7 +890,7 @@ static READ32_HANDLER( spi_unknown_r ) static WRITE32_DEVICE_HANDLER( eeprom_w ) { - const device_config *oki2 = devtag_get_device(device->machine, "oki2"); + running_device *oki2 = devtag_get_device(device->machine, "oki2"); // tile banks if( ACCESSING_BITS_16_23 ) { @@ -1113,7 +1113,7 @@ static WRITE8_DEVICE_HANDLER( flashrom_write ) } } -static void irqhandler(const device_config *device, int state) +static void irqhandler(running_device *device, int state) { if (state) cputag_set_input_line_and_vector(device->machine, "soundcpu", 0, ASSERT_LINE, 0xd7); // IRQ is RST10 diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c index a630c294a9a..618b9926ea1 100644 --- a/src/mame/drivers/seta.c +++ b/src/mame/drivers/seta.c @@ -1335,7 +1335,7 @@ static struct st_chip { /*------------------------------ uppdate timer ------------------------------*/ -static void uPD71054_update_timer( running_machine *machine, const device_config *cpu, int no ) +static void uPD71054_update_timer( running_machine *machine, running_device *cpu, int no ) { UINT16 max = uPD71054.max[no]&0xffff; @@ -1437,7 +1437,7 @@ static const x1_010_interface seta_sound_intf2 = 0x1000, /* address */ }; -static void utoukond_ym3438_interrupt(const device_config *device, int linestate) +static void utoukond_ym3438_interrupt(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, linestate); } diff --git a/src/mame/drivers/sf.c b/src/mame/drivers/sf.c index 95c725ebcab..00359707d62 100644 --- a/src/mame/drivers/sf.c +++ b/src/mame/drivers/sf.c @@ -783,7 +783,7 @@ GFXDECODE_END -static void irq_handler( const device_config *device, int irq ) +static void irq_handler( running_device *device, int irq ) { sf_state *state = (sf_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/sfbonus.c b/src/mame/drivers/sfbonus.c index 131888090bd..2250960e599 100644 --- a/src/mame/drivers/sfbonus.c +++ b/src/mame/drivers/sfbonus.c @@ -547,7 +547,7 @@ static VIDEO_START(sfbonus) } -static void sfbonus_draw_reel_layer(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int catagory) +static void sfbonus_draw_reel_layer(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int catagory) { int zz; int i; diff --git a/src/mame/drivers/sfkick.c b/src/mame/drivers/sfkick.c index 8f0c4d0d8b3..c84726a877f 100644 --- a/src/mame/drivers/sfkick.c +++ b/src/mame/drivers/sfkick.c @@ -442,7 +442,7 @@ static INTERRUPT_GEN( sfkick_interrupt ) { v9938_interrupt(device->machine, 0); } -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line_and_vector(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xff); } diff --git a/src/mame/drivers/shadfrce.c b/src/mame/drivers/shadfrce.c index 548a9fe2a12..4f4c5916e0f 100644 --- a/src/mame/drivers/shadfrce.c +++ b/src/mame/drivers/shadfrce.c @@ -546,7 +546,7 @@ GFXDECODE_END /* Machine Driver Bits */ -static void irq_handler(const device_config *device, int irq) +static void irq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE ); } diff --git a/src/mame/drivers/shangha3.c b/src/mame/drivers/shangha3.c index e11cf363969..0152e1cd33d 100644 --- a/src/mame/drivers/shangha3.c +++ b/src/mame/drivers/shangha3.c @@ -465,7 +465,7 @@ static const ay8910_interface ay8910_config = DEVCB_NULL }; -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, linestate); } diff --git a/src/mame/drivers/shootout.c b/src/mame/drivers/shootout.c index 8d898ed5efe..af2dc1a280e 100644 --- a/src/mame/drivers/shootout.c +++ b/src/mame/drivers/shootout.c @@ -227,12 +227,12 @@ static GFXDECODE_START( shootout ) GFXDECODE_ENTRY( "gfx3", 0, tile_layout, 0, 16 ) /* tiles */ GFXDECODE_END -static void shootout_snd_irq(const device_config *device, int linestate) +static void shootout_snd_irq(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 0, linestate); } -static void shootout_snd2_irq(const device_config *device, int linestate) +static void shootout_snd2_irq(running_device *device, int linestate) { cputag_set_input_line(device->machine, "maincpu", 0, linestate); } diff --git a/src/mame/drivers/sidearms.c b/src/mame/drivers/sidearms.c index b518291eec8..dbfe251feef 100644 --- a/src/mame/drivers/sidearms.c +++ b/src/mame/drivers/sidearms.c @@ -632,7 +632,7 @@ static GFXDECODE_START( turtship ) GFXDECODE_END /* handler called by the 2203 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/sidepckt.c b/src/mame/drivers/sidepckt.c index d7bf57be387..35fe93e8475 100644 --- a/src/mame/drivers/sidepckt.c +++ b/src/mame/drivers/sidepckt.c @@ -247,7 +247,7 @@ GFXDECODE_END /* handler called by the 3526 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 0, linestate); } diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c index 44b747b3333..1bfd508a272 100644 --- a/src/mame/drivers/simpl156.c +++ b/src/mame/drivers/simpl156.c @@ -175,7 +175,7 @@ static READ32_HANDLER( simpl156_system_r ) static WRITE32_HANDLER( simpl156_eeprom_w ) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); //int okibank; //okibank = data & 0x07; diff --git a/src/mame/drivers/skeetsht.c b/src/mame/drivers/skeetsht.c index 32fcaa49bfc..78967970350 100644 --- a/src/mame/drivers/skeetsht.c +++ b/src/mame/drivers/skeetsht.c @@ -46,7 +46,7 @@ static VIDEO_START ( skeetsht ) } -static void skeetsht_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void skeetsht_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { const rgb_t *const pens = tlc34076_get_pens(); UINT16 *vram = &tms_vram[(params->rowaddr << 8) & 0x3ff00]; @@ -89,7 +89,7 @@ static WRITE16_HANDLER( ramdac_w ) * *************************************/ -static void skeetsht_tms_irq(const device_config *device, int state) +static void skeetsht_tms_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "68hc11", MC68HC11_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); } @@ -137,7 +137,7 @@ static WRITE8_HANDLER( hc11_porta_w ) static WRITE8_HANDLER( ay8910_w ) { - const device_config *ay = devtag_get_device(space->machine, "aysnd"); + running_device *ay = devtag_get_device(space->machine, "aysnd"); if (ay_sel) ay8910_data_w(ay, 0, data); diff --git a/src/mame/drivers/skimaxx.c b/src/mame/drivers/skimaxx.c index e0f423ddc94..65ba5e55456 100644 --- a/src/mame/drivers/skimaxx.c +++ b/src/mame/drivers/skimaxx.c @@ -167,7 +167,7 @@ static void skimaxx_from_shiftreg(const address_space *space, UINT32 address, UI * *************************************/ -static void skimaxx_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void skimaxx_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { // TODO: This isn't correct. I just hacked it together quickly so I could see something! @@ -274,7 +274,7 @@ static WRITE32_HANDLER( skimaxx_sub_ctrl_w ) // 7e/7f at the start. 3f/7f, related to reads from 1018xxxx if (ACCESSING_BITS_0_7) { - const device_config *subcpu = devtag_get_device(space->machine, "subcpu"); + running_device *subcpu = devtag_get_device(space->machine, "subcpu"); cpu_set_input_line(subcpu, INPUT_LINE_RESET, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE); cpu_set_input_line(subcpu, INPUT_LINE_HALT, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); @@ -468,7 +468,7 @@ INPUT_PORTS_END * *************************************/ -static void skimaxx_tms_irq(const device_config *device, int state) +static void skimaxx_tms_irq(running_device *device, int state) { // TODO } diff --git a/src/mame/drivers/skullxbo.c b/src/mame/drivers/skullxbo.c index 477a2ac63a5..d16911d9916 100644 --- a/src/mame/drivers/skullxbo.c +++ b/src/mame/drivers/skullxbo.c @@ -45,7 +45,7 @@ static TIMER_CALLBACK( irq_gen ) } -static void alpha_row_update(const device_config *screen, int scanline) +static void alpha_row_update(running_device *screen, int scanline) { skullxbo_state *state = (skullxbo_state *)screen->machine->driver_data; UINT16 *check = &state->atarigen.alpha[(scanline / 8) * 64 + 42]; diff --git a/src/mame/drivers/skydiver.c b/src/mame/drivers/skydiver.c index a7f4b8f3b3e..92e3ec31326 100644 --- a/src/mame/drivers/skydiver.c +++ b/src/mame/drivers/skydiver.c @@ -147,7 +147,7 @@ static WRITE8_HANDLER( skydiver_nmion_w ) static INTERRUPT_GEN( skydiver_interrupt ) { - const device_config *discrete = devtag_get_device(device->machine, "discrete"); + running_device *discrete = devtag_get_device(device->machine, "discrete"); /* Convert range data to divide value and write to sound */ discrete_sound_w(discrete, SKYDIVER_RANGE_DATA, (0x01 << (~skydiver_videoram[0x394] & 0x07)) & 0xff); // Range 0-2 diff --git a/src/mame/drivers/slapshot.c b/src/mame/drivers/slapshot.c index d08f625e90d..43f17999092 100644 --- a/src/mame/drivers/slapshot.c +++ b/src/mame/drivers/slapshot.c @@ -466,7 +466,7 @@ GFXDECODE_END **************************************************************/ /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { slapshot_state *state = (slapshot_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/slotcarn.c b/src/mame/drivers/slotcarn.c index 39f93b1c3dd..f109c918dbd 100644 --- a/src/mame/drivers/slotcarn.c +++ b/src/mame/drivers/slotcarn.c @@ -525,7 +525,7 @@ GFXDECODE_END static VIDEO_UPDATE( slotcarn ) { - const device_config *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/drivers/snk.c b/src/mame/drivers/snk.c index 01e63b523a0..51e0ad7c05e 100644 --- a/src/mame/drivers/snk.c +++ b/src/mame/drivers/snk.c @@ -447,13 +447,13 @@ static TIMER_CALLBACK( sndirq_update_callback ) -static void ymirq_callback_1(const device_config *device, int irq) +static void ymirq_callback_1(running_device *device, int irq) { if (irq) timer_call_after_resynch(device->machine, NULL, YM1IRQ_ASSERT, sndirq_update_callback); } -static void ymirq_callback_2(const device_config *device, int irq) +static void ymirq_callback_2(running_device *device, int irq) { if (irq) timer_call_after_resynch(device->machine, NULL, YM2IRQ_ASSERT, sndirq_update_callback); diff --git a/src/mame/drivers/snk68.c b/src/mame/drivers/snk68.c index 36173d533b1..91f08446984 100644 --- a/src/mame/drivers/snk68.c +++ b/src/mame/drivers/snk68.c @@ -585,7 +585,7 @@ GFXDECODE_END /******************************************************************************/ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c index a5101a40465..138fc8ded82 100644 --- a/src/mame/drivers/snowbros.c +++ b/src/mame/drivers/snowbros.c @@ -82,7 +82,7 @@ static WRITE16_HANDLER( snowbros_flipscreen_w ) static VIDEO_UPDATE( snowbros ) { - const device_config *pandora = devtag_get_device(screen->machine, "pandora"); + running_device *pandora = devtag_get_device(screen->machine, "pandora"); /* This clears & redraws the entire screen each pass */ bitmap_fill(bitmap,cliprect,0xf0); @@ -93,7 +93,7 @@ static VIDEO_UPDATE( snowbros ) static VIDEO_EOF( snowbros ) { - const device_config *pandora = devtag_get_device(machine, "pandora"); + running_device *pandora = devtag_get_device(machine, "pandora"); pandora_eof(pandora); } @@ -124,7 +124,7 @@ static INTERRUPT_GEN( snowbros_interrupt ) static INTERRUPT_GEN( snowbro3_interrupt ) { - const device_config *adpcm = devtag_get_device(device->machine, "oki"); + running_device *adpcm = devtag_get_device(device->machine, "oki"); int status = okim6295_r(adpcm,0); cpu_set_input_line(device, cpu_getiloops(device) + 2, ASSERT_LINE); /* IRQs 4, 3, and 2 */ @@ -426,7 +426,7 @@ static void sb3_play_music(running_machine *machine, int data) } } -static void sb3_play_sound (const device_config *device, int data) +static void sb3_play_sound (running_device *device, int data) { int status = okim6295_r(device,0); @@ -1474,7 +1474,7 @@ static GFXDECODE_START( hyperpac ) GFXDECODE_END /* handler called by the 3812/2151 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "soundcpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/sothello.c b/src/mame/drivers/sothello.c index cb530d4b999..cd3e564d53e 100644 --- a/src/mame/drivers/sothello.c +++ b/src/mame/drivers/sothello.c @@ -290,7 +290,7 @@ static INPUT_PORTS_START( sothello ) INPUT_PORTS_END -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "sub", 0, irq ? ASSERT_LINE : CLEAR_LINE); } @@ -305,7 +305,7 @@ static INTERRUPT_GEN( sothello_interrupt ) v9938_interrupt(device->machine, 0); } -static void adpcm_int(const device_config *device) +static void adpcm_int(running_device *device) { /* only 4 bits are used */ msm5205_data_w( device, msm_data & 0x0f ); diff --git a/src/mame/drivers/spbactn.c b/src/mame/drivers/spbactn.c index 5fc0101dd00..99364ce07a9 100644 --- a/src/mame/drivers/spbactn.c +++ b/src/mame/drivers/spbactn.c @@ -325,7 +325,7 @@ static GFXDECODE_START( spbactn ) GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x0000, 16 + 384 ) GFXDECODE_END -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 0, linestate); } diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c index a11f199b5b5..04c17592f7b 100644 --- a/src/mame/drivers/spdodgeb.c +++ b/src/mame/drivers/spdodgeb.c @@ -61,7 +61,7 @@ static WRITE8_HANDLER( sound_command_w ) static WRITE8_HANDLER( spd_adpcm_w ) { int chip = offset & 1; - const device_config *adpcm = devtag_get_device(space->machine, (chip == 0) ? "msm1" : "msm2"); + running_device *adpcm = devtag_get_device(space->machine, (chip == 0) ? "msm1" : "msm2"); switch (offset/2) { @@ -85,7 +85,7 @@ static WRITE8_HANDLER( spd_adpcm_w ) } } -static void spd_adpcm_int(const device_config *device) +static void spd_adpcm_int(running_device *device) { int chip = (strcmp(device->tag, "msm1") == 0) ? 0 : 1; if (adpcm_pos[chip] >= adpcm_end[chip] || adpcm_pos[chip] >= 0x10000) @@ -400,7 +400,7 @@ static GFXDECODE_START( spdodgeb ) GFXDECODE_END -static void irq_handler(const device_config *device, int irq) +static void irq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/spiders.c b/src/mame/drivers/spiders.c index fd4187085d8..45f28d108fd 100644 --- a/src/mame/drivers/spiders.c +++ b/src/mame/drivers/spiders.c @@ -231,9 +231,9 @@ static READ8_DEVICE_HANDLER( gfx_rom_r ); static WRITE_LINE_DEVICE_HANDLER( main_cpu_irq ) { - const device_config *pia1 = devtag_get_device(device->machine, "pia1"); - const device_config *pia2 = devtag_get_device(device->machine, "pia2"); - const device_config *pia3 = devtag_get_device(device->machine, "pia3"); + running_device *pia1 = devtag_get_device(device->machine, "pia1"); + running_device *pia2 = devtag_get_device(device->machine, "pia2"); + running_device *pia3 = devtag_get_device(device->machine, "pia3"); int combined_state = pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1) | pia6821_get_irq_b(pia2) | pia6821_get_irq_a(pia3) | pia6821_get_irq_b(pia3); @@ -279,7 +279,7 @@ static const pia6821_interface pia_1_intf = static INTERRUPT_GEN( update_pia_1 ) { - const device_config *pia1 = devtag_get_device(device->machine, "pia1"); + running_device *pia1 = devtag_get_device(device->machine, "pia1"); /* update the different PIA pins from the input ports */ /* CA1 - copy of PA1 (COIN1) */ @@ -382,7 +382,7 @@ static const pia6821_interface pia_4_intf = static WRITE8_DEVICE_HANDLER( ic60_74123_output_changed) { - const device_config *pia2 = devtag_get_device(device->machine, "pia2"); + running_device *pia2 = devtag_get_device(device->machine, "pia2"); pia6821_ca1_w(pia2, 0, data); } @@ -530,7 +530,7 @@ static const mc6845_interface mc6845_intf = static VIDEO_UPDATE( spiders ) { - const device_config *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/drivers/splash.c b/src/mame/drivers/splash.c index dc0ce6e21d8..febadfa7cb3 100644 --- a/src/mame/drivers/splash.c +++ b/src/mame/drivers/splash.c @@ -127,7 +127,7 @@ static WRITE8_HANDLER( splash_adpcm_data_w ) adpcm_data = data; } -static void splash_msm5205_int(const device_config *device) +static void splash_msm5205_int(running_device *device) { msm5205_data_w(device,adpcm_data >> 4); adpcm_data = (adpcm_data << 4) & 0xf0; @@ -429,7 +429,7 @@ static MACHINE_DRIVER_START( splash ) MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) MACHINE_DRIVER_END -static void ym_irq(const device_config *device, int state) +static void ym_irq(running_device *device, int state) { logerror("2203 IRQ: %d\n", state); } diff --git a/src/mame/drivers/sprint2.c b/src/mame/drivers/sprint2.c index e2aa50f9261..3be74f54c37 100644 --- a/src/mame/drivers/sprint2.c +++ b/src/mame/drivers/sprint2.c @@ -71,7 +71,7 @@ static int service_mode(running_machine *machine) static INTERRUPT_GEN( sprint2 ) { - const device_config *discrete = devtag_get_device(device->machine, "discrete"); + running_device *discrete = devtag_get_device(device->machine, "discrete"); static UINT8 dial[2]; /* handle steering wheels */ diff --git a/src/mame/drivers/spy.c b/src/mame/drivers/spy.c index 8680f858c2b..f37cd5a4102 100644 --- a/src/mame/drivers/spy.c +++ b/src/mame/drivers/spy.c @@ -466,7 +466,7 @@ INPUT_PORTS_END -static void volume_callback( const device_config *device, int v ) +static void volume_callback( running_device *device, int v ) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); @@ -478,7 +478,7 @@ static const k007232_interface spy_k007232_interface = }; -static void irqhandler( const device_config *device, int linestate ) +static void irqhandler( running_device *device, int linestate ) { spy_state *state = (spy_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, linestate); diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c index b84e986aace..50ca8821933 100644 --- a/src/mame/drivers/srmp2.c +++ b/src/mame/drivers/srmp2.c @@ -220,7 +220,7 @@ static WRITE8_DEVICE_HANDLER( srmp3_adpcm_code_w ) } -static void srmp2_adpcm_int(const device_config *device) +static void srmp2_adpcm_int(running_device *device) { srmp2_state *state = (srmp2_state *)device->machine->driver_data; UINT8 *ROM = memory_region(device->machine, "adpcm"); diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c index 73801e9a6ef..40bf2c49558 100644 --- a/src/mame/drivers/sshangha.c +++ b/src/mame/drivers/sshangha.c @@ -338,7 +338,7 @@ GFXDECODE_END /******************************************************************************/ -static void irqhandler(const device_config *device, int state) +static void irqhandler(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 0, state); } diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c index 5f530ef164b..588b8b83fd6 100644 --- a/src/mame/drivers/ssingles.c +++ b/src/mame/drivers/ssingles.c @@ -244,7 +244,7 @@ static VIDEO_START(ssingles) static VIDEO_UPDATE( ssingles ) { - const device_config *mc6845 = devtag_get_device(screen->machine, "crtc"); + running_device *mc6845 = devtag_get_device(screen->machine, "crtc"); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/drivers/sslam.c b/src/mame/drivers/sslam.c index 4a102a0a9cf..a18e6a055e2 100644 --- a/src/mame/drivers/sslam.c +++ b/src/mame/drivers/sslam.c @@ -219,7 +219,7 @@ static TIMER_CALLBACK( music_playback ) { sslam_state *state = (sslam_state *)machine->driver_data; int pattern = 0; - const device_config *device = devtag_get_device(machine, "oki"); + running_device *device = devtag_get_device(machine, "oki"); if ((okim6295_r(device,0) & 0x08) == 0) { @@ -255,7 +255,7 @@ static TIMER_CALLBACK( music_playback ) } -static void sslam_play(const device_config *device, int track, int data) +static void sslam_play(running_device *device, int track, int data) { sslam_state *state = (sslam_state *)device->machine->driver_data; int status = okim6295_r(device,0); diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c index 2d0aea8c9ea..36050ac4bbf 100644 --- a/src/mame/drivers/ssv.c +++ b/src/mame/drivers/ssv.c @@ -766,7 +766,7 @@ static WRITE16_HANDLER( srmp7_sound_bank_w ) { if (ACCESSING_BITS_0_7) { - const device_config *device = devtag_get_device(space->machine, "ensoniq"); + running_device *device = devtag_get_device(space->machine, "ensoniq"); int bank = 0x400000/2 * (data & 1); // UINT16 address int voice; for (voice = 0; voice < 32; voice++) diff --git a/src/mame/drivers/stadhero.c b/src/mame/drivers/stadhero.c index 3dab93bf2bf..67ea379c4d1 100644 --- a/src/mame/drivers/stadhero.c +++ b/src/mame/drivers/stadhero.c @@ -207,7 +207,7 @@ GFXDECODE_END /******************************************************************************/ -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 0, linestate); } diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c index 230c96847cf..3dd3e162791 100644 --- a/src/mame/drivers/stv.c +++ b/src/mame/drivers/stv.c @@ -498,7 +498,7 @@ static void stv_SMPC_w8 (const address_space *space, int offset, UINT8 data) if(offset == 0x75) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); eeprom_set_clock_line(device, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(device, data & 0x10); eeprom_set_cs_line(device, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); @@ -2494,7 +2494,7 @@ static const sh2_cpu_core sh2_conf_slave = { 1, NULL }; static int scsp_last_line = 0; -static void scsp_irq(const device_config *device, int irq) +static void scsp_irq(running_device *device, int irq) { // don't bother the 68k if it's off if (!en_68k) @@ -2575,7 +2575,7 @@ SCU register[40] is for IRQ masking. /* to do, update bios idle skips so they work better with this arrangement.. */ -static const device_config *vblank_out_timer,*scan_timer,*t1_timer; +static running_device *vblank_out_timer,*scan_timer,*t1_timer; static int h_sync,v_sync; static int cur_scan; diff --git a/src/mame/drivers/suna16.c b/src/mame/drivers/suna16.c index 09f771e2398..c57252ebc04 100644 --- a/src/mame/drivers/suna16.c +++ b/src/mame/drivers/suna16.c @@ -920,7 +920,7 @@ MACHINE_DRIVER_END Best Of Best ***************************************************************************/ -static void bestbest_ym3526_irqhandler(const device_config *device, int state) +static void bestbest_ym3526_irqhandler(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_IRQ0, state); } diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c index 91efbc9514f..247b931c015 100644 --- a/src/mame/drivers/suna8.c +++ b/src/mame/drivers/suna8.c @@ -1434,7 +1434,7 @@ GFXDECODE_END ***************************************************************************/ -static void soundirq(const device_config *device, int state) +static void soundirq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 0, state); } diff --git a/src/mame/drivers/supbtime.c b/src/mame/drivers/supbtime.c index b458ebe7b76..66a1198e0b8 100644 --- a/src/mame/drivers/supbtime.c +++ b/src/mame/drivers/supbtime.c @@ -309,7 +309,7 @@ GFXDECODE_END /******************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } diff --git a/src/mame/drivers/superchs.c b/src/mame/drivers/superchs.c index e5f1e4fd8b5..92ef0b3c7d0 100644 --- a/src/mame/drivers/superchs.c +++ b/src/mame/drivers/superchs.c @@ -150,7 +150,7 @@ static WRITE32_HANDLER( superchs_input_w ) if (ACCESSING_BITS_0_7) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(device, data & 0x40); eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/drivers/superdq.c b/src/mame/drivers/superdq.c index 7507a5ad5c0..e385acb883c 100644 --- a/src/mame/drivers/superdq.c +++ b/src/mame/drivers/superdq.c @@ -27,7 +27,7 @@ #include "machine/laserdsc.h" #include "video/resnet.h" -static const device_config *laserdisc; +static running_device *laserdisc; static UINT8 superdq_ld_in_latch; static UINT8 superdq_ld_out_latch; diff --git a/src/mame/drivers/superqix.c b/src/mame/drivers/superqix.c index 72cd2ad2291..97c674a2c5b 100644 --- a/src/mame/drivers/superqix.c +++ b/src/mame/drivers/superqix.c @@ -147,7 +147,7 @@ static SAMPLES_START( pbillian_sh_start ) static WRITE8_HANDLER( pbillian_sample_trigger_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); int start,end; start = data << 7; diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c index 4a4690e9865..30c32cd88f3 100644 --- a/src/mame/drivers/suprgolf.c +++ b/src/mame/drivers/suprgolf.c @@ -384,7 +384,7 @@ static WRITE8_DEVICE_HANDLER( suprgolf_writeB ) mame_printf_debug("ymwA\n"); } -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { //cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); } @@ -402,7 +402,7 @@ static const ym2203_interface ym2203_config = irqhandler }; -static void adpcm_int(const device_config *device) +static void adpcm_int(running_device *device) { static int toggle = 0; diff --git a/src/mame/drivers/suprslam.c b/src/mame/drivers/suprslam.c index 1a1c3e90993..d38f6a1cfe1 100644 --- a/src/mame/drivers/suprslam.c +++ b/src/mame/drivers/suprslam.c @@ -278,7 +278,7 @@ GFXDECODE_END /*** MORE SOUND **************************************************************/ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { suprslam_state *state = (suprslam_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/surpratk.c b/src/mame/drivers/surpratk.c index ed0ba833344..535851d5b44 100644 --- a/src/mame/drivers/surpratk.c +++ b/src/mame/drivers/surpratk.c @@ -168,7 +168,7 @@ INPUT_PORTS_END -static void irqhandler( const device_config *device, int linestate ) +static void irqhandler( running_device *device, int linestate ) { surpratk_state *state = (surpratk_state *)device->machine->driver_data; cpu_set_input_line(state->maincpu, KONAMI_FIRQ_LINE, linestate); diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c index ad333456772..4d7335a1346 100644 --- a/src/mame/drivers/system1.c +++ b/src/mame/drivers/system1.c @@ -409,7 +409,7 @@ static void bank0c_custom_w(running_machine *machine, UINT8 data, UINT8 prevdata static WRITE8_HANDLER( videomode_w ) { - const device_config *i8751 = devtag_get_device(space->machine, "mcu"); + running_device *i8751 = devtag_get_device(space->machine, "mcu"); /* bit 6 is connected to the 8751 IRQ */ if (i8751 != NULL) @@ -484,8 +484,8 @@ static WRITE8_DEVICE_HANDLER( sound_control_w ) static READ8_HANDLER( sound_data_r ) { - const device_config *ppi = devtag_get_device(space->machine, "ppi"); - const device_config *pio = devtag_get_device(space->machine, "pio"); + running_device *ppi = devtag_get_device(space->machine, "ppi"); + running_device *pio = devtag_get_device(space->machine, "pio"); /* if we have an 8255 PPI, get the data from the port and toggle the ack */ if (ppi != NULL) @@ -608,7 +608,7 @@ static TIMER_DEVICE_CALLBACK( mcu_t0_callback ) enough, the MCU will fail; on shtngmst this happens after 3 VBLANKs without a tick */ - const device_config *mcu = devtag_get_device(timer->machine, "mcu"); + running_device *mcu = devtag_get_device(timer->machine, "mcu"); cpu_set_input_line(mcu, MCS51_T0_LINE, ASSERT_LINE); cpu_set_input_line(mcu, MCS51_T0_LINE, CLEAR_LINE); } diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c index 3eb4334844d..cdd92c57b52 100644 --- a/src/mame/drivers/system16.c +++ b/src/mame/drivers/system16.c @@ -157,7 +157,7 @@ static WRITE8_HANDLER( tturfbl_msm5205_data_w ) sample_buffer = data; } -static void tturfbl_msm5205_callback(const device_config *device) +static void tturfbl_msm5205_callback(running_device *device) { msm5205_data_w(device, (sample_buffer >> 4) & 0x0F); sample_buffer <<= 4; @@ -2716,7 +2716,7 @@ static WRITE8_HANDLER( shdancbl_msm5205_data_w ) sample_buffer = data; } -static void shdancbl_msm5205_callback(const device_config *device) +static void shdancbl_msm5205_callback(running_device *device) { msm5205_data_w(device, sample_buffer & 0x0F); sample_buffer >>= 4; diff --git a/src/mame/drivers/tail2nos.c b/src/mame/drivers/tail2nos.c index 8d2310993a1..3bda3739a04 100644 --- a/src/mame/drivers/tail2nos.c +++ b/src/mame/drivers/tail2nos.c @@ -178,7 +178,7 @@ GFXDECODE_END -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { tail2nos_state *state = (tail2nos_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/taito_b.c b/src/mame/drivers/taito_b.c index 8caf1c53e09..5d41d18b959 100644 --- a/src/mame/drivers/taito_b.c +++ b/src/mame/drivers/taito_b.c @@ -2089,7 +2089,7 @@ GFXDECODE_END /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { taitob_state *state = (taitob_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c index 198229dbcc0..1652f520a99 100644 --- a/src/mame/drivers/taito_f2.c +++ b/src/mame/drivers/taito_f2.c @@ -3167,7 +3167,7 @@ GFXDECODE_END /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irq_handler( const device_config *device, int irq ) +static void irq_handler( running_device *device, int irq ) { taitof2_state *state = (taitof2_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c index 03bc1172234..5329a1dd12b 100644 --- a/src/mame/drivers/taito_f3.c +++ b/src/mame/drivers/taito_f3.c @@ -3669,7 +3669,7 @@ static WRITE32_DEVICE_HANDLER( bubsympb_oki_w ) static DRIVER_INIT( bubsympb ) { - const device_config *oki = devtag_get_device(machine, "oki"); + running_device *oki = devtag_get_device(machine, "oki"); f3_game=BUBSYMPH; //tile_decode(machine); diff --git a/src/mame/drivers/taito_h.c b/src/mame/drivers/taito_h.c index 593a0608c07..0c627de0cd1 100644 --- a/src/mame/drivers/taito_h.c +++ b/src/mame/drivers/taito_h.c @@ -156,7 +156,7 @@ some kind of zoom table? ***************************************************************************/ /* Handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { taitoh_state *state = (taitoh_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/taito_l.c b/src/mame/drivers/taito_l.c index 05fc2b969b5..6d138e61ad7 100644 --- a/src/mame/drivers/taito_l.c +++ b/src/mame/drivers/taito_l.c @@ -614,7 +614,7 @@ static WRITE8_HANDLER( mux_ctrl_w ) } -static void champwr_msm5205_vck( const device_config *device ) +static void champwr_msm5205_vck( running_device *device ) { taitol_state *state = (taitol_state *)device->machine->driver_data; @@ -1940,7 +1940,7 @@ GFXDECODE_END -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { taitol_state *state = (taitol_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/taito_x.c b/src/mame/drivers/taito_x.c index 20c13f20845..80935f953f4 100644 --- a/src/mame/drivers/taito_x.c +++ b/src/mame/drivers/taito_x.c @@ -870,7 +870,7 @@ GFXDECODE_END /**************************************************************************/ /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c index 4eaaf22418f..62e1f3dc912 100644 --- a/src/mame/drivers/taito_z.c +++ b/src/mame/drivers/taito_z.c @@ -2751,14 +2751,14 @@ Interface B is for games which lack a Z80 (Spacegun, Bshark). **************************************************************/ /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { taitoz_state *state = (taitoz_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); } /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irqhandlerb(const device_config *device, int irq) +static void irqhandlerb(running_device *device, int irq) { // DG: this is probably specific to Z80 and wrong? // taitoz_state *state = (taitoz_state *)device->machine->driver_data; diff --git a/src/mame/drivers/taitoair.c b/src/mame/drivers/taitoair.c index 59c7f7b0743..19eade771a8 100644 --- a/src/mame/drivers/taitoair.c +++ b/src/mame/drivers/taitoair.c @@ -569,7 +569,7 @@ GFXDECODE_END ************************************************************/ /* Handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { taitoair_state *state = (taitoair_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/taitogn.c b/src/mame/drivers/taitogn.c index db6b798fc6f..8660ce41962 100644 --- a/src/mame/drivers/taitogn.c +++ b/src/mame/drivers/taitogn.c @@ -548,7 +548,7 @@ static WRITE32_HANDLER(control_w) // selection too, but they're always 0. UINT32 p = control; - const device_config *mb3773 = devtag_get_device(space->machine, "mb3773"); + running_device *mb3773 = devtag_get_device(space->machine, "mb3773"); COMBINE_DATA(&control); @@ -900,7 +900,7 @@ static ADDRESS_MAP_START( zn_map, ADDRESS_SPACE_PROGRAM, 32 ) ADDRESS_MAP_END -static void psx_spu_irq(const device_config *device, UINT32 data) +static void psx_spu_irq(running_device *device, UINT32 data) { psx_irq_set(device->machine, data); } diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c index 238880a2f7c..30aee19450c 100644 --- a/src/mame/drivers/taitowlf.c +++ b/src/mame/drivers/taitowlf.c @@ -17,17 +17,17 @@ #include "machine/pckeybrd.h" #include "machine/idectrl.h" -static void ide_interrupt(const device_config *device, int state); +static void ide_interrupt(running_device *device, int state); static UINT32 *cga_ram; static UINT32 *bios_ram; static struct { - const device_config *pit8254; - const device_config *pic8259_1; - const device_config *pic8259_2; - const device_config *dma8237_1; - const device_config *dma8237_2; + running_device *pit8254; + running_device *pic8259_1; + running_device *pic8259_2; + running_device *dma8237_1; + running_device *dma8237_2; } taitowlf_devices; @@ -120,14 +120,14 @@ static WRITE32_DEVICE_HANDLER(at32_dma8237_2_w) // Intel 82439TX System Controller (MXTC) static UINT8 mxtc_config_reg[256]; -static UINT8 mxtc_config_r(const device_config *busdevice, const device_config *device, int function, int reg) +static UINT8 mxtc_config_r(running_device *busdevice, running_device *device, int function, int reg) { // mame_printf_debug("MXTC: read %d, %02X\n", function, reg); return mxtc_config_reg[reg]; } -static void mxtc_config_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT8 data) +static void mxtc_config_w(running_device *busdevice, running_device *device, int function, int reg, UINT8 data) { // mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", cpuexec_describe_context(machine), function, reg, data); @@ -160,7 +160,7 @@ static void intel82439tx_init(void) mxtc_config_reg[0x65] = 0x02; } -static UINT32 intel82439tx_pci_r(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 mem_mask) +static UINT32 intel82439tx_pci_r(running_device *busdevice, running_device *device, int function, int reg, UINT32 mem_mask) { UINT32 r = 0; if (ACCESSING_BITS_24_31) @@ -182,7 +182,7 @@ static UINT32 intel82439tx_pci_r(const device_config *busdevice, const device_co return r; } -static void intel82439tx_pci_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82439tx_pci_w(running_device *busdevice, running_device *device, int function, int reg, UINT32 data, UINT32 mem_mask) { if (ACCESSING_BITS_24_31) { @@ -205,19 +205,19 @@ static void intel82439tx_pci_w(const device_config *busdevice, const device_conf // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) static UINT8 piix4_config_reg[4][256]; -static UINT8 piix4_config_r(const device_config *busdevice, const device_config *device, int function, int reg) +static UINT8 piix4_config_r(running_device *busdevice, running_device *device, int function, int reg) { // mame_printf_debug("PIIX4: read %d, %02X\n", function, reg); return piix4_config_reg[function][reg]; } -static void piix4_config_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT8 data) +static void piix4_config_w(running_device *busdevice, running_device *device, int function, int reg, UINT8 data) { // mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", cpuexec_describe_context(machine), function, reg, data); piix4_config_reg[function][reg] = data; } -static UINT32 intel82371ab_pci_r(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 mem_mask) +static UINT32 intel82371ab_pci_r(running_device *busdevice, running_device *device, int function, int reg, UINT32 mem_mask) { UINT32 r = 0; if (ACCESSING_BITS_24_31) @@ -239,7 +239,7 @@ static UINT32 intel82371ab_pci_r(const device_config *busdevice, const device_co return r; } -static void intel82371ab_pci_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void intel82371ab_pci_w(running_device *busdevice, running_device *device, int function, int reg, UINT32 data, UINT32 mem_mask) { if (ACCESSING_BITS_24_31) { @@ -659,7 +659,7 @@ static void keyboard_interrupt(running_machine *machine, int state) pic8259_set_irq_line(taitowlf_devices.pic8259_1, 1, state); } -static void ide_interrupt(const device_config *device, int state) +static void ide_interrupt(running_device *device, int state) { pic8259_set_irq_line(taitowlf_devices.pic8259_2, 6, state); } diff --git a/src/mame/drivers/tankbatt.c b/src/mame/drivers/tankbatt.c index 5080219500f..dcaa90835c4 100644 --- a/src/mame/drivers/tankbatt.c +++ b/src/mame/drivers/tankbatt.c @@ -121,14 +121,14 @@ static WRITE8_HANDLER( tankbatt_sh_expl_w ) { if (tankbatt_sound_enable) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); sample_start (samples, 1, 3, 0); } } static WRITE8_HANDLER( tankbatt_sh_engine_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); if (tankbatt_sound_enable) { if (data) @@ -143,7 +143,7 @@ static WRITE8_HANDLER( tankbatt_sh_fire_w ) { if (tankbatt_sound_enable) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); sample_start (samples, 0, 0, 0); } } diff --git a/src/mame/drivers/taotaido.c b/src/mame/drivers/taotaido.c index e5b200b5073..af333ca3100 100644 --- a/src/mame/drivers/taotaido.c +++ b/src/mame/drivers/taotaido.c @@ -320,7 +320,7 @@ static GFXDECODE_START( taotaido ) GFXDECODE_ENTRY( "gfx2", 0, taotaido_layout, 0x300, 256 ) /* bg tiles */ GFXDECODE_END -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/tatsumi.c b/src/mame/drivers/tatsumi.c index af2898d3799..583c6a4e478 100644 --- a/src/mame/drivers/tatsumi.c +++ b/src/mame/drivers/tatsumi.c @@ -826,7 +826,7 @@ GFXDECODE_END /******************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_IRQ0, state); } @@ -841,7 +841,7 @@ static INTERRUPT_GEN( roundup5_interrupt ) cpu_set_input_line_and_vector(device, 0, HOLD_LINE, 0xc8/4); /* VBL */ } -static void apache3_68000_reset(const device_config *device) +static void apache3_68000_reset(running_device *device) { cputag_set_input_line(device->machine, "sub2", INPUT_LINE_RESET, PULSE_LINE); } diff --git a/src/mame/drivers/tbowl.c b/src/mame/drivers/tbowl.c index f92cd2ac97e..59e4a3d62f2 100644 --- a/src/mame/drivers/tbowl.c +++ b/src/mame/drivers/tbowl.c @@ -163,7 +163,7 @@ ADDRESS_MAP_END static WRITE8_HANDLER( tbowl_adpcm_start_w ) { - const device_config *adpcm = devtag_get_device(space->machine, (offset & 1) ? "msm2" : "msm1"); + running_device *adpcm = devtag_get_device(space->machine, (offset & 1) ? "msm2" : "msm1"); adpcm_pos[offset & 1] = data << 8; msm5205_reset_w(adpcm,0); } @@ -175,11 +175,11 @@ static WRITE8_HANDLER( tbowl_adpcm_end_w ) static WRITE8_HANDLER( tbowl_adpcm_vol_w ) { - const device_config *adpcm = devtag_get_device(space->machine, (offset & 1) ? "msm2" : "msm1"); + running_device *adpcm = devtag_get_device(space->machine, (offset & 1) ? "msm2" : "msm1"); msm5205_set_volume(adpcm, (data & 0x7f) * 100 / 0x7f); } -static void tbowl_adpcm_int(const device_config *device) +static void tbowl_adpcm_int(running_device *device) { int num = (strcmp(device->tag, "msm1") == 0) ? 0 : 1; if (adpcm_pos[num] >= adpcm_end[num] || @@ -442,7 +442,7 @@ GFXDECODE_END */ -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 0, linestate); } diff --git a/src/mame/drivers/tecmo.c b/src/mame/drivers/tecmo.c index 0122a2f61cf..90e17c622d1 100644 --- a/src/mame/drivers/tecmo.c +++ b/src/mame/drivers/tecmo.c @@ -97,7 +97,7 @@ static WRITE8_DEVICE_HANDLER( tecmo_adpcm_vol_w ) { msm5205_set_volume(device,(data & 0x0f) * 100 / 15); } -static void tecmo_adpcm_int(const device_config *device) +static void tecmo_adpcm_int(running_device *device) { if (adpcm_pos >= adpcm_end || adpcm_pos >= memory_region_length(device->machine, "adpcm")) @@ -651,7 +651,7 @@ GFXDECODE_END -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "soundcpu", 0, linestate); } diff --git a/src/mame/drivers/tecmo16.c b/src/mame/drivers/tecmo16.c index f96106e224c..c67370395f7 100644 --- a/src/mame/drivers/tecmo16.c +++ b/src/mame/drivers/tecmo16.c @@ -386,7 +386,7 @@ GFXDECODE_END /******************************************************************************/ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/tecmosys.c b/src/mame/drivers/tecmosys.c index 3ab839ad37e..cfb7a6b6803 100644 --- a/src/mame/drivers/tecmosys.c +++ b/src/mame/drivers/tecmosys.c @@ -864,7 +864,7 @@ static VIDEO_UPDATE(deroon) */ -static void sound_irq(const device_config *device, int irq) +static void sound_irq(running_device *device, int irq) { /* IRQ */ cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/tehkanwc.c b/src/mame/drivers/tehkanwc.c index 010599d54a4..842ea650faa 100644 --- a/src/mame/drivers/tehkanwc.c +++ b/src/mame/drivers/tehkanwc.c @@ -208,7 +208,7 @@ static WRITE8_DEVICE_HANDLER( msm_reset_w ) msm5205_reset_w(device,data ? 0 : 1); } -static void tehkanwc_adpcm_int(const device_config *device) +static void tehkanwc_adpcm_int(running_device *device) { static int toggle; diff --git a/src/mame/drivers/thayers.c b/src/mame/drivers/thayers.c index 10caa35f54a..91b707eaca9 100644 --- a/src/mame/drivers/thayers.c +++ b/src/mame/drivers/thayers.c @@ -19,7 +19,7 @@ extern const char layout_dlair[]; -static const device_config *laserdisc; +static running_device *laserdisc; static UINT8 laserdisc_data; static int rx_bit; diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c index 257067e0fe4..84b6cfd8a8d 100644 --- a/src/mame/drivers/thedeep.c +++ b/src/mame/drivers/thedeep.c @@ -306,7 +306,7 @@ GFXDECODE_END ***************************************************************************/ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/thief.c b/src/mame/drivers/thief.c index 0578d71abda..3cdb19738e8 100644 --- a/src/mame/drivers/thief.c +++ b/src/mame/drivers/thief.c @@ -75,12 +75,12 @@ enum kTalkTrack, kCrashTrack }; -static void tape_set_audio( const device_config *samples, int track, int bOn ) +static void tape_set_audio( running_device *samples, int track, int bOn ) { sample_set_volume(samples, track, bOn ? 1.0 : 0.0 ); } -static void tape_set_motor( const device_config *samples, int bOn ) +static void tape_set_motor( running_device *samples, int bOn ) { if( bOn ) { diff --git a/src/mame/drivers/thunderx.c b/src/mame/drivers/thunderx.c index f1349897589..eb21a92e208 100644 --- a/src/mame/drivers/thunderx.c +++ b/src/mame/drivers/thunderx.c @@ -596,7 +596,7 @@ INPUT_PORTS_END ***************************************************************************/ -static void volume_callback(const device_config *device, int v) +static void volume_callback(running_device *device, int v) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); diff --git a/src/mame/drivers/tickee.c b/src/mame/drivers/tickee.c index cbf14a51217..583713d2f4e 100644 --- a/src/mame/drivers/tickee.c +++ b/src/mame/drivers/tickee.c @@ -128,7 +128,7 @@ static VIDEO_START( tickee ) * *************************************/ -static void scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *src = &tickee_vram[(params->rowaddr << 8) & 0x3ff00]; UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); @@ -153,7 +153,7 @@ static void scanline_update(const device_config *screen, bitmap_t *bitmap, int s } -static void rapidfir_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void rapidfir_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *src = &tickee_vram[(params->rowaddr << 8) & 0x3ff00]; UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); diff --git a/src/mame/drivers/tigeroad.c b/src/mame/drivers/tigeroad.c index f83899427e4..02bab580c72 100644 --- a/src/mame/drivers/tigeroad.c +++ b/src/mame/drivers/tigeroad.c @@ -499,7 +499,7 @@ GFXDECODE_END /* handler called by the 2203 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c index 7caf9978305..e7e0adc152e 100644 --- a/src/mame/drivers/tmaster.c +++ b/src/mame/drivers/tmaster.c @@ -117,7 +117,7 @@ To Do: static struct { - const device_config *duart68681; + running_device *duart68681; } tmaster_devices; /*************************************************************************** @@ -148,12 +148,12 @@ static WRITE16_DEVICE_HANDLER( tmaster_oki_bank_w ) ***************************************************************************/ -static void duart_irq_handler(const device_config *device, UINT8 vector) +static void duart_irq_handler(running_device *device, UINT8 vector) { cputag_set_input_line_and_vector(device->machine, "maincpu", 4, HOLD_LINE, vector); }; -static void duart_tx(const device_config *device, int channel, UINT8 data) +static void duart_tx(running_device *device, int channel, UINT8 data) { if ( channel == 0 ) { @@ -545,7 +545,7 @@ static const char *const galgames_eeprom_names[5] = { GALGAMES_EEPROM_BIOS, GALG static READ16_HANDLER( galgames_eeprom_r ) { - const device_config *eeprom = devtag_get_device(space->machine, galgames_eeprom_names[galgames_cart]); + running_device *eeprom = devtag_get_device(space->machine, galgames_eeprom_names[galgames_cart]); return eeprom_read_bit(eeprom) ? 0x80 : 0x00; } @@ -557,7 +557,7 @@ static WRITE16_HANDLER( galgames_eeprom_w ) if ( ACCESSING_BITS_0_7 ) { - const device_config *eeprom = devtag_get_device(space->machine, galgames_eeprom_names[galgames_cart]); + running_device *eeprom = devtag_get_device(space->machine, galgames_eeprom_names[galgames_cart]); // latch the bit eeprom_write_bit(eeprom, data & 0x0001); diff --git a/src/mame/drivers/tmmjprd.c b/src/mame/drivers/tmmjprd.c index 36185e7c07b..8c877cd7835 100644 --- a/src/mame/drivers/tmmjprd.c +++ b/src/mame/drivers/tmmjprd.c @@ -265,8 +265,8 @@ static void ttmjprd_draw_tilemap(running_machine *machine, bitmap_t *bitmap, con static VIDEO_UPDATE( tmmjprd ) { UINT8* gfxroms = memory_region(screen->machine,"gfx2"); - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); - const device_config *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine)); diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c index 3bb7ad30b01..264d07a9a47 100644 --- a/src/mame/drivers/tmnt.c +++ b/src/mame/drivers/tmnt.c @@ -2063,7 +2063,7 @@ static INPUT_PORTS_START( prmrsocr ) INPUT_PORTS_END -static void cuebrick_irq_handler( const device_config *device, int state ) +static void cuebrick_irq_handler( running_device *device, int state ) { tmnt_state *tmnt = (tmnt_state *)device->machine->driver_data; tmnt->cuebrick_snd_irqlatch = state; @@ -2074,7 +2074,7 @@ static const ym2151_interface ym2151_interface_cbj = cuebrick_irq_handler }; -static void volume_callback(const device_config *device, int v) +static void volume_callback(running_device *device, int v) { k007232_set_volume(device, 0, (v >> 4) * 0x11, 0); k007232_set_volume(device, 1, 0, (v & 0x0f) * 0x11); @@ -2640,7 +2640,7 @@ static MACHINE_DRIVER_START( glfgreat ) MACHINE_DRIVER_END -static void sound_nmi( const device_config *device ) +static void sound_nmi( running_device *device ) { tmnt_state *state = (tmnt_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); diff --git a/src/mame/drivers/tnzs.c b/src/mame/drivers/tnzs.c index f6f58f5ac83..428f8bfaae8 100644 --- a/src/mame/drivers/tnzs.c +++ b/src/mame/drivers/tnzs.c @@ -1552,7 +1552,7 @@ static const ym2203_interface ym2203_config = /* handler called by the 2203 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { tnzs_state *state = (tnzs_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/toaplan1.c b/src/mame/drivers/toaplan1.c index 223c0105897..af18a521333 100644 --- a/src/mame/drivers/toaplan1.c +++ b/src/mame/drivers/toaplan1.c @@ -1222,7 +1222,7 @@ static GFXDECODE_START( vm ) GFXDECODE_END -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 0, linestate); } diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c index e489f01596a..0ed03cb323b 100644 --- a/src/mame/drivers/toaplan2.c +++ b/src/mame/drivers/toaplan2.c @@ -301,13 +301,13 @@ static READ16_HANDLER( batsugun_share2_r ); static WRITE16_HANDLER( batsugun_share2_w ); #endif -static const device_config *sub_cpu = NULL; +static running_device *sub_cpu = NULL; /*************************************************************************** Initialisation handlers ***************************************************************************/ -static void toaplan2_reset(const device_config *device) +static void toaplan2_reset(running_device *device) { if (sub_cpu != NULL) cpu_set_input_line(sub_cpu, INPUT_LINE_RESET, PULSE_LINE); @@ -1087,7 +1087,7 @@ static WRITE8_HANDLER( bgaregga_bankswitch_w ) static WRITE8_HANDLER( raizing_okim6295_bankselect_0 ) { - const device_config *nmk112 = devtag_get_device(space->machine, "nmk112"); + running_device *nmk112 = devtag_get_device(space->machine, "nmk112"); nmk112_okibank_w(nmk112, 0, data & 0x0f); // chip 0 bank 0 nmk112_okibank_w(nmk112, 1, (data >> 4) & 0x0f); // chip 0 bank 1 @@ -1095,7 +1095,7 @@ static WRITE8_HANDLER( raizing_okim6295_bankselect_0 ) static WRITE8_HANDLER( raizing_okim6295_bankselect_1 ) { - const device_config *nmk112 = devtag_get_device(space->machine, "nmk112"); + running_device *nmk112 = devtag_get_device(space->machine, "nmk112"); nmk112_okibank_w(nmk112, 2, data & 0x0f); // chip 0 bank 2 nmk112_okibank_w(nmk112, 3, (data >> 4) & 0x0f); // chip 0 bank 3 @@ -1103,7 +1103,7 @@ static WRITE8_HANDLER( raizing_okim6295_bankselect_1 ) static WRITE8_HANDLER( raizing_okim6295_bankselect_2 ) { - const device_config *nmk112 = devtag_get_device(space->machine, "nmk112"); + running_device *nmk112 = devtag_get_device(space->machine, "nmk112"); nmk112_okibank_w(nmk112, 4, data & 0x0f); // chip 1 bank 0 nmk112_okibank_w(nmk112, 5, (data >> 4) & 0x0f); // chip 1 bank 1 @@ -1111,7 +1111,7 @@ static WRITE8_HANDLER( raizing_okim6295_bankselect_2 ) static WRITE8_HANDLER( raizing_okim6295_bankselect_3 ) { - const device_config *nmk112 = devtag_get_device(space->machine, "nmk112"); + running_device *nmk112 = devtag_get_device(space->machine, "nmk112"); nmk112_okibank_w(nmk112, 6, data & 0x0f); // chip 1 bank 2 nmk112_okibank_w(nmk112, 7, (data >> 4) & 0x0f); // chip 1 bank 3 @@ -1270,7 +1270,7 @@ static const eeprom_interface bbakraid_93C66_intf = static READ16_HANDLER( bbakraid_nvram_r ) { - const device_config *eeprom = devtag_get_device(space->machine, "eeprom"); + running_device *eeprom = devtag_get_device(space->machine, "eeprom"); /* Bit 1 returns the status of BUSAK from the Z80. BUSRQ is activated via bit 0x10 on the NVRAM write port. @@ -1298,7 +1298,7 @@ static WRITE16_HANDLER( bbakraid_nvram_w ) } -static void bbakraid_irqhandler(const device_config *device, int state) +static void bbakraid_irqhandler(running_device *device, int state) { /* Not used ??? Connected to a test pin (TP082) */ logerror("YMZ280 is generating an interrupt. State=%08x\n",state); @@ -3391,7 +3391,7 @@ static GFXDECODE_START( fixeighb ) GFXDECODE_ENTRY( "gfx2", 0, fixeighblayout , 0, 128 ) GFXDECODE_END -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { if (sub_cpu != NULL) // wouldn't tekipaki have problem without this? "mcu" is not generally added cpu_set_input_line(sub_cpu, 0, linestate); @@ -4013,7 +4013,7 @@ static MACHINE_RESET(batsugun) -static void batsugun_ym2151_irqhandler(const device_config *device, int linestate) +static void batsugun_ym2151_irqhandler(running_device *device, int linestate) { logerror("batsugun_ym2151_irqhandler %02x\n",linestate); // update_irq_lines(machine, linestate ? assert : clear); diff --git a/src/mame/drivers/toki.c b/src/mame/drivers/toki.c index 498ee6cab10..da06e67d839 100644 --- a/src/mame/drivers/toki.c +++ b/src/mame/drivers/toki.c @@ -71,7 +71,7 @@ static READ16_HANDLER( pip16_r ) static int msm5205next; -static void toki_adpcm_int (const device_config *device) +static void toki_adpcm_int (running_device *device) { static int toggle = 0; diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c index 7e1b71943f1..cacf22fad3f 100644 --- a/src/mame/drivers/topspeed.c +++ b/src/mame/drivers/topspeed.c @@ -406,7 +406,7 @@ static WRITE8_DEVICE_HANDLER( sound_bankswitch_w ) /* assumes Z80 sandwiched bet reset_sound_region(device->machine); } -static void topspeed_msm5205_vck( const device_config *device ) +static void topspeed_msm5205_vck( running_device *device ) { topspeed_state *state = (topspeed_state *)device->machine->driver_data; if (state->adpcm_data != -1) @@ -617,7 +617,7 @@ GFXDECODE_END /* handler called by the YM2151 emulator when the internal timers cause an IRQ */ -static void irq_handler( const device_config *device, int irq ) /* assumes Z80 sandwiched between 68Ks */ +static void irq_handler( running_device *device, int irq ) /* assumes Z80 sandwiched between 68Ks */ { topspeed_state *state = (topspeed_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/toratora.c b/src/mame/drivers/toratora.c index bb53bcd7d17..96c24891636 100644 --- a/src/mame/drivers/toratora.c +++ b/src/mame/drivers/toratora.c @@ -36,10 +36,10 @@ struct _toratora_state UINT8 clear_tv; /* devices */ - const device_config *maincpu; - const device_config *pia_u1; - const device_config *pia_u2; - const device_config *pia_u3; + running_device *maincpu; + running_device *pia_u1; + running_device *pia_u2; + running_device *pia_u3; }; diff --git a/src/mame/drivers/toypop.c b/src/mame/drivers/toypop.c index 1e6c30e008f..97c1558985a 100644 --- a/src/mame/drivers/toypop.c +++ b/src/mame/drivers/toypop.c @@ -95,9 +95,9 @@ static WRITE8_HANDLER( toypop_sound_interrupt_disable_w ) static TIMER_CALLBACK( namcoio_run ) { - const device_config *io58xx = devtag_get_device(machine, "58xx"); - const device_config *io56xx_1 = devtag_get_device(machine, "56xx_1"); - const device_config *io56xx_2 = devtag_get_device(machine, "56xx_2"); + running_device *io58xx = devtag_get_device(machine, "58xx"); + running_device *io56xx_1 = devtag_get_device(machine, "56xx_1"); + running_device *io56xx_2 = devtag_get_device(machine, "56xx_2"); switch (param) { @@ -115,9 +115,9 @@ static TIMER_CALLBACK( namcoio_run ) static INTERRUPT_GEN( toypop_main_interrupt ) { - const device_config *namcoio_0 = devtag_get_device(device->machine, "58xx"); - const device_config *namcoio_1 = devtag_get_device(device->machine, "56xx_1"); - const device_config *namcoio_2 = devtag_get_device(device->machine, "56xx_2"); + running_device *namcoio_0 = devtag_get_device(device->machine, "58xx"); + running_device *namcoio_1 = devtag_get_device(device->machine, "56xx_1"); + running_device *namcoio_2 = devtag_get_device(device->machine, "56xx_2"); irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); diff --git a/src/mame/drivers/trackfld.c b/src/mame/drivers/trackfld.c index 6aaa9996fb2..27a9657d7cd 100644 --- a/src/mame/drivers/trackfld.c +++ b/src/mame/drivers/trackfld.c @@ -678,7 +678,7 @@ static GFXDECODE_START( trackfld ) GFXDECODE_END -static void adpcm_vck_callback( const device_config *device ) +static void adpcm_vck_callback( running_device *device ) { trackfld_state *state = (trackfld_state *)device->machine->driver_data; state->hyprolyb_vck_ready = 0x80; diff --git a/src/mame/drivers/triplhnt.c b/src/mame/drivers/triplhnt.c index 5cc6c3cda2a..9003936d313 100644 --- a/src/mame/drivers/triplhnt.c +++ b/src/mame/drivers/triplhnt.c @@ -38,8 +38,8 @@ void triplhnt_set_collision(running_machine *machine, int code) static void triplhnt_update_misc(running_machine *machine, int offset) { - const device_config *samples = devtag_get_device(machine, "samples"); - const device_config *discrete = devtag_get_device(machine, "discrete"); + running_device *samples = devtag_get_device(machine, "samples"); + running_device *discrete = devtag_get_device(machine, "discrete"); UINT8 is_witch_hunt; UINT8 bit = offset >> 1; diff --git a/src/mame/drivers/trvquest.c b/src/mame/drivers/trvquest.c index 23dcf84fa80..3ec48032410 100644 --- a/src/mame/drivers/trvquest.c +++ b/src/mame/drivers/trvquest.c @@ -152,7 +152,7 @@ static TIMER_CALLBACK( via_irq_delayed ) cpu_set_input_line(state->maincpu, 0, param); } -static void via_irq( const device_config *device, int state ) +static void via_irq( running_device *device, int state ) { // from gameplan.c diff --git a/src/mame/drivers/tubep.c b/src/mame/drivers/tubep.c index f9af5264f88..53e910b2ed0 100644 --- a/src/mame/drivers/tubep.c +++ b/src/mame/drivers/tubep.c @@ -560,7 +560,7 @@ static WRITE8_DEVICE_HANDLER( rjammer_voice_frequency_select_w ) } -static void rjammer_adpcm_vck (const device_config *device) +static void rjammer_adpcm_vck (running_device *device) { ls74 = (ls74 + 1) & 1; diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c index e05ea7165aa..a6dfcf3e1ca 100644 --- a/src/mame/drivers/tumbleb.c +++ b/src/mame/drivers/tumbleb.c @@ -456,7 +456,7 @@ static int tumblep_music_command; static int tumblep_music_bank; static int tumbleb2_music_is_playing; -static void tumbleb2_playmusic(const device_config *device) +static void tumbleb2_playmusic(running_device *device) { int status = okim6295_r(device,0); @@ -504,7 +504,7 @@ static void tumbleb2_set_music_bank(running_machine *machine, int bank) memcpy(&oki[0x38000], &oki[0x80000+0x38000+0x8000*bank],0x8000); } -static void tumbleb2_play_sound (const device_config *device, int data) +static void tumbleb2_play_sound (running_device *device, int data) { int status = okim6295_r(device,0); @@ -537,7 +537,7 @@ static void tumbleb2_play_sound (const device_config *device, int data) // bank 7 = how to play? // bank 8 = boss??? -static void process_tumbleb2_music_command(const device_config *device, int data) +static void process_tumbleb2_music_command(running_device *device, int data) { int status = okim6295_r(device,0); @@ -2115,7 +2115,7 @@ MACHINE_DRIVER_END -static void semicom_irqhandler(const device_config *device, int irq) +static void semicom_irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } @@ -3280,7 +3280,7 @@ static DRIVER_INIT( tumblepb ) static DRIVER_INIT( tumbleb2 ) { - const device_config *oki = devtag_get_device(machine, "oki"); + running_device *oki = devtag_get_device(machine, "oki"); tumblepb_gfx1_rearrange(machine); diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c index 8204c3a15fa..21885d0265f 100644 --- a/src/mame/drivers/tumblep.c +++ b/src/mame/drivers/tumblep.c @@ -272,7 +272,7 @@ GFXDECODE_END /***************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } diff --git a/src/mame/drivers/twin16.c b/src/mame/drivers/twin16.c index ea0188d85a4..43b3c761d3d 100644 --- a/src/mame/drivers/twin16.c +++ b/src/mame/drivers/twin16.c @@ -670,7 +670,7 @@ GFXDECODE_END /* Sound Interfaces */ -static void volume_callback(const device_config *device, int v) +static void volume_callback(running_device *device, int v) { k007232_set_volume(device,0,(v >> 4) * 0x11,0); k007232_set_volume(device,1,0,(v & 0x0f) * 0x11); diff --git a/src/mame/drivers/twincobr.c b/src/mame/drivers/twincobr.c index 6c479678bec..34ade88652d 100644 --- a/src/mame/drivers/twincobr.c +++ b/src/mame/drivers/twincobr.c @@ -688,7 +688,7 @@ GFXDECODE_END /* handler called by the 3812 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 0, linestate); } diff --git a/src/mame/drivers/twinkle.c b/src/mame/drivers/twinkle.c index 4f8958a113e..f44d2978c94 100644 --- a/src/mame/drivers/twinkle.c +++ b/src/mame/drivers/twinkle.c @@ -668,7 +668,7 @@ ADDRESS_MAP_END /* SPU board */ -static void ide_interrupt(const device_config *device, int state) +static void ide_interrupt(running_device *device, int state) { if ((state) && (twinkle_spu_ctrl & 0x0400)) { @@ -890,7 +890,7 @@ static MACHINE_RESET( twinkle ) cdda_set_cdrom(devtag_get_device(machine, "cdda"), am53cf96_get_device(SCSI_ID_4)); } -static void spu_irq(const device_config *device, UINT32 data) +static void spu_irq(running_device *device, UINT32 data) { psx_irq_set(device->machine, data); } diff --git a/src/mame/drivers/ultrsprt.c b/src/mame/drivers/ultrsprt.c index aef76edbf9d..1b7a6502868 100644 --- a/src/mame/drivers/ultrsprt.c +++ b/src/mame/drivers/ultrsprt.c @@ -111,7 +111,7 @@ ADDRESS_MAP_END static READ16_HANDLER( K056800_68k_r ) { - const device_config *k056800 = devtag_get_device(space->machine, "k056800"); + running_device *k056800 = devtag_get_device(space->machine, "k056800"); UINT16 r = 0; if (ACCESSING_BITS_8_15) @@ -125,7 +125,7 @@ static READ16_HANDLER( K056800_68k_r ) static WRITE16_HANDLER( K056800_68k_w ) { - const device_config *k056800 = devtag_get_device(space->machine, "k056800"); + running_device *k056800 = devtag_get_device(space->machine, "k056800"); if (ACCESSING_BITS_8_15) k056800_sound_w(k056800, (offset*2)+0, (data >> 8) & 0xff, 0x00ff); diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c index 807e3e95e0a..0f8574d77c8 100644 --- a/src/mame/drivers/undrfire.c +++ b/src/mame/drivers/undrfire.c @@ -297,7 +297,7 @@ static WRITE32_HANDLER( undrfire_input_w ) if (ACCESSING_BITS_0_7) { - const device_config *device = devtag_get_device(space->machine, "eeprom"); + running_device *device = devtag_get_device(space->machine, "eeprom"); eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); eeprom_write_bit(device, data & 0x40); eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c index 353fd9cd0ba..596cd7ae0ef 100644 --- a/src/mame/drivers/vamphalf.c +++ b/src/mame/drivers/vamphalf.c @@ -339,7 +339,7 @@ or Offset+3 -------x xxxxxxxx X offs */ -static void draw_sprites(const device_config *screen, bitmap_t *bitmap) +static void draw_sprites(running_device *screen, bitmap_t *bitmap) { const gfx_element *gfx = screen->machine->gfx[0]; UINT32 cnt; @@ -412,7 +412,7 @@ static void draw_sprites(const device_config *screen, bitmap_t *bitmap) } } -static void draw_sprites_aoh(const device_config *screen, bitmap_t *bitmap) +static void draw_sprites_aoh(running_device *screen, bitmap_t *bitmap) { const gfx_element *gfx = screen->machine->gfx[0]; UINT32 cnt; diff --git a/src/mame/drivers/vaportra.c b/src/mame/drivers/vaportra.c index f58fa13a819..a128e8c8a7a 100644 --- a/src/mame/drivers/vaportra.c +++ b/src/mame/drivers/vaportra.c @@ -204,7 +204,7 @@ GFXDECODE_END /******************************************************************************/ -static void sound_irq(const device_config *device, int state) +static void sound_irq(running_device *device, int state) { cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } diff --git a/src/mame/drivers/vball.c b/src/mame/drivers/vball.c index 573000152bf..ad06fcab220 100644 --- a/src/mame/drivers/vball.c +++ b/src/mame/drivers/vball.c @@ -404,7 +404,7 @@ static GFXDECODE_START( vb ) GFXDECODE_END -static void vball_irq_handler(const device_config *device, int irq) +static void vball_irq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c index 3930e2a9a3e..08ef1c469ba 100644 --- a/src/mame/drivers/vcombat.c +++ b/src/mame/drivers/vcombat.c @@ -103,7 +103,7 @@ static VIDEO_UPDATE( vcombat ) { int y; const rgb_t *const pens = tlc34076_get_pens(); - const device_config *aux = devtag_get_device(screen->machine, "aux"); + running_device *aux = devtag_get_device(screen->machine, "aux"); UINT16 *m68k_buf = m68k_framebuffer[(*framebuffer_ctrl & 0x20) ? 1 : 0]; UINT16 *i860_buf = i860_framebuffer[(screen == aux) ? 1 : 0][0]; @@ -188,7 +188,7 @@ static READ16_HANDLER( control_3_r ) return (input_port_read(space->machine, "IN2") << 8); } -static void wiggle_i860_common(const device_config *device, UINT16 data) +static void wiggle_i860_common(running_device *device, UINT16 data) { int bus_hold = (data & 0x03) == 0x03; int reset = data & 0x10; @@ -286,7 +286,7 @@ static WRITE64_HANDLER( v1_fb_w ) static WRITE16_HANDLER( crtc_w ) { - const device_config *crtc = devtag_get_device(space->machine, "crtc"); + running_device *crtc = devtag_get_device(space->machine, "crtc"); if (crtc == NULL) return; diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c index ead5f53bd79..0986ca929fb 100644 --- a/src/mame/drivers/vegas.c +++ b/src/mame/drivers/vegas.c @@ -475,7 +475,7 @@ static UINT8 cmos_unlocked; static UINT32 *timekeeper_nvram; static size_t timekeeper_nvram_size; -static const device_config *voodoo_device; +static running_device *voodoo_device; static UINT8 dcs_idma_cs; static int dynamic_count; @@ -487,7 +487,7 @@ static struct dynamic_address write32_space_func mwrite; read32_device_func dread; write32_device_func dwrite; - const device_config *device; + running_device *device; const char * rdname; const char * wrname; } dynamic[MAX_DYNAMIC_ADDRESSES]; @@ -503,7 +503,7 @@ static struct dynamic_address static STATE_POSTLOAD( vegas_postload ); static TIMER_CALLBACK( nile_timer_callback ); -static void ide_interrupt(const device_config *device, int state); +static void ide_interrupt(running_device *device, int state); static void remap_dynamic_addresses(running_machine *machine); @@ -1246,7 +1246,7 @@ static WRITE32_HANDLER( nile_w ) * *************************************/ -static void ide_interrupt(const device_config *device, int state) +static void ide_interrupt(running_device *device, int state) { ide_irq_state = state; if (state) @@ -1274,7 +1274,7 @@ static void update_sio_irqs(running_machine *machine) } -static void vblank_assert(const device_config *device, int state) +static void vblank_assert(running_device *device, int state) { if (!vblank_state && state) { @@ -1301,7 +1301,7 @@ static void ioasic_irq(running_machine *machine, int state) } -static void ethernet_interrupt(const device_config *device, int state) +static void ethernet_interrupt(running_device *device, int state) { if (state) sio_irq_state |= 0x10; @@ -1534,7 +1534,7 @@ INLINE void _add_dynamic_address(offs_t start, offs_t end, read32_space_func rea dynamic_count++; } -INLINE void _add_dynamic_device_address(const device_config *device, offs_t start, offs_t end, read32_device_func read, write32_device_func write, const char *rdname, const char *wrname) +INLINE void _add_dynamic_device_address(running_device *device, offs_t start, offs_t end, read32_device_func read, write32_device_func write, const char *rdname, const char *wrname) { dynamic[dynamic_count].start = start; dynamic[dynamic_count].end = end; @@ -1551,8 +1551,8 @@ INLINE void _add_dynamic_device_address(const device_config *device, offs_t star static void remap_dynamic_addresses(running_machine *machine) { - const device_config *ethernet = devtag_get_device(machine, "ethernet"); - const device_config *ide = devtag_get_device(machine, "ide"); + running_device *ethernet = devtag_get_device(machine, "ethernet"); + running_device *ide = devtag_get_device(machine, "ide"); int voodoo_type = voodoo_get_type(voodoo_device); offs_t base; int addr; diff --git a/src/mame/drivers/videopin.c b/src/mame/drivers/videopin.c index 7c199295fea..0107e7f61dd 100644 --- a/src/mame/drivers/videopin.c +++ b/src/mame/drivers/videopin.c @@ -66,7 +66,7 @@ static TIMER_CALLBACK( interrupt_callback ) static MACHINE_RESET( videopin ) { - const device_config *discrete = devtag_get_device(machine, "discrete"); + running_device *discrete = devtag_get_device(machine, "discrete"); timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 32, 0), NULL, 32, interrupt_callback); diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c index 6d99981a6ec..bba16fbf501 100644 --- a/src/mame/drivers/viper.c +++ b/src/mame/drivers/viper.c @@ -49,7 +49,7 @@ DASM code snippets: static VIDEO_UPDATE(viper) { - const device_config *device = devtag_get_device(screen->machine, "voodoo"); + running_device *device = devtag_get_device(screen->machine, "voodoo"); return voodoo_update(device, bitmap, cliprect) ? 0 : UPDATE_HAS_NOT_CHANGED; } @@ -57,7 +57,7 @@ static VIDEO_UPDATE(viper) /*****************************************************************************/ static UINT32 mpc8240_regs[256/4]; -static UINT32 mpc8240_pci_r(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 mem_mask) +static UINT32 mpc8240_pci_r(running_device *busdevice, running_device *device, int function, int reg, UINT32 mem_mask) { #ifdef VIPER_DEBUG_LOG printf("MPC8240: PCI read %d, %02X, %08X\n", function, reg, mem_mask); @@ -70,7 +70,7 @@ static UINT32 mpc8240_pci_r(const device_config *busdevice, const device_config return mpc8240_regs[reg/4]; } -static void mpc8240_pci_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void mpc8240_pci_w(running_device *busdevice, running_device *device, int function, int reg, UINT32 data, UINT32 mem_mask) { #ifdef VIPER_DEBUG_LOG printf("MPC8240: PCI write %d, %02X, %08X, %08X\n", function, reg, data, mem_mask); @@ -428,7 +428,7 @@ static WRITE64_HANDLER(unk1b_w) } static UINT32 voodoo3_pci_reg[0x100]; -static UINT32 voodoo3_pci_r(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 mem_mask) +static UINT32 voodoo3_pci_r(running_device *busdevice, running_device *device, int function, int reg, UINT32 mem_mask) { switch (reg) { @@ -467,7 +467,7 @@ static UINT32 voodoo3_pci_r(const device_config *busdevice, const device_config return 0; } -static void voodoo3_pci_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT32 data, UINT32 mem_mask) +static void voodoo3_pci_w(running_device *busdevice, running_device *device, int function, int reg, UINT32 data, UINT32 mem_mask) { // printf("voodoo3_pci_w: %08X, %08X\n", reg, data); @@ -605,7 +605,7 @@ static INTERRUPT_GEN(viper_vblank) } -static void ide_interrupt(const device_config *device, int state) +static void ide_interrupt(running_device *device, int state) { } @@ -658,7 +658,7 @@ static DRIVER_INIT(viper) static DRIVER_INIT(vipercf) { - const device_config *ide = devtag_get_device(machine, "ide"); + running_device *ide = devtag_get_device(machine, "ide"); DRIVER_INIT_CALL(viper); diff --git a/src/mame/drivers/volfied.c b/src/mame/drivers/volfied.c index aada0414b14..783d601c664 100644 --- a/src/mame/drivers/volfied.c +++ b/src/mame/drivers/volfied.c @@ -207,7 +207,7 @@ GFXDECODE_END /* handler called by the YM2203 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { volfied_state *state = (volfied_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/wardner.c b/src/mame/drivers/wardner.c index cb580b75fad..6dde746d43e 100644 --- a/src/mame/drivers/wardner.c +++ b/src/mame/drivers/wardner.c @@ -415,7 +415,7 @@ static const gfx_layout spritelayout = /* handler called by the 3812 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int linestate) +static void irqhandler(running_device *device, int linestate) { cputag_set_input_line(device->machine, "audiocpu", 0, linestate); } diff --git a/src/mame/drivers/warriorb.c b/src/mame/drivers/warriorb.c index 91b8cc6a3a5..80400c99b68 100644 --- a/src/mame/drivers/warriorb.c +++ b/src/mame/drivers/warriorb.c @@ -202,7 +202,7 @@ static READ16_HANDLER( warriorb_sound_r ) static WRITE8_HANDLER( warriorb_pancontrol ) { warriorb_state *state = (warriorb_state *)space->machine->driver_data; - const device_config *flt = NULL; + running_device *flt = NULL; offset &= 3; switch (offset) @@ -417,7 +417,7 @@ GFXDECODE_END **************************************************************/ /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) +static void irqhandler( running_device *device, int irq ) { warriorb_state *state = (warriorb_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/wc90.c b/src/mame/drivers/wc90.c index 4724ea5de12..8510cdf5fc8 100644 --- a/src/mame/drivers/wc90.c +++ b/src/mame/drivers/wc90.c @@ -291,7 +291,7 @@ GFXDECODE_END /* handler called by the 2608 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/wc90b.c b/src/mame/drivers/wc90b.c index e4e37a79709..c15ac087d8c 100644 --- a/src/mame/drivers/wc90b.c +++ b/src/mame/drivers/wc90b.c @@ -340,7 +340,7 @@ GFXDECODE_END /* handler called by the 2203 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { /* NMI writes to MSM ports *only*! -AS */ //cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE); @@ -356,7 +356,7 @@ static const ym2203_interface ym2203_config = irqhandler }; -static void adpcm_int(const device_config *device) +static void adpcm_int(running_device *device) { static int toggle = 0; diff --git a/src/mame/drivers/wecleman.c b/src/mame/drivers/wecleman.c index c4c70a1876c..972a34ee991 100644 --- a/src/mame/drivers/wecleman.c +++ b/src/mame/drivers/wecleman.c @@ -693,7 +693,7 @@ static WRITE16_HANDLER( hotchase_soundlatch_w ) static WRITE8_HANDLER( hotchase_sound_control_w ) { - const device_config *sound[3]; + running_device *sound[3]; int reg[8]; diff --git a/src/mame/drivers/welltris.c b/src/mame/drivers/welltris.c index 21501d6f21a..3ee25531e01 100644 --- a/src/mame/drivers/welltris.c +++ b/src/mame/drivers/welltris.c @@ -676,7 +676,7 @@ GFXDECODE_END -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c index f8b8a1672a8..0cf10ee0dd3 100644 --- a/src/mame/drivers/wgp.c +++ b/src/mame/drivers/wgp.c @@ -903,7 +903,7 @@ GFXDECODE_END **************************************************************/ /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irqhandler( const device_config *device, int irq ) // assumes Z80 sandwiched between 68Ks +static void irqhandler( running_device *device, int irq ) // assumes Z80 sandwiched between 68Ks { wgp_state *state = (wgp_state *)device->machine->driver_data; cpu_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE); diff --git a/src/mame/drivers/wheelfir.c b/src/mame/drivers/wheelfir.c index ad315bd3c09..abf96f82c1e 100644 --- a/src/mame/drivers/wheelfir.c +++ b/src/mame/drivers/wheelfir.c @@ -540,8 +540,8 @@ static INPUT_PORTS_START( wheelfir ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END -static const device_config* frame_timer; -static const device_config* scanline_timer; +static running_device* frame_timer; +static running_device* scanline_timer; static TIMER_DEVICE_CALLBACK( frame_timer_callback ) { diff --git a/src/mame/drivers/williams.c b/src/mame/drivers/williams.c index bd3a1e0faeb..28bcceb6329 100644 --- a/src/mame/drivers/williams.c +++ b/src/mame/drivers/williams.c @@ -526,8 +526,8 @@ ADDRESS_MAP_END void defender_install_io_space(const address_space *space) { - const device_config *pia_0 = devtag_get_device(space->machine, "pia_0"); - const device_config *pia_1 = devtag_get_device(space->machine, "pia_1"); + running_device *pia_0 = devtag_get_device(space->machine, "pia_0"); + running_device *pia_1 = devtag_get_device(space->machine, "pia_1"); /* this routine dynamically installs the memory mapped above from c000-cfff */ memory_install_write_bank (space, 0xc000, 0xc00f, 0, 0x03e0, "bank4"); @@ -2809,7 +2809,7 @@ static DRIVER_INIT( blastkit ) static DRIVER_INIT( spdball ) { - const device_config *pia_3 = devtag_get_device(machine, "pia_3"); + running_device *pia_3 = devtag_get_device(machine, "pia_3"); CONFIGURE_BLITTER(WILLIAMS_BLITTER_SC01, 0xc000); diff --git a/src/mame/drivers/wiz.c b/src/mame/drivers/wiz.c index bd8e45a4d74..48ab4380422 100644 --- a/src/mame/drivers/wiz.c +++ b/src/mame/drivers/wiz.c @@ -189,7 +189,7 @@ static int dsc0, dsc1; static WRITE8_HANDLER( sound_command_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); switch (offset) { diff --git a/src/mame/drivers/wolfpack.c b/src/mame/drivers/wolfpack.c index fd3c824fc95..9b200e28ee5 100644 --- a/src/mame/drivers/wolfpack.c +++ b/src/mame/drivers/wolfpack.c @@ -61,7 +61,7 @@ static CUSTOM_INPUT( wolfpack_dial_r ) static READ8_HANDLER( wolfpack_misc_r ) { - const device_config *device = devtag_get_device(space->machine, "speech"); + running_device *device = devtag_get_device(space->machine, "speech"); UINT8 val = 0; /* BIT0 => SPEECH BUSY */ diff --git a/src/mame/drivers/wwfsstar.c b/src/mame/drivers/wwfsstar.c index 62d8c55fb1a..1f634edfb0e 100644 --- a/src/mame/drivers/wwfsstar.c +++ b/src/mame/drivers/wwfsstar.c @@ -413,7 +413,7 @@ GFXDECODE_END Straight from Ddragon 3 *******************************************************************************/ -static void wwfsstar_ymirq_handler(const device_config *device, int irq) +static void wwfsstar_ymirq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE ); } diff --git a/src/mame/drivers/wwfwfest.c b/src/mame/drivers/wwfwfest.c index e2861b82b21..174e98a2fb6 100644 --- a/src/mame/drivers/wwfwfest.c +++ b/src/mame/drivers/wwfwfest.c @@ -369,7 +369,7 @@ static TIMER_DEVICE_CALLBACK( wwfwfest_scanline ) Straight from Ddragon 3 with some adjusted volumes *******************************************************************************/ -static void dd3_ymirq_handler(const device_config *device, int irq) +static void dd3_ymirq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0 , irq ? ASSERT_LINE : CLEAR_LINE ); } diff --git a/src/mame/drivers/xain.c b/src/mame/drivers/xain.c index 8e07494f5d4..ec1e3f1544b 100644 --- a/src/mame/drivers/xain.c +++ b/src/mame/drivers/xain.c @@ -451,7 +451,7 @@ GFXDECODE_END /* handler called by the 2203 emulator when the internal timers cause an IRQ */ -static void irqhandler(const device_config *device, int irq) +static void irqhandler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/xexex.c b/src/mame/drivers/xexex.c index 2e2752495d4..724dbe54575 100644 --- a/src/mame/drivers/xexex.c +++ b/src/mame/drivers/xexex.c @@ -256,7 +256,7 @@ static WRITE8_HANDLER( sound_bankswitch_w ) reset_sound_region(space->machine); } -static void ym_set_mixing(const device_config *device, double left, double right) +static void ym_set_mixing(running_device *device, double left, double right) { xexex_state *state = (xexex_state *)device->machine->driver_data; flt_volume_set_volume(state->filter1l, (71.0 * left) / 55.0); diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c index 8c837204a2f..65c8f4f3bde 100644 --- a/src/mame/drivers/xtheball.c +++ b/src/mame/drivers/xtheball.c @@ -44,7 +44,7 @@ static MACHINE_RESET( xtheball ) * *************************************/ -static void xtheball_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void xtheball_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *srcbg = &vram_bg[(params->rowaddr << 8) & 0xff00]; UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); diff --git a/src/mame/drivers/yunsun16.c b/src/mame/drivers/yunsun16.c index ceae0914d11..cecdb0de734 100644 --- a/src/mame/drivers/yunsun16.c +++ b/src/mame/drivers/yunsun16.c @@ -577,7 +577,7 @@ static MACHINE_RESET( yunsun16 ) Magic Bubble ***************************************************************************/ -static void soundirq(const device_config *device, int state) +static void soundirq(running_device *device, int state) { yunsun16_state *yunsun16 = (yunsun16_state *)device->machine->driver_data; cpu_set_input_line(yunsun16->audiocpu, 0, state); diff --git a/src/mame/drivers/yunsung8.c b/src/mame/drivers/yunsung8.c index 6e6bde93662..d6f0b6f87de 100644 --- a/src/mame/drivers/yunsung8.c +++ b/src/mame/drivers/yunsung8.c @@ -446,7 +446,7 @@ GFXDECODE_END ***************************************************************************/ -static void yunsung8_adpcm_int( const device_config *device ) +static void yunsung8_adpcm_int( running_device *device ) { yunsung8_state *state = (yunsung8_state *)device->machine->driver_data; diff --git a/src/mame/drivers/zaccaria.c b/src/mame/drivers/zaccaria.c index c275aadc0b4..7fb9598698a 100644 --- a/src/mame/drivers/zaccaria.c +++ b/src/mame/drivers/zaccaria.c @@ -163,7 +163,7 @@ static WRITE8_DEVICE_HANDLER( zaccaria_port0b_w ) static INTERRUPT_GEN( zaccaria_cb1_toggle ) { - const device_config *pia0 = devtag_get_device(device->machine, "pia0"); + running_device *pia0 = devtag_get_device(device->machine, "pia0"); static int toggle; pia6821_cb1_w(pia0,0, toggle & 1); @@ -172,7 +172,7 @@ static INTERRUPT_GEN( zaccaria_cb1_toggle ) static WRITE8_DEVICE_HANDLER( zaccaria_port1b_w ) { - const device_config *tms = devtag_get_device(device->machine, "tms"); + running_device *tms = devtag_get_device(device->machine, "tms"); // bit 0 = /RS tms5220_rsq_w(tms, (data >> 0) & 0x01); @@ -245,7 +245,7 @@ static WRITE8_HANDLER( sound_command_w ) static WRITE8_HANDLER( sound1_command_w ) { - const device_config *pia0 = devtag_get_device(space->machine, "pia0"); + running_device *pia0 = devtag_get_device(space->machine, "pia0"); pia6821_ca1_w(pia0, 0, data & 0x80); soundlatch2_w(space, 0, data); } diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c index 7408a3b476c..d28346e5a0c 100644 --- a/src/mame/drivers/zn.c +++ b/src/mame/drivers/zn.c @@ -437,7 +437,7 @@ static void zn_driver_init( running_machine *machine ) dip_timer = timer_alloc(machine, dip_timer_fired, NULL ); } -static void psx_spu_irq(const device_config *device, UINT32 data) +static void psx_spu_irq(running_device *device, UINT32 data) { psx_irq_set(device->machine, data); } @@ -1147,7 +1147,7 @@ static UINT8 *taitofx1_eeprom2 = NULL; static WRITE32_HANDLER( bank_coh1000t_w ) { - const device_config *mb3773 = devtag_get_device(space->machine, "mb3773"); + running_device *mb3773 = devtag_get_device(space->machine, "mb3773"); mb3773_set_ck(mb3773, 0, (data & 0x20) >> 5); verboselog( space->machine, 1, "bank_coh1000t_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); memory_set_bankptr(space->machine, "bank1", memory_region( space->machine, "user2" ) + ( ( data & 3 ) * 0x800000 ) ); @@ -1160,13 +1160,13 @@ static WRITE8_HANDLER( fx1a_sound_bankswitch_w ) static READ32_HANDLER( taitofx1a_ymsound_r ) { - const device_config *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); + running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); return tc0140syt_comm_r(tc0140syt, 0) << 16; } static WRITE32_HANDLER( taitofx1a_ymsound_w ) { - const device_config *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); + running_device *tc0140syt = devtag_get_device(space->machine, "tc0140syt"); if (mem_mask == 0x0000ffff) { @@ -1227,7 +1227,7 @@ static ADDRESS_MAP_START( fx1a_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) ADDRESS_MAP_END /* handler called by the YM2610 emulator when the internal timers cause an IRQ */ -static void irq_handler(const device_config *device, int irq) +static void irq_handler(running_device *device, int irq) { cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } @@ -1447,7 +1447,7 @@ Notes: *2 - Unpopulated DIP28 socket */ -static void atpsx_interrupt(const device_config *device, int state) +static void atpsx_interrupt(running_device *device, int state) { if (state) { @@ -1457,7 +1457,7 @@ static void atpsx_interrupt(const device_config *device, int state) static void atpsx_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size ) { - const device_config *ide = devtag_get_device(machine, "ide"); + running_device *ide = devtag_get_device(machine, "ide"); logerror("DMA read: %d bytes (%d words) to %08x\n", n_size<<2, n_size, n_address); @@ -1485,7 +1485,7 @@ static void atpsx_dma_write( running_machine *machine, UINT32 n_address, INT32 n static DRIVER_INIT( coh1000w ) { - const device_config *ide = devtag_get_device(machine, "ide"); + running_device *ide = devtag_get_device(machine, "ide"); memory_install_read_bank ( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f000000, 0x1f1fffff, 0, 0, "bank1" ); memory_nop_write ( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1f000000, 0x1f000003, 0, 0 ); @@ -2014,7 +2014,7 @@ Notes: * - Unpopulated DIP42 socket */ -static void jdredd_ide_interrupt(const device_config *device, int state) +static void jdredd_ide_interrupt(running_device *device, int state) { if (state) { @@ -2158,7 +2158,7 @@ static DRIVER_INIT( coh1000a ) if( ( !strcmp( machine->gamedrv->name, "jdredd" ) ) || ( !strcmp( machine->gamedrv->name, "jdreddb" ) ) ) { - const device_config *ide = devtag_get_device(machine, "ide"); + running_device *ide = devtag_get_device(machine, "ide"); memory_install_read32_device_handler( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), ide, 0x1fbfff8c, 0x1fbfff8f, 0, 0, jdredd_idestat_r ); memory_nop_write ( cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1fbfff8c, 0x1fbfff8f, 0, 0 ); diff --git a/src/mame/drivers/zr107.c b/src/mame/drivers/zr107.c index 511b4d12e8c..d2e688d4760 100644 --- a/src/mame/drivers/zr107.c +++ b/src/mame/drivers/zr107.c @@ -237,7 +237,7 @@ static void game_tile_callback(running_machine *machine, int layer, int *code, i static VIDEO_START( zr107 ) { - const device_config *k056832 = devtag_get_device(machine, "k056832"); + running_device *k056832 = devtag_get_device(machine, "k056832"); k056832_set_layer_offs(k056832, 0, -29, -27); k056832_set_layer_offs(k056832, 1, -29, -27); @@ -254,7 +254,7 @@ static VIDEO_START( zr107 ) static VIDEO_UPDATE( zr107 ) { - const device_config *k056832 = devtag_get_device(screen->machine, "k056832"); + running_device *k056832 = devtag_get_device(screen->machine, "k056832"); bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); k056832_tilemap_draw(k056832, bitmap, cliprect, 1, 0, 0); @@ -644,7 +644,7 @@ static const sharc_config sharc_cfg = /* ADC0838 Interface */ -static double adc0838_callback( const device_config *device, UINT8 input ) +static double adc0838_callback( running_device *device, UINT8 input ) { switch (input) { diff --git a/src/mame/includes/1942.h b/src/mame/includes/1942.h index f3956f5c295..13ff991ac24 100644 --- a/src/mame/includes/1942.h +++ b/src/mame/includes/1942.h @@ -19,7 +19,7 @@ struct __1942_state UINT8 scroll[2]; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/20pacgal.h b/src/mame/includes/20pacgal.h index 38b93cf102d..b441e82e485 100644 --- a/src/mame/includes/20pacgal.h +++ b/src/mame/includes/20pacgal.h @@ -22,8 +22,8 @@ struct __20pacgal_state UINT8 game_selected; /* 0 = Ms. Pac-Man, 1 = Galaga */ /* devices */ - const device_config *maincpu; - const device_config *eeprom; + running_device *maincpu; + running_device *eeprom; }; diff --git a/src/mame/includes/88games.h b/src/mame/includes/88games.h index a443cf72475..b3659141675 100644 --- a/src/mame/includes/88games.h +++ b/src/mame/includes/88games.h @@ -21,12 +21,12 @@ struct __88games_state int speech_chip; /* devices */ - const device_config *audiocpu; - const device_config *k052109; - const device_config *k051960; - const device_config *k051316; - const device_config *upd_1; - const device_config *upd_2; + running_device *audiocpu; + running_device *k052109; + running_device *k051960; + running_device *k051316; + running_device *upd_1; + running_device *upd_2; }; diff --git a/src/mame/includes/actfancr.h b/src/mame/includes/actfancr.h index be0e106d464..a57b3726445 100644 --- a/src/mame/includes/actfancr.h +++ b/src/mame/includes/actfancr.h @@ -24,8 +24,8 @@ struct _actfancr_state int trio_control_select; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/aerofgt.h b/src/mame/includes/aerofgt.h index 0bb1b413e99..ac07986a4e9 100644 --- a/src/mame/includes/aerofgt.h +++ b/src/mame/includes/aerofgt.h @@ -29,7 +29,7 @@ struct _aerofgt_state int pending_command; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/airbustr.h b/src/mame/includes/airbustr.h index 113d44a6777..55f9f6eaf6d 100644 --- a/src/mame/includes/airbustr.h +++ b/src/mame/includes/airbustr.h @@ -26,10 +26,10 @@ struct _airbustr_state int slave_addr; /* devices */ - const device_config *master; - const device_config *slave; - const device_config *audiocpu; - const device_config *pandora; + running_device *master; + running_device *slave; + running_device *audiocpu; + running_device *pandora; }; diff --git a/src/mame/includes/ajax.h b/src/mame/includes/ajax.h index 09473fee379..519dd44fe67 100644 --- a/src/mame/includes/ajax.h +++ b/src/mame/includes/ajax.h @@ -13,14 +13,14 @@ struct _ajax_state int firq_enable; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *subcpu; - const device_config *k007232_1; - const device_config *k007232_2; - const device_config *k052109; - const device_config *k051960; - const device_config *k051316; + running_device *maincpu; + running_device *audiocpu; + running_device *subcpu; + running_device *k007232_1; + running_device *k007232_2; + running_device *k052109; + running_device *k051960; + running_device *k051316; }; diff --git a/src/mame/includes/aliens.h b/src/mame/includes/aliens.h index 65b30d782d3..a7895cf680e 100644 --- a/src/mame/includes/aliens.h +++ b/src/mame/includes/aliens.h @@ -18,11 +18,11 @@ struct _aliens_state int palette_selected; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k007232; - const device_config *k052109; - const device_config *k051960; + running_device *maincpu; + running_device *audiocpu; + running_device *k007232; + running_device *k052109; + running_device *k051960; }; /*----------- defined in video/aliens.c -----------*/ diff --git a/src/mame/includes/alpha68k.h b/src/mame/includes/alpha68k.h index 0aceac7a709..b6cdc2b4a3d 100644 --- a/src/mame/includes/alpha68k.h +++ b/src/mame/includes/alpha68k.h @@ -29,7 +29,7 @@ struct _alpha68k_state unsigned game_id; // see below /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; /* game_id - used to deal with a few game specific situations */ diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h index 2c12e80f880..b211dcad004 100644 --- a/src/mame/includes/amiga.h +++ b/src/mame/includes/amiga.h @@ -388,8 +388,8 @@ void amiga_add_autoconfig(running_machine *machine, const amiga_autoconfig_devic READ16_HANDLER( amiga_autoconfig_r ); WRITE16_HANDLER( amiga_autoconfig_w ); -void amiga_cia_0_irq(const device_config *device, int state); -void amiga_cia_1_irq(const device_config *device, int state); +void amiga_cia_0_irq(running_device *device, int state); +void amiga_cia_1_irq(running_device *device, int state); const amiga_machine_interface *amiga_get_interface(void); @@ -409,7 +409,7 @@ PALETTE_INIT( amiga ); VIDEO_START( amiga ); VIDEO_UPDATE( amiga ); -UINT32 amiga_gethvpos(const device_config *screen); +UINT32 amiga_gethvpos(running_device *screen); void copper_setpc(UINT32 pc); void amiga_set_genlock_color(UINT16 color); void amiga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanline); @@ -421,7 +421,7 @@ void amiga_sprite_enable_comparitor(int which, int enable); VIDEO_START( amiga_aga ); VIDEO_UPDATE( amiga_aga ); -UINT32 amiga_aga_gethvpos(const device_config *screen); +UINT32 amiga_aga_gethvpos(running_device *screen); void aga_copper_setpc(UINT32 pc); void amiga_aga_set_genlock_color(UINT16 color); void amiga_aga_render_scanline(running_machine *machine, bitmap_t *bitmap, int scanline); diff --git a/src/mame/includes/amspdwy.h b/src/mame/includes/amspdwy.h index 5f33af04383..47d33d02661 100644 --- a/src/mame/includes/amspdwy.h +++ b/src/mame/includes/amspdwy.h @@ -23,7 +23,7 @@ struct _amspdwy_state UINT8 wheel_return[2]; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/angelkds.h b/src/mame/includes/angelkds.h index 460956c1174..8540952c6d9 100644 --- a/src/mame/includes/angelkds.h +++ b/src/mame/includes/angelkds.h @@ -24,7 +24,7 @@ struct _angelkds_state UINT8 layer_ctrl; /* devices */ - const device_config *subcpu; + running_device *subcpu; }; diff --git a/src/mame/includes/appoooh.h b/src/mame/includes/appoooh.h index 9d49224aeb9..de398c9f120 100644 --- a/src/mame/includes/appoooh.h +++ b/src/mame/includes/appoooh.h @@ -21,7 +21,7 @@ struct _appoooh_state UINT32 adpcm_address; /* devices */ - const device_config *adpcm; + running_device *adpcm; }; #define CHR1_OFST 0x00 /* palette page of char set #1 */ diff --git a/src/mame/includes/aquarium.h b/src/mame/includes/aquarium.h index 2e3ec265271..71b81417bfa 100644 --- a/src/mame/includes/aquarium.h +++ b/src/mame/includes/aquarium.h @@ -20,7 +20,7 @@ struct _aquarium_state int aquarium_snd_ack; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/arkanoid.h b/src/mame/includes/arkanoid.h index efa4c993ffb..9b91260e844 100644 --- a/src/mame/includes/arkanoid.h +++ b/src/mame/includes/arkanoid.h @@ -33,7 +33,7 @@ struct _arkanoid_state UINT8 bootleg_cmd; /* devices */ - const device_config *mcu; + running_device *mcu; }; diff --git a/src/mame/includes/artmagic.h b/src/mame/includes/artmagic.h index 27c799d0737..f6b331cf55d 100644 --- a/src/mame/includes/artmagic.h +++ b/src/mame/includes/artmagic.h @@ -19,4 +19,4 @@ void artmagic_from_shiftreg(const address_space *space, offs_t address, UINT16 * READ16_HANDLER( artmagic_blitter_r ); WRITE16_HANDLER( artmagic_blitter_w ); -void artmagic_scanline(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void artmagic_scanline(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/includes/ashnojoe.h b/src/mame/includes/ashnojoe.h index 6132fc14736..d7d2b6f9ae3 100644 --- a/src/mame/includes/ashnojoe.h +++ b/src/mame/includes/ashnojoe.h @@ -28,7 +28,7 @@ struct _ashnojoe_state int msm5205_vclk_toggle; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/asterix.h b/src/mame/includes/asterix.h index 8d8c3495a20..57d17bed645 100644 --- a/src/mame/includes/asterix.h +++ b/src/mame/includes/asterix.h @@ -22,12 +22,12 @@ struct _asterix_state UINT16 prot[2]; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k053260; - const device_config *k056832; - const device_config *k053244; - const device_config *k053251; + running_device *maincpu; + running_device *audiocpu; + running_device *k053260; + running_device *k056832; + running_device *k053244; + running_device *k053251; }; diff --git a/src/mame/includes/astrof.h b/src/mame/includes/astrof.h index 7991f211c9d..61d773bc690 100644 --- a/src/mame/includes/astrof.h +++ b/src/mame/includes/astrof.h @@ -29,9 +29,9 @@ struct _astrof_state UINT8 astrof_bosskill_playing; /* devices */ - const device_config *maincpu; - const device_config *samples; // astrof & abattle - const device_config *sn; // tomahawk + running_device *maincpu; + running_device *samples; // astrof & abattle + running_device *sn; // tomahawk }; /*----------- defined in audio/astrof.c -----------*/ diff --git a/src/mame/includes/asuka.h b/src/mame/includes/asuka.h index 141570d5109..4fcab65774d 100644 --- a/src/mame/includes/asuka.h +++ b/src/mame/includes/asuka.h @@ -27,10 +27,10 @@ struct _asuka_state int adpcm_data; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *pc090oj; - const device_config *tc0100scn; + running_device *maincpu; + running_device *audiocpu; + running_device *pc090oj; + running_device *tc0100scn; }; diff --git a/src/mame/includes/atari.h b/src/mame/includes/atari.h index b443d05748a..6ef492835d6 100644 --- a/src/mame/includes/atari.h +++ b/src/mame/includes/atari.h @@ -28,7 +28,7 @@ void atari_machine_start(running_machine *machine); MACHINE_START( atarixl ); -void atari_interrupt_cb(const device_config *device, int mask); +void atari_interrupt_cb(running_device *device, int mask); void a800_handle_keyboard(running_machine *machine); void a5200_handle_keypads(running_machine *machine); diff --git a/src/mame/includes/atarifb.h b/src/mame/includes/atarifb.h index c62382bb8a4..a8ff6e2482a 100644 --- a/src/mame/includes/atarifb.h +++ b/src/mame/includes/atarifb.h @@ -42,7 +42,7 @@ struct _atarifb_state int counter_x_in2b, counter_y_in2b; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/includes/atarig1.h b/src/mame/includes/atarig1.h index 2b57cf05020..5e3221c722d 100644 --- a/src/mame/includes/atarig1.h +++ b/src/mame/includes/atarig1.h @@ -35,4 +35,4 @@ WRITE16_HANDLER( atarig1_mo_control_w ); VIDEO_START( atarig1 ); VIDEO_UPDATE( atarig1 ); -void atarig1_scanline_update(const device_config *screen, int scanline); +void atarig1_scanline_update(running_device *screen, int scanline); diff --git a/src/mame/includes/atarig42.h b/src/mame/includes/atarig42.h index 76a5d07acbf..0949f58357e 100644 --- a/src/mame/includes/atarig42.h +++ b/src/mame/includes/atarig42.h @@ -38,5 +38,5 @@ VIDEO_UPDATE( atarig42 ); WRITE16_HANDLER( atarig42_mo_control_w ); -void atarig42_scanline_update(const device_config *screen, int scanline); +void atarig42_scanline_update(running_device *screen, int scanline); diff --git a/src/mame/includes/atarigt.h b/src/mame/includes/atarigt.h index ff7146b6b58..e42e354c4b0 100644 --- a/src/mame/includes/atarigt.h +++ b/src/mame/includes/atarigt.h @@ -45,4 +45,4 @@ UINT16 atarigt_colorram_r(atarigt_state *state, offs_t address); VIDEO_START( atarigt ); VIDEO_UPDATE( atarigt ); -void atarigt_scanline_update(const device_config *screen, int scanline); +void atarigt_scanline_update(running_device *screen, int scanline); diff --git a/src/mame/includes/atarigx2.h b/src/mame/includes/atarigx2.h index 3ff14692a11..b57a1ec9fc8 100644 --- a/src/mame/includes/atarigx2.h +++ b/src/mame/includes/atarigx2.h @@ -32,4 +32,4 @@ VIDEO_UPDATE( atarigx2 ); WRITE16_HANDLER( atarigx2_mo_control_w ); -void atarigx2_scanline_update(const device_config *screen, int scanline); +void atarigx2_scanline_update(running_device *screen, int scanline); diff --git a/src/mame/includes/atarisy1.h b/src/mame/includes/atarisy1.h index adddc5d99be..e6761f5b20d 100644 --- a/src/mame/includes/atarisy1.h +++ b/src/mame/includes/atarisy1.h @@ -16,7 +16,7 @@ struct _atarisy1_state UINT8 joystick_type; UINT8 trackball_type; - const device_config *joystick_timer; + running_device *joystick_timer; UINT8 joystick_int; UINT8 joystick_int_enable; UINT8 joystick_value; @@ -29,12 +29,12 @@ struct _atarisy1_state UINT16 playfield_lookup[256]; UINT8 playfield_tile_bank; UINT16 playfield_priority_pens; - const device_config *yscroll_reset_timer; + running_device *yscroll_reset_timer; /* INT3 tracking */ int next_timer_scanline; - const device_config *scanline_timer; - const device_config *int3off_timer; + running_device *scanline_timer; + running_device *int3off_timer; /* graphics bank tracking */ UINT8 bank_gfx[3][8]; diff --git a/src/mame/includes/balsente.h b/src/mame/includes/balsente.h index 67f8fcf48c7..6f19129aeb6 100644 --- a/src/mame/includes/balsente.h +++ b/src/mame/includes/balsente.h @@ -39,7 +39,7 @@ struct _balsente_state /* 8253 counter state */ struct { - const device_config *timer; + running_device *timer; UINT8 timer_active; INT32 initial; INT32 count; @@ -50,12 +50,12 @@ struct _balsente_state UINT8 writebyte; } counter[3]; - const device_config *scanline_timer; + running_device *scanline_timer; /* manually clocked counter 0 states */ UINT8 counter_control; UINT8 counter_0_ff; - const device_config *counter_0_timer; + running_device *counter_0_timer; UINT8 counter_0_timer_active; /* random number generator states */ @@ -86,7 +86,7 @@ struct _balsente_state /* noise generator states */ UINT32 noise_position[6]; - const device_config *cem_device[6]; + running_device *cem_device[6]; /* game-specific states */ UINT8 nstocker_bits; @@ -113,7 +113,7 @@ TIMER_DEVICE_CALLBACK( balsente_interrupt_timer ); MACHINE_START( balsente ); MACHINE_RESET( balsente ); -void balsente_noise_gen(const device_config *device, int count, short *buffer); +void balsente_noise_gen(running_device *device, int count, short *buffer); WRITE8_HANDLER( balsente_random_reset_w ); READ8_HANDLER( balsente_random_num_r ); diff --git a/src/mame/includes/batman.h b/src/mame/includes/batman.h index 723ea08d311..d2bceb3df93 100644 --- a/src/mame/includes/batman.h +++ b/src/mame/includes/batman.h @@ -22,4 +22,4 @@ struct _batman_state VIDEO_START( batman ); VIDEO_UPDATE( batman ); -void batman_scanline_update(const device_config *screen, int scanline); +void batman_scanline_update(running_device *screen, int scanline); diff --git a/src/mame/includes/battlane.h b/src/mame/includes/battlane.h index ef8c571874b..f040d9dbc1f 100644 --- a/src/mame/includes/battlane.h +++ b/src/mame/includes/battlane.h @@ -18,8 +18,8 @@ struct _battlane_state int cpu_control; /* CPU interrupt control register */ /* devices */ - const device_config *maincpu; - const device_config *subcpu; + running_device *maincpu; + running_device *subcpu; }; diff --git a/src/mame/includes/battlnts.h b/src/mame/includes/battlnts.h index 9fcdcc6088d..5428a40dfe2 100644 --- a/src/mame/includes/battlnts.h +++ b/src/mame/includes/battlnts.h @@ -16,9 +16,9 @@ struct _battlnts_state /* devices */ - const device_config *audiocpu; - const device_config *k007342; - const device_config *k007420; + running_device *audiocpu; + running_device *k007342; + running_device *k007420; }; /*----------- defined in video/battlnts.c -----------*/ diff --git a/src/mame/includes/bigevglf.h b/src/mame/includes/bigevglf.h index bcdfcb7f823..171001e1d73 100644 --- a/src/mame/includes/bigevglf.h +++ b/src/mame/includes/bigevglf.h @@ -32,8 +32,8 @@ struct _bigevglf_state UINT8 port_select; /* for muxed controls */ /* devices */ - const device_config *audiocpu; - const device_config *mcu; + running_device *audiocpu; + running_device *mcu; }; diff --git a/src/mame/includes/bishi.h b/src/mame/includes/bishi.h index 04f07985a0b..74cea129d65 100644 --- a/src/mame/includes/bishi.h +++ b/src/mame/includes/bishi.h @@ -21,12 +21,12 @@ struct _bishi_state UINT16 cur_control, cur_control2; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k007232; - const device_config *k056832; - const device_config *k054338; - const device_config *k055555; + running_device *maincpu; + running_device *audiocpu; + running_device *k007232; + running_device *k056832; + running_device *k054338; + running_device *k055555; }; /*----------- defined in video/bishi.c -----------*/ diff --git a/src/mame/includes/bladestl.h b/src/mame/includes/bladestl.h index 76d1b1afa1d..a8b355e5aad 100644 --- a/src/mame/includes/bladestl.h +++ b/src/mame/includes/bladestl.h @@ -18,9 +18,9 @@ struct _bladestl_state int last_track[4]; /* devices */ - const device_config *audiocpu; - const device_config *k007342; - const device_config *k007420; + running_device *audiocpu; + running_device *k007342; + running_device *k007420; }; diff --git a/src/mame/includes/blktiger.h b/src/mame/includes/blktiger.h index 2e3b24821e2..bd5ca90c42a 100644 --- a/src/mame/includes/blktiger.h +++ b/src/mame/includes/blktiger.h @@ -26,8 +26,8 @@ struct _blktiger_state UINT8 z80_latch, i8751_latch; /* devices */ - const device_config *mcu; - const device_config *audiocpu; + running_device *mcu; + running_device *audiocpu; }; diff --git a/src/mame/includes/blockhl.h b/src/mame/includes/blockhl.h index 1a61b9f342d..b9c081e6eea 100644 --- a/src/mame/includes/blockhl.h +++ b/src/mame/includes/blockhl.h @@ -19,10 +19,10 @@ struct _blockhl_state int rombank; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k052109; - const device_config *k051960; + running_device *maincpu; + running_device *audiocpu; + running_device *k052109; + running_device *k051960; }; /*----------- defined in video/blockhl.c -----------*/ diff --git a/src/mame/includes/blockout.h b/src/mame/includes/blockout.h index 4a1d9b3edc3..469c02f9b24 100644 --- a/src/mame/includes/blockout.h +++ b/src/mame/includes/blockout.h @@ -17,7 +17,7 @@ struct _blockout_state UINT16 color; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/blstroid.h b/src/mame/includes/blstroid.h index c6c338760c6..9b995d38927 100644 --- a/src/mame/includes/blstroid.h +++ b/src/mame/includes/blstroid.h @@ -20,4 +20,4 @@ struct _blstroid_state VIDEO_START( blstroid ); VIDEO_UPDATE( blstroid ); -void blstroid_scanline_update(const device_config *screen, int scanline); +void blstroid_scanline_update(running_device *screen, int scanline); diff --git a/src/mame/includes/blueprnt.h b/src/mame/includes/blueprnt.h index f038597ded1..3e0ed6980f2 100644 --- a/src/mame/includes/blueprnt.h +++ b/src/mame/includes/blueprnt.h @@ -22,7 +22,7 @@ struct _blueprnt_state int dipsw; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/bottom9.h b/src/mame/includes/bottom9.h index 8fbe72aa280..ce0d8f7640d 100644 --- a/src/mame/includes/bottom9.h +++ b/src/mame/includes/bottom9.h @@ -19,13 +19,13 @@ struct _bottom9_state int nmienable; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k007232_1; - const device_config *k007232_2; - const device_config *k052109; - const device_config *k051960; - const device_config *k051316; + running_device *maincpu; + running_device *audiocpu; + running_device *k007232_1; + running_device *k007232_2; + running_device *k052109; + running_device *k051960; + running_device *k051316; }; /*----------- defined in video/bottom9.c -----------*/ diff --git a/src/mame/includes/brkthru.h b/src/mame/includes/brkthru.h index 6ded5f5d466..2586e6b19c5 100644 --- a/src/mame/includes/brkthru.h +++ b/src/mame/includes/brkthru.h @@ -23,8 +23,8 @@ struct _brkthru_state //UINT8 *brkthru_nmi_enable; /* needs to be tracked down */ /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/btime.h b/src/mame/includes/btime.h index 28c0e9a5c33..cb92ea9d021 100644 --- a/src/mame/includes/btime.h +++ b/src/mame/includes/btime.h @@ -37,8 +37,8 @@ struct _btime_state int protection_ret; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/btoads.h b/src/mame/includes/btoads.h index 9b84c5e948e..e124e2da314 100644 --- a/src/mame/includes/btoads.h +++ b/src/mame/includes/btoads.h @@ -37,4 +37,4 @@ READ16_HANDLER( btoads_vram_fg_draw_r ); void btoads_to_shiftreg(const address_space *space, UINT32 address, UINT16 *shiftreg); void btoads_from_shiftreg(const address_space *space, UINT32 address, UINT16 *shiftreg); -void btoads_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void btoads_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/includes/bublbobl.h b/src/mame/includes/bublbobl.h index 026818df2e2..aecd9453aab 100644 --- a/src/mame/includes/bublbobl.h +++ b/src/mame/includes/bublbobl.h @@ -35,10 +35,10 @@ struct _bublbobl_state int ic43_a, ic43_b; /* devices */ - const device_config *maincpu; - const device_config *mcu; - const device_config *audiocpu; - const device_config *slave; + running_device *maincpu; + running_device *mcu; + running_device *audiocpu; + running_device *slave; }; diff --git a/src/mame/includes/buggychl.h b/src/mame/includes/buggychl.h index 61e83ffcb91..69f1c1c9c1e 100644 --- a/src/mame/includes/buggychl.h +++ b/src/mame/includes/buggychl.h @@ -84,8 +84,8 @@ struct _buggychl_state int addr_h, addr_l; /* devices */ - const device_config *audiocpu; - const device_config *mcu; + running_device *audiocpu; + running_device *mcu; }; diff --git a/src/mame/includes/bwing.h b/src/mame/includes/bwing.h index d27859d24e8..f91b2b07a0c 100644 --- a/src/mame/includes/bwing.h +++ b/src/mame/includes/bwing.h @@ -34,9 +34,9 @@ struct _bwing_state int coin; /* device */ - const device_config *maincpu; - const device_config *subcpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *subcpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/capbowl.h b/src/mame/includes/capbowl.h index c285350b7ae..a0743ec6def 100644 --- a/src/mame/includes/capbowl.h +++ b/src/mame/includes/capbowl.h @@ -18,8 +18,8 @@ struct _capbowl_state UINT8 last_trackball_val[2]; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; /*----------- defined in video/capbowl.c -----------*/ diff --git a/src/mame/includes/carpolo.h b/src/mame/includes/carpolo.h index 9187ea1d08f..4eb95fc2df4 100644 --- a/src/mame/includes/carpolo.h +++ b/src/mame/includes/carpolo.h @@ -13,12 +13,12 @@ extern const pia6821_interface carpolo_pia0_intf; extern const pia6821_interface carpolo_pia1_intf; -void carpolo_74148_3s_cb(const device_config *device); +void carpolo_74148_3s_cb(running_device *device); -void carpolo_7474_2s_1_cb(const device_config *device); -void carpolo_7474_2s_2_cb(const device_config *device); -void carpolo_7474_2u_1_cb(const device_config *device); -void carpolo_7474_2u_2_cb(const device_config *device); +void carpolo_7474_2s_1_cb(running_device *device); +void carpolo_7474_2s_2_cb(running_device *device); +void carpolo_7474_2u_1_cb(running_device *device); +void carpolo_7474_2u_2_cb(running_device *device); MACHINE_START( carpolo ); MACHINE_RESET( carpolo ); diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h index 979e0bf510a..addf71623fa 100644 --- a/src/mame/includes/cave.h +++ b/src/mame/includes/cave.h @@ -107,8 +107,8 @@ struct _cave_state int hopper; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; /*----------- defined in video/cave.c -----------*/ diff --git a/src/mame/includes/ccastles.h b/src/mame/includes/ccastles.h index b0f1b89a0bc..3362d3de3a3 100644 --- a/src/mame/includes/ccastles.h +++ b/src/mame/includes/ccastles.h @@ -32,7 +32,7 @@ struct _ccastles_state UINT8 nvram_store[2]; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/includes/champbas.h b/src/mame/includes/champbas.h index 98cdac61eea..a997dbd5899 100644 --- a/src/mame/includes/champbas.h +++ b/src/mame/includes/champbas.h @@ -26,9 +26,9 @@ struct _champbas_state int watchdog_count; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *mcu; + running_device *maincpu; + running_device *audiocpu; + running_device *mcu; }; diff --git a/src/mame/includes/changela.h b/src/mame/includes/changela.h index 9494390ad85..78831f4a037 100644 --- a/src/mame/includes/changela.h +++ b/src/mame/includes/changela.h @@ -43,7 +43,7 @@ struct _changela_state UINT8 mcu_pc_0; /* devices */ - const device_config *mcu; + running_device *mcu; }; /*----------- defined in video/changela.c -----------*/ diff --git a/src/mame/includes/cheekyms.h b/src/mame/includes/cheekyms.h index 12c274ea41a..d634955ae6b 100644 --- a/src/mame/includes/cheekyms.h +++ b/src/mame/includes/cheekyms.h @@ -18,8 +18,8 @@ struct _cheekyms_state bitmap_t *bitmap_buffer; /* devices */ - const device_config *maincpu; - const device_config *dac; + running_device *maincpu; + running_device *dac; }; diff --git a/src/mame/includes/chqflag.h b/src/mame/includes/chqflag.h index 99e2c6b7a97..3226cb338c8 100644 --- a/src/mame/includes/chqflag.h +++ b/src/mame/includes/chqflag.h @@ -21,13 +21,13 @@ struct _chqflag_state int accel, wheel; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k007232_1; - const device_config *k007232_2; - const device_config *k051960; - const device_config *k051316_1; - const device_config *k051316_2; + running_device *maincpu; + running_device *audiocpu; + running_device *k007232_1; + running_device *k007232_2; + running_device *k051960; + running_device *k051316_1; + running_device *k051316_2; }; /*----------- defined in video/chqflag.c -----------*/ diff --git a/src/mame/includes/cidelsa.h b/src/mame/includes/cidelsa.h index 1d798f5c286..2a1cdf1ddfe 100644 --- a/src/mame/includes/cidelsa.h +++ b/src/mame/includes/cidelsa.h @@ -45,8 +45,8 @@ struct _cidelsa_state int draco_ay_latch; /* devices */ - const device_config *cdp1802; - const device_config *cdp1869; + running_device *cdp1802; + running_device *cdp1869; }; /*----------- defined in video/cidelsa.c -----------*/ diff --git a/src/mame/includes/cinemat.h b/src/mame/includes/cinemat.h index 94a65199ada..0432999d6b0 100644 --- a/src/mame/includes/cinemat.h +++ b/src/mame/includes/cinemat.h @@ -34,7 +34,7 @@ MACHINE_DRIVER_EXTERN( qb3_sound ); /*----------- defined in video/cinemat.c -----------*/ -void cinemat_vector_callback(const device_config *device, INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift); +void cinemat_vector_callback(running_device *device, INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift); WRITE8_HANDLER( cinemat_vector_control_w ); VIDEO_START( cinemat_bilevel ); diff --git a/src/mame/includes/circus.h b/src/mame/includes/circus.h index bdc3d4356a8..5862d25abdd 100644 --- a/src/mame/includes/circus.h +++ b/src/mame/includes/circus.h @@ -17,9 +17,9 @@ struct _circus_state int clown_x, clown_y, clown_z; /* devices */ - const device_config *maincpu; - const device_config *samples; - const device_config *discrete; + running_device *maincpu; + running_device *samples; + running_device *discrete; /* game id */ int game_id; diff --git a/src/mame/includes/circusc.h b/src/mame/includes/circusc.h index 8751a0bfb17..77138cf9490 100644 --- a/src/mame/includes/circusc.h +++ b/src/mame/includes/circusc.h @@ -23,11 +23,11 @@ struct _circusc_state UINT8 sn_latch; /* devices */ - const device_config *audiocpu; - const device_config *sn1; - const device_config *sn2; - const device_config *dac; - const device_config *discrete; + running_device *audiocpu; + running_device *sn1; + running_device *sn2; + running_device *dac; + running_device *discrete; }; diff --git a/src/mame/includes/citycon.h b/src/mame/includes/citycon.h index 8ba772b5fd0..3b2117199a5 100644 --- a/src/mame/includes/citycon.h +++ b/src/mame/includes/citycon.h @@ -20,7 +20,7 @@ struct _citycon_state int bg_image; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/includes/cloud9.h b/src/mame/includes/cloud9.h index 63b95064912..f0f3e9bd5cd 100644 --- a/src/mame/includes/cloud9.h +++ b/src/mame/includes/cloud9.h @@ -30,7 +30,7 @@ struct _cloud9_state UINT8 irq_state; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/includes/combatsc.h b/src/mame/includes/combatsc.h index 72612fe4610..e036321ef87 100644 --- a/src/mame/includes/combatsc.h +++ b/src/mame/includes/combatsc.h @@ -33,9 +33,9 @@ struct _combatsc_state /* devices */ - const device_config *audiocpu; - const device_config *k007121_1; - const device_config *k007121_2; + running_device *audiocpu; + running_device *k007121_1; + running_device *k007121_2; }; diff --git a/src/mame/includes/commando.h b/src/mame/includes/commando.h index 7361cedfabc..753efe08e8b 100644 --- a/src/mame/includes/commando.h +++ b/src/mame/includes/commando.h @@ -20,7 +20,7 @@ struct _commando_state UINT8 scroll_y[2]; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/contra.h b/src/mame/includes/contra.h index dcc280e18de..a0551167f23 100644 --- a/src/mame/includes/contra.h +++ b/src/mame/includes/contra.h @@ -24,9 +24,9 @@ struct _contra_state rectangle bg_clip, fg_clip, tx_clip; /* devices */ - const device_config *audiocpu; - const device_config *k007121_1; - const device_config *k007121_2; + running_device *audiocpu; + running_device *k007121_1; + running_device *k007121_2; }; diff --git a/src/mame/includes/cop01.h b/src/mame/includes/cop01.h index a0d2e5ec7ad..ff168f5e2d7 100644 --- a/src/mame/includes/cop01.h +++ b/src/mame/includes/cop01.h @@ -22,7 +22,7 @@ struct _cop01_state int timer; // kludge for ym3526 in mightguy /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/cosmic.h b/src/mame/includes/cosmic.h index af95032636a..74555b29609 100644 --- a/src/mame/includes/cosmic.h +++ b/src/mame/includes/cosmic.h @@ -31,8 +31,8 @@ struct _cosmic_state UINT32 pixel_clock; /* devices */ - const device_config *samples; - const device_config *dac; + running_device *samples; + running_device *dac; }; diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h index b16a044f9ac..8abd5702e5c 100644 --- a/src/mame/includes/cps1.h +++ b/src/mame/includes/cps1.h @@ -124,10 +124,10 @@ struct _cps_state int cps_version; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *msm_1; // fcrash - const device_config *msm_2; // fcrash + running_device *maincpu; + running_device *audiocpu; + running_device *msm_1; // fcrash + running_device *msm_2; // fcrash }; /*----------- defined in drivers/cps1.c -----------*/ diff --git a/src/mame/includes/crbaloon.h b/src/mame/includes/crbaloon.h index edde7ea4840..3476d9b06ad 100644 --- a/src/mame/includes/crbaloon.h +++ b/src/mame/includes/crbaloon.h @@ -12,9 +12,9 @@ Crazy Ballooon WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_freq ); WRITE8_DEVICE_HANDLER( crbaloon_audio_set_music_enable ); -void crbaloon_audio_set_explosion_enable(const device_config *sn, int enabled); -void crbaloon_audio_set_breath_enable(const device_config *sn, int enabled); -void crbaloon_audio_set_appear_enable(const device_config *sn, int enabled); +void crbaloon_audio_set_explosion_enable(running_device *sn, int enabled); +void crbaloon_audio_set_breath_enable(running_device *sn, int enabled); +void crbaloon_audio_set_appear_enable(running_device *sn, int enabled); WRITE8_DEVICE_HANDLER( crbaloon_audio_set_laugh_enable ); MACHINE_DRIVER_EXTERN( crbaloon_audio ); diff --git a/src/mame/includes/crgolf.h b/src/mame/includes/crgolf.h index 535355e0fe7..920ee22af35 100644 --- a/src/mame/includes/crgolf.h +++ b/src/mame/includes/crgolf.h @@ -26,8 +26,8 @@ struct _crgolf_state UINT8 sample_count; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; /*----------- defined in video/crgolf.c -----------*/ diff --git a/src/mame/includes/crimfght.h b/src/mame/includes/crimfght.h index 55fd6b47264..d4c093cdb19 100644 --- a/src/mame/includes/crimfght.h +++ b/src/mame/includes/crimfght.h @@ -14,11 +14,11 @@ struct _crimfght_state int layer_colorbase[3], sprite_colorbase; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k007232; - const device_config *k052109; - const device_config *k051960; + running_device *maincpu; + running_device *audiocpu; + running_device *k007232; + running_device *k052109; + running_device *k051960; }; /*----------- defined in video/crimfght.c -----------*/ diff --git a/src/mame/includes/crospang.h b/src/mame/includes/crospang.h index 074ee16c8fe..5c330b95a04 100644 --- a/src/mame/includes/crospang.h +++ b/src/mame/includes/crospang.h @@ -20,7 +20,7 @@ struct _crospang_state int bestri_tilebank; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/crshrace.h b/src/mame/includes/crshrace.h index ec562941c54..e7e6898344a 100644 --- a/src/mame/includes/crshrace.h +++ b/src/mame/includes/crshrace.h @@ -17,8 +17,8 @@ struct _crshrace_state int pending_command; /* devices */ - const device_config *audiocpu; - const device_config *k053936; + running_device *audiocpu; + running_device *k053936; }; /*----------- defined in video/crshrace.c -----------*/ diff --git a/src/mame/includes/cvs.h b/src/mame/includes/cvs.h index 0cd8ccb1c50..246886c6150 100644 --- a/src/mame/includes/cvs.h +++ b/src/mame/includes/cvs.h @@ -54,14 +54,14 @@ struct _cvs_state UINT8 page, io_page; // quasar /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *speech; - const device_config *dac3; - const device_config *tms; - const device_config *s2636_0; - const device_config *s2636_1; - const device_config *s2636_2; + running_device *maincpu; + running_device *audiocpu; + running_device *speech; + running_device *dac3; + running_device *tms; + running_device *s2636_0; + running_device *s2636_1; + running_device *s2636_2; }; /*----------- defined in drivers/cvs.c -----------*/ diff --git a/src/mame/includes/cyberbal.h b/src/mame/includes/cyberbal.h index a59413bb283..e5814c3c85a 100644 --- a/src/mame/includes/cyberbal.h +++ b/src/mame/includes/cyberbal.h @@ -58,4 +58,4 @@ VIDEO_START( cyberbal ); VIDEO_START( cyberb2p ); VIDEO_UPDATE( cyberbal ); -void cyberbal_scanline_update(const device_config *screen, int scanline); +void cyberbal_scanline_update(running_device *screen, int scanline); diff --git a/src/mame/includes/darius.h b/src/mame/includes/darius.h index 3f3342d4a1e..508a579fbb0 100644 --- a/src/mame/includes/darius.h +++ b/src/mame/includes/darius.h @@ -29,35 +29,35 @@ struct _darius_state UINT8 pan[DARIUS_PAN_MAX]; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *cpub; - const device_config *adpcm; - const device_config *tc0140syt; - const device_config *pc080sn; + running_device *maincpu; + running_device *audiocpu; + running_device *cpub; + running_device *adpcm; + running_device *tc0140syt; + running_device *pc080sn; - const device_config *lscreen; - const device_config *mscreen; - const device_config *rscreen; + running_device *lscreen; + running_device *mscreen; + running_device *rscreen; - const device_config *filter0_0l; - const device_config *filter0_0r; - const device_config *filter0_1l; - const device_config *filter0_1r; - const device_config *filter0_2l; - const device_config *filter0_2r; - const device_config *filter0_3l; - const device_config *filter0_3r; - const device_config *filter1_0l; - const device_config *filter1_0r; - const device_config *filter1_1l; - const device_config *filter1_1r; - const device_config *filter1_2l; - const device_config *filter1_2r; - const device_config *filter1_3l; - const device_config *filter1_3r; - const device_config *msm5205_l; - const device_config *msm5205_r; + running_device *filter0_0l; + running_device *filter0_0r; + running_device *filter0_1l; + running_device *filter0_1r; + running_device *filter0_2l; + running_device *filter0_2r; + running_device *filter0_3l; + running_device *filter0_3r; + running_device *filter1_0l; + running_device *filter1_0r; + running_device *filter1_1l; + running_device *filter1_1r; + running_device *filter1_2l; + running_device *filter1_2r; + running_device *filter1_3l; + running_device *filter1_3r; + running_device *msm5205_l; + running_device *msm5205_r; }; diff --git a/src/mame/includes/dbz.h b/src/mame/includes/dbz.h index 43a3dca295b..39352055625 100644 --- a/src/mame/includes/dbz.h +++ b/src/mame/includes/dbz.h @@ -20,13 +20,13 @@ struct _dbz_state int control; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k053246; - const device_config *k053251; - const device_config *k056832; - const device_config *k053936_1; - const device_config *k053936_2; + running_device *maincpu; + running_device *audiocpu; + running_device *k053246; + running_device *k053251; + running_device *k056832; + running_device *k053936_1; + running_device *k053936_2; }; diff --git a/src/mame/includes/dcheese.h b/src/mame/includes/dcheese.h index 4204c45dc49..d6a7d629985 100644 --- a/src/mame/includes/dcheese.h +++ b/src/mame/includes/dcheese.h @@ -24,9 +24,9 @@ struct _dcheese_state UINT8 sound_msb_latch; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *bsmt; + running_device *maincpu; + running_device *audiocpu; + running_device *bsmt; }; diff --git a/src/mame/includes/dday.h b/src/mame/includes/dday.h index 783ff2393d8..b5f31b031ad 100644 --- a/src/mame/includes/dday.h +++ b/src/mame/includes/dday.h @@ -23,7 +23,7 @@ struct _dday_state int timer_value; /* devices */ - const device_config *ay1; + running_device *ay1; }; diff --git a/src/mame/includes/ddragon.h b/src/mame/includes/ddragon.h index 771d7ea1f1a..27c9f2ad6d9 100644 --- a/src/mame/includes/ddragon.h +++ b/src/mame/includes/ddragon.h @@ -45,11 +45,11 @@ struct _ddragon_state #endif /* devices */ - const device_config *maincpu; - const device_config *snd_cpu; - const device_config *sub_cpu; - const device_config *adpcm_1; - const device_config *adpcm_2; + running_device *maincpu; + running_device *snd_cpu; + running_device *sub_cpu; + running_device *adpcm_1; + running_device *adpcm_2; }; diff --git a/src/mame/includes/ddragon3.h b/src/mame/includes/ddragon3.h index 781fc9ebe0a..5bdbaaa8e0f 100644 --- a/src/mame/includes/ddragon3.h +++ b/src/mame/includes/ddragon3.h @@ -27,8 +27,8 @@ struct _ddragon3_state UINT16 io_reg[8]; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/ddrible.h b/src/mame/includes/ddrible.h index 2c9528907c3..22037e8b59c 100644 --- a/src/mame/includes/ddrible.h +++ b/src/mame/includes/ddrible.h @@ -25,9 +25,9 @@ struct _ddrible_state int int_enable_0, int_enable_1; /* devices */ - const device_config *filter1; - const device_config *filter2; - const device_config *filter3; + running_device *filter1; + running_device *filter2; + running_device *filter3; }; /*----------- defined in video/ddrible.c -----------*/ diff --git a/src/mame/includes/dec8.h b/src/mame/includes/dec8.h index 4f6afc30fe2..e31dbe629ce 100644 --- a/src/mame/includes/dec8.h +++ b/src/mame/includes/dec8.h @@ -27,10 +27,10 @@ struct _dec8_state int toggle; /* devices */ - const device_config *maincpu; - const device_config *subcpu; - const device_config *audiocpu; - const device_config *mcu; + running_device *maincpu; + running_device *subcpu; + running_device *audiocpu; + running_device *mcu; }; /*----------- defined in video/dec8.c -----------*/ diff --git a/src/mame/includes/deco16ic.h b/src/mame/includes/deco16ic.h index 88f092ab10e..d7a6b7bfec2 100644 --- a/src/mame/includes/deco16ic.h +++ b/src/mame/includes/deco16ic.h @@ -29,12 +29,12 @@ void deco16_set_tilemap_colour_base(int tmap, int base); void deco16_set_tilemap_colour_mask(int tmap, int mask); void deco16_set_tilemap_transparency_mask(int tmap, int mask); -void deco16_tilemap_1_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); -void deco16_tilemap_2_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); -void deco16_tilemap_3_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); -void deco16_tilemap_4_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); +void deco16_tilemap_1_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); +void deco16_tilemap_2_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); +void deco16_tilemap_3_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); +void deco16_tilemap_4_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); -void deco16_tilemap_34_combine_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); +void deco16_tilemap_34_combine_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority); void deco16_clear_sprite_priority_bitmap(void); void deco16_pdrawgfx( diff --git a/src/mame/includes/deniam.h b/src/mame/includes/deniam.h index 030a73fef4d..97aaf3381b6 100644 --- a/src/mame/includes/deniam.h +++ b/src/mame/includes/deniam.h @@ -26,7 +26,7 @@ struct _deniam_state UINT16 coinctrl; /* devices */ - const device_config *audio_cpu; // system 16c does not have sound CPU + running_device *audio_cpu; // system 16c does not have sound CPU }; diff --git a/src/mame/includes/djboy.h b/src/mame/includes/djboy.h index 48f48555533..3403bf16ec4 100644 --- a/src/mame/includes/djboy.h +++ b/src/mame/includes/djboy.h @@ -33,10 +33,10 @@ struct _djboy_state int prot_mode; /* devices */ - const device_config *maincpu; - const device_config *cpu1; - const device_config *cpu2; - const device_config *pandora; + running_device *maincpu; + running_device *cpu1; + running_device *cpu2; + running_device *pandora; }; diff --git a/src/mame/includes/dkong.h b/src/mame/includes/dkong.h index ab6b8f5777a..6b547427255 100644 --- a/src/mame/includes/dkong.h +++ b/src/mame/includes/dkong.h @@ -78,10 +78,10 @@ struct _dkong_state size_t sprite_ram_size; /* devices */ - const device_config *dev_n2a03a; - const device_config *dev_n2a03b; - const device_config *dev_vp2; /* virtual port 2 */ - const device_config *dev_6h; + running_device *dev_n2a03a; + running_device *dev_n2a03b; + running_device *dev_vp2; /* virtual port 2 */ + running_device *dev_6h; #if 0 /* machine states */ diff --git a/src/mame/includes/docastle.h b/src/mame/includes/docastle.h index 00b525ee965..a8c694e23cd 100644 --- a/src/mame/includes/docastle.h +++ b/src/mame/includes/docastle.h @@ -19,7 +19,7 @@ struct _docastle_state UINT8 buffer0[9], buffer1[9]; /* devices */ - const device_config *slave; + running_device *slave; }; diff --git a/src/mame/includes/dogfgt.h b/src/mame/includes/dogfgt.h index a78e59ad7a3..7b9c0c4ef0d 100644 --- a/src/mame/includes/dogfgt.h +++ b/src/mame/includes/dogfgt.h @@ -25,7 +25,7 @@ struct _dogfgt_state int soundlatch, last_snd_ctrl; /* devices */ - const device_config *subcpu; + running_device *subcpu; }; diff --git a/src/mame/includes/dragrace.h b/src/mame/includes/dragrace.h index 7b5d50bf2bc..fe568477897 100644 --- a/src/mame/includes/dragrace.h +++ b/src/mame/includes/dragrace.h @@ -37,7 +37,7 @@ struct _dragrace_state int gear[2]; /* devices */ - const device_config *discrete; + running_device *discrete; }; diff --git a/src/mame/includes/drgnmst.h b/src/mame/includes/drgnmst.h index 1ba967d77c2..11e530df542 100644 --- a/src/mame/includes/drgnmst.h +++ b/src/mame/includes/drgnmst.h @@ -26,8 +26,8 @@ struct _drgnmst_state UINT8 oki1_bank; /* devices */ - const device_config *oki_1; - const device_config *oki_2; + running_device *oki_1; + running_device *oki_2; }; diff --git a/src/mame/includes/dribling.h b/src/mame/includes/dribling.h index e6452b7a07b..59030ad8cc6 100644 --- a/src/mame/includes/dribling.h +++ b/src/mame/includes/dribling.h @@ -20,9 +20,9 @@ struct _dribling_state UINT8 di; /* devices */ - const device_config *maincpu; - const device_config *ppi_0; - const device_config *ppi_1; + running_device *maincpu; + running_device *ppi_0; + running_device *ppi_1; }; diff --git a/src/mame/includes/drmicro.h b/src/mame/includes/drmicro.h index 763003632b7..29b07de57df 100644 --- a/src/mame/includes/drmicro.h +++ b/src/mame/includes/drmicro.h @@ -20,7 +20,7 @@ struct _drmicro_state int pcm_adr; /* devices */ - const device_config *msm; + running_device *msm; }; diff --git a/src/mame/includes/eprom.h b/src/mame/includes/eprom.h index 2f88eaaec01..b68698dbdf7 100644 --- a/src/mame/includes/eprom.h +++ b/src/mame/includes/eprom.h @@ -24,4 +24,4 @@ VIDEO_UPDATE( eprom ); VIDEO_START( guts ); VIDEO_UPDATE( guts ); -void eprom_scanline_update(const device_config *screen, int scanline); +void eprom_scanline_update(running_device *screen, int scanline); diff --git a/src/mame/includes/equites.h b/src/mame/includes/equites.h index 96f1b8406ab..9a827037d18 100644 --- a/src/mame/includes/equites.h +++ b/src/mame/includes/equites.h @@ -34,11 +34,11 @@ struct _equites_state #endif /* devices */ - const device_config *mcu; - const device_config *audio_cpu; - const device_config *msm; - const device_config *dac_1; - const device_config *dac_2; + running_device *mcu; + running_device *audio_cpu; + running_device *msm; + running_device *dac_1; + running_device *dac_2; }; diff --git a/src/mame/includes/esd16.h b/src/mame/includes/esd16.h index 913721efc16..aa57d8e38ec 100644 --- a/src/mame/includes/esd16.h +++ b/src/mame/includes/esd16.h @@ -25,8 +25,8 @@ struct _esd16_state int tilemap0_color; /* devices */ - const device_config *audio_cpu; - const device_config *eeprom; + running_device *audio_cpu; + running_device *eeprom; }; diff --git a/src/mame/includes/espial.h b/src/mame/includes/espial.h index 4e1c60cb493..3a57742dca4 100644 --- a/src/mame/includes/espial.h +++ b/src/mame/includes/espial.h @@ -36,8 +36,8 @@ struct _espial_state int percuss_hardware; // zodiack /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; /*----------- defined in drivers/espial.c -----------*/ diff --git a/src/mame/includes/exerion.h b/src/mame/includes/exerion.h index 5eff5856bc5..339d4bc1d12 100644 --- a/src/mame/includes/exerion.h +++ b/src/mame/includes/exerion.h @@ -41,7 +41,7 @@ struct _exerion_state UINT8 portb; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/includes/exprraid.h b/src/mame/includes/exprraid.h index b6b602c0614..100fb88a913 100644 --- a/src/mame/includes/exprraid.h +++ b/src/mame/includes/exprraid.h @@ -23,8 +23,8 @@ struct _exprraid_state //int coin; // used in the commented out INTERRUPT_GEN - can this be removed? /* devices */ - const device_config *maincpu; - const device_config *slave; + running_device *maincpu; + running_device *slave; }; diff --git a/src/mame/includes/exterm.h b/src/mame/includes/exterm.h index f50ed063513..ae81474729e 100644 --- a/src/mame/includes/exterm.h +++ b/src/mame/includes/exterm.h @@ -10,7 +10,7 @@ extern UINT16 *exterm_master_videoram; extern UINT16 *exterm_slave_videoram; PALETTE_INIT( exterm ); -void exterm_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void exterm_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); void exterm_to_shiftreg_master(const address_space *space, UINT32 address, UINT16* shiftreg); void exterm_from_shiftreg_master(const address_space *space, UINT32 address, UINT16* shiftreg); diff --git a/src/mame/includes/f1gp.h b/src/mame/includes/f1gp.h index f876a60554b..fdd7e7637cd 100644 --- a/src/mame/includes/f1gp.h +++ b/src/mame/includes/f1gp.h @@ -29,8 +29,8 @@ struct _f1gp_state int pending_command; /* devices */ - const device_config *audiocpu; - const device_config *k053936; + running_device *audiocpu; + running_device *k053936; }; /*----------- defined in video/f1gp.c -----------*/ diff --git a/src/mame/includes/fantland.h b/src/mame/includes/fantland.h index efb5c1ff443..50e9a9996f4 100644 --- a/src/mame/includes/fantland.h +++ b/src/mame/includes/fantland.h @@ -17,11 +17,11 @@ struct _fantland_state int adpcm_nibble[4]; /* devices */ - const device_config *audio_cpu; - const device_config *msm1; - const device_config *msm2; - const device_config *msm3; - const device_config *msm4; + running_device *audio_cpu; + running_device *msm1; + running_device *msm2; + running_device *msm3; + running_device *msm4; }; diff --git a/src/mame/includes/fastlane.h b/src/mame/includes/fastlane.h index 3a137ea3a30..49596892de0 100644 --- a/src/mame/includes/fastlane.h +++ b/src/mame/includes/fastlane.h @@ -19,8 +19,8 @@ struct _fastlane_state rectangle clip0, clip1; /* devices */ - const device_config *konami2; - const device_config *k007121; + running_device *konami2; + running_device *k007121; }; diff --git a/src/mame/includes/fcombat.h b/src/mame/includes/fcombat.h index adada83c942..cbda1338327 100644 --- a/src/mame/includes/fcombat.h +++ b/src/mame/includes/fcombat.h @@ -43,7 +43,7 @@ struct _fcombat_state int tx, ty; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/includes/fgoal.h b/src/mame/includes/fgoal.h index ab3d0f9c31b..349274dad8d 100644 --- a/src/mame/includes/fgoal.h +++ b/src/mame/includes/fgoal.h @@ -17,8 +17,8 @@ struct _fgoal_state int prev_coin; /* devices */ - const device_config *maincpu; - const device_config *mb14241; + running_device *maincpu; + running_device *mb14241; }; diff --git a/src/mame/includes/finalizr.h b/src/mame/includes/finalizr.h index 584fcfe0354..30fe3a6b6a8 100644 --- a/src/mame/includes/finalizr.h +++ b/src/mame/includes/finalizr.h @@ -27,7 +27,7 @@ struct _finalizr_state UINT8 nmi_enable, irq_enable; /* devices */ - const device_config *audio_cpu; + running_device *audio_cpu; }; diff --git a/src/mame/includes/firetrap.h b/src/mame/includes/firetrap.h index ba08613d065..d9dbc53692f 100644 --- a/src/mame/includes/firetrap.h +++ b/src/mame/includes/firetrap.h @@ -29,9 +29,9 @@ struct _firetrap_state int coin_command_pending; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *msm; + running_device *maincpu; + running_device *audiocpu; + running_device *msm; }; diff --git a/src/mame/includes/flkatck.h b/src/mame/includes/flkatck.h index 77b53599694..b8ce793c46f 100644 --- a/src/mame/includes/flkatck.h +++ b/src/mame/includes/flkatck.h @@ -20,8 +20,8 @@ struct _flkatck_state int multiply_reg[2]; /* devices */ - const device_config *audiocpu; - const device_config *k007121; + running_device *audiocpu; + running_device *k007121; }; diff --git a/src/mame/includes/flstory.h b/src/mame/includes/flstory.h index b9183a51e9f..a8f466e5d52 100644 --- a/src/mame/includes/flstory.h +++ b/src/mame/includes/flstory.h @@ -35,9 +35,9 @@ struct _flstory_state int mcu_select; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *mcu; + running_device *maincpu; + running_device *audiocpu; + running_device *mcu; }; diff --git a/src/mame/includes/fromanc2.h b/src/mame/includes/fromanc2.h index babeaaa601f..5f656298b9e 100644 --- a/src/mame/includes/fromanc2.h +++ b/src/mame/includes/fromanc2.h @@ -18,11 +18,11 @@ struct _fromanc2_state UINT8 datalatch_2h, datalatch_2l; /* devices */ - const device_config *audiocpu; - const device_config *subcpu; - const device_config *eeprom; - const device_config *left_screen; - const device_config *right_screen; + running_device *audiocpu; + running_device *subcpu; + running_device *eeprom; + running_device *left_screen; + running_device *right_screen; }; diff --git a/src/mame/includes/fromance.h b/src/mame/includes/fromance.h index 90f39032795..7dde062b17d 100644 --- a/src/mame/includes/fromance.h +++ b/src/mame/includes/fromance.h @@ -37,7 +37,7 @@ struct _fromance_state UINT8 pending_command, sound_command; /* devices */ - const device_config *subcpu; + running_device *subcpu; }; diff --git a/src/mame/includes/funybubl.h b/src/mame/includes/funybubl.h index 599514c497d..8e734414af6 100644 --- a/src/mame/includes/funybubl.h +++ b/src/mame/includes/funybubl.h @@ -8,7 +8,7 @@ struct _funybubl_state UINT8 * paletteram; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/fuukifg2.h b/src/mame/includes/fuukifg2.h index 9fc9559af4b..597c8dd625e 100644 --- a/src/mame/includes/fuukifg2.h +++ b/src/mame/includes/fuukifg2.h @@ -22,8 +22,8 @@ struct _fuuki16_state emu_timer *raster_interrupt_timer; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/fuukifg3.h b/src/mame/includes/fuukifg3.h index 4f0c783eed4..a5ec0098d7e 100644 --- a/src/mame/includes/fuukifg3.h +++ b/src/mame/includes/fuukifg3.h @@ -35,8 +35,8 @@ struct _fuuki32_state UINT8 shared_ram[16]; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/gaelco.h b/src/mame/includes/gaelco.h index e268f419413..e3852379ede 100644 --- a/src/mame/includes/gaelco.h +++ b/src/mame/includes/gaelco.h @@ -18,7 +18,7 @@ struct _gaelco_state tilemap_t *tilemap[2]; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/gaelco3d.h b/src/mame/includes/gaelco3d.h index 035b11b64ec..95be5d82660 100644 --- a/src/mame/includes/gaelco3d.h +++ b/src/mame/includes/gaelco3d.h @@ -14,7 +14,7 @@ extern UINT8 *gaelco3d_texmask; extern offs_t gaelco3d_texture_size; extern offs_t gaelco3d_texmask_size; -void gaelco3d_render(const device_config *screen); +void gaelco3d_render(running_device *screen); WRITE32_HANDLER( gaelco3d_render_w ); WRITE16_HANDLER( gaelco3d_paletteram_w ); diff --git a/src/mame/includes/gaiden.h b/src/mame/includes/gaiden.h index 8007f1092ee..7dcfb58650a 100644 --- a/src/mame/includes/gaiden.h +++ b/src/mame/includes/gaiden.h @@ -27,7 +27,7 @@ struct _gaiden_state const int *raiga_jumppoints; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/galaxold.h b/src/mame/includes/galaxold.h index 4d0d824e46d..a58f79774a3 100644 --- a/src/mame/includes/galaxold.h +++ b/src/mame/includes/galaxold.h @@ -100,8 +100,8 @@ WRITE8_HANDLER( galaxold_flip_screen_y_w ); TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer ); -void galaxold_7474_9m_2_callback(const device_config *device); -void galaxold_7474_9m_1_callback(const device_config *device); +void galaxold_7474_9m_2_callback(running_device *device); +void galaxold_7474_9m_1_callback(running_device *device); DRIVER_INIT( 4in1 ); DRIVER_INIT( ladybugg ); @@ -172,7 +172,7 @@ CUSTOM_INPUT( darkplnt_custom_r ); /*----------- defined in audio/scramble.c -----------*/ void scramble_sh_init(running_machine *machine); -void scramble_sh_7474_callback(const device_config *device); +void scramble_sh_7474_callback(running_device *device); WRITE8_HANDLER( scramble_filter_w ); WRITE8_HANDLER( frogger_filter_w ); diff --git a/src/mame/includes/galspnbl.h b/src/mame/includes/galspnbl.h index e0a13cf8a6d..6ca0ddeb482 100644 --- a/src/mame/includes/galspnbl.h +++ b/src/mame/includes/galspnbl.h @@ -18,7 +18,7 @@ struct _galspnbl_state size_t spriteram_size; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/gameplan.h b/src/mame/includes/gameplan.h index c0bc85cefca..064254d99e5 100644 --- a/src/mame/includes/gameplan.h +++ b/src/mame/includes/gameplan.h @@ -38,12 +38,12 @@ struct _gameplan_state emu_timer *via_0_ca1_timer; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *riot; - const device_config *via_0; - const device_config *via_1; - const device_config *via_2; + running_device *maincpu; + running_device *audiocpu; + running_device *riot; + running_device *via_0; + running_device *via_1; + running_device *via_2; }; diff --git a/src/mame/includes/gbusters.h b/src/mame/includes/gbusters.h index a8ce2a5e8d2..f9c20147cba 100644 --- a/src/mame/includes/gbusters.h +++ b/src/mame/includes/gbusters.h @@ -19,11 +19,11 @@ struct _gbusters_state int priority; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k007232; - const device_config *k052109; - const device_config *k051960; + running_device *maincpu; + running_device *audiocpu; + running_device *k007232; + running_device *k052109; + running_device *k051960; }; /*----------- defined in video/gbusters.c -----------*/ diff --git a/src/mame/includes/gcpinbal.h b/src/mame/includes/gcpinbal.h index b50e21a6e99..3fc081f1732 100644 --- a/src/mame/includes/gcpinbal.h +++ b/src/mame/includes/gcpinbal.h @@ -23,9 +23,9 @@ struct _gcpinbal_state UINT8 adpcm_trigger, adpcm_data; /* devices */ - const device_config *maincpu; - const device_config *oki; - const device_config *msm; + running_device *maincpu; + running_device *oki; + running_device *msm; }; diff --git a/src/mame/includes/gijoe.h b/src/mame/includes/gijoe.h index 5350689e9cc..601f4f27549 100644 --- a/src/mame/includes/gijoe.h +++ b/src/mame/includes/gijoe.h @@ -22,12 +22,12 @@ struct _gijoe_state emu_timer *dmadelay_timer; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k054539; - const device_config *k056832; - const device_config *k053246; - const device_config *k053251; + running_device *maincpu; + running_device *audiocpu; + running_device *k054539; + running_device *k056832; + running_device *k053246; + running_device *k053251; }; /*----------- defined in video/gijoe.c -----------*/ diff --git a/src/mame/includes/ginganin.h b/src/mame/includes/ginganin.h index 1a68fdfc47c..3a5abe5b09b 100644 --- a/src/mame/includes/ginganin.h +++ b/src/mame/includes/ginganin.h @@ -32,7 +32,7 @@ struct _ginganin_state int MC6809_FLAG; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/goal92.h b/src/mame/includes/goal92.h index 08e850abc05..0e9a37742b8 100644 --- a/src/mame/includes/goal92.h +++ b/src/mame/includes/goal92.h @@ -24,7 +24,7 @@ struct _goal92_state int adpcm_toggle; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/gotcha.h b/src/mame/includes/gotcha.h index a6bcf415084..2599a1801c6 100644 --- a/src/mame/includes/gotcha.h +++ b/src/mame/includes/gotcha.h @@ -20,7 +20,7 @@ struct _gotcha_state UINT16 scroll[4]; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/gotya.h b/src/mame/includes/gotya.h index f8e586283fe..32d15da2ee4 100644 --- a/src/mame/includes/gotya.h +++ b/src/mame/includes/gotya.h @@ -17,7 +17,7 @@ struct _gotya_state int theme_playing; /* devices */ - const device_config *samples; + running_device *samples; }; diff --git a/src/mame/includes/gradius3.h b/src/mame/includes/gradius3.h index 6dfd82674ff..bbd6d89c558 100644 --- a/src/mame/includes/gradius3.h +++ b/src/mame/includes/gradius3.h @@ -19,12 +19,12 @@ struct _gradius3_state int irqAen, irqBmask; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *subcpu; - const device_config *k007232; - const device_config *k052109; - const device_config *k051960; + running_device *maincpu; + running_device *audiocpu; + running_device *subcpu; + running_device *k007232; + running_device *k052109; + running_device *k051960; }; /*----------- defined in video/gradius3.c -----------*/ diff --git a/src/mame/includes/gyruss.h b/src/mame/includes/gyruss.h index 9b04b7bc574..4230f3179c1 100644 --- a/src/mame/includes/gyruss.h +++ b/src/mame/includes/gyruss.h @@ -17,8 +17,8 @@ struct _gyruss_state tilemap_t *tilemap; /* devices */ - const device_config *audiocpu; - const device_config *audiocpu_2; + running_device *audiocpu; + running_device *audiocpu_2; }; diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h index ad9c07fbac5..4bf5370a6c3 100644 --- a/src/mame/includes/harddriv.h +++ b/src/mame/includes/harddriv.h @@ -12,14 +12,14 @@ struct _harddriv_state { atarigen_state atarigen; - const device_config * maincpu; - const device_config * gsp; - const device_config * msp; - const device_config * adsp; - const device_config * soundcpu; - const device_config * sounddsp; - const device_config * jsacpu; - const device_config * dsp32; + running_device * maincpu; + running_device * gsp; + running_device * msp; + running_device * adsp; + running_device * soundcpu; + running_device * sounddsp; + running_device * jsacpu; + running_device * dsp32; UINT8 hd34010_host_access; UINT8 dsk_pio_access; @@ -77,7 +77,7 @@ struct _harddriv_state UINT8 duart_read_data[16]; UINT8 duart_write_data[16]; UINT8 duart_output_port; - const device_config * duart_timer; + running_device * duart_timer; UINT8 last_gsp_shiftreg; @@ -166,8 +166,8 @@ MACHINE_RESET( harddriv ); INTERRUPT_GEN( hd68k_irq_gen ); WRITE16_HANDLER( hd68k_irq_ack_w ); -void hdgsp_irq_gen(const device_config *device, int state); -void hdmsp_irq_gen(const device_config *device, int state); +void hdgsp_irq_gen(running_device *device, int state); +void hdmsp_irq_gen(running_device *device, int state); READ16_HANDLER( hd68k_gsp_io_r ); WRITE16_HANDLER( hd68k_gsp_io_w ); @@ -240,7 +240,7 @@ READ16_HANDLER( hd68k_ds3_program_r ); WRITE16_HANDLER( hd68k_ds3_program_w ); /* DSK board */ -void hddsk_update_pif(const device_config *device, UINT32 pins); +void hddsk_update_pif(running_device *device, UINT32 pins); WRITE16_HANDLER( hd68k_dsk_control_w ); READ16_HANDLER( hd68k_dsk_ram_r ); WRITE16_HANDLER( hd68k_dsk_ram_w ); @@ -343,5 +343,5 @@ WRITE16_HANDLER( hdgsp_paletteram_lo_w ); READ16_HANDLER( hdgsp_paletteram_hi_r ); WRITE16_HANDLER( hdgsp_paletteram_hi_w ); -void harddriv_scanline_driver(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); -void harddriv_scanline_multisync(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void harddriv_scanline_driver(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void harddriv_scanline_multisync(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/includes/hcastle.h b/src/mame/includes/hcastle.h index ab5bd16f90b..8fb5461b61f 100644 --- a/src/mame/includes/hcastle.h +++ b/src/mame/includes/hcastle.h @@ -21,9 +21,9 @@ struct _hcastle_state int gfx_bank; /* devices */ - const device_config *audiocpu; - const device_config *k007121_1; - const device_config *k007121_2; + running_device *audiocpu; + running_device *k007121_1; + running_device *k007121_2; }; diff --git a/src/mame/includes/himesiki.h b/src/mame/includes/himesiki.h index b9048bb9197..7356e14d78e 100644 --- a/src/mame/includes/himesiki.h +++ b/src/mame/includes/himesiki.h @@ -18,7 +18,7 @@ struct _himesiki_state int flipscreen; /* devices */ - const device_config *subcpu; + running_device *subcpu; }; diff --git a/src/mame/includes/homedata.h b/src/mame/includes/homedata.h index 281f33d2af1..dda01c080c0 100644 --- a/src/mame/includes/homedata.h +++ b/src/mame/includes/homedata.h @@ -27,11 +27,11 @@ struct _homedata_state int to_cpu, from_cpu; /* device */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *dac; - const device_config *ym; - const device_config *sn; + running_device *maincpu; + running_device *audiocpu; + running_device *dac; + running_device *ym; + running_device *sn; }; diff --git a/src/mame/includes/hyprduel.h b/src/mame/includes/hyprduel.h index 5b20ad9c7b2..4c2d302a5d7 100644 --- a/src/mame/includes/hyprduel.h +++ b/src/mame/includes/hyprduel.h @@ -40,8 +40,8 @@ struct _hyprduel_state int int_num; /* devices */ - const device_config *maincpu; - const device_config *subcpu; + running_device *maincpu; + running_device *subcpu; }; diff --git a/src/mame/includes/inufuku.h b/src/mame/includes/inufuku.h index a119f421a23..f6d4f7214fb 100644 --- a/src/mame/includes/inufuku.h +++ b/src/mame/includes/inufuku.h @@ -22,7 +22,7 @@ struct _inufuku_state UINT16 pending_command; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/iremz80.h b/src/mame/includes/iremz80.h index f65a05bb60c..3548a7b6239 100644 --- a/src/mame/includes/iremz80.h +++ b/src/mame/includes/iremz80.h @@ -56,10 +56,10 @@ struct _irem_z80_state int bankcontrol[2]; //ldrun2 /* sound devices */ - const device_config *ay1; - const device_config *ay2; - const device_config *adpcm1; - const device_config *adpcm2; + running_device *ay1; + running_device *ay2; + running_device *adpcm1; + running_device *adpcm2; }; diff --git a/src/mame/includes/ironhors.h b/src/mame/includes/ironhors.h index c40c706ff67..614306b86c0 100644 --- a/src/mame/includes/ironhors.h +++ b/src/mame/includes/ironhors.h @@ -21,7 +21,7 @@ struct _ironhors_state int palettebank, charbank, spriterambank; /* devices */ - const device_config *soundcpu; + running_device *soundcpu; }; diff --git a/src/mame/includes/jack.h b/src/mame/includes/jack.h index 7ac92ac33b2..6b5f5fd0e96 100644 --- a/src/mame/includes/jack.h +++ b/src/mame/includes/jack.h @@ -26,7 +26,7 @@ struct _jack_state /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/jackal.h b/src/mame/includes/jackal.h index a2994fe9c65..edf2880025a 100644 --- a/src/mame/includes/jackal.h +++ b/src/mame/includes/jackal.h @@ -21,8 +21,8 @@ struct _jackal_state UINT8 *spritebank; /* devices */ - const device_config *mastercpu; - const device_config *slavecpu; + running_device *mastercpu; + running_device *slavecpu; }; diff --git a/src/mame/includes/jaguar.h b/src/mame/includes/jaguar.h index 1894f885a7f..02b02cda834 100644 --- a/src/mame/includes/jaguar.h +++ b/src/mame/includes/jaguar.h @@ -36,7 +36,7 @@ void jaguar_dsp_resume(running_machine *machine); void cojag_sound_init(running_machine *machine); -void jaguar_external_int(const device_config *device, int state); +void jaguar_external_int(running_device *device, int state); READ16_HANDLER( jaguar_jerry_regs_r ); WRITE16_HANDLER( jaguar_jerry_regs_w ); @@ -52,8 +52,8 @@ WRITE32_HANDLER( jaguar_serial_w ); void jaguar_gpu_suspend(running_machine *machine); void jaguar_gpu_resume(running_machine *machine); -void jaguar_gpu_cpu_int(const device_config *device); -void jaguar_dsp_cpu_int(const device_config *device); +void jaguar_gpu_cpu_int(running_device *device); +void jaguar_dsp_cpu_int(running_device *device); READ32_HANDLER( jaguar_blitter_r ); WRITE32_HANDLER( jaguar_blitter_w ); diff --git a/src/mame/includes/jpmimpct.h b/src/mame/includes/jpmimpct.h index 7b4a24df4c2..400898260a0 100644 --- a/src/mame/includes/jpmimpct.h +++ b/src/mame/includes/jpmimpct.h @@ -13,6 +13,6 @@ WRITE16_HANDLER( jpmimpct_bt477_w ); void jpmimpct_to_shiftreg(const address_space *space, UINT32 address, UINT16 *shiftreg); void jpmimpct_from_shiftreg(const address_space *space, UINT32 address, UINT16 *shiftreg); -void jpmimpct_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void jpmimpct_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); VIDEO_START( jpmimpct ); diff --git a/src/mame/includes/karnov.h b/src/mame/includes/karnov.h index ee53429eed0..a6da37d6eb7 100644 --- a/src/mame/includes/karnov.h +++ b/src/mame/includes/karnov.h @@ -26,8 +26,8 @@ struct _karnov_state int latch; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; enum { diff --git a/src/mame/includes/kchamp.h b/src/mame/includes/kchamp.h index 3b3afa03cb2..5b330799111 100644 --- a/src/mame/includes/kchamp.h +++ b/src/mame/includes/kchamp.h @@ -24,7 +24,7 @@ struct _kchamp_state int counter; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/kickgoal.h b/src/mame/includes/kickgoal.h index 75738545b80..10636f9f3ec 100644 --- a/src/mame/includes/kickgoal.h +++ b/src/mame/includes/kickgoal.h @@ -26,8 +26,8 @@ struct _kickgoal_state UINT16 m6295_key_delay; /* devices */ - const device_config *adpcm; - const device_config *eeprom; + running_device *adpcm; + running_device *eeprom; }; diff --git a/src/mame/includes/kingobox.h b/src/mame/includes/kingobox.h index fa9ea456e7c..a7bd85f664e 100644 --- a/src/mame/includes/kingobox.h +++ b/src/mame/includes/kingobox.h @@ -24,9 +24,9 @@ struct _kingofb_state int nmi_enable; /* devices */ - const device_config *video_cpu; - const device_config *sprite_cpu; - const device_config *audio_cpu; + running_device *video_cpu; + running_device *sprite_cpu; + running_device *audio_cpu; }; diff --git a/src/mame/includes/kncljoe.h b/src/mame/includes/kncljoe.h index b622fac2139..2023fb62fe4 100644 --- a/src/mame/includes/kncljoe.h +++ b/src/mame/includes/kncljoe.h @@ -22,7 +22,7 @@ struct _kncljoe_state UINT8 port1, port2; /* devices */ - const device_config *soundcpu; + running_device *soundcpu; }; diff --git a/src/mame/includes/kopunch.h b/src/mame/includes/kopunch.h index 6f5d6b05e0a..c758d5532bd 100644 --- a/src/mame/includes/kopunch.h +++ b/src/mame/includes/kopunch.h @@ -19,7 +19,7 @@ struct _kopunch_state int gfxbank; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; /*----------- defined in video/kopunch.c -----------*/ diff --git a/src/mame/includes/kyugo.h b/src/mame/includes/kyugo.h index 2ff9ef32b49..ec65941ccd8 100644 --- a/src/mame/includes/kyugo.h +++ b/src/mame/includes/kyugo.h @@ -23,8 +23,8 @@ struct _kyugo_state const UINT8 *color_codes; /* devices */ - const device_config *maincpu; - const device_config *subcpu; + running_device *maincpu; + running_device *subcpu; }; diff --git a/src/mame/includes/labyrunr.h b/src/mame/includes/labyrunr.h index 4595a7ce453..b4aaa1bd6d7 100644 --- a/src/mame/includes/labyrunr.h +++ b/src/mame/includes/labyrunr.h @@ -19,7 +19,7 @@ struct _labyrunr_state rectangle clip0, clip1; /* devices */ - const device_config *k007121; + running_device *k007121; }; diff --git a/src/mame/includes/ladybug.h b/src/mame/includes/ladybug.h index 7dd462e315d..46c9002323f 100644 --- a/src/mame/includes/ladybug.h +++ b/src/mame/includes/ladybug.h @@ -35,7 +35,7 @@ struct _ladybug_state UINT8 sraider_0x30, sraider_0x38; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/includes/ladyfrog.h b/src/mame/includes/ladyfrog.h index 49acf0ecfcf..a5ffb11c72b 100644 --- a/src/mame/includes/ladyfrog.h +++ b/src/mame/includes/ladyfrog.h @@ -26,7 +26,7 @@ struct _ladyfrog_state UINT8 snd_data; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/laserbat.h b/src/mame/includes/laserbat.h index 9dccd2d44b0..71e2d721c4f 100644 --- a/src/mame/includes/laserbat.h +++ b/src/mame/includes/laserbat.h @@ -31,16 +31,16 @@ struct _laserbat_state int degr, filt, a, us, bit14; /* device */ - const device_config *audiocpu; - const device_config *s2636_1; - const device_config *s2636_2; - const device_config *s2636_3; - const device_config *pia; - const device_config *sn; - const device_config *tms1; - const device_config *tms2; - const device_config *ay1; - const device_config *ay2; + running_device *audiocpu; + running_device *s2636_1; + running_device *s2636_2; + running_device *s2636_3; + running_device *pia; + running_device *sn; + running_device *tms1; + running_device *tms2; + running_device *ay1; + running_device *ay2; }; diff --git a/src/mame/includes/lasso.h b/src/mame/includes/lasso.h index 7b15d057d58..0c7e22daa68 100644 --- a/src/mame/includes/lasso.h +++ b/src/mame/includes/lasso.h @@ -24,10 +24,10 @@ struct _lasso_state UINT8 track_enable; /* used by wwjgtin */ /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *sn_1; - const device_config *sn_2; + running_device *maincpu; + running_device *audiocpu; + running_device *sn_1; + running_device *sn_2; }; diff --git a/src/mame/includes/lastduel.h b/src/mame/includes/lastduel.h index 0df7c986543..f482240671c 100644 --- a/src/mame/includes/lastduel.h +++ b/src/mame/includes/lastduel.h @@ -20,7 +20,7 @@ struct _lastduel_state int sprite_flipy_mask, sprite_pri_mask, tilemap_priority; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; /*----------- defined in video/lastduel.c -----------*/ diff --git a/src/mame/includes/lazercmd.h b/src/mame/includes/lazercmd.h index 6835577aed8..9d86954d958 100644 --- a/src/mame/includes/lazercmd.h +++ b/src/mame/includes/lazercmd.h @@ -31,7 +31,7 @@ struct _lazercmd_state int timer_count, sense_state, dac_data; /* device */ - const device_config *dac; + running_device *dac; }; diff --git a/src/mame/includes/lemmings.h b/src/mame/includes/lemmings.h index 7a2183cb407..00c81926fd5 100644 --- a/src/mame/includes/lemmings.h +++ b/src/mame/includes/lemmings.h @@ -18,7 +18,7 @@ struct _lemmings_state UINT8 *vram_buffer; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/lethal.h b/src/mame/includes/lethal.h index 1dfd35d658b..88857439274 100644 --- a/src/mame/includes/lethal.h +++ b/src/mame/includes/lethal.h @@ -17,12 +17,12 @@ struct _lethal_state UINT8 cur_control2; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k054539; - const device_config *k056832; - const device_config *k053244; - const device_config *k054000; + running_device *maincpu; + running_device *audiocpu; + running_device *k054539; + running_device *k056832; + running_device *k053244; + running_device *k054000; }; /*----------- defined in video/lethal.c -----------*/ diff --git a/src/mame/includes/lethalj.h b/src/mame/includes/lethalj.h index 7d25c9a86ca..c3c782703e4 100644 --- a/src/mame/includes/lethalj.h +++ b/src/mame/includes/lethalj.h @@ -12,4 +12,4 @@ VIDEO_START( lethalj ); WRITE16_HANDLER( lethalj_blitter_w ); -void lethalj_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void lethalj_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/includes/m10.h b/src/mame/includes/m10.h index 621c8679216..40bc6c6381e 100644 --- a/src/mame/includes/m10.h +++ b/src/mame/includes/m10.h @@ -53,10 +53,10 @@ struct _m10_state int last; /* devices */ - const device_config *maincpu; - const device_config *ic8j1; - const device_config *ic8j2; - const device_config *samples; + running_device *maincpu; + running_device *ic8j1; + running_device *ic8j2; + running_device *samples; }; diff --git a/src/mame/includes/mainevt.h b/src/mame/includes/mainevt.h index 6c409bc0821..f8734538366 100644 --- a/src/mame/includes/mainevt.h +++ b/src/mame/includes/mainevt.h @@ -17,12 +17,12 @@ struct _mainevt_state int nmi_enable; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *upd; - const device_config *k007232; - const device_config *k052109; - const device_config *k051960; + running_device *maincpu; + running_device *audiocpu; + running_device *upd; + running_device *k007232; + running_device *k052109; + running_device *k051960; }; /*----------- defined in video/mainevt.c -----------*/ diff --git a/src/mame/includes/malzak.h b/src/mame/includes/malzak.h index 0a702f58ea0..b7db92c49cf 100644 --- a/src/mame/includes/malzak.h +++ b/src/mame/includes/malzak.h @@ -17,9 +17,9 @@ struct _malzak_state int collision_counter; /* devices */ - const device_config *s2636_0; - const device_config *s2636_1; - const device_config *saa5050; + running_device *s2636_0; + running_device *s2636_1; + running_device *saa5050; }; diff --git a/src/mame/includes/metalmx.h b/src/mame/includes/metalmx.h index 15bbc085368..b6bc7fc6a54 100644 --- a/src/mame/includes/metalmx.h +++ b/src/mame/includes/metalmx.h @@ -1,11 +1,11 @@ typedef struct _metalmx_state metalmx_state; struct _metalmx_state { - const device_config *maincpu; - const device_config *gsp; - const device_config *adsp; - const device_config *dsp32c_1; - const device_config *dsp32c_2; + running_device *maincpu; + running_device *gsp; + running_device *adsp; + running_device *dsp32c_1; + running_device *dsp32c_2; UINT16 *gsp_dram; UINT16 *gsp_vram; diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h index 72da89de502..12b268693a5 100644 --- a/src/mame/includes/micro3d.h +++ b/src/mame/includes/micro3d.h @@ -52,7 +52,7 @@ struct _micro3d_state } mc68901; UINT16 *shared_ram; - const device_config *duart68681; + running_device *duart68681; UINT8 m68681_tx0; /* Sound */ @@ -145,10 +145,10 @@ WRITE32_HANDLER( micro3d_mac1_w ); WRITE32_HANDLER( micro3d_mac2_w ); READ32_HANDLER( micro3d_mac2_r ); -void micro3d_duart_irq_handler(const device_config *device, UINT8 vector); -UINT8 micro3d_duart_input_r(const device_config *device); -void micro3d_duart_output_w(const device_config *device, UINT8 data); -void micro3d_duart_tx(const device_config *device, int channel, UINT8 data); +void micro3d_duart_irq_handler(running_device *device, UINT8 vector); +UINT8 micro3d_duart_input_r(running_device *device); +void micro3d_duart_output_w(running_device *device, UINT8 data); +void micro3d_duart_tx(running_device *device, int channel, UINT8 data); MACHINE_RESET( micro3d ); DRIVER_INIT( micro3d ); @@ -169,8 +169,8 @@ VIDEO_START( micro3d ); VIDEO_UPDATE( micro3d ); VIDEO_RESET( micro3d ); -void micro3d_tms_interrupt(const device_config *device, int state); -void micro3d_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void micro3d_tms_interrupt(running_device *device, int state); +void micro3d_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); WRITE16_HANDLER( micro3d_clut_w ); WRITE16_HANDLER( micro3d_creg_w ); diff --git a/src/mame/includes/midtunit.h b/src/mame/includes/midtunit.h index 3960e7caace..2076492ae8d 100644 --- a/src/mame/includes/midtunit.h +++ b/src/mame/includes/midtunit.h @@ -61,5 +61,5 @@ READ16_HANDLER( midxunit_paletteram_r ); READ16_HANDLER( midtunit_dma_r ); WRITE16_HANDLER( midtunit_dma_w ); -void midtunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); -void midxunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void midtunit_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void midxunit_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/includes/midyunit.h b/src/mame/includes/midyunit.h index d0d2d56fe30..260fd17ac89 100644 --- a/src/mame/includes/midyunit.h +++ b/src/mame/includes/midyunit.h @@ -62,4 +62,4 @@ WRITE16_HANDLER( midyunit_paletteram_w ); READ16_HANDLER( midyunit_dma_r ); WRITE16_HANDLER( midyunit_dma_w ); -void midyunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); +void midyunit_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params); diff --git a/src/mame/includes/mitchell.h b/src/mame/includes/mitchell.h index 8ca91c46be0..f297aaf9e0e 100644 --- a/src/mame/includes/mitchell.h +++ b/src/mame/includes/mitchell.h @@ -31,8 +31,8 @@ struct _mitchell_state int keymatrix; /* devices */ - const device_config *audiocpu; - const device_config *oki; + running_device *audiocpu; + running_device *oki; }; diff --git a/src/mame/includes/moo.h b/src/mame/includes/moo.h index 28986e45ef7..055f1a21860 100644 --- a/src/mame/includes/moo.h +++ b/src/mame/includes/moo.h @@ -23,13 +23,13 @@ struct _moo_state UINT16 cur_control2; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k054539; - const device_config *k053246; - const device_config *k053251; - const device_config *k056832; - const device_config *k054338; + running_device *maincpu; + running_device *audiocpu; + running_device *k054539; + running_device *k053246; + running_device *k053251; + running_device *k056832; + running_device *k054338; }; diff --git a/src/mame/includes/mw8080bw.h b/src/mame/includes/mw8080bw.h index cbd01e051b3..d653a506b7f 100644 --- a/src/mame/includes/mw8080bw.h +++ b/src/mame/includes/mw8080bw.h @@ -78,16 +78,16 @@ struct _mw8080bw_state emu_timer *interrupt_timer; /* devices */ - const device_config *maincpu; - const device_config *mb14241; - const device_config *samples; - const device_config *samples1; - const device_config *samples2; - const device_config *speaker; - const device_config *sn1; - const device_config *sn2; - const device_config *sn; - const device_config *discrete; + running_device *maincpu; + running_device *mb14241; + running_device *samples; + running_device *samples1; + running_device *samples2; + running_device *speaker; + running_device *sn1; + running_device *sn2; + running_device *sn; + running_device *discrete; }; @@ -168,7 +168,7 @@ WRITE8_HANDLER( zzzap_audio_1_w ); WRITE8_HANDLER( zzzap_audio_2_w ); MACHINE_DRIVER_EXTERN( maze_audio ); -void maze_write_discrete(const device_config *device, UINT8 maze_tone_timing_state); +void maze_write_discrete(running_device *device, UINT8 maze_tone_timing_state); MACHINE_DRIVER_EXTERN( boothill_audio ); WRITE8_DEVICE_HANDLER( boothill_audio_w ); diff --git a/src/mame/includes/n8080.h b/src/mame/includes/n8080.h index b8f8e10bc8a..4fda7d9a900 100644 --- a/src/mame/includes/n8080.h +++ b/src/mame/includes/n8080.h @@ -34,7 +34,7 @@ struct _n8080_state int inte; /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/includes/naomibd.h b/src/mame/includes/naomibd.h index 889e91dc051..79f51e26555 100644 --- a/src/mame/includes/naomibd.h +++ b/src/mame/includes/naomibd.h @@ -31,7 +31,7 @@ enum TYPE DEFINITIONS ***************************************************************************/ -typedef void (*naomibd_interrupt_func)(const device_config *device, int state); +typedef void (*naomibd_interrupt_func)(running_device *device, int state); typedef struct _naomibd_config naomibd_config; struct _naomibd_config @@ -89,8 +89,8 @@ struct _naomibd_config FUNCTION PROTOTYPES ***************************************************************************/ -int naomibd_interrupt_callback(const device_config *device, naomibd_interrupt_func callback); -int naomibd_get_type(const device_config *device); +int naomibd_interrupt_callback(running_device *device, naomibd_interrupt_func callback); +int naomibd_get_type(running_device *device); READ64_DEVICE_HANDLER( naomibd_r ); WRITE64_DEVICE_HANDLER( naomibd_w ); diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h index 51bc9fe9fbb..7f1b96102f6 100644 --- a/src/mame/includes/neogeo.h +++ b/src/mame/includes/neogeo.h @@ -102,9 +102,9 @@ struct _neogeo_state int fixed_layer_bank_type; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *upd4990a; + running_device *maincpu; + running_device *audiocpu; + running_device *upd4990a; }; diff --git a/src/mame/includes/ninjaw.h b/src/mame/includes/ninjaw.h index 51f2efb96d1..4fa59fc2dc9 100644 --- a/src/mame/includes/ninjaw.h +++ b/src/mame/includes/ninjaw.h @@ -17,20 +17,20 @@ struct _ninjaw_state int pandata[4]; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *subcpu; - const device_config *tc0140syt; - const device_config *tc0100scn_1; - const device_config *tc0100scn_2; - const device_config *tc0100scn_3; - const device_config *lscreen; - const device_config *mscreen; - const device_config *rscreen; - const device_config *_2610_1l; - const device_config *_2610_1r; - const device_config *_2610_2l; - const device_config *_2610_2r; + running_device *maincpu; + running_device *audiocpu; + running_device *subcpu; + running_device *tc0140syt; + running_device *tc0100scn_1; + running_device *tc0100scn_2; + running_device *tc0100scn_3; + running_device *lscreen; + running_device *mscreen; + running_device *rscreen; + running_device *_2610_1l; + running_device *_2610_1r; + running_device *_2610_2l; + running_device *_2610_2r; }; diff --git a/src/mame/includes/opwolf.h b/src/mame/includes/opwolf.h index 1b3dd05ce17..07395d99d49 100644 --- a/src/mame/includes/opwolf.h +++ b/src/mame/includes/opwolf.h @@ -36,12 +36,12 @@ struct _opwolf_state UINT8 c588, c589, c58a; // These variables derived from the bootleg /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *pc080sn; - const device_config *pc090oj; - const device_config *msm1; - const device_config *msm2; + running_device *maincpu; + running_device *audiocpu; + running_device *pc080sn; + running_device *pc090oj; + running_device *msm1; + running_device *msm2; }; diff --git a/src/mame/includes/othunder.h b/src/mame/includes/othunder.h index 64c8c3cb5a4..0f9c89d4b8d 100644 --- a/src/mame/includes/othunder.h +++ b/src/mame/includes/othunder.h @@ -31,19 +31,19 @@ struct _othunder_state int pan[4]; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *eeprom; - const device_config *tc0220ioc; - const device_config *tc0100scn; - const device_config *tc0110pcr; - const device_config *tc0140syt; - const device_config *_2610_0l; - const device_config *_2610_0r; - const device_config *_2610_1l; - const device_config *_2610_1r; - const device_config *_2610_2l; - const device_config *_2610_2r; + running_device *maincpu; + running_device *audiocpu; + running_device *eeprom; + running_device *tc0220ioc; + running_device *tc0100scn; + running_device *tc0110pcr; + running_device *tc0140syt; + running_device *_2610_0l; + running_device *_2610_0r; + running_device *_2610_1l; + running_device *_2610_1r; + running_device *_2610_2l; + running_device *_2610_2r; }; diff --git a/src/mame/includes/overdriv.h b/src/mame/includes/overdriv.h index d1e3c4435b2..4a882074a41 100644 --- a/src/mame/includes/overdriv.h +++ b/src/mame/includes/overdriv.h @@ -17,15 +17,15 @@ struct _overdriv_state UINT16 cpuB_ctrl; /* devices */ - const device_config *maincpu; - const device_config *subcpu; - const device_config *audiocpu; - const device_config *k053260_1; - const device_config *k053260_2; - const device_config *k051316_1; - const device_config *k051316_2; - const device_config *k053246; - const device_config *k053251; + running_device *maincpu; + running_device *subcpu; + running_device *audiocpu; + running_device *k053260_1; + running_device *k053260_2; + running_device *k051316_1; + running_device *k051316_2; + running_device *k053246; + running_device *k053251; }; /*----------- defined in video/overdriv.c -----------*/ diff --git a/src/mame/includes/pandoras.h b/src/mame/includes/pandoras.h index 8ef0c99b238..b69a6bcb973 100644 --- a/src/mame/includes/pandoras.h +++ b/src/mame/includes/pandoras.h @@ -21,10 +21,10 @@ struct _pandoras_state int i8039_status; /* devices */ - const device_config *maincpu; - const device_config *subcpu; - const device_config *audiocpu; - const device_config *mcu; + running_device *maincpu; + running_device *subcpu; + running_device *audiocpu; + running_device *mcu; }; diff --git a/src/mame/includes/parodius.h b/src/mame/includes/parodius.h index 496f4bd09eb..55ffe7318e7 100644 --- a/src/mame/includes/parodius.h +++ b/src/mame/includes/parodius.h @@ -20,12 +20,12 @@ struct _parodius_state //int nmi_enabled; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k053260; - const device_config *k052109; - const device_config *k053245; - const device_config *k053251; + running_device *maincpu; + running_device *audiocpu; + running_device *k053260; + running_device *k052109; + running_device *k053245; + running_device *k053251; }; /*----------- defined in video/parodius.c -----------*/ diff --git a/src/mame/includes/pgm.h b/src/mame/includes/pgm.h index 8b47da914f7..17f4597c9f3 100644 --- a/src/mame/includes/pgm.h +++ b/src/mame/includes/pgm.h @@ -61,9 +61,9 @@ struct _pgm_state mame_system_time systime; /* devices */ - const device_config *soundcpu; - const device_config *prot; - const device_config *ics; + running_device *soundcpu; + running_device *prot; + running_device *ics; }; extern UINT16 *pgm_mainram; // used by nvram handler, we cannot move it to driver data struct diff --git a/src/mame/includes/pk8000.h b/src/mame/includes/pk8000.h index ec534db61bc..51c8d7fe8ba 100644 --- a/src/mame/includes/pk8000.h +++ b/src/mame/includes/pk8000.h @@ -18,4 +18,4 @@ extern UINT8 pk8000_video_enable; PALETTE_INIT( pk8000 ); -UINT32 pk8000_video_update(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *videomem); +UINT32 pk8000_video_update(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *videomem); diff --git a/src/mame/includes/popper.h b/src/mame/includes/popper.h index a80d3bc7ffd..4780f0f69e2 100644 --- a/src/mame/includes/popper.h +++ b/src/mame/includes/popper.h @@ -22,7 +22,7 @@ struct _popper_state rectangle tilemap_clip; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/psikyo.h b/src/mame/includes/psikyo.h index f1dc1df8b05..7dd7fff42f3 100644 --- a/src/mame/includes/psikyo.h +++ b/src/mame/includes/psikyo.h @@ -29,7 +29,7 @@ struct _psikyo_state int z80_nmi, mcu_status; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; /* game-specific */ // 1945 MCU diff --git a/src/mame/includes/psikyo4.h b/src/mame/includes/psikyo4.h index 5e4621d9dc0..0f40317f003 100644 --- a/src/mame/includes/psikyo4.h +++ b/src/mame/includes/psikyo4.h @@ -27,7 +27,7 @@ struct _psikyo4_state UINT32 sample_offs; // only used if ROMTEST = 1 /* devices */ - const device_config *maincpu; + running_device *maincpu; }; diff --git a/src/mame/includes/psikyosh.h b/src/mame/includes/psikyosh.h index 798b0e69b24..cfe876f387d 100644 --- a/src/mame/includes/psikyosh.h +++ b/src/mame/includes/psikyosh.h @@ -40,7 +40,7 @@ struct _psikyosh_state UINT32 sample_offs; // only used if ROMTEST = 1 /* devices */ - const device_config *maincpu; + running_device *maincpu; }; /*----------- defined in video/psikyosh.c -----------*/ diff --git a/src/mame/includes/rainbow.h b/src/mame/includes/rainbow.h index 4ee57b83b38..798c9973d6d 100644 --- a/src/mame/includes/rainbow.h +++ b/src/mame/includes/rainbow.h @@ -25,10 +25,10 @@ struct _rainbow_state UINT8 current_bank; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *pc080sn; - const device_config *pc090oj; + running_device *maincpu; + running_device *audiocpu; + running_device *pc080sn; + running_device *pc090oj; }; diff --git a/src/mame/includes/rastan.h b/src/mame/includes/rastan.h index 92908b0d4bf..b1d89c42809 100644 --- a/src/mame/includes/rastan.h +++ b/src/mame/includes/rastan.h @@ -19,10 +19,10 @@ struct _rastan_state int adpcm_data; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *pc090oj; - const device_config *pc080sn; + running_device *maincpu; + running_device *audiocpu; + running_device *pc090oj; + running_device *pc080sn; }; diff --git a/src/mame/includes/rockrage.h b/src/mame/includes/rockrage.h index f8ced327cd4..c2d5acb0874 100644 --- a/src/mame/includes/rockrage.h +++ b/src/mame/includes/rockrage.h @@ -15,9 +15,9 @@ struct _rockrage_state int vreg; /* devices */ - const device_config *audiocpu; - const device_config *k007342; - const device_config *k007420; + running_device *audiocpu; + running_device *k007342; + running_device *k007420; }; diff --git a/src/mame/includes/rollerg.h b/src/mame/includes/rollerg.h index 17d661eca0d..1d86005f345 100644 --- a/src/mame/includes/rollerg.h +++ b/src/mame/includes/rollerg.h @@ -17,11 +17,11 @@ struct _rollerg_state int readzoomroms; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k053260; - const device_config *k053244; - const device_config *k051316; + running_device *maincpu; + running_device *audiocpu; + running_device *k053260; + running_device *k053244; + running_device *k051316; }; /*----------- defined in video/rollerg.c -----------*/ diff --git a/src/mame/includes/rungun.h b/src/mame/includes/rungun.h index 2e6aaac06de..4b0e7ccc433 100644 --- a/src/mame/includes/rungun.h +++ b/src/mame/includes/rungun.h @@ -22,13 +22,13 @@ struct _rungun_state int sound_status; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k054539_1; - const device_config *k054539_2; - const device_config *k053936; - const device_config *k055673; - const device_config *k053252; + running_device *maincpu; + running_device *audiocpu; + running_device *k054539_1; + running_device *k054539_2; + running_device *k053936; + running_device *k055673; + running_device *k053252; }; diff --git a/src/mame/includes/segas32.h b/src/mame/includes/segas32.h index edd71ffedec..a06d3117fd8 100644 --- a/src/mame/includes/segas32.h +++ b/src/mame/includes/segas32.h @@ -23,7 +23,7 @@ WRITE16_HANDLER( brival_protection_w ); READ16_HANDLER( darkedge_protection_r ); WRITE16_HANDLER( darkedge_protection_w ); -void darkedge_fd1149_vblank(const device_config *device); +void darkedge_fd1149_vblank(running_device *device); WRITE16_HANDLER( jleague_protection_w ); READ16_HANDLER( dbzvrvs_protection_r ); diff --git a/src/mame/includes/sf.h b/src/mame/includes/sf.h index 591248b5bb1..4464cb65f0d 100644 --- a/src/mame/includes/sf.h +++ b/src/mame/includes/sf.h @@ -19,8 +19,8 @@ struct _sf_state UINT16 bgscroll, fgscroll; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/simpsons.h b/src/mame/includes/simpsons.h index 3a1f3c9cc90..49b64dafc46 100644 --- a/src/mame/includes/simpsons.h +++ b/src/mame/includes/simpsons.h @@ -18,12 +18,12 @@ struct _simpsons_state //int nmi_enabled; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k053260; - const device_config *k052109; - const device_config *k053246; - const device_config *k053251; + running_device *maincpu; + running_device *audiocpu; + running_device *k053260; + running_device *k052109; + running_device *k053246; + running_device *k053251; }; /*----------- defined in machine/simpsons.c -----------*/ diff --git a/src/mame/includes/slapshot.h b/src/mame/includes/slapshot.h index 505273ff99d..9ea5e0e01f9 100644 --- a/src/mame/includes/slapshot.h +++ b/src/mame/includes/slapshot.h @@ -38,12 +38,12 @@ struct _slapshot_state INT32 banknum; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *tc0140syt; - const device_config *tc0480scp; - const device_config *tc0360pri; - const device_config *tc0640fio; + running_device *maincpu; + running_device *audiocpu; + running_device *tc0140syt; + running_device *tc0480scp; + running_device *tc0360pri; + running_device *tc0640fio; }; diff --git a/src/mame/includes/sonson.h b/src/mame/includes/sonson.h index 397c055232d..628044e09f7 100644 --- a/src/mame/includes/sonson.h +++ b/src/mame/includes/sonson.h @@ -21,7 +21,7 @@ struct _sonson_state int last_irq; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/spy.h b/src/mame/includes/spy.h index 622ac43f5b3..47579fceac4 100644 --- a/src/mame/includes/spy.h +++ b/src/mame/includes/spy.h @@ -21,12 +21,12 @@ struct _spy_state int old_3f90; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k007232_1; - const device_config *k007232_2; - const device_config *k052109; - const device_config *k051960; + running_device *maincpu; + running_device *audiocpu; + running_device *k007232_1; + running_device *k007232_2; + running_device *k052109; + running_device *k051960; }; diff --git a/src/mame/includes/stfight.h b/src/mame/includes/stfight.h index 273251dec55..615689e8324 100644 --- a/src/mame/includes/stfight.h +++ b/src/mame/includes/stfight.h @@ -10,7 +10,7 @@ READ8_HANDLER( stfight_coin_r ); WRITE8_HANDLER( stfight_coin_w ); WRITE8_HANDLER( stfight_e800_w ); READ8_HANDLER( stfight_fm_r ); -void stfight_adpcm_int(const device_config *device); +void stfight_adpcm_int(running_device *device); WRITE8_DEVICE_HANDLER( stfight_adpcm_control_w ); diff --git a/src/mame/includes/suprslam.h b/src/mame/includes/suprslam.h index 39903977955..027cb5d1dc1 100644 --- a/src/mame/includes/suprslam.h +++ b/src/mame/includes/suprslam.h @@ -24,8 +24,8 @@ struct _suprslam_state int pending_command; /* devices */ - const device_config *audiocpu; - const device_config *k053936; + running_device *audiocpu; + running_device *k053936; }; diff --git a/src/mame/includes/surpratk.h b/src/mame/includes/surpratk.h index dd91aa5a139..a9d1df56a66 100644 --- a/src/mame/includes/surpratk.h +++ b/src/mame/includes/surpratk.h @@ -19,10 +19,10 @@ struct _surpratk_state int videobank; /* devices */ - const device_config *maincpu; - const device_config *k052109; - const device_config *k053244; - const device_config *k053251; + running_device *maincpu; + running_device *k052109; + running_device *k053244; + running_device *k053251; }; /*----------- defined in video/surpratk.c -----------*/ diff --git a/src/mame/includes/system16.h b/src/mame/includes/system16.h index 6f2e786f36c..bb00e7b0d0b 100644 --- a/src/mame/includes/system16.h +++ b/src/mame/includes/system16.h @@ -51,7 +51,7 @@ VIDEO_UPDATE( yboard ); /*----------- defined in machine/s16fd.c -----------*/ void *fd1094_get_decrypted_base(void); -void fd1094_machine_init(const device_config *device); +void fd1094_machine_init(running_device *device); void fd1094_driver_init(running_machine *machine, const char* tag, void (*set_decrypted)(running_machine *, UINT8 *)); /*----------- defined in machine/system16.c -----------*/ diff --git a/src/mame/includes/tail2nos.h b/src/mame/includes/tail2nos.h index 528ce7ea4df..fe115a5dce1 100644 --- a/src/mame/includes/tail2nos.h +++ b/src/mame/includes/tail2nos.h @@ -19,9 +19,9 @@ struct _tail2nos_state int charbank, charpalette, video_enable; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k051316; + running_device *maincpu; + running_device *audiocpu; + running_device *k051316; }; diff --git a/src/mame/includes/taito_b.h b/src/mame/includes/taito_b.h index 333c5e42c61..c56d30691db 100644 --- a/src/mame/includes/taito_b.h +++ b/src/mame/includes/taito_b.h @@ -21,13 +21,13 @@ struct _taitob_state UINT16 coin_word; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *mb87078; - const device_config *ym; - const device_config *tc0180vcu; - const device_config *tc0640fio; - const device_config *tc0220ioc; + running_device *maincpu; + running_device *audiocpu; + running_device *mb87078; + running_device *ym; + running_device *tc0180vcu; + running_device *tc0640fio; + running_device *tc0220ioc; }; diff --git a/src/mame/includes/taito_f2.h b/src/mame/includes/taito_f2.h index 73f0de9ee2c..d0918f0d229 100644 --- a/src/mame/includes/taito_f2.h +++ b/src/mame/includes/taito_f2.h @@ -60,16 +60,16 @@ struct _taitof2_state INT32 oki_bank; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *oki; - const device_config *tc0100scn; - const device_config *tc0100scn_1; - const device_config *tc0100scn_2; - const device_config *tc0360pri; - const device_config *tc0280grd; - const device_config *tc0430grw; - const device_config *tc0480scp; + running_device *maincpu; + running_device *audiocpu; + running_device *oki; + running_device *tc0100scn; + running_device *tc0100scn_1; + running_device *tc0100scn_2; + running_device *tc0360pri; + running_device *tc0280grd; + running_device *tc0430grw; + running_device *tc0480scp; }; /*----------- defined in video/taito_f2.c -----------*/ diff --git a/src/mame/includes/taito_h.h b/src/mame/includes/taito_h.h index b37643b12f5..de9b5fe3580 100644 --- a/src/mame/includes/taito_h.h +++ b/src/mame/includes/taito_h.h @@ -15,10 +15,10 @@ struct _taitoh_state INT32 banknum; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *tc0080vco; - const device_config *tc0220ioc; + running_device *maincpu; + running_device *audiocpu; + running_device *tc0080vco; + running_device *tc0220ioc; }; /*----------- defined in video/taito_h.c -----------*/ diff --git a/src/mame/includes/taito_l.h b/src/mame/includes/taito_l.h index 32492d0bc14..401ec9f0f82 100644 --- a/src/mame/includes/taito_l.h +++ b/src/mame/includes/taito_l.h @@ -45,8 +45,8 @@ struct _taitol_state const char *portf1_tag; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; + running_device *maincpu; + running_device *audiocpu; }; /*----------- defined in video/taito_l.c -----------*/ diff --git a/src/mame/includes/taito_o.h b/src/mame/includes/taito_o.h index 7b867cc6fc7..3befff5033f 100644 --- a/src/mame/includes/taito_o.h +++ b/src/mame/includes/taito_o.h @@ -11,8 +11,8 @@ struct _taitoo_state // UINT16 * paletteram; // currently this uses generic palette handling /* devices */ - const device_config *maincpu; - const device_config *tc0080vco; + running_device *maincpu; + running_device *tc0080vco; }; /*----------- defined in video/taito_o.c -----------*/ diff --git a/src/mame/includes/taito_z.h b/src/mame/includes/taito_z.h index 0625cc215c2..226b4ea2147 100644 --- a/src/mame/includes/taito_z.h +++ b/src/mame/includes/taito_z.h @@ -27,15 +27,15 @@ struct _taitoz_state // UINT8 pandata[4]; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *subcpu; - const device_config *eeprom; - const device_config *tc0480scp; - const device_config *tc0150rod; - const device_config *tc0100scn; - const device_config *tc0220ioc; - const device_config *tc0140syt; + running_device *maincpu; + running_device *audiocpu; + running_device *subcpu; + running_device *eeprom; + running_device *tc0480scp; + running_device *tc0150rod; + running_device *tc0100scn; + running_device *tc0220ioc; + running_device *tc0140syt; }; /*----------- defined in video/taito_z.c -----------*/ diff --git a/src/mame/includes/taitoair.h b/src/mame/includes/taitoair.h index 2099b697b4f..ca4c2aef1b7 100644 --- a/src/mame/includes/taitoair.h +++ b/src/mame/includes/taitoair.h @@ -34,9 +34,9 @@ struct _taitoair_state INT32 banknum; /* devices */ - const device_config *audiocpu; - const device_config *dsp; - const device_config *tc0080vco; + running_device *audiocpu; + running_device *dsp; + running_device *tc0080vco; }; diff --git a/src/mame/includes/thunderx.h b/src/mame/includes/thunderx.h index 8532b05f6a1..3326268acbc 100644 --- a/src/mame/includes/thunderx.h +++ b/src/mame/includes/thunderx.h @@ -22,11 +22,11 @@ struct _thunderx_state int rambank, pmcbank; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k007232; - const device_config *k052109; - const device_config *k051960; + running_device *maincpu; + running_device *audiocpu; + running_device *k007232; + running_device *k052109; + running_device *k051960; }; diff --git a/src/mame/includes/timeplt.h b/src/mame/includes/timeplt.h index a97d58f2174..b5125d3f152 100644 --- a/src/mame/includes/timeplt.h +++ b/src/mame/includes/timeplt.h @@ -55,16 +55,16 @@ struct _timeplt_state struct jungler_star stars[JUNGLER_MAX_STARS]; // jungler /* devices */ - const device_config *maincpu; - const device_config *soundcpu; - const device_config *i8039; // junofrst - const device_config *samples; // rallyx - const device_config *filter_0_0; - const device_config *filter_0_1; - const device_config *filter_0_2; - const device_config *filter_1_0; - const device_config *filter_1_1; - const device_config *filter_1_2; + running_device *maincpu; + running_device *soundcpu; + running_device *i8039; // junofrst + running_device *samples; // rallyx + running_device *filter_0_0; + running_device *filter_0_1; + running_device *filter_0_2; + running_device *filter_1_0; + running_device *filter_1_1; + running_device *filter_1_2; }; diff --git a/src/mame/includes/tmnt.h b/src/mame/includes/tmnt.h index 0518a8ce624..917bb1a0421 100644 --- a/src/mame/includes/tmnt.h +++ b/src/mame/includes/tmnt.h @@ -30,19 +30,19 @@ struct _tmnt_state int toggle, last; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k007232; - const device_config *k053260; - const device_config *k054539; - const device_config *k052109; - const device_config *k051960; - const device_config *k053245; - const device_config *k053251; - const device_config *k053936; - const device_config *k054000; - const device_config *upd; - const device_config *samples; + running_device *maincpu; + running_device *audiocpu; + running_device *k007232; + running_device *k053260; + running_device *k054539; + running_device *k052109; + running_device *k051960; + running_device *k053245; + running_device *k053251; + running_device *k053936; + running_device *k054000; + running_device *upd; + running_device *samples; }; diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h index 2a3cf31e240..6cf896793f4 100644 --- a/src/mame/includes/tnzs.h +++ b/src/mame/includes/tnzs.h @@ -54,9 +54,9 @@ struct _tnzs_state /* devices */ - const device_config *audiocpu; - const device_config *subcpu; - const device_config *mcu; + running_device *audiocpu; + running_device *subcpu; + running_device *mcu; }; diff --git a/src/mame/includes/toaplan2.h b/src/mame/includes/toaplan2.h index 048abb1d999..2a0cd12acac 100644 --- a/src/mame/includes/toaplan2.h +++ b/src/mame/includes/toaplan2.h @@ -1,9 +1,9 @@ /*----------- defined in audio/toaplan2.c -----------*/ -void dogyuun_okisnd_w(const device_config *device, int data); -void kbash_okisnd_w(const device_config *device, int data); -void fixeight_okisnd_w(const device_config *device, int data); -void batsugun_okisnd_w(const device_config *device, int data); +void dogyuun_okisnd_w(running_device *device, int data); +void kbash_okisnd_w(running_device *device, int data); +void fixeight_okisnd_w(running_device *device, int data); +void batsugun_okisnd_w(running_device *device, int data); /*----------- defined in drivers/toaplan2.c -----------*/ diff --git a/src/mame/includes/topspeed.h b/src/mame/includes/topspeed.h index a5c954cc0b9..74c3832db60 100644 --- a/src/mame/includes/topspeed.h +++ b/src/mame/includes/topspeed.h @@ -24,12 +24,12 @@ struct _topspeed_state int adpcm_data; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *subcpu; - const device_config *pc080sn_1; - const device_config *pc080sn_2; - const device_config *tc0220ioc; + running_device *maincpu; + running_device *audiocpu; + running_device *subcpu; + running_device *pc080sn_1; + running_device *pc080sn_2; + running_device *tc0220ioc; }; diff --git a/src/mame/includes/trackfld.h b/src/mame/includes/trackfld.h index 70189bf023d..e7e117b6abc 100644 --- a/src/mame/includes/trackfld.h +++ b/src/mame/includes/trackfld.h @@ -41,8 +41,8 @@ struct _trackfld_state int yiear_nmi_enable; // yiear /* devices */ - const device_config *audiocpu; - const device_config *vlm; + running_device *audiocpu; + running_device *vlm; }; diff --git a/src/mame/includes/ultraman.h b/src/mame/includes/ultraman.h index 362e1b81a0a..823e11f8b61 100644 --- a/src/mame/includes/ultraman.h +++ b/src/mame/includes/ultraman.h @@ -15,12 +15,12 @@ struct _ultraman_state int bank0, bank1, bank2; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k051316_1; - const device_config *k051316_2; - const device_config *k051316_3; - const device_config *k051960; + running_device *maincpu; + running_device *audiocpu; + running_device *k051316_1; + running_device *k051316_2; + running_device *k051316_3; + running_device *k051960; }; diff --git a/src/mame/includes/vendetta.h b/src/mame/includes/vendetta.h index c6b68f23586..8304d4aecef 100644 --- a/src/mame/includes/vendetta.h +++ b/src/mame/includes/vendetta.h @@ -20,13 +20,13 @@ struct _vendetta_state offs_t video_banking_base; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k053260; - const device_config *k052109; - const device_config *k053246; - const device_config *k053251; - const device_config *k054000; + running_device *maincpu; + running_device *audiocpu; + running_device *k053260; + running_device *k052109; + running_device *k053246; + running_device *k053251; + running_device *k054000; }; /*----------- defined in video/vendetta.c -----------*/ diff --git a/src/mame/includes/vertigo.h b/src/mame/includes/vertigo.h index ff8b7bcecbd..4eed022fb46 100644 --- a/src/mame/includes/vertigo.h +++ b/src/mame/includes/vertigo.h @@ -6,7 +6,7 @@ /*----------- defined in machine/vertigo.c -----------*/ -void vertigo_update_irq(const device_config *device); +void vertigo_update_irq(running_device *device); extern const struct pit8253_config vertigo_pit8254_config; diff --git a/src/mame/includes/vindictr.h b/src/mame/includes/vindictr.h index 53b6ccd9d57..61409d21cde 100644 --- a/src/mame/includes/vindictr.h +++ b/src/mame/includes/vindictr.h @@ -24,4 +24,4 @@ WRITE16_HANDLER( vindictr_paletteram_w ); VIDEO_START( vindictr ); VIDEO_UPDATE( vindictr ); -void vindictr_scanline_update(const device_config *screen, int scanline); +void vindictr_scanline_update(running_device *screen, int scanline); diff --git a/src/mame/includes/volfied.h b/src/mame/includes/volfied.h index bc7bd9b839f..de7dbf86307 100644 --- a/src/mame/includes/volfied.h +++ b/src/mame/includes/volfied.h @@ -23,9 +23,9 @@ struct _volfied_state UINT8 current_cmd; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *pc090oj; + running_device *maincpu; + running_device *audiocpu; + running_device *pc090oj; }; diff --git a/src/mame/includes/warriorb.h b/src/mame/includes/warriorb.h index 109e62fb182..689cdd8bb74 100644 --- a/src/mame/includes/warriorb.h +++ b/src/mame/includes/warriorb.h @@ -16,17 +16,17 @@ struct _warriorb_state int pandata[4]; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *tc0140syt; - const device_config *tc0100scn_1; - const device_config *tc0100scn_2; - const device_config *lscreen; - const device_config *rscreen; - const device_config *_2610_1l; - const device_config *_2610_1r; - const device_config *_2610_2l; - const device_config *_2610_2r; + running_device *maincpu; + running_device *audiocpu; + running_device *tc0140syt; + running_device *tc0100scn_1; + running_device *tc0100scn_2; + running_device *lscreen; + running_device *rscreen; + running_device *_2610_1l; + running_device *_2610_1r; + running_device *_2610_2l; + running_device *_2610_2r; }; diff --git a/src/mame/includes/wgp.h b/src/mame/includes/wgp.h index 892622bda6c..9b4d710077a 100644 --- a/src/mame/includes/wgp.h +++ b/src/mame/includes/wgp.h @@ -31,11 +31,11 @@ struct _wgp_state INT32 banknum; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *subcpu; - const device_config *tc0100scn; - const device_config *tc0140syt; + running_device *maincpu; + running_device *audiocpu; + running_device *subcpu; + running_device *tc0100scn; + running_device *tc0140syt; }; diff --git a/src/mame/includes/xexex.h b/src/mame/includes/xexex.h index 08b7675fef2..018f7751661 100644 --- a/src/mame/includes/xexex.h +++ b/src/mame/includes/xexex.h @@ -25,19 +25,19 @@ struct _xexex_state int frame; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k054539; - const device_config *filter1l; - const device_config *filter1r; - const device_config *filter2l; - const device_config *filter2r; - const device_config *k056832; - const device_config *k053246; - const device_config *k053250; - const device_config *k053251; - const device_config *k053252; - const device_config *k054338; + running_device *maincpu; + running_device *audiocpu; + running_device *k054539; + running_device *filter1l; + running_device *filter1r; + running_device *filter2l; + running_device *filter2r; + running_device *k056832; + running_device *k053246; + running_device *k053250; + running_device *k053251; + running_device *k053252; + running_device *k054338; }; diff --git a/src/mame/includes/xmen.h b/src/mame/includes/xmen.h index b806eef4417..913ea062772 100644 --- a/src/mame/includes/xmen.h +++ b/src/mame/includes/xmen.h @@ -23,14 +23,14 @@ struct _xmen_state UINT8 sound_curbank; /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *k054539; - const device_config *k052109; - const device_config *k053246; - const device_config *k053251; - const device_config *lscreen; - const device_config *rscreen; + running_device *maincpu; + running_device *audiocpu; + running_device *k054539; + running_device *k052109; + running_device *k053246; + running_device *k053251; + running_device *lscreen; + running_device *rscreen; }; /*----------- defined in video/xmen.c -----------*/ diff --git a/src/mame/includes/yunsun16.h b/src/mame/includes/yunsun16.h index d701c826cf7..67ecc78d37a 100644 --- a/src/mame/includes/yunsun16.h +++ b/src/mame/includes/yunsun16.h @@ -22,7 +22,7 @@ struct _yunsun16_state int sprites_scrolldx, sprites_scrolldy; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/yunsung8.h b/src/mame/includes/yunsung8.h index da18a3d4908..5948b450b75 100644 --- a/src/mame/includes/yunsung8.h +++ b/src/mame/includes/yunsung8.h @@ -21,7 +21,7 @@ struct _yunsung8_state int toggle; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; diff --git a/src/mame/includes/zerozone.h b/src/mame/includes/zerozone.h index e914e1c54f5..4f893694536 100644 --- a/src/mame/includes/zerozone.h +++ b/src/mame/includes/zerozone.h @@ -17,7 +17,7 @@ struct _zerozone_state tilemap_t *zz_tilemap; /* devices */ - const device_config *audiocpu; + running_device *audiocpu; }; /*----------- defined in video/zerozone.c -----------*/ diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c index e9322319c02..33d495ed66c 100644 --- a/src/mame/machine/amiga.c +++ b/src/mame/machine/amiga.c @@ -291,7 +291,7 @@ void amiga_machine_config(running_machine *machine, const amiga_machine_interfac } -static void amiga_m68k_reset(const device_config *device) +static void amiga_m68k_reset(running_device *device) { const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM); @@ -341,8 +341,8 @@ MACHINE_RESET( amiga ) static TIMER_CALLBACK( scanline_callback ) { int scanline = param; - const device_config *cia_0 = devtag_get_device(machine, "cia_0"); - const device_config *cia_1 = devtag_get_device(machine, "cia_1"); + running_device *cia_0 = devtag_get_device(machine, "cia_0"); + running_device *cia_1 = devtag_get_device(machine, "cia_1"); /* on the first scanline, we do some extra bookkeeping */ if (scanline == 0) @@ -1041,7 +1041,7 @@ READ16_HANDLER( amiga_cia_r ) { UINT8 data; int shift; - const device_config *cia; + running_device *cia; /* offsets 0000-07ff reference CIA B, and are accessed via the MSB */ if ((offset & 0x0800) == 0) @@ -1076,7 +1076,7 @@ READ16_HANDLER( amiga_cia_r ) WRITE16_HANDLER( amiga_cia_w ) { - const device_config *cia; + running_device *cia; if (LOG_CIA) logerror("%06x:cia_%c_write(%03x) = %04x & %04x\n", cpu_get_pc(space->cpu), 'A' + ((~offset & 0x0800) >> 11), offset * 2, data, mem_mask); @@ -1111,13 +1111,13 @@ WRITE16_HANDLER( amiga_cia_w ) * *************************************/ -void amiga_cia_0_irq(const device_config *device, int state) +void amiga_cia_0_irq(running_device *device, int state) { amiga_custom_w(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_PORTS, 0xffff); } -void amiga_cia_1_irq(const device_config *device, int state) +void amiga_cia_1_irq(running_device *device, int state) { amiga_custom_w(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM), REG_INTREQ, (state ? 0x8000 : 0x0000) | INTENA_EXTER, 0xffff); } @@ -1281,8 +1281,8 @@ static TIMER_CALLBACK( finish_serial_write ) WRITE16_HANDLER( amiga_custom_w ) { - const device_config *cia_0; - const device_config *cia_1; + running_device *cia_0; + running_device *cia_1; UINT16 temp; offset &= 0xff; diff --git a/src/mame/machine/archimds.c b/src/mame/machine/archimds.c index fbd10bbb5eb..9f70bee511e 100644 --- a/src/mame/machine/archimds.c +++ b/src/mame/machine/archimds.c @@ -317,7 +317,7 @@ static void latch_timer_cnt(int tmr) READ32_HANDLER(archimedes_ioc_r) { #ifdef MESS - const device_config *fdc = (const device_config *)devtag_get_device(space->machine, "wd1772"); + running_device *fdc = (running_device *)devtag_get_device(space->machine, "wd1772"); #endif if (offset >= 0x80000 && offset < 0xc0000) { @@ -367,7 +367,7 @@ READ32_HANDLER(archimedes_ioc_r) WRITE32_HANDLER(archimedes_ioc_w) { #ifdef MESS - const device_config *fdc = (const device_config *)devtag_get_device(space->machine, "wd1772"); + running_device *fdc = (running_device *)devtag_get_device(space->machine, "wd1772"); #endif if (offset >= 0x80000 && offset < 0xc0000) diff --git a/src/mame/machine/asic65.c b/src/mame/machine/asic65.c index 92283801a13..de623bffd6e 100644 --- a/src/mame/machine/asic65.c +++ b/src/mame/machine/asic65.c @@ -31,7 +31,7 @@ static struct _asic65_t UINT8 last_bank; /* ROM-based interface states */ - const device_config *cpu; + running_device *cpu; UINT8 tfull; UINT8 _68full; UINT8 cmd; diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c index 71084447dbb..9be195b5635 100644 --- a/src/mame/machine/atari.c +++ b/src/mame/machine/atari.c @@ -24,7 +24,7 @@ static void a600xl_mmu(running_machine *machine, UINT8 new_mmu); static void pokey_reset(running_machine *machine); -void atari_interrupt_cb(const device_config *device, int mask) +void atari_interrupt_cb(running_device *device, int mask) { if (VERBOSE_POKEY) @@ -159,7 +159,7 @@ static int atari_last; void a800_handle_keyboard(running_machine *machine) { - const device_config *pokey = devtag_get_device(machine, "pokey"); + running_device *pokey = devtag_get_device(machine, "pokey"); int atari_code, count, ipt, i; static const char *const tag[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", @@ -244,7 +244,7 @@ void a800_handle_keyboard(running_machine *machine) void a5200_handle_keypads(running_machine *machine) { - const device_config *pokey = devtag_get_device(machine, "pokey"); + running_device *pokey = devtag_get_device(machine, "pokey"); int atari_code, count, ipt, i; static const char *const tag[] = { "keypad_0", "keypad_1", "keypad_2", "keypad_3" }; @@ -308,7 +308,7 @@ void a5200_handle_keypads(running_machine *machine) static void pokey_reset(running_machine *machine) { - const device_config *pokey = devtag_get_device(machine, "pokey"); + running_device *pokey = devtag_get_device(machine, "pokey"); pokey_w(pokey,15,0); atari_last = 0xff; } @@ -322,7 +322,7 @@ static UINT8 console_read(const address_space *space) static void console_write(const address_space *space, UINT8 data) { - const device_config *dac = devtag_get_device(space->machine, "dac"); + running_device *dac = devtag_get_device(space->machine, "dac"); if (data & 0x08) dac_data_w(dac, (UINT8)-120); else diff --git a/src/mame/machine/atari_vg.c b/src/mame/machine/atari_vg.c index d1f080b48f0..d2c9771fa88 100644 --- a/src/mame/machine/atari_vg.c +++ b/src/mame/machine/atari_vg.c @@ -13,7 +13,7 @@ typedef struct _atari_vg_earom_state atari_vg_earom_state; struct _atari_vg_earom_state { - const device_config *device; + running_device *device; int offset; int data; @@ -31,7 +31,7 @@ struct _atari_vg_earom_state into a atari_vg_earom_state -------------------------------------------------*/ -INLINE atari_vg_earom_state *get_safe_token(const device_config *device) +INLINE atari_vg_earom_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/mame/machine/atarifb.c b/src/mame/machine/atarifb.c index 522483b4f2f..6593e919eae 100644 --- a/src/mame/machine/atarifb.c +++ b/src/mame/machine/atarifb.c @@ -13,7 +13,7 @@ WRITE8_HANDLER( atarifb_out1_w ) { atarifb_state *state = (atarifb_state *)space->machine->driver_data; - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); state->CTRLD = data; @@ -27,7 +27,7 @@ WRITE8_HANDLER( atarifb_out1_w ) WRITE8_HANDLER( atarifb4_out1_w ) { atarifb_state *state = (atarifb_state *)space->machine->driver_data; - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); state->CTRLD = data; @@ -43,7 +43,7 @@ WRITE8_HANDLER( atarifb4_out1_w ) WRITE8_HANDLER( abaseb_out1_w ) { atarifb_state *state = (atarifb_state *)space->machine->driver_data; - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); state->CTRLD = data; @@ -70,7 +70,7 @@ WRITE8_HANDLER( abaseb_out1_w ) WRITE8_HANDLER( soccer_out1_w ) { atarifb_state *state = (atarifb_state *)space->machine->driver_data; - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); state->CTRLD = data; @@ -94,7 +94,7 @@ WRITE8_HANDLER( soccer_out1_w ) WRITE8_HANDLER( atarifb_out2_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); discrete_sound_w(discrete, ATARIFB_CROWD_DATA, data & 0x0f); // Crowd @@ -104,7 +104,7 @@ WRITE8_HANDLER( atarifb_out2_w ) WRITE8_HANDLER( soccer_out2_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); discrete_sound_w(discrete, ATARIFB_CROWD_DATA, data & 0x0f); // Crowd diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c index c0d22d5fcc7..61db145f22f 100644 --- a/src/mame/machine/atarigen.c +++ b/src/mame/machine/atarigen.c @@ -48,7 +48,7 @@ static void atarigen_set_vol(running_machine *machine, int volume, sound_type ty static TIMER_CALLBACK( scanline_timer_callback ); -static void atarivc_common_w(const device_config *screen, offs_t offset, UINT16 newword); +static void atarivc_common_w(running_device *screen, offs_t offset, UINT16 newword); static TIMER_CALLBACK( unhalt_cpu ); @@ -60,7 +60,7 @@ static TIMER_CALLBACK( atarivc_eof_update ); INLINE FUNCTIONS ***************************************************************************/ -INLINE const atarigen_screen_timer *get_screen_timer(const device_config *screen) +INLINE const atarigen_screen_timer *get_screen_timer(running_device *screen) { atarigen_state *state = (atarigen_state *)screen->machine->driver_data; int i; @@ -83,12 +83,12 @@ INLINE const atarigen_screen_timer *get_screen_timer(const device_config *screen void atarigen_init(running_machine *machine) { atarigen_state *state = (atarigen_state *)machine->driver_data; - const device_config *screen; + running_device *screen; int i; /* allocate timers for all screens */ assert(video_screen_count(machine->config) <= ARRAY_LENGTH(state->screen_timer)); - for (i = 0, screen = video_screen_first(machine->config); screen != NULL; i++, screen = video_screen_next(screen)) + for (i = 0, screen = video_screen_first(machine); screen != NULL; i++, screen = video_screen_next(screen)) { state->screen_timer[i].screen = screen; state->screen_timer[i].scanline_interrupt_timer = timer_alloc(machine, scanline_interrupt_callback, (void *)screen); @@ -179,7 +179,7 @@ void atarigen_update_interrupts(running_machine *machine) scanline interrupt should be generated. ---------------------------------------------------------------*/ -void atarigen_scanline_int_set(const device_config *screen, int scanline) +void atarigen_scanline_int_set(running_device *screen, int scanline) { emu_timer *timer = get_screen_timer(screen)->scanline_interrupt_timer; timer_adjust_oneshot(timer, video_screen_get_time_until_pos(screen, scanline, 0), 0); @@ -291,7 +291,7 @@ WRITE32_HANDLER( atarigen_video_int_ack32_w ) static TIMER_CALLBACK( scanline_interrupt_callback ) { - const device_config *screen = (const device_config *)ptr; + running_device *screen = (running_device *)ptr; emu_timer *timer = get_screen_timer(screen)->scanline_interrupt_timer; /* generate the interrupt */ @@ -521,7 +521,7 @@ static DIRECT_UPDATE_HANDLER( atarigen_slapstic_setdirect ) slapstic and sets the chip number. ---------------------------------------------------------------*/ -void atarigen_slapstic_init(const device_config *device, offs_t base, offs_t mirror, int chipnum) +void atarigen_slapstic_init(running_device *device, offs_t base, offs_t mirror, int chipnum) { atarigen_state *state = (atarigen_state *)device->machine->driver_data; @@ -607,7 +607,7 @@ READ16_HANDLER( atarigen_slapstic_r ) atarigen_sound_io_reset: Resets the state of the sound I/O. ---------------------------------------------------------------*/ -void atarigen_sound_io_reset(const device_config *device) +void atarigen_sound_io_reset(running_device *device) { atarigen_state *state = (atarigen_state *)device->machine->driver_data; @@ -662,7 +662,7 @@ WRITE8_HANDLER( atarigen_6502_irq_ack_w ) IRQ line. ---------------------------------------------------------------*/ -void atarigen_ym2151_irq_gen(const device_config *device, int irq) +void atarigen_ym2151_irq_gen(running_device *device, int irq) { atarigen_state *state = (atarigen_state *)device->machine->driver_data; state->ym2151_int = irq; @@ -875,9 +875,7 @@ static TIMER_CALLBACK( delayed_6502_sound_w ) void atarigen_set_vol(running_machine *machine, int volume, sound_type type) { - const device_config *device; - - for (device = sound_first(machine->config); device != NULL; device = sound_next(device)) + for (running_device *device = sound_first(machine); device != NULL; device = sound_next(device)) if (sound_get_type(device) == type) sound_set_output_gain(device, ALL_OUTPUTS, volume / 100.0); } @@ -923,7 +921,7 @@ void atarigen_set_oki6295_vol(running_machine *machine, int volume) atarigen_scanline_timer_reset: Sets up the scanline timer. ---------------------------------------------------------------*/ -void atarigen_scanline_timer_reset(const device_config *screen, atarigen_scanline_func update_graphics, int frequency) +void atarigen_scanline_timer_reset(running_device *screen, atarigen_scanline_func update_graphics, int frequency) { atarigen_state *state = (atarigen_state *)screen->machine->driver_data; @@ -948,7 +946,7 @@ void atarigen_scanline_timer_reset(const device_config *screen, atarigen_scanlin static TIMER_CALLBACK( scanline_timer_callback ) { atarigen_state *state = (atarigen_state *)machine->driver_data; - const device_config *screen = (const device_config *)ptr; + running_device *screen = (running_device *)ptr; int scanline = param; /* callback */ @@ -978,7 +976,7 @@ static TIMER_CALLBACK( scanline_timer_callback ) static TIMER_CALLBACK( atarivc_eof_update ) { atarigen_state *state = (atarigen_state *)machine->driver_data; - const device_config *screen = (const device_config *)ptr; + running_device *screen = (running_device *)ptr; emu_timer *timer = get_screen_timer(screen)->atarivc_eof_update_timer; int i; @@ -1022,7 +1020,7 @@ static TIMER_CALLBACK( atarivc_eof_update ) atarivc_reset: Initializes the video controller. ---------------------------------------------------------------*/ -void atarivc_reset(const device_config *screen, UINT16 *eof_data, int playfields) +void atarivc_reset(running_device *screen, UINT16 *eof_data, int playfields) { atarigen_state *state = (atarigen_state *)screen->machine->driver_data; @@ -1052,7 +1050,7 @@ void atarivc_reset(const device_config *screen, UINT16 *eof_data, int playfields atarivc_w: Handles an I/O write to the video controller. ---------------------------------------------------------------*/ -void atarivc_w(const device_config *screen, offs_t offset, UINT16 data, UINT16 mem_mask) +void atarivc_w(running_device *screen, offs_t offset, UINT16 data, UINT16 mem_mask) { atarigen_state *state = (atarigen_state *)screen->machine->driver_data; int oldword = state->atarivc_data[offset]; @@ -1069,7 +1067,7 @@ void atarivc_w(const device_config *screen, offs_t offset, UINT16 data, UINT16 m write. ---------------------------------------------------------------*/ -static void atarivc_common_w(const device_config *screen, offs_t offset, UINT16 newword) +static void atarivc_common_w(running_device *screen, offs_t offset, UINT16 newword) { atarigen_state *state = (atarigen_state *)screen->machine->driver_data; int oldword = state->atarivc_data[offset]; @@ -1179,7 +1177,7 @@ static void atarivc_common_w(const device_config *screen, offs_t offset, UINT16 atarivc_r: Handles an I/O read from the video controller. ---------------------------------------------------------------*/ -UINT16 atarivc_r(const device_config *screen, offs_t offset) +UINT16 atarivc_r(running_device *screen, offs_t offset) { atarigen_state *state = (atarigen_state *)screen->machine->driver_data; @@ -1396,7 +1394,7 @@ WRITE16_HANDLER( atarigen_playfield2_latched_msb_w ) 10% of the scanline period. ---------------------------------------------------------------*/ -int atarigen_get_hblank(const device_config *screen) +int atarigen_get_hblank(running_device *screen) { return (video_screen_get_hpos(screen) > (video_screen_get_width(screen) * 9 / 10)); } @@ -1407,9 +1405,9 @@ int atarigen_get_hblank(const device_config *screen) next HBLANK. ---------------------------------------------------------------*/ -void atarigen_halt_until_hblank_0(const device_config *screen) +void atarigen_halt_until_hblank_0(running_device *screen) { - const device_config *cpu = devtag_get_device(screen->machine, "maincpu"); + running_device *cpu = devtag_get_device(screen->machine, "maincpu"); /* halt the CPU until the next HBLANK */ int hpos = video_screen_get_hpos(screen); @@ -1512,7 +1510,7 @@ WRITE32_HANDLER( atarigen_666_paletteram32_w ) static TIMER_CALLBACK( unhalt_cpu ) { - const device_config *cpu = (const device_config *)ptr; + running_device *cpu = (running_device *)ptr; cpu_set_input_line(cpu, INPUT_LINE_HALT, CLEAR_LINE); } diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h index 8462aa0330c..49cef7fae7f 100644 --- a/src/mame/machine/atarigen.h +++ b/src/mame/machine/atarigen.h @@ -30,7 +30,7 @@ typedef void (*atarigen_int_func)(running_machine *machine); -typedef void (*atarigen_scanline_func)(const device_config *screen, int scanline); +typedef void (*atarigen_scanline_func)(running_device *screen, int scanline); typedef struct _atarivc_state_desc atarivc_state_desc; struct _atarivc_state_desc @@ -53,7 +53,7 @@ struct _atarivc_state_desc typedef struct _atarigen_screen_timer atarigen_screen_timer; struct _atarigen_screen_timer { - const device_config *screen; + running_device *screen; emu_timer * scanline_interrupt_timer; emu_timer * scanline_timer; emu_timer * atarivc_eof_update_timer; @@ -108,7 +108,7 @@ struct _atarigen_state offs_t slapstic_base; offs_t slapstic_mirror; - const device_config * sound_cpu; + running_device * sound_cpu; UINT8 cpu_to_sound; UINT8 sound_to_cpu; UINT8 timed_int; @@ -147,7 +147,7 @@ void atarigen_init(running_machine *machine); void atarigen_interrupt_reset(atarigen_state *state, atarigen_int_func update_int); void atarigen_update_interrupts(running_machine *machine); -void atarigen_scanline_int_set(const device_config *screen, int scanline); +void atarigen_scanline_int_set(running_device *screen, int scanline); INTERRUPT_GEN( atarigen_scanline_int_gen ); WRITE16_HANDLER( atarigen_scanline_int_ack_w ); WRITE32_HANDLER( atarigen_scanline_int_ack32_w ); @@ -183,7 +183,7 @@ NVRAM_HANDLER( atarigen ); SLAPSTIC HANDLING ---------------------------------------------------------------*/ -void atarigen_slapstic_init(const device_config *device, offs_t base, offs_t mirror, int chipnum); +void atarigen_slapstic_init(running_device *device, offs_t base, offs_t mirror, int chipnum); void atarigen_slapstic_reset(atarigen_state *state); WRITE16_HANDLER( atarigen_slapstic_w ); @@ -194,13 +194,13 @@ READ16_HANDLER( atarigen_slapstic_r ); SOUND I/O ---------------------------------------------------------------*/ -void atarigen_sound_io_reset(const device_config *device); +void atarigen_sound_io_reset(running_device *device); INTERRUPT_GEN( atarigen_6502_irq_gen ); READ8_HANDLER( atarigen_6502_irq_ack_r ); WRITE8_HANDLER( atarigen_6502_irq_ack_w ); -void atarigen_ym2151_irq_gen(const device_config *device, int irq); +void atarigen_ym2151_irq_gen(running_device *device, int irq); WRITE16_HANDLER( atarigen_sound_w ); READ16_HANDLER( atarigen_sound_r ); @@ -231,10 +231,10 @@ void atarigen_set_oki6295_vol(running_machine *machine, int volume); VIDEO CONTROLLER ---------------------------------------------------------------*/ -void atarivc_reset(const device_config *screen, UINT16 *eof_data, int playfields); +void atarivc_reset(running_device *screen, UINT16 *eof_data, int playfields); -void atarivc_w(const device_config *screen, offs_t offset, UINT16 data, UINT16 mem_mask); -UINT16 atarivc_r(const device_config *screen, offs_t offset); +void atarivc_w(running_device *screen, offs_t offset, UINT16 data, UINT16 mem_mask); +UINT16 atarivc_r(running_device *screen, offs_t offset); INLINE void atarivc_update_pf_xscrolls(atarigen_state *state) { @@ -267,9 +267,9 @@ WRITE16_HANDLER( atarigen_playfield2_latched_msb_w ); VIDEO HELPERS ---------------------------------------------------------------*/ -void atarigen_scanline_timer_reset(const device_config *screen, atarigen_scanline_func update_graphics, int frequency); -int atarigen_get_hblank(const device_config *screen); -void atarigen_halt_until_hblank_0(const device_config *screen); +void atarigen_scanline_timer_reset(running_device *screen, atarigen_scanline_func update_graphics, int frequency); +int atarigen_get_hblank(running_device *screen); +void atarigen_halt_until_hblank_0(running_device *screen); WRITE16_HANDLER( atarigen_666_paletteram_w ); WRITE16_HANDLER( atarigen_expanded_666_paletteram_w ); WRITE32_HANDLER( atarigen_666_paletteram32_w ); diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c index 882ded1a5af..472ced8bc21 100644 --- a/src/mame/machine/balsente.c +++ b/src/mame/machine/balsente.c @@ -222,7 +222,7 @@ static void poly17_init(running_machine *machine) } -void balsente_noise_gen(const device_config *device, int count, short *buffer) +void balsente_noise_gen(running_device *device, int count, short *buffer) { balsente_state *state = (balsente_state *)device->machine->driver_data; int chip; @@ -884,7 +884,7 @@ WRITE8_HANDLER( balsente_counter_8253_w ) * *************************************/ -static void set_counter_0_ff(const device_config *timer, int newstate) +static void set_counter_0_ff(running_device *timer, int newstate) { balsente_state *state = (balsente_state *)timer->machine->driver_data; diff --git a/src/mame/machine/beezer.c b/src/mame/machine/beezer.c index aab01e8699b..9cdd360a46e 100644 --- a/src/mame/machine/beezer.c +++ b/src/mame/machine/beezer.c @@ -108,7 +108,7 @@ WRITE8_HANDLER( beezer_bankswitch_w ) { if ((data & 0x07) == 0) { - const device_config *via_0 = devtag_get_device(space->machine, "via6522_0"); + running_device *via_0 = devtag_get_device(space->machine, "via6522_0"); memory_install_write8_handler(space, 0xc600, 0xc7ff, 0, 0, watchdog_reset_w); memory_install_write8_handler(space, 0xc800, 0xc9ff, 0, 0, beezer_map_w); memory_install_read8_handler(space, 0xca00, 0xcbff, 0, 0, beezer_line_r); diff --git a/src/mame/machine/carpolo.c b/src/mame/machine/carpolo.c index 17af8e76be9..cae12eb5a7a 100644 --- a/src/mame/machine/carpolo.c +++ b/src/mame/machine/carpolo.c @@ -69,50 +69,50 @@ static UINT8 car_border_collision_cause; static UINT8 priority_0_extension; static UINT8 last_wheel_value[4]; -static const device_config *ttl74148_3s; +static running_device *ttl74148_3s; -static const device_config *ttl74153_1k; +static running_device *ttl74153_1k; -static const device_config *ttl7474_2s_1; -static const device_config *ttl7474_2s_2; -static const device_config *ttl7474_2u_1; -static const device_config *ttl7474_2u_2; -static const device_config *ttl7474_1f_1; -static const device_config *ttl7474_1f_2; -static const device_config *ttl7474_1d_1; -static const device_config *ttl7474_1d_2; -static const device_config *ttl7474_1c_1; -static const device_config *ttl7474_1c_2; -static const device_config *ttl7474_1a_1; -static const device_config *ttl7474_1a_2; +static running_device *ttl7474_2s_1; +static running_device *ttl7474_2s_2; +static running_device *ttl7474_2u_1; +static running_device *ttl7474_2u_2; +static running_device *ttl7474_1f_1; +static running_device *ttl7474_1f_2; +static running_device *ttl7474_1d_1; +static running_device *ttl7474_1d_2; +static running_device *ttl7474_1c_1; +static running_device *ttl7474_1c_2; +static running_device *ttl7474_1a_1; +static running_device *ttl7474_1a_2; -void carpolo_74148_3s_cb(const device_config *device) +void carpolo_74148_3s_cb(running_device *device) { cputag_set_input_line(device->machine, "maincpu", M6502_IRQ_LINE, ttl74148_output_valid_r(device) ? CLEAR_LINE : ASSERT_LINE); } /* the outputs of the flip-flops are connected to the priority encoder */ -void carpolo_7474_2s_1_cb(const device_config *device) +void carpolo_7474_2s_1_cb(running_device *device) { ttl74148_input_line_w(ttl74148_3s, COIN1_PRIORITY_LINE, ttl7474_output_comp_r(device)); ttl74148_update(ttl74148_3s); } -void carpolo_7474_2s_2_cb(const device_config *device) +void carpolo_7474_2s_2_cb(running_device *device) { ttl74148_input_line_w(ttl74148_3s, COIN2_PRIORITY_LINE, ttl7474_output_comp_r(device)); ttl74148_update(ttl74148_3s); } -void carpolo_7474_2u_1_cb(const device_config *device) +void carpolo_7474_2u_1_cb(running_device *device) { ttl74148_input_line_w(ttl74148_3s, COIN3_PRIORITY_LINE, ttl7474_output_comp_r(device)); ttl74148_update(ttl74148_3s); } -void carpolo_7474_2u_2_cb(const device_config *device) +void carpolo_7474_2u_2_cb(running_device *device) { ttl74148_input_line_w(ttl74148_3s, COIN4_PRIORITY_LINE, ttl7474_output_comp_r(device)); ttl74148_update(ttl74148_3s); @@ -257,8 +257,8 @@ INTERRUPT_GEN( carpolo_timer_interrupt ) for (player = 0; player < 4; player++) { static const char *const portnames[] = { "DIAL0", "DIAL1", "DIAL2", "DIAL3" }; - const device_config *movement_flip_flop; - const device_config *dir_flip_flop; + running_device *movement_flip_flop; + running_device *dir_flip_flop; switch (player) { diff --git a/src/mame/machine/cubocd32.c b/src/mame/machine/cubocd32.c index 6027f165ef0..d07e47e818b 100644 --- a/src/mame/machine/cubocd32.c +++ b/src/mame/machine/cubocd32.c @@ -279,7 +279,7 @@ static const char* get_akiko_reg_name(int reg) static void akiko_cdda_stop( running_machine *machine ) { - const device_config *cdda = cdda_from_cdrom(machine, akiko.cdrom); + running_device *cdda = cdda_from_cdrom(machine, akiko.cdrom); if (cdda != NULL) { @@ -290,7 +290,7 @@ static void akiko_cdda_stop( running_machine *machine ) static void akiko_cdda_play( running_machine *machine, UINT32 lba, UINT32 num_blocks ) { - const device_config *cdda = cdda_from_cdrom(machine, akiko.cdrom); + running_device *cdda = cdda_from_cdrom(machine, akiko.cdrom); if (cdda != NULL) { cdda_start_audio(cdda, lba, num_blocks); @@ -300,7 +300,7 @@ static void akiko_cdda_play( running_machine *machine, UINT32 lba, UINT32 num_bl static void akiko_cdda_pause( running_machine *machine, int pause ) { - const device_config *cdda = cdda_from_cdrom(machine, akiko.cdrom); + running_device *cdda = cdda_from_cdrom(machine, akiko.cdrom); if (cdda != NULL) { if (cdda_audio_active(cdda) && cdda_audio_paused(cdda) != pause ) @@ -321,7 +321,7 @@ static void akiko_cdda_pause( running_machine *machine, int pause ) static UINT8 akiko_cdda_getstatus( running_machine *machine, UINT32 *lba ) { - const device_config *cdda = cdda_from_cdrom(machine, akiko.cdrom); + running_device *cdda = cdda_from_cdrom(machine, akiko.cdrom); if ( lba ) *lba = 0; @@ -362,7 +362,7 @@ static void akiko_set_cd_status( running_machine *machine, UINT32 status ) static TIMER_CALLBACK(akiko_frame_proc) { - const device_config *cdda = cdda_from_cdrom(machine, akiko.cdrom); + running_device *cdda = cdda_from_cdrom(machine, akiko.cdrom); (void)param; diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c index 7cd4c014b8d..b1e60af551d 100644 --- a/src/mame/machine/dc.c +++ b/src/mame/machine/dc.c @@ -1127,8 +1127,8 @@ WRITE64_HANDLER( dc_g1_ctrl_w ) return; } // printf("ROM board DMA to %x len %x (PC %x)\n", g1bus_regs[SB_GDSTAR], g1bus_regs[SB_GDLEN], cpu_get_pc(space->cpu)); - ROM = (UINT8 *)devtag_get_info_ptr(space->machine, "rom_board", DEVINFO_PTR_MEMORY); - dmaoffset = (UINT32)devtag_get_info_int(space->machine, "rom_board", DEVINFO_INT_DMAOFFSET); + ROM = (UINT8 *)space->machine->device("rom_board")->get_runtime_ptr(DEVINFO_PTR_MEMORY); + dmaoffset = (UINT32)space->machine->device("rom_board")->get_runtime_int(DEVINFO_INT_DMAOFFSET); ddtdata.destination=g1bus_regs[SB_GDSTAR]; // destination address ddtdata.length=g1bus_regs[SB_GDLEN] >> 5; // words to transfer ddtdata.size=32; // bytes per word diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c index 9c75d4a6274..b1659c61ec9 100644 --- a/src/mame/machine/decocass.c +++ b/src/mame/machine/decocass.c @@ -47,9 +47,9 @@ enum { -static UINT8 tape_get_status_bits(const device_config *device); -static UINT8 tape_is_present(const device_config *device); -static void tape_change_speed(const device_config *device, INT8 newspeed); +static UINT8 tape_get_status_bits(running_device *device); +static UINT8 tape_is_present(running_device *device); +static void tape_change_speed(running_device *device, INT8 newspeed); WRITE8_HANDLER( decocass_coin_counter_w ) @@ -1906,7 +1906,7 @@ struct _tape_state in device is, in fact, an IDE controller -------------------------------------------------*/ -INLINE tape_state *get_safe_token(const device_config *device) +INLINE tape_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -2014,7 +2014,7 @@ static const char *tape_describe_state(tape_state *tape) static TIMER_CALLBACK( tape_clock_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; tape_state *tape = get_safe_token(device); /* advance by one clock in the desired direction */ @@ -2071,7 +2071,7 @@ static TIMER_CALLBACK( tape_clock_callback ) bits from the tape -------------------------------------------------*/ -static UINT8 tape_get_status_bits(const device_config *device) +static UINT8 tape_get_status_bits(running_device *device) { tape_state *tape = get_safe_token(device); UINT8 tape_bits = 0; @@ -2128,7 +2128,7 @@ static UINT8 tape_get_status_bits(const device_config *device) present -------------------------------------------------*/ -static UINT8 tape_is_present(const device_config *device) +static UINT8 tape_is_present(running_device *device) { return device->region != NULL; } @@ -2139,7 +2139,7 @@ static UINT8 tape_is_present(const device_config *device) playback -------------------------------------------------*/ -static void tape_change_speed(const device_config *device, INT8 newspeed) +static void tape_change_speed(running_device *device, INT8 newspeed) { tape_state *tape = get_safe_token(device); attotime newperiod; @@ -2173,8 +2173,8 @@ static DEVICE_START( decocass_tape ) /* validate some basic stuff */ assert(device != NULL); - assert(device->static_config == NULL); - assert(device->inline_config == NULL); + assert(device->baseconfig().static_config == NULL); + assert(device->baseconfig().inline_config == NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); diff --git a/src/mame/machine/decocass.h b/src/mame/machine/decocass.h index c28fed78666..dd160db7bae 100644 --- a/src/mame/machine/decocass.h +++ b/src/mame/machine/decocass.h @@ -98,10 +98,10 @@ struct _decocass_state INT32 type5_latch; /* latched enable PROM (1100xxxx written to E5x1) */ /* devices */ - const device_config *maincpu; - const device_config *audiocpu; - const device_config *mcu; - const device_config *cassette; + running_device *maincpu; + running_device *audiocpu; + running_device *mcu; + running_device *cassette; }; diff --git a/src/mame/machine/fddebug.c b/src/mame/machine/fddebug.c index 18775ebc484..8075142f841 100644 --- a/src/mame/machine/fddebug.c +++ b/src/mame/machine/fddebug.c @@ -258,7 +258,7 @@ static void set_default_key_params(running_machine *machine); static void load_overlay_file(running_machine *machine); static void save_overlay_file(running_machine *machine); -static int instruction_hook(const device_config *device, offs_t curpc); +static int instruction_hook(running_device *device, offs_t curpc); static void execute_fdsave(running_machine *machine, int ref, int params, const char **param); static void execute_fdoutput(running_machine *machine, int ref, int params, const char **param); @@ -688,7 +688,7 @@ void fd1094_regenerate_key(running_machine *machine) instruction_hook - per-instruction hook -----------------------------------------------*/ -static int instruction_hook(const device_config *device, offs_t curpc) +static int instruction_hook(running_device *device, offs_t curpc) { int curfdstate = fd1094_set_state(keyregion, -1); UINT8 instrbuffer[10], keybuffer[5]; @@ -887,7 +887,7 @@ static void execute_fdeliminate(running_machine *machine, int ref, int params, c static void execute_fdunlock(running_machine *machine, int ref, int params, const char **param) { - const device_config *cpu = debug_cpu_get_visible_cpu(machine); + running_device *cpu = debug_cpu_get_visible_cpu(machine); int reps = keystatus_words / KEY_SIZE; int keyaddr, repnum; UINT64 offset; @@ -925,7 +925,7 @@ static void execute_fdunlock(running_machine *machine, int ref, int params, cons static void execute_fdignore(running_machine *machine, int ref, int params, const char **param) { - const device_config *cpu = debug_cpu_get_visible_cpu(machine); + running_device *cpu = debug_cpu_get_visible_cpu(machine); UINT64 offset; /* support 0 or 1 parameters */ @@ -1030,7 +1030,7 @@ static void execute_fdstate(running_machine *machine, int ref, int params, const static void execute_fdpc(running_machine *machine, int ref, int params, const char **param) { - const device_config *cpu = debug_cpu_get_visible_cpu(machine); + running_device *cpu = debug_cpu_get_visible_cpu(machine); UINT64 newpc; /* support 0 or 1 parameters */ diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c index 131c3a71696..65dcc1c029d 100644 --- a/src/mame/machine/galaxold.c +++ b/src/mame/machine/galaxold.c @@ -12,20 +12,20 @@ #include "includes/galaxold.h" static int irq_line; -static const device_config *int_timer; +static running_device *int_timer; static UINT8 _4in1_bank; -void galaxold_7474_9m_2_callback(const device_config *device) +void galaxold_7474_9m_2_callback(running_device *device) { /* Q bar clocks the other flip-flop, Q is VBLANK (not visible to the CPU) */ - const device_config *target = devtag_get_device(device->machine, "7474_9m_1"); + running_device *target = devtag_get_device(device->machine, "7474_9m_1"); ttl7474_clock_w(target, ttl7474_output_comp_r(device)); ttl7474_update(target); } -void galaxold_7474_9m_1_callback(const device_config *device) +void galaxold_7474_9m_1_callback(running_device *device) { /* Q goes to the NMI line */ cputag_set_input_line(device->machine, "maincpu", irq_line, ttl7474_output_r(device) ? CLEAR_LINE : ASSERT_LINE); @@ -33,7 +33,7 @@ void galaxold_7474_9m_1_callback(const device_config *device) WRITE8_HANDLER( galaxold_nmi_enable_w ) { - const device_config *target = devtag_get_device(space->machine, "7474_9m_1"); + running_device *target = devtag_get_device(space->machine, "7474_9m_1"); ttl7474_preset_w(target, data); ttl7474_update(target); } @@ -41,7 +41,7 @@ WRITE8_HANDLER( galaxold_nmi_enable_w ) TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer ) { - const device_config *target = devtag_get_device(timer->machine, "7474_9m_2"); + running_device *target = devtag_get_device(timer->machine, "7474_9m_2"); /* 128V, 64V and 32V go to D */ ttl7474_d_w(target, (param & 0xe0) != 0xe0); @@ -59,8 +59,8 @@ TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer ) static void machine_reset_common(running_machine *machine, int line) { - const device_config *ttl7474_9m_1 = devtag_get_device(machine, "7474_9m_1"); - const device_config *ttl7474_9m_2 = devtag_get_device(machine, "7474_9m_2"); + running_device *ttl7474_9m_1 = devtag_get_device(machine, "7474_9m_1"); + running_device *ttl7474_9m_2 = devtag_get_device(machine, "7474_9m_2"); irq_line = line; /* initalize main CPU interrupt generator flip-flops */ diff --git a/src/mame/machine/gaplus.c b/src/mame/machine/gaplus.c index d7a4daa4394..b9f5e16b83d 100644 --- a/src/mame/machine/gaplus.c +++ b/src/mame/machine/gaplus.c @@ -21,7 +21,7 @@ UINT8 *gaplus_customio_3; WRITE8_HANDLER( gaplus_customio_3_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); if ((offset == 0x09) && (data >= 0x0f)) sample_start(samples,0,0,0); diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c index 9871faffd22..764781431c1 100644 --- a/src/mame/machine/harddriv.c +++ b/src/mame/machine/harddriv.c @@ -140,7 +140,7 @@ WRITE16_HANDLER( hd68k_irq_ack_w ) } -void hdgsp_irq_gen(const device_config *device, int irqstate) +void hdgsp_irq_gen(running_device *device, int irqstate) { harddriv_state *state = (harddriv_state *)device->machine->driver_data; state->gsp_irq_state = irqstate; @@ -148,7 +148,7 @@ void hdgsp_irq_gen(const device_config *device, int irqstate) } -void hdmsp_irq_gen(const device_config *device, int irqstate) +void hdmsp_irq_gen(running_device *device, int irqstate) { harddriv_state *state = (harddriv_state *)device->machine->driver_data; state->msp_irq_state = irqstate; @@ -1375,7 +1375,7 @@ WRITE16_HANDLER( hd68k_ds3_program_w ) * *************************************/ -void hddsk_update_pif(const device_config *device, UINT32 pins) +void hddsk_update_pif(running_device *device, UINT32 pins) { atarigen_state *atarigen = (atarigen_state *)device->machine->driver_data; atarigen->sound_int_state = ((pins & DSP32_OUTPUT_PIF) != 0); diff --git a/src/mame/machine/irobot.c b/src/mame/machine/irobot.c index d0bb6ecaa9a..0d9a4797f70 100644 --- a/src/mame/machine/irobot.c +++ b/src/mame/machine/irobot.c @@ -35,8 +35,8 @@ static UINT8 irvg_running; static UINT8 irmb_running; #if IR_TIMING -static const device_config *irvg_timer; -static const device_config *irmb_timer; +static running_device *irvg_timer; +static running_device *irmb_timer; #endif static UINT8 *comRAM[2], *mbRAM, *mbROM; diff --git a/src/mame/machine/konppc.c b/src/mame/machine/konppc.c index 8c1d837347c..853551ccdaa 100644 --- a/src/mame/machine/konppc.c +++ b/src/mame/machine/konppc.c @@ -142,8 +142,8 @@ WRITE32_HANDLER( cgboard_dsp_comm_w_ppc ) { const char *dsptag = (cgboard_id == 0) ? "dsp" : "dsp2"; const char *pcitag = (cgboard_id == 0) ? "k033906_1" : "k033906_2"; - const device_config *dsp = devtag_get_device(space->machine, dsptag); - const device_config *k033906 = devtag_get_device(space->machine, pcitag); + running_device *dsp = devtag_get_device(space->machine, dsptag); + running_device *k033906 = devtag_get_device(space->machine, pcitag); // mame_printf_debug("dsp_cmd_w: (board %d) %08X, %08X, %08X at %08X\n", cgboard_id, data, offset, mem_mask, cpu_get_pc(space->cpu)); if (cgboard_id < MAX_CG_BOARDS) @@ -239,7 +239,7 @@ static void dsp_comm_sharc_w(const address_space *space, int board, int offset, case CGBOARD_TYPE_HANGPLT: { const char *dsptag = (board == 0) ? "dsp" : "dsp2"; - const device_config *device = devtag_get_device(space->machine, dsptag); + running_device *device = devtag_get_device(space->machine, dsptag); if (offset == 1) { @@ -354,7 +354,7 @@ WRITE32_HANDLER( cgboard_1_shared_sharc_w ) static UINT32 nwk_fifo_r(const address_space *space, int board) { const char *dsptag = (board == 0) ? "dsp" : "dsp2"; - const device_config *device = devtag_get_device(space->machine, dsptag); + running_device *device = devtag_get_device(space->machine, dsptag); UINT32 data; if (nwk_fifo_read_ptr[board] < nwk_fifo_half_full_r) @@ -385,7 +385,7 @@ static UINT32 nwk_fifo_r(const address_space *space, int board) static void nwk_fifo_w(running_machine *machine, int board, UINT32 data) { const char *dsptag = (board == 0) ? "dsp" : "dsp2"; - const device_config *device = devtag_get_device(machine, dsptag); + running_device *device = devtag_get_device(machine, dsptag); if (nwk_fifo_write_ptr[board] < nwk_fifo_half_full_w) { @@ -409,7 +409,7 @@ static void nwk_fifo_w(running_machine *machine, int board, UINT32 data) READ32_HANDLER( K033906_0_r ) { - const device_config *k033906_1 = devtag_get_device(space->machine, "k033906_1"); + running_device *k033906_1 = devtag_get_device(space->machine, "k033906_1"); if (nwk_device_sel[0] & 0x01) return nwk_fifo_r(space, 0); else @@ -418,13 +418,13 @@ READ32_HANDLER( K033906_0_r ) WRITE32_HANDLER( K033906_0_w ) { - const device_config *k033906_1 = devtag_get_device(space->machine, "k033906_1"); + running_device *k033906_1 = devtag_get_device(space->machine, "k033906_1"); k033906_w(k033906_1, offset, data, mem_mask); } READ32_HANDLER( K033906_1_r ) { - const device_config *k033906_2 = devtag_get_device(space->machine, "k033906_2"); + running_device *k033906_2 = devtag_get_device(space->machine, "k033906_2"); if (nwk_device_sel[1] & 0x01) return nwk_fifo_r(space, 1); else @@ -433,7 +433,7 @@ READ32_HANDLER( K033906_1_r ) WRITE32_HANDLER(K033906_1_w) { - const device_config *k033906_2 = devtag_get_device(space->machine, "k033906_2"); + running_device *k033906_2 = devtag_get_device(space->machine, "k033906_2"); k033906_w(k033906_2, offset, data, mem_mask); } diff --git a/src/mame/machine/leland.c b/src/mame/machine/leland.c index c5a7de3d3c8..5e74c7ba664 100644 --- a/src/mame/machine/leland.c +++ b/src/mame/machine/leland.c @@ -1175,7 +1175,7 @@ READ8_HANDLER( leland_master_input_r ) WRITE8_HANDLER( leland_master_output_w ) { - const device_config *eeprom; + running_device *eeprom; switch (offset) { diff --git a/src/mame/machine/mathbox.c b/src/mame/machine/mathbox.c index d39edf2f93e..2eb16acd179 100644 --- a/src/mame/machine/mathbox.c +++ b/src/mame/machine/mathbox.c @@ -32,7 +32,7 @@ typedef struct _mathbox_state mathbox_state; struct _mathbox_state { - const device_config *device; + running_device *device; /* math box scratch registers */ INT16 reg[16]; @@ -51,7 +51,7 @@ struct _mathbox_state into a mathbox_state -------------------------------------------------*/ -INLINE mathbox_state *get_safe_token(const device_config *device) +INLINE mathbox_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c index 617f71a89c6..a26d98e1d1d 100644 --- a/src/mame/machine/mcr.c +++ b/src/mame/machine/mcr.c @@ -420,7 +420,7 @@ MACHINE_RESET( zwackery ) INTERRUPT_GEN( mcr_interrupt ) { - const device_config *ctc = devtag_get_device(device->machine, "ctc"); + running_device *ctc = devtag_get_device(device->machine, "ctc"); /* CTC line 2 is connected to VBLANK, which is once every 1/2 frame */ /* for the 30Hz interlaced display */ @@ -439,7 +439,7 @@ INTERRUPT_GEN( mcr_interrupt ) INTERRUPT_GEN( mcr_ipu_interrupt ) { - const device_config *ctc = devtag_get_device(device->machine, "ipu_ctc"); + running_device *ctc = devtag_get_device(device->machine, "ipu_ctc"); /* CTC line 3 is connected to 493, which is signalled once every */ /* frame at 30Hz */ @@ -606,14 +606,14 @@ static WRITE_LINE_DEVICE_HANDLER( zwackery_pia_irq ) static TIMER_CALLBACK( zwackery_493_off_callback ) { - const device_config *pia = devtag_get_device(machine, "pia0"); + running_device *pia = devtag_get_device(machine, "pia0"); pia6821_ca1_w(pia, 0, 0); } static TIMER_CALLBACK( zwackery_493_callback ) { - const device_config *pia = devtag_get_device(machine, "pia0"); + running_device *pia = devtag_get_device(machine, "pia0"); pia6821_ca1_w(pia, 0, 1); timer_set(machine, video_screen_get_scan_period(machine->primary_screen), NULL, 0, zwackery_493_off_callback); diff --git a/src/mame/machine/mhavoc.c b/src/mame/machine/mhavoc.c index 60e01b91664..535c121b970 100644 --- a/src/mame/machine/mhavoc.c +++ b/src/mame/machine/mhavoc.c @@ -328,7 +328,7 @@ static WRITE8_HANDLER( mhavocrv_speech_data_w ) static WRITE8_HANDLER( mhavocrv_speech_strobe_w ) { - const device_config *tms = devtag_get_device(space->machine, "tms"); + running_device *tms = devtag_get_device(space->machine, "tms"); tms5220_data_w(tms, 0, speech_write_buffer); } diff --git a/src/mame/machine/micro3d.c b/src/mame/machine/micro3d.c index 25449aab14f..304e8b01f4d 100644 --- a/src/mame/machine/micro3d.c +++ b/src/mame/machine/micro3d.c @@ -29,12 +29,12 @@ * *************************************/ -void micro3d_duart_irq_handler(const device_config *device, UINT8 vector) +void micro3d_duart_irq_handler(running_device *device, UINT8 vector) { cputag_set_input_line_and_vector(device->machine, "maincpu", 3, HOLD_LINE, vector); }; -void micro3d_duart_tx(const device_config *device, int channel, UINT8 data) +void micro3d_duart_tx(running_device *device, int channel, UINT8 data) { micro3d_state *state = (micro3d_state*)device->machine->driver_data; @@ -51,13 +51,13 @@ void micro3d_duart_tx(const device_config *device, int channel, UINT8 data) } }; -static int data_to_i8031(const device_config *device) +static int data_to_i8031(running_device *device) { micro3d_state *state = (micro3d_state*)device->machine->driver_data; return state->m68681_tx0; } -static void data_from_i8031(const device_config *device, int data) +static void data_from_i8031(running_device *device, int data) { micro3d_state *state = (micro3d_state*)device->machine->driver_data; duart68681_rx_data(state->duart68681, 1, data); @@ -71,7 +71,7 @@ static void data_from_i8031(const device_config *device, int data) * 4: - * 5: - */ -UINT8 micro3d_duart_input_r(const device_config *device) +UINT8 micro3d_duart_input_r(running_device *device) { return 0x2; } @@ -80,7 +80,7 @@ UINT8 micro3d_duart_input_r(const device_config *device) * 5: /I8051 reset * 7: Status LED */ -void micro3d_duart_output_w(const device_config *device, UINT8 data) +void micro3d_duart_output_w(running_device *device, UINT8 data) { cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_RESET, data & 0x20 ? CLEAR_LINE : ASSERT_LINE); } diff --git a/src/mame/machine/midwayic.c b/src/mame/machine/midwayic.c index 96eda6157f3..2b1d6a309fe 100644 --- a/src/mame/machine/midwayic.c +++ b/src/mame/machine/midwayic.c @@ -69,7 +69,7 @@ struct ioasic_state UINT32 reg[16]; UINT8 has_dcs; UINT8 has_cage; - const device_config *dcs_cpu; + running_device *dcs_cpu; UINT8 shuffle_type; UINT8 shuffle_active; const UINT8 * shuffle_map; @@ -558,8 +558,8 @@ enum IOASIC_INTCTL /* f: interrupt control */ }; -static UINT16 ioasic_fifo_r(const device_config *device); -static UINT16 ioasic_fifo_status_r(const device_config *device); +static UINT16 ioasic_fifo_r(running_device *device); +static UINT16 ioasic_fifo_status_r(running_device *device); static void ioasic_input_empty(running_machine *machine, int state); static void ioasic_output_full(running_machine *machine, int state); static void update_ioasic_irq(running_machine *machine); @@ -724,7 +724,7 @@ static void ioasic_output_full(running_machine *machine, int state) * *************************************/ -static UINT16 ioasic_fifo_r(const device_config *device) +static UINT16 ioasic_fifo_r(running_device *device) { UINT16 result = 0; @@ -759,7 +759,7 @@ static UINT16 ioasic_fifo_r(const device_config *device) } -static UINT16 ioasic_fifo_status_r(const device_config *device) +static UINT16 ioasic_fifo_status_r(running_device *device) { UINT16 result = 0; diff --git a/src/mame/machine/model1.c b/src/mame/machine/model1.c index 264578303a7..5910db73550 100644 --- a/src/mame/machine/model1.c +++ b/src/mame/machine/model1.c @@ -1987,7 +1987,7 @@ void model1_vr_tgp_reset( running_machine *machine ) } /* FIFO */ -static int copro_fifoin_pop(const device_config *device, UINT32 *result) +static int copro_fifoin_pop(running_device *device, UINT32 *result) { UINT32 r; @@ -2054,7 +2054,7 @@ static UINT32 copro_fifoout_pop(const address_space *space) return r; } -static void copro_fifoout_push(const device_config *device, UINT32 data) +static void copro_fifoout_push(running_device *device, UINT32 data) { if (copro_fifoout_num == FIFO_SIZE) { diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c index 52335bb7930..5a2101e868e 100644 --- a/src/mame/machine/n64.c +++ b/src/mame/machine/n64.c @@ -135,7 +135,7 @@ WRITE32_HANDLER( n64_mi_reg_w ) } } -static const device_config *dmadac[2]; +static running_device *dmadac[2]; void signal_rcp_interrupt(running_machine *machine, int interrupt) { @@ -421,7 +421,7 @@ static void sp_dma(int direction) } } -static void sp_set_status(const device_config *device, UINT32 status) +static void sp_set_status(running_device *device, UINT32 status) { if (status & 0x1) { diff --git a/src/mame/machine/namco06.c b/src/mame/machine/namco06.c index 456dd964b98..314ff7dbecb 100644 --- a/src/mame/machine/namco06.c +++ b/src/mame/machine/namco06.c @@ -98,14 +98,14 @@ struct _namco_06xx_state { UINT8 control; emu_timer *nmi_timer; - const device_config *nmicpu; - const device_config *device[4]; + running_device *nmicpu; + running_device *device[4]; read8_device_func read[4]; - void (*readreq[4])(const device_config *device); + void (*readreq[4])(running_device *device); write8_device_func write[4]; }; -INLINE namco_06xx_state *get_safe_token(const device_config *device) +INLINE namco_06xx_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -118,7 +118,7 @@ INLINE namco_06xx_state *get_safe_token(const device_config *device) static TIMER_CALLBACK( nmi_generate ) { - namco_06xx_state *state = get_safe_token((const device_config *)ptr); + namco_06xx_state *state = get_safe_token((running_device *)ptr); if (!cpu_is_suspended(state->nmicpu, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) { @@ -221,7 +221,7 @@ WRITE8_DEVICE_HANDLER( namco_06xx_ctrl_w ) static DEVICE_START( namco_06xx ) { - const namco_06xx_config *config = (const namco_06xx_config *)device->inline_config; + const namco_06xx_config *config = (const namco_06xx_config *)device->baseconfig().inline_config; namco_06xx_state *state = get_safe_token(device); int devnum; @@ -268,7 +268,7 @@ static DEVICE_START( namco_06xx ) else if (type == NAMCO_54XX) state->write[devnum] = namco_54xx_write; else - fatalerror("Unknown device type %s connected to Namco 06xx", devtype_get_name(type)); + fatalerror("Unknown device type %s connected to Namco 06xx", device_get_name(state->device[devnum])); } /* allocate a timer */ diff --git a/src/mame/machine/namco50.c b/src/mame/machine/namco50.c index 92baea8b03c..1d87afad1b6 100644 --- a/src/mame/machine/namco50.c +++ b/src/mame/machine/namco50.c @@ -138,13 +138,13 @@ Flags: 80=high score, 40=first bonus, 20=interval bonus, 10=? typedef struct _namco_50xx_state namco_50xx_state; struct _namco_50xx_state { - const device_config * cpu; + running_device * cpu; UINT8 latched_cmd; UINT8 latched_rw; UINT8 portO; }; -INLINE namco_50xx_state *get_safe_token(const device_config *device) +INLINE namco_50xx_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -157,7 +157,7 @@ INLINE namco_50xx_state *get_safe_token(const device_config *device) static TIMER_CALLBACK( namco_50xx_latch_callback ) { - namco_50xx_state *state = get_safe_token((const device_config *)ptr); + namco_50xx_state *state = get_safe_token((running_device *)ptr); state->latched_cmd = param; state->latched_rw = 1; } @@ -165,7 +165,7 @@ static TIMER_CALLBACK( namco_50xx_latch_callback ) static TIMER_CALLBACK( namco_50xx_readrequest_callback ) { - namco_50xx_state *state = get_safe_token((const device_config *)ptr); + namco_50xx_state *state = get_safe_token((running_device *)ptr); state->latched_rw = 0; } @@ -205,11 +205,11 @@ static WRITE8_HANDLER( namco_50xx_O_w ) static TIMER_CALLBACK( namco_50xx_irq_clear ) { - namco_50xx_state *state = get_safe_token((const device_config *)ptr); + namco_50xx_state *state = get_safe_token((running_device *)ptr); cpu_set_input_line(state->cpu, 0, CLEAR_LINE); } -static void namco_50xx_irq_set(const device_config *device) +static void namco_50xx_irq_set(running_device *device) { namco_50xx_state *state = get_safe_token(device); @@ -231,7 +231,7 @@ WRITE8_DEVICE_HANDLER( namco_50xx_write ) } -void namco_50xx_read_request(const device_config *device) +void namco_50xx_read_request(running_device *device) { timer_call_after_resynch(device->machine, (void *)device, 0, namco_50xx_readrequest_callback); @@ -284,7 +284,7 @@ static DEVICE_START( namco_50xx ) astring tempstring; /* find our CPU */ - state->cpu = devtag_get_device(device->machine, device_build_tag(tempstring, device, "mcu")); + state->cpu = device->subdevice("mcu"); assert(state->cpu != NULL); } diff --git a/src/mame/machine/namco50.h b/src/mame/machine/namco50.h index 4422dd34050..f41f89fb2e5 100644 --- a/src/mame/machine/namco50.h +++ b/src/mame/machine/namco50.h @@ -7,7 +7,7 @@ READ8_DEVICE_HANDLER( namco_50xx_read ); -void namco_50xx_read_request(const device_config *device); +void namco_50xx_read_request(running_device *device); WRITE8_DEVICE_HANDLER( namco_50xx_write ); diff --git a/src/mame/machine/namco51.c b/src/mame/machine/namco51.c index bf8786a7fca..3e021ce17e2 100644 --- a/src/mame/machine/namco51.c +++ b/src/mame/machine/namco51.c @@ -70,7 +70,7 @@ typedef struct _namco_51xx_state namco_51xx_state; struct _namco_51xx_state { - const device_config * cpu; + running_device * cpu; devcb_resolved_read8 in[4]; devcb_resolved_write8 out[2]; INT32 lastcoins,lastbuttons; @@ -82,7 +82,7 @@ struct _namco_51xx_state INT32 mode,coincred_mode,remap_joy; }; -INLINE namco_51xx_state *get_safe_token(const device_config *device) +INLINE namco_51xx_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -377,14 +377,14 @@ ROM_END static DEVICE_START( namco_51xx ) { - const namco_51xx_interface *config = (const namco_51xx_interface *)device->static_config; + const namco_51xx_interface *config = (const namco_51xx_interface *)device->baseconfig().static_config; namco_51xx_state *state = get_safe_token(device); astring tempstring; assert(config != NULL); /* find our CPU */ - state->cpu = devtag_get_device(device->machine, device_build_tag(tempstring, device, "mcu")); + state->cpu = device->subdevice("mcu"); assert(state->cpu != NULL); /* resolve our read callbacks */ diff --git a/src/mame/machine/namco53.c b/src/mame/machine/namco53.c index e6a8ec8deb1..bcbb346b9f8 100644 --- a/src/mame/machine/namco53.c +++ b/src/mame/machine/namco53.c @@ -64,14 +64,14 @@ typedef struct _namco_53xx_state namco_53xx_state; struct _namco_53xx_state { - const device_config * cpu; + running_device * cpu; UINT8 portO; devcb_resolved_read8 k; devcb_resolved_read8 in[4]; devcb_resolved_write8 p; }; -INLINE namco_53xx_state *get_safe_token(const device_config *device) +INLINE namco_53xx_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -113,11 +113,11 @@ static WRITE8_HANDLER( namco_53xx_P_w ) static TIMER_CALLBACK( namco_53xx_irq_clear ) { - namco_53xx_state *state = get_safe_token((const device_config *)ptr); + namco_53xx_state *state = get_safe_token((running_device *)ptr); cpu_set_input_line(state->cpu, 0, CLEAR_LINE); } -void namco_53xx_read_request(const device_config *device) +void namco_53xx_read_request(running_device *device) { namco_53xx_state *state = get_safe_token(device); cpu_set_input_line(state->cpu, 0, ASSERT_LINE); @@ -171,14 +171,14 @@ ROM_END static DEVICE_START( namco_53xx ) { - const namco_53xx_interface *config = (const namco_53xx_interface *)device->static_config; + const namco_53xx_interface *config = (const namco_53xx_interface *)device->baseconfig().static_config; namco_53xx_state *state = get_safe_token(device); astring tempstring; assert(config != NULL); /* find our CPU */ - state->cpu = devtag_get_device(device->machine, device_build_tag(tempstring, device, "mcu")); + state->cpu = device->subdevice("mcu"); assert(state->cpu != NULL); /* resolve our read/write callbacks */ diff --git a/src/mame/machine/namco53.h b/src/mame/machine/namco53.h index 6159bf7cd64..45286f78ae8 100644 --- a/src/mame/machine/namco53.h +++ b/src/mame/machine/namco53.h @@ -18,7 +18,7 @@ struct _namco_53xx_interface MDRV_DEVICE_CONFIG(_interface) -void namco_53xx_read_request(const device_config *device); +void namco_53xx_read_request(running_device *device); READ8_DEVICE_HANDLER( namco_53xx_read ); diff --git a/src/mame/machine/namcoio.c b/src/mame/machine/namcoio.c index e56fa8f8748..833253df4f9 100644 --- a/src/mame/machine/namcoio.c +++ b/src/mame/machine/namcoio.c @@ -132,14 +132,14 @@ struct _namcoio_state INT32 creds_per_coin[2]; INT32 in_count; - const device_config *device; + running_device *device; }; /***************************************************************************** INLINE FUNCTIONS *****************************************************************************/ -INLINE namcoio_state *get_safe_token( const device_config *device ) +INLINE namcoio_state *get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -148,11 +148,11 @@ INLINE namcoio_state *get_safe_token( const device_config *device ) return (namcoio_state *)device->token; } -INLINE const namcoio_interface *get_interface( const device_config *device ) +INLINE const namcoio_interface *get_interface( running_device *device ) { assert(device != NULL); assert(device->type == NAMCO56XX || device->type == NAMCO58XX || device->type == NAMCO59XX); - return (const namcoio_interface *) device->static_config; + return (const namcoio_interface *) device->baseconfig().static_config; } @@ -166,7 +166,7 @@ INLINE const namcoio_interface *get_interface( const device_config *device ) #define IORAM_READ(offset) (namcoio->ram[offset] & 0x0f) #define IORAM_WRITE(offset,data) {namcoio->ram[offset] = (data) & 0x0f;} -static void handle_coins( const device_config *device, int swap ) +static void handle_coins( running_device *device, int swap ) { namcoio_state *namcoio = get_safe_token(device); int val, toggled; @@ -241,7 +241,7 @@ static void handle_coins( const device_config *device, int swap ) } -void namco_customio_56xx_run( const device_config *device ) +void namco_customio_56xx_run( running_device *device ) { namcoio_state *namcoio = get_safe_token(device); @@ -323,7 +323,7 @@ void namco_customio_56xx_run( const device_config *device ) -void namco_customio_59xx_run( const device_config *device ) +void namco_customio_59xx_run( running_device *device ) { namcoio_state *namcoio = get_safe_token(device); @@ -348,7 +348,7 @@ void namco_customio_59xx_run( const device_config *device ) -void namco_customio_58xx_run( const device_config *device ) +void namco_customio_58xx_run( running_device *device ) { namcoio_state *namcoio = get_safe_token(device); diff --git a/src/mame/machine/namcoio.h b/src/mame/machine/namcoio.h index 713de58b82b..1583e338a40 100644 --- a/src/mame/machine/namcoio.h +++ b/src/mame/machine/namcoio.h @@ -13,7 +13,7 @@ struct _namcoio_interface devcb_read8 in[4]; devcb_write8 out[2]; - const device_config *device; + running_device *device; }; /*************************************************************************** @@ -55,9 +55,9 @@ READ_LINE_DEVICE_HANDLER( namcoio_read_reset_line ); /* these must be used in the single drivers, inside a timer */ -void namco_customio_56xx_run(const device_config *device); -void namco_customio_58xx_run(const device_config *device); -void namco_customio_59xx_run(const device_config *device); +void namco_customio_56xx_run(running_device *device); +void namco_customio_58xx_run(running_device *device); +void namco_customio_59xx_run(running_device *device); #endif /* __NAMCOIO_H__ */ diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c index 347da68dfec..f85086a4fba 100644 --- a/src/mame/machine/namcos2.c +++ b/src/mame/machine/namcos2.c @@ -490,7 +490,7 @@ static UINT16 ReadWriteC148( const address_space *space, offs_t offset, UINT16 data, int bWrite ) { offs_t addr = ((offset * 2) + 0x1c0000) & 0x1fe000; - const device_config *altcpu = NULL; + running_device *altcpu = NULL; UINT16 *pC148Reg = NULL; UINT16 *pC148RegAlt = NULL; UINT16 result = 0; diff --git a/src/mame/machine/naomibd.c b/src/mame/machine/naomibd.c index a81bfe4d361..d2c7be2be2a 100644 --- a/src/mame/machine/naomibd.c +++ b/src/mame/machine/naomibd.c @@ -204,7 +204,7 @@ struct _naomibd_state { UINT8 index; /* index of board */ UINT8 type; - const device_config *device; /* pointer to our containing device */ + running_device *device; /* pointer to our containing device */ UINT8 * memory; UINT8 * protdata; @@ -299,7 +299,7 @@ static const naomibd_config_table naomibd_translate_tbl[] = in device is, in fact, a naomibd device -------------------------------------------------*/ -INLINE naomibd_state *get_safe_token(const device_config *device) +INLINE naomibd_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -316,16 +316,16 @@ INLINE naomibd_state *get_safe_token(const device_config *device) * *************************************/ -int naomibd_interrupt_callback(const device_config *device, naomibd_interrupt_func callback) +int naomibd_interrupt_callback(running_device *device, naomibd_interrupt_func callback) { - naomibd_config *config = (naomibd_config *)device->inline_config; + naomibd_config *config = (naomibd_config *)device->baseconfig().inline_config; //naomibd_state *v = get_safe_token(device); config->interrupt = callback; return 0; } -int naomibd_get_type(const device_config *device) +int naomibd_get_type(running_device *device) { naomibd_state *v = get_safe_token(device); return v->type; @@ -347,7 +347,7 @@ static STATE_POSTLOAD( naomibd_postload ) } -static void init_save_state(const device_config *device) +static void init_save_state(running_device *device) { naomibd_state *v = get_safe_token(device); @@ -977,13 +977,13 @@ static void load_rom_gdrom(running_machine* machine, naomibd_state *v) static DEVICE_START( naomibd ) { - const naomibd_config *config = (const naomibd_config *)device->inline_config; + const naomibd_config *config = (const naomibd_config *)device->baseconfig().inline_config; naomibd_state *v = get_safe_token(device); int i; /* validate some basic stuff */ - assert(device->static_config == NULL); - assert(device->inline_config != NULL); + assert(device->baseconfig().static_config == NULL); + assert(device->baseconfig().inline_config != NULL); assert(device->machine != NULL); assert(device->machine->config != NULL); @@ -1034,7 +1034,7 @@ static DEVICE_START( naomibd ) } /* set the type */ - v->index = device->machine->config->devicelist.index(device->type, device->tag); + v->index = device->machine->devicelist.index(device->type, device->tag); v->type = config->type; /* initialize some registers */ @@ -1118,15 +1118,11 @@ static DEVICE_NVRAM( naomibd ) device get info callback -------------------------------------------------*/ -DEVICE_GET_INFO( naomibd ) +DEVICE_GET_RUNTIME_INFO( naomibd ) { - const naomibd_config *config = (device != NULL) ? (const naomibd_config *)device->inline_config : NULL; switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ - case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(naomibd_state); break; - case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(naomibd_config); break; - case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; case DEVINFO_INT_DMAOFFSET: #if NAOMIBD_PRINTF_PROTECTION printf("DMA source %08x, flags %x\n", get_safe_token(device)->dma_offset, get_safe_token(device)->dma_offset_flags); @@ -1168,15 +1164,33 @@ DEVICE_GET_INFO( naomibd ) break; /* --- the following bits of info are returned as pointers --- */ + case DEVINFO_PTR_MEMORY: info->p = get_safe_token(device)->memory; break; + + /* default to the standard info */ + default: DEVICE_GET_INFO_NAME(naomibd)(&device->baseconfig(), state, info); break; + } +} + +DEVICE_GET_INFO( naomibd ) +{ + const naomibd_config *config = (device != NULL) ? (const naomibd_config *)device->inline_config : NULL; + switch (state) + { + /* --- the following bits of info are returned as 64-bit signed integers --- */ + case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(naomibd_state); break; + case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(naomibd_config); break; + case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; + + /* --- the following bits of info are returned as pointers --- */ case DEVINFO_PTR_ROM_REGION: info->romregion = NULL; break; case DEVINFO_PTR_MACHINE_CONFIG: info->machine_config = NULL; break; - case DEVINFO_PTR_MEMORY: info->p = get_safe_token(device)->memory; break; /* --- the following bits of info are returned as pointers to data or functions --- */ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(naomibd); break; case DEVINFO_FCT_STOP: info->stop = DEVICE_STOP_NAME(naomibd); break; case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(naomibd); break; case DEVINFO_FCT_NVRAM: info->nvram = DEVICE_NVRAM_NAME(naomibd); break; + case DEVINFO_FCT_GET_RUNTIME_INFO: info->get_runtime_info = DEVICE_GET_RUNTIME_INFO_NAME(naomibd); break; /* --- the following bits of info are returned as NULL-terminated strings --- */ case DEVINFO_STR_NAME: diff --git a/src/mame/machine/nitedrvr.c b/src/mame/machine/nitedrvr.c index aa8a20719f2..b0bf134127a 100644 --- a/src/mame/machine/nitedrvr.c +++ b/src/mame/machine/nitedrvr.c @@ -211,7 +211,7 @@ D5 = SKID2 ***************************************************************************/ WRITE8_HANDLER( nitedrvr_out0_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); discrete_sound_w(discrete, NITEDRVR_MOTOR_DATA, data & 0x0f); // Motor freq data discrete_sound_w(discrete, NITEDRVR_SKID1_EN, data & 0x10); // Skid1 enable discrete_sound_w(discrete, NITEDRVR_SKID2_EN, data & 0x20); // Skid2 enable @@ -229,7 +229,7 @@ D5 = Spare (Not used) ***************************************************************************/ WRITE8_HANDLER( nitedrvr_out1_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); set_led_status(space->machine, 0,data & 0x10); @@ -254,7 +254,7 @@ TIMER_DEVICE_CALLBACK( nitedrvr_crash_toggle_callback ) { if (nitedrvr_crash_en && nitedrvr_crash_data_en) { - const device_config *discrete = devtag_get_device(timer->machine, "discrete"); + running_device *discrete = devtag_get_device(timer->machine, "discrete"); nitedrvr_crash_data--; discrete_sound_w(discrete, NITEDRVR_BANG_DATA, nitedrvr_crash_data); // Crash Volume diff --git a/src/mame/machine/nmk004.c b/src/mame/machine/nmk004.c index f9be2c1fc7d..73b3e2a1071 100644 --- a/src/mame/machine/nmk004.c +++ b/src/mame/machine/nmk004.c @@ -96,9 +96,9 @@ static struct int protection_check; running_machine *machine; - const device_config *ymdevice; - const device_config *oki1device; - const device_config *oki2device; + running_device *ymdevice; + running_device *oki1device; + running_device *oki2device; /* C001 */ UINT8 last_command; // last command received /* C016 */ UINT8 oki_playing; // bitmap of active Oki channels @@ -144,7 +144,7 @@ static void oki_play_sample(int sample_no) UINT8 byte1 = read8(table_start + 2 * (sample_no & 0x7f) + 0); UINT8 byte2 = read8(table_start + 2 * (sample_no & 0x7f) + 1); int chip = (byte1 & 0x80) >> 7; - const device_config *okidevice = (chip) ? NMK004_state.oki2device : NMK004_state.oki1device; + running_device *okidevice = (chip) ? NMK004_state.oki2device : NMK004_state.oki1device; if ((byte1 & 0x7f) == 0) { @@ -988,7 +988,7 @@ static void update_music(void) -void NMK004_irq(const device_config *device, int irq) +void NMK004_irq(running_device *device, int irq) { if (irq) { diff --git a/src/mame/machine/nmk004.h b/src/mame/machine/nmk004.h index 0c776be76d1..366312e814f 100644 --- a/src/mame/machine/nmk004.h +++ b/src/mame/machine/nmk004.h @@ -1,4 +1,4 @@ void NMK004_init(running_machine *machine); -void NMK004_irq(const device_config *device, int irq); +void NMK004_irq(running_device *device, int irq); READ16_HANDLER( NMK004_r ); WRITE16_HANDLER( NMK004_w ); diff --git a/src/mame/machine/nmk112.c b/src/mame/machine/nmk112.c index 0bd0ae42e38..22c2a8cb4b3 100644 --- a/src/mame/machine/nmk112.c +++ b/src/mame/machine/nmk112.c @@ -30,7 +30,7 @@ struct _nmk112_state INLINE FUNCTIONS *****************************************************************************/ -INLINE nmk112_state *get_safe_token( const device_config *device ) +INLINE nmk112_state *get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -39,11 +39,11 @@ INLINE nmk112_state *get_safe_token( const device_config *device ) return (nmk112_state *)device->token; } -INLINE const nmk112_interface *get_interface( const device_config *device ) +INLINE const nmk112_interface *get_interface( running_device *device ) { assert(device != NULL); assert((device->type == NMK112)); - return (const nmk112_interface *) device->static_config; + return (const nmk112_interface *) device->baseconfig().static_config; } /***************************************************************************** diff --git a/src/mame/machine/playch10.c b/src/mame/machine/playch10.c index 8f1b510823e..c08773dcf9c 100644 --- a/src/mame/machine/playch10.c +++ b/src/mame/machine/playch10.c @@ -51,7 +51,7 @@ static chr_bank chr_page[8]; // Simple wrapper for ROM/RAM, since we could be ba MACHINE_RESET( pc10 ) { - const device_config *rp5h01 = devtag_get_device(machine, "rp5h01"); + running_device *rp5h01 = devtag_get_device(machine, "rp5h01"); /* initialize latches and flip-flops */ pc10_nmi_enable = pc10_dog_di = pc10_dispmask = pc10_sdcs = pc10_int_detect = 0; @@ -193,7 +193,7 @@ WRITE8_HANDLER( pc10_CARTSEL_w ) READ8_HANDLER( pc10_prot_r ) { - const device_config *rp5h01 = devtag_get_device(space->machine, "rp5h01"); + running_device *rp5h01 = devtag_get_device(space->machine, "rp5h01"); int data = 0xe7; /* we only support a single cart connected at slot 0 */ @@ -209,7 +209,7 @@ READ8_HANDLER( pc10_prot_r ) WRITE8_HANDLER( pc10_prot_w ) { - const device_config *rp5h01 = devtag_get_device(space->machine, "rp5h01"); + running_device *rp5h01 = devtag_get_device(space->machine, "rp5h01"); /* we only support a single cart connected at slot 0 */ if (cart_sel == 0) { @@ -277,7 +277,7 @@ READ8_HANDLER( pc10_in1_r ) /* do the gun thing */ if (pc10_gun_controller) { - const device_config *ppu = devtag_get_device(space->machine, "ppu"); + running_device *ppu = devtag_get_device(space->machine, "ppu"); int trigger = input_port_read(space->machine, "P1"); int x = input_port_read(space->machine, "GUNX"); int y = input_port_read(space->machine, "GUNY"); @@ -723,7 +723,7 @@ DRIVER_INIT( pcdboard_2 ) /* E Board games (Mike Tyson's Punchout) - BROKEN - FIX ME */ /* callback for the ppu_latch */ -static void mapper9_latch( const device_config *ppu, offs_t offset ) +static void mapper9_latch( running_device *ppu, offs_t offset ) { if((offset & 0x1ff0) == 0x0fd0 && MMC2_bank_latch[0] != 0xfd) @@ -862,7 +862,7 @@ static int gboard_4screen; static int gboard_last_bank; static int gboard_command; -static void gboard_scanline_cb( const device_config *device, int scanline, int vblank, int blanked ) +static void gboard_scanline_cb( running_device *device, int scanline, int vblank, int blanked ) { if (!vblank && !blanked) { @@ -876,7 +876,7 @@ static void gboard_scanline_cb( const device_config *device, int scanline, int v static WRITE8_HANDLER( gboard_rom_switch_w ) { - const device_config *ppu = devtag_get_device(space->machine, "ppu"); + running_device *ppu = devtag_get_device(space->machine, "ppu"); /* basically, a MMC3 mapper from the nes */ diff --git a/src/mame/machine/qix.c b/src/mame/machine/qix.c index 195451fc0bb..bfb6aae1dad 100644 --- a/src/mame/machine/qix.c +++ b/src/mame/machine/qix.c @@ -252,7 +252,7 @@ MACHINE_START( qixmcu ) WRITE_LINE_DEVICE_HANDLER( qix_vsync_changed ) { - const device_config *pia = devtag_get_device(device->machine, "sndpia0"); + running_device *pia = devtag_get_device(device->machine, "sndpia0"); pia6821_cb1_w(pia, 0, state); } @@ -471,7 +471,7 @@ WRITE8_HANDLER( qix_68705_portC_w ) static TIMER_CALLBACK( pia_w_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; pia6821_w(device, param >> 8, param & 0xff); } diff --git a/src/mame/machine/s16fd.c b/src/mame/machine/s16fd.c index 3cedbbddaae..0acc86ad9a8 100644 --- a/src/mame/machine/s16fd.c +++ b/src/mame/machine/s16fd.c @@ -111,7 +111,7 @@ static void fd1094_setstate_and_decrypt(running_machine *machine, int state) } /* Callback for CMP.L instructions (state change) */ -static void fd1094_cmp_callback(const device_config *device, UINT32 val, UINT8 reg) +static void fd1094_cmp_callback(running_device *device, UINT32 val, UINT8 reg) { if (reg == 0 && (val & 0x0000ffff) == 0x0000ffff) // ? { @@ -126,7 +126,7 @@ static IRQ_CALLBACK(fd1094_int_callback) return (0x60+irqline*4)/4; // vector address } -static void fd1094_rte_callback (const device_config *device) +static void fd1094_rte_callback (running_device *device) { fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_RTE); } @@ -143,7 +143,7 @@ static void fd1094_kludge_reset_values(void) /* function, to be called from MACHINE_RESET (every reset) */ -void fd1094_machine_init(const device_config *device) +void fd1094_machine_init(running_device *device) { /* punt if no key; this allows us to be called even for non-FD1094 games */ if (!fd1094_key) diff --git a/src/mame/machine/s24fd.c b/src/mame/machine/s24fd.c index 72456b8be9e..f5a6e0691b0 100644 --- a/src/mame/machine/s24fd.c +++ b/src/mame/machine/s24fd.c @@ -89,7 +89,7 @@ static void s24_fd1094_setstate_and_decrypt(running_machine *machine, int state) } /* Callback for CMP.L instructions (state change) */ -static void s24_fd1094_cmp_callback(const device_config *device, UINT32 val, UINT8 reg) +static void s24_fd1094_cmp_callback(running_device *device, UINT32 val, UINT8 reg) { if (reg == 0 && (val & 0x0000ffff) == 0x0000ffff) // ? { @@ -104,7 +104,7 @@ static IRQ_CALLBACK(s24_fd1094_int_callback) return (0x60+irqline*4)/4; // vector address } -static void s24_fd1094_rte_callback (const device_config *device) +static void s24_fd1094_rte_callback (running_device *device) { s24_fd1094_setstate_and_decrypt(device->machine, FD1094_STATE_RTE); } diff --git a/src/mame/machine/segaic16.c b/src/mame/machine/segaic16.c index 4a938c7565e..e7d1f85c0b4 100644 --- a/src/mame/machine/segaic16.c +++ b/src/mame/machine/segaic16.c @@ -33,7 +33,7 @@ struct memory_mapper_chip { UINT8 regs[0x20]; - const device_config *cpu; + running_device *cpu; const segaic16_memory_map_entry *map; void (*sound_w)(running_machine *, UINT8); UINT8 (*sound_r)(running_machine *); @@ -124,7 +124,7 @@ READ16_HANDLER( segaic16_open_bus_r ) * *************************************/ -void segaic16_memory_mapper_init(const device_config *cpu, const segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(running_machine *, UINT8), UINT8 (*sound_r_callback)(running_machine *)) +void segaic16_memory_mapper_init(running_device *cpu, const segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(running_machine *, UINT8), UINT8 (*sound_r_callback)(running_machine *)) { struct memory_mapper_chip *chip = &memory_mapper; diff --git a/src/mame/machine/segaic16.h b/src/mame/machine/segaic16.h index 8c60a77696e..e3ed955aaad 100644 --- a/src/mame/machine/segaic16.h +++ b/src/mame/machine/segaic16.h @@ -24,7 +24,7 @@ struct _segaic16_memory_map_entry const char * name; /* friendly name for debugging */ }; -void segaic16_memory_mapper_init(const device_config *cpu, const segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(running_machine *, UINT8), UINT8 (*sound_r_callback)(running_machine *)); +void segaic16_memory_mapper_init(running_device *cpu, const segaic16_memory_map_entry *entrylist, void (*sound_w_callback)(running_machine *, UINT8), UINT8 (*sound_r_callback)(running_machine *)); void segaic16_memory_mapper_reset(running_machine *machine); void segaic16_memory_mapper_config(running_machine *machine, const UINT8 *map_data); void segaic16_memory_mapper_set_decrypted(running_machine *machine, UINT8 *decrypted); diff --git a/src/mame/machine/segas32.c b/src/mame/machine/segas32.c index 2d3b5570353..1e393949d8d 100644 --- a/src/mame/machine/segas32.c +++ b/src/mame/machine/segas32.c @@ -226,7 +226,7 @@ WRITE16_HANDLER(brival_protection_w) ****************************************************************************** ******************************************************************************/ -void darkedge_fd1149_vblank(const device_config *device) +void darkedge_fd1149_vblank(running_device *device) { const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM); diff --git a/src/mame/machine/stfight.c b/src/mame/machine/stfight.c index 97aa2366d45..9e5324a2400 100644 --- a/src/mame/machine/stfight.c +++ b/src/mame/machine/stfight.c @@ -197,7 +197,7 @@ static const int sampleLimits[] = 0x7200 // (end of samples) }; -void stfight_adpcm_int(const device_config *device) +void stfight_adpcm_int(running_device *device) { UINT8 *SAMPLES = memory_region(device->machine, "adpcm"); int adpcm_data = SAMPLES[adpcm_data_offs & 0x7fff]; diff --git a/src/mame/machine/stvcd.c b/src/mame/machine/stvcd.c index 42d6247b67b..8badaf4a979 100644 --- a/src/mame/machine/stvcd.c +++ b/src/mame/machine/stvcd.c @@ -105,7 +105,7 @@ typedef enum } trans32T; // local variables -static const device_config *sector_timer; +static running_device *sector_timer; static partitionT partitions[MAX_FILTERS]; static partitionT *transpart; diff --git a/src/mame/machine/system16.c b/src/mame/machine/system16.c index cc3234ccee6..13376f9608e 100644 --- a/src/mame/machine/system16.c +++ b/src/mame/machine/system16.c @@ -52,7 +52,7 @@ GFXDECODE_END /* sound */ -static void sound_cause_nmi( const device_config *device, int chip ) +static void sound_cause_nmi( running_device *device, int chip ) { /* upd7759 callback */ cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE); diff --git a/src/mame/machine/taitoio.c b/src/mame/machine/taitoio.c index 4a53fa38ccd..c9d489540f7 100644 --- a/src/mame/machine/taitoio.c +++ b/src/mame/machine/taitoio.c @@ -69,7 +69,7 @@ struct _tc0220ioc_state INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0220ioc_state *tc0220ioc_get_safe_token( const device_config *device ) +INLINE tc0220ioc_state *tc0220ioc_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -78,11 +78,11 @@ INLINE tc0220ioc_state *tc0220ioc_get_safe_token( const device_config *device ) return (tc0220ioc_state *)device->token; } -INLINE const tc0220ioc_interface *tc0220ioc_get_interface( const device_config *device ) +INLINE const tc0220ioc_interface *tc0220ioc_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == TC0220IOC)); - return (const tc0220ioc_interface *) device->static_config; + return (const tc0220ioc_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -226,7 +226,7 @@ struct _tc0510nio_state INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0510nio_state *tc0510nio_get_safe_token( const device_config *device ) +INLINE tc0510nio_state *tc0510nio_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -235,11 +235,11 @@ INLINE tc0510nio_state *tc0510nio_get_safe_token( const device_config *device ) return (tc0510nio_state *)device->token; } -INLINE const tc0510nio_interface *tc0510nio_get_interface( const device_config *device ) +INLINE const tc0510nio_interface *tc0510nio_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == TC0510NIO)); - return (const tc0510nio_interface *) device->static_config; + return (const tc0510nio_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -378,7 +378,7 @@ struct _tc0640fio_state INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0640fio_state *tc0640fio_get_safe_token( const device_config *device ) +INLINE tc0640fio_state *tc0640fio_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -387,11 +387,11 @@ INLINE tc0640fio_state *tc0640fio_get_safe_token( const device_config *device ) return (tc0640fio_state *)device->token; } -INLINE const tc0640fio_interface *tc0640fio_get_interface( const device_config *device ) +INLINE const tc0640fio_interface *tc0640fio_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == TC0640FIO)); - return (const tc0640fio_interface *) device->static_config; + return (const tc0640fio_interface *) device->baseconfig().static_config; } /***************************************************************************** diff --git a/src/mame/machine/ticket.c b/src/mame/machine/ticket.c index 5c7ee1ce8ab..8d09f04aea4 100644 --- a/src/mame/machine/ticket.c +++ b/src/mame/machine/ticket.c @@ -31,7 +31,7 @@ struct _ticket_state emu_timer *timer; }; -INLINE ticket_state *get_safe_token(const device_config *device) +INLINE ticket_state *get_safe_token(running_device *device) { assert(device != NULL); assert(device->token != NULL); @@ -43,7 +43,7 @@ INLINE ticket_state *get_safe_token(const device_config *device) static TIMER_CALLBACK( ticket_dispenser_toggle ) { - ticket_state *state = get_safe_token((const device_config *)ptr); + ticket_state *state = get_safe_token((running_device *)ptr); /* If we still have power, keep toggling ticket states. */ if (state->power) @@ -122,7 +122,7 @@ WRITE8_DEVICE_HANDLER( ticket_dispenser_w ) static DEVICE_START( ticket ) { - const ticket_config *config = (const ticket_config *)device->inline_config; + const ticket_config *config = (const ticket_config *)device->baseconfig().inline_config; ticket_state *state = get_safe_token(device); assert(config != NULL); diff --git a/src/mame/machine/vertigo.c b/src/mame/machine/vertigo.c index 0113598b440..560f7eff281 100644 --- a/src/mame/machine/vertigo.c +++ b/src/mame/machine/vertigo.c @@ -11,7 +11,7 @@ #include "machine/pit8253.h" -static const device_config *ttl74148; +static running_device *ttl74148; @@ -70,7 +70,7 @@ const struct pit8253_config vertigo_pit8254_config = * *************************************/ -void vertigo_update_irq(const device_config *device) +void vertigo_update_irq(running_device *device) { if (irq_state < 7) cputag_set_input_line(device->machine, "maincpu", irq_state ^ 7, CLEAR_LINE); diff --git a/src/mame/machine/vsnes.c b/src/mame/machine/vsnes.c index cac77cdbedd..7798515d7f1 100644 --- a/src/mame/machine/vsnes.c +++ b/src/mame/machine/vsnes.c @@ -106,7 +106,7 @@ static const UINT8 rp2c05004_colortable[] = /* remap callback */ -static int remap_colors( const device_config *device, int addr, int data ) +static int remap_colors( running_device *device, int addr, int data ) { /* this is the protection. color codes are shuffled around */ /* the ones with value 0xff are unknown */ @@ -239,7 +239,7 @@ READ8_HANDLER( vsnes_in1_1_r ) MACHINE_RESET( vsnes ) { - const device_config *ppu = devtag_get_device(machine, "ppu1"); + running_device *ppu = devtag_get_device(machine, "ppu1"); last_bank = 0xff; sound_fix = 0; @@ -259,8 +259,8 @@ MACHINE_RESET( vsnes ) MACHINE_RESET( vsdual ) { - const device_config *ppu1 = devtag_get_device(machine, "ppu1"); - const device_config *ppu2 = devtag_get_device(machine, "ppu2"); + running_device *ppu1 = devtag_get_device(machine, "ppu1"); + running_device *ppu2 = devtag_get_device(machine, "ppu2"); input_latch[0] = input_latch[1] = 0; input_latch[2] = input_latch[3] = 0; @@ -469,7 +469,7 @@ DRIVER_INIT( vsnormal ) static WRITE8_HANDLER( ppuRC2C05_protection ) { - const device_config *ppu1 = devtag_get_device(space->machine, "ppu1"); + running_device *ppu1 = devtag_get_device(space->machine, "ppu1"); /* This PPU has registers mapped at $2000 and $2001 inverted */ /* and no remapped color */ @@ -507,7 +507,7 @@ DRIVER_INIT( suprmrio ) static WRITE8_HANDLER( gun_in0_w ) { - const device_config *ppu1 = devtag_get_device(space->machine, "ppu1"); + running_device *ppu1 = devtag_get_device(space->machine, "ppu1"); static int zapstore; if (vsnes_do_vrom_bank) @@ -1006,7 +1006,7 @@ static void mapper4_set_chr( running_machine *machine ) #define BOTTOM_VISIBLE_SCANLINE 239 /* The bottommost visible scanline */ #define NUM_SCANLINE 262 -static void mapper4_irq( const device_config *device, int scanline, int vblank, int blanked ) +static void mapper4_irq( running_device *device, int scanline, int vblank, int blanked ) { if (scanline < PPU_BOTTOM_VISIBLE_SCANLINE) { @@ -1027,7 +1027,7 @@ static void mapper4_irq( const device_config *device, int scanline, int vblank, static WRITE8_HANDLER( mapper4_w ) { - const device_config *ppu1 = devtag_get_device(space->machine, "ppu1"); + running_device *ppu1 = devtag_get_device(space->machine, "ppu1"); UINT8 MMC3_helper, cmd; switch (offset & 0x6001) @@ -1417,7 +1417,7 @@ DRIVER_INIT( mightybj ) static WRITE8_HANDLER( vstennis_vrom_banking ) { - const device_config *other_cpu = (space->cpu == devtag_get_device(space->machine, "maincpu")) ? devtag_get_device(space->machine, "sub") : devtag_get_device(space->machine, "maincpu"); + running_device *other_cpu = (space->cpu == devtag_get_device(space->machine, "maincpu")) ? devtag_get_device(space->machine, "sub") : devtag_get_device(space->machine, "maincpu"); /* switch vrom */ (space->cpu == devtag_get_device(space->machine, "maincpu")) ? memory_set_bankptr(space->machine, "bank2", (data & 4) ? vrom[0] + 0x2000 : vrom[0]) : memory_set_bankptr(space->machine, "bank3", (data & 4) ? vrom[1] + 0x2000 : vrom[1]); diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c index fe99ce73f64..2572d6cf8d9 100644 --- a/src/mame/machine/williams.c +++ b/src/mame/machine/williams.c @@ -26,9 +26,9 @@ static UINT8 vram_bank; static UINT16 joust2_current_sound_data; /* older-Williams routines */ -static void williams_main_irq(const device_config *device, int state); -static void williams_main_firq(const device_config *device, int state); -static void williams_snd_irq(const device_config *device, int state); +static void williams_main_irq(running_device *device, int state); +static void williams_main_firq(running_device *device, int state); +static void williams_snd_irq(running_device *device, int state); static WRITE8_DEVICE_HANDLER( williams_snd_cmd_w ); static WRITE8_DEVICE_HANDLER( playball_snd_cmd_w ); @@ -40,8 +40,8 @@ static READ8_DEVICE_HANDLER( williams_49way_port_0_r ); /* newer-Williams routines */ static WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w ); -static void mysticm_main_irq(const device_config *device, int state); -static void tshoot_main_irq(const device_config *device, int state); +static void mysticm_main_irq(running_device *device, int state); +static void tshoot_main_irq(running_device *device, int state); /* Lotto Fun-specific code */ static WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w ); @@ -250,7 +250,7 @@ const pia6821_interface joust2_pia_1_intf = TIMER_DEVICE_CALLBACK( williams_va11_callback ) { - const device_config *pia_1 = devtag_get_device(timer->machine, "pia_1"); + running_device *pia_1 = devtag_get_device(timer->machine, "pia_1"); int scanline = param; /* the IRQ signal comes into CB1, and is set to VA11 */ @@ -265,7 +265,7 @@ TIMER_DEVICE_CALLBACK( williams_va11_callback ) static TIMER_CALLBACK( williams_count240_off_callback ) { - const device_config *pia_1 = devtag_get_device(machine, "pia_1"); + running_device *pia_1 = devtag_get_device(machine, "pia_1"); /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */ pia6821_ca1_w(pia_1, 0, 0); @@ -274,7 +274,7 @@ static TIMER_CALLBACK( williams_count240_off_callback ) TIMER_DEVICE_CALLBACK( williams_count240_callback ) { - const device_config *pia_1 = devtag_get_device(timer->machine, "pia_1"); + running_device *pia_1 = devtag_get_device(timer->machine, "pia_1"); /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */ pia6821_ca1_w(pia_1, 0, 1); @@ -287,9 +287,9 @@ TIMER_DEVICE_CALLBACK( williams_count240_callback ) } -static void williams_main_irq(const device_config *device, int state) +static void williams_main_irq(running_device *device, int state) { - const device_config *pia_1 = devtag_get_device(device->machine, "pia_1"); + running_device *pia_1 = devtag_get_device(device->machine, "pia_1"); int combined_state = pia6821_get_irq_a(pia_1) | pia6821_get_irq_b(pia_1); /* IRQ to the main CPU */ @@ -297,16 +297,16 @@ static void williams_main_irq(const device_config *device, int state) } -static void williams_main_firq(const device_config *device, int state) +static void williams_main_firq(running_device *device, int state) { /* FIRQ to the main CPU */ cputag_set_input_line(device->machine, "maincpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); } -static void williams_snd_irq(const device_config *device, int state) +static void williams_snd_irq(running_device *device, int state) { - const device_config *pia_2 = devtag_get_device(device->machine, "pia_2"); + running_device *pia_2 = devtag_get_device(device->machine, "pia_2"); int combined_state = pia6821_get_irq_a(pia_2) | pia6821_get_irq_b(pia_2); /* IRQ to the sound CPU */ @@ -321,10 +321,10 @@ static void williams_snd_irq(const device_config *device, int state) * *************************************/ -static void mysticm_main_irq(const device_config *device, int state) +static void mysticm_main_irq(running_device *device, int state) { - const device_config *pia_0 = devtag_get_device(device->machine, "pia_0"); - const device_config *pia_1 = devtag_get_device(device->machine, "pia_1"); + running_device *pia_0 = devtag_get_device(device->machine, "pia_0"); + running_device *pia_1 = devtag_get_device(device->machine, "pia_1"); int combined_state = pia6821_get_irq_b(pia_0) | pia6821_get_irq_a(pia_1) | pia6821_get_irq_b(pia_1); /* IRQ to the main CPU */ @@ -332,10 +332,10 @@ static void mysticm_main_irq(const device_config *device, int state) } -static void tshoot_main_irq(const device_config *device, int state) +static void tshoot_main_irq(running_device *device, int state) { - const device_config *pia_0 = devtag_get_device(device->machine, "pia_0"); - const device_config *pia_1 = devtag_get_device(device->machine, "pia_1"); + running_device *pia_0 = devtag_get_device(device->machine, "pia_0"); + running_device *pia_1 = devtag_get_device(device->machine, "pia_1"); int combined_state = pia6821_get_irq_a(pia_0) | pia6821_get_irq_b(pia_0) | pia6821_get_irq_a(pia_1) | pia6821_get_irq_b(pia_1); /* IRQ to the main CPU */ @@ -391,8 +391,8 @@ MACHINE_RESET( williams ) TIMER_DEVICE_CALLBACK( williams2_va11_callback ) { - const device_config *pia_0 = devtag_get_device(timer->machine, "pia_0"); - const device_config *pia_1 = devtag_get_device(timer->machine, "pia_1"); + running_device *pia_0 = devtag_get_device(timer->machine, "pia_0"); + running_device *pia_1 = devtag_get_device(timer->machine, "pia_1"); int scanline = param; /* the IRQ signal comes into CB1, and is set to VA11 */ @@ -408,7 +408,7 @@ TIMER_DEVICE_CALLBACK( williams2_va11_callback ) static TIMER_CALLBACK( williams2_endscreen_off_callback ) { - const device_config *pia_0 = devtag_get_device(machine, "pia_0"); + running_device *pia_0 = devtag_get_device(machine, "pia_0"); /* the /ENDSCREEN signal comes into CA1 */ pia6821_ca1_w(pia_0, 0, 1); @@ -417,7 +417,7 @@ static TIMER_CALLBACK( williams2_endscreen_off_callback ) TIMER_DEVICE_CALLBACK( williams2_endscreen_callback ) { - const device_config *pia_0 = devtag_get_device(timer->machine, "pia_0"); + running_device *pia_0 = devtag_get_device(timer->machine, "pia_0"); /* the /ENDSCREEN signal comes into CA1 */ pia6821_ca1_w(pia_0, 0, 0); @@ -533,7 +533,7 @@ WRITE8_HANDLER( williams2_bank_select_w ) static TIMER_CALLBACK( williams_deferred_snd_cmd_w ) { - const device_config *pia_2 = devtag_get_device(machine, "pia_2"); + running_device *pia_2 = devtag_get_device(machine, "pia_2"); pia6821_portb_w(pia_2, 0, param); pia6821_cb1_w(pia_2, 0, (param == 0xff) ? 0 : 1); @@ -553,7 +553,7 @@ WRITE8_DEVICE_HANDLER( playball_snd_cmd_w ) static TIMER_CALLBACK( williams2_deferred_snd_cmd_w ) { - const device_config *pia_2 = devtag_get_device(machine, "pia_2"); + running_device *pia_2 = devtag_get_device(machine, "pia_2"); pia6821_porta_w(pia_2, 0, param); } @@ -961,7 +961,7 @@ MACHINE_START( joust2 ) MACHINE_RESET( joust2 ) { - const device_config *pia_3 = devtag_get_device(machine, "cvsdpia"); + running_device *pia_3 = devtag_get_device(machine, "cvsdpia"); /* standard init */ MACHINE_RESET_CALL(williams2); @@ -971,14 +971,14 @@ MACHINE_RESET( joust2 ) static TIMER_CALLBACK( joust2_deferred_snd_cmd_w ) { - const device_config *pia_2 = devtag_get_device(machine, "pia_2"); + running_device *pia_2 = devtag_get_device(machine, "pia_2"); pia6821_porta_w(pia_2, 0, param & 0xff); } static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w ) { - const device_config *pia_3 = devtag_get_device(device->machine, "cvsdpia"); + running_device *pia_3 = devtag_get_device(device->machine, "cvsdpia"); joust2_current_sound_data = (joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100); pia6821_cb1_w(pia_3, offset, data); diff --git a/src/mame/machine/xevious.c b/src/mame/machine/xevious.c index 72644de2b48..00fcc4c0a91 100644 --- a/src/mame/machine/xevious.c +++ b/src/mame/machine/xevious.c @@ -89,7 +89,7 @@ READ8_HANDLER( battles_customio3_r ) WRITE8_HANDLER( battles_customio0_w ) { - const device_config *timer = devtag_get_device(space->machine, "battles_nmi"); + running_device *timer = devtag_get_device(space->machine, "battles_nmi"); logerror("CPU0 %04x: custom I/O Write = %02x\n",cpu_get_pc(space->cpu),data); @@ -157,7 +157,7 @@ WRITE8_HANDLER( battles_noise_sound_w ) { logerror("CPU3 %04x: 50%02x Write = %02x\n",cpu_get_pc(space->cpu),offset,data); if( (battles_sound_played == 0) && (data == 0xFF) ){ - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); if( customio[0] == 0x40 ){ sample_start (samples, 0, 0, 0); } diff --git a/src/mame/video/amiga.c b/src/mame/video/amiga.c index 2e4538d9b4b..65ec959ce31 100644 --- a/src/mame/video/amiga.c +++ b/src/mame/video/amiga.c @@ -165,7 +165,7 @@ VIDEO_START( amiga ) * *************************************/ -UINT32 amiga_gethvpos(const device_config *screen) +UINT32 amiga_gethvpos(running_device *screen) { UINT32 hvpos = (last_scanline << 8) | (video_screen_get_hpos(screen) >> 2); UINT32 latchedpos = input_port_read_safe(screen->machine, "HVPOS", 0); diff --git a/src/mame/video/amigaaga.c b/src/mame/video/amigaaga.c index 26ae1368196..67a9aa4ba91 100644 --- a/src/mame/video/amigaaga.c +++ b/src/mame/video/amigaaga.c @@ -208,7 +208,7 @@ VIDEO_START( amiga_aga ) * *************************************/ -UINT32 amiga_aga_gethvpos(const device_config *screen) +UINT32 amiga_aga_gethvpos(running_device *screen) { UINT32 hvpos = (last_scanline << 8) | (video_screen_get_hpos(screen) >> 2); UINT32 latchedpos = input_port_read_safe(screen->machine, "HVPOS", 0); diff --git a/src/mame/video/argus.c b/src/mame/video/argus.c index 774586131f8..a0e909f83c8 100644 --- a/src/mame/video/argus.c +++ b/src/mame/video/argus.c @@ -913,7 +913,7 @@ static void argus_draw_sprites(running_machine *machine, bitmap_t *bitmap, const } #if 1 -static void valtric_draw_mosaic(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) +static void valtric_draw_mosaic(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { static int mosaic=0; @@ -964,7 +964,7 @@ static void valtric_draw_mosaic(const device_config *screen, bitmap_t *bitmap, c } } #else -static void valtric_draw_mosaic(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) +static void valtric_draw_mosaic(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { int step = 0x10 - (valtric_mosaic & 0x0f); diff --git a/src/mame/video/artmagic.c b/src/mame/video/artmagic.c index e31145c3c9f..664b2708b5c 100644 --- a/src/mame/video/artmagic.c +++ b/src/mame/video/artmagic.c @@ -351,7 +351,7 @@ WRITE16_HANDLER( artmagic_blitter_w ) * *************************************/ -void artmagic_scanline(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void artmagic_scanline(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { offs_t offset = (params->rowaddr << 12) & 0x7ff000; UINT16 *vram = address_to_vram(&offset); diff --git a/src/mame/video/atarig1.c b/src/mame/video/atarig1.c index 3e6461296bc..544ca7a4701 100644 --- a/src/mame/video/atarig1.c +++ b/src/mame/video/atarig1.c @@ -131,7 +131,7 @@ WRITE16_HANDLER( atarig1_mo_control_w ) } -void atarig1_scanline_update(const device_config *screen, int scanline) +void atarig1_scanline_update(running_device *screen, int scanline) { atarig1_state *state = (atarig1_state *)screen->machine->driver_data; UINT16 *base = &state->atarigen.alpha[(scanline / 8) * 64 + 48]; diff --git a/src/mame/video/atarig42.c b/src/mame/video/atarig42.c index b046743810b..e38df425990 100644 --- a/src/mame/video/atarig42.c +++ b/src/mame/video/atarig42.c @@ -136,7 +136,7 @@ WRITE16_HANDLER( atarig42_mo_control_w ) } -void atarig42_scanline_update(const device_config *screen, int scanline) +void atarig42_scanline_update(running_device *screen, int scanline) { atarig42_state *state = (atarig42_state *)screen->machine->driver_data; UINT16 *base = &state->atarigen.alpha[(scanline / 8) * 64 + 48]; diff --git a/src/mame/video/atarigt.c b/src/mame/video/atarigt.c index d477f35e78f..e168e66132a 100644 --- a/src/mame/video/atarigt.c +++ b/src/mame/video/atarigt.c @@ -186,7 +186,7 @@ UINT16 atarigt_colorram_r(atarigt_state *state, offs_t address) * *************************************/ -void atarigt_scanline_update(const device_config *screen, int scanline) +void atarigt_scanline_update(running_device *screen, int scanline) { atarigt_state *state = (atarigt_state *)screen->machine->driver_data; UINT32 *base = &state->atarigen.alpha32[(scanline / 8) * 32 + 24]; diff --git a/src/mame/video/atarigx2.c b/src/mame/video/atarigx2.c index 65d3eaf36dc..cddad654a0d 100644 --- a/src/mame/video/atarigx2.c +++ b/src/mame/video/atarigx2.c @@ -136,7 +136,7 @@ WRITE16_HANDLER( atarigx2_mo_control_w ) } -void atarigx2_scanline_update(const device_config *screen, int scanline) +void atarigx2_scanline_update(running_device *screen, int scanline) { atarigx2_state *state = (atarigx2_state *)screen->machine->driver_data; UINT32 *base = &state->atarigen.alpha32[(scanline / 8) * 32 + 24]; diff --git a/src/mame/video/batman.c b/src/mame/video/batman.c index 00c616b353d..ed819df2ec8 100644 --- a/src/mame/video/batman.c +++ b/src/mame/video/batman.c @@ -121,7 +121,7 @@ VIDEO_START( batman ) * *************************************/ -void batman_scanline_update(const device_config *screen, int scanline) +void batman_scanline_update(running_device *screen, int scanline) { batman_state *state = (batman_state *)screen->machine->driver_data; diff --git a/src/mame/video/beezer.c b/src/mame/video/beezer.c index 70b00ade8dc..b11c5358901 100644 --- a/src/mame/video/beezer.c +++ b/src/mame/video/beezer.c @@ -7,7 +7,7 @@ static int scanline=0; INTERRUPT_GEN( beezer_interrupt ) { - const device_config *via_0 = devtag_get_device(device->machine, "via6522_0"); + running_device *via_0 = devtag_get_device(device->machine, "via6522_0"); scanline = (scanline + 1) % 0x80; via_ca2_w(via_0, (scanline & 0x10) ? 1 : 0); diff --git a/src/mame/video/blstroid.c b/src/mame/video/blstroid.c index be717fe6e5d..76c33f00d7a 100644 --- a/src/mame/video/blstroid.c +++ b/src/mame/video/blstroid.c @@ -105,7 +105,7 @@ static TIMER_CALLBACK( irq_on ) } -void blstroid_scanline_update(const device_config *screen, int scanline) +void blstroid_scanline_update(running_device *screen, int scanline) { blstroid_state *state = (blstroid_state *)screen->machine->driver_data; int offset = (scanline / 8) * 64 + 40; diff --git a/src/mame/video/btoads.c b/src/mame/video/btoads.c index bc7e830dedc..d4b67e54981 100644 --- a/src/mame/video/btoads.c +++ b/src/mame/video/btoads.c @@ -343,7 +343,7 @@ void btoads_from_shiftreg(const address_space *space, UINT32 address, UINT16 *sh * *************************************/ -void btoads_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void btoads_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT32 fulladdr = ((params->rowaddr << 16) | params->coladdr) >> 4; UINT16 *bg0_base = &btoads_vram_bg0[(fulladdr + (yscroll0 << 10)) & 0x3fc00]; diff --git a/src/mame/video/cave.c b/src/mame/video/cave.c index 95e7c1d77e1..0d45b5d5db2 100644 --- a/src/mame/video/cave.c +++ b/src/mame/video/cave.c @@ -797,7 +797,7 @@ static void sprite_init_cave( running_machine *machine ) state_save_register_postload(machine, cave_sprite_postload, NULL); } -static void cave_sprite_check( const device_config *screen, const rectangle *clip ) +static void cave_sprite_check( running_device *screen, const rectangle *clip ) { cave_state *state = (cave_state *)screen->machine->driver_data; diff --git a/src/mame/video/cinemat.c b/src/mame/video/cinemat.c index 08374e00053..96f50cf5723 100644 --- a/src/mame/video/cinemat.c +++ b/src/mame/video/cinemat.c @@ -46,7 +46,7 @@ static UINT8 last_control; * *************************************/ -void cinemat_vector_callback(const device_config *device, INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift) +void cinemat_vector_callback(running_device *device, INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift) { const rectangle *visarea = video_screen_get_visible_area(device->machine->primary_screen); int intensity = 0xff; @@ -84,7 +84,7 @@ void cinemat_vector_callback(const device_config *device, INT16 sx, INT16 sy, IN WRITE8_HANDLER(cinemat_vector_control_w) { int r, g, b, i; - const device_config *cpu = devtag_get_device(space->machine, "maincpu"); + running_device *cpu = devtag_get_device(space->machine, "maincpu"); switch (color_mode) { diff --git a/src/mame/video/combatsc.c b/src/mame/video/combatsc.c index 8fbf4ab16be..a4f9bdb2563 100644 --- a/src/mame/video/combatsc.c +++ b/src/mame/video/combatsc.c @@ -358,7 +358,7 @@ WRITE8_HANDLER( combatsc_video_w ) WRITE8_HANDLER( combatsc_pf_control_w ) { combatsc_state *state = (combatsc_state *)space->machine->driver_data; - const device_config *k007121 = state->video_circuit ? state->k007121_2 : state->k007121_1; + running_device *k007121 = state->video_circuit ? state->k007121_2 : state->k007121_1; k007121_ctrl_w(k007121, offset, data); if (offset == 7) @@ -396,7 +396,7 @@ WRITE8_HANDLER( combatsc_scrollram_w ) static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, const UINT8 *source, int circuit, UINT32 pri_mask ) { combatsc_state *state = (combatsc_state *)machine->driver_data; - const device_config *k007121 = circuit ? state->k007121_2 : state->k007121_1; + running_device *k007121 = circuit ? state->k007121_2 : state->k007121_1; int base_color = (circuit * 4) * 16 + (k007121_ctrlram_r(k007121, 6) & 0x10) * 2; k007121_sprites_draw(k007121, bitmap, cliprect, machine->gfx[circuit], machine->colortable, source, base_color, 0, 0, pri_mask); diff --git a/src/mame/video/contra.c b/src/mame/video/contra.c index 15bf240c47e..2021007bd52 100644 --- a/src/mame/video/contra.c +++ b/src/mame/video/contra.c @@ -304,7 +304,7 @@ WRITE8_HANDLER( contra_K007121_ctrl_1_w ) static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bank ) { contra_state *state = (contra_state *)machine->driver_data; - const device_config *k007121 = bank ? state->k007121_2 : state->k007121_1; + running_device *k007121 = bank ? state->k007121_2 : state->k007121_1; int base_color = (k007121_ctrlram_r(k007121, 6) & 0x30) * 2; const UINT8 *source; diff --git a/src/mame/video/cosmic.c b/src/mame/video/cosmic.c index ec7c5178d2f..b9d25c79374 100644 --- a/src/mame/video/cosmic.c +++ b/src/mame/video/cosmic.c @@ -317,7 +317,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect } -static void cosmica_draw_starfield( const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect ) +static void cosmica_draw_starfield( running_device *screen, bitmap_t *bitmap, const rectangle *cliprect ) { UINT8 y = 0; UINT8 map = 0; @@ -424,7 +424,7 @@ static void devzone_draw_grid( running_machine *machine, bitmap_t *bitmap, const } -static void nomnlnd_draw_background( const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect ) +static void nomnlnd_draw_background( running_device *screen, bitmap_t *bitmap, const rectangle *cliprect ) { UINT8 y = 0; UINT8 water = video_screen_get_frame_number(screen); diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c index dd29746bcfe..24e10ab6327 100644 --- a/src/mame/video/cps1.c +++ b/src/mame/video/cps1.c @@ -2583,7 +2583,7 @@ static void cps2_render_sprites( running_machine *machine, bitmap_t *bitmap, con -static void cps1_render_stars( const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect ) +static void cps1_render_stars( running_device *screen, bitmap_t *bitmap, const rectangle *cliprect ) { cps_state *state = (cps_state *)screen->machine->driver_data; int offs; diff --git a/src/mame/video/cyberbal.c b/src/mame/video/cyberbal.c index 121b9146528..77ee67839a9 100644 --- a/src/mame/video/cyberbal.c +++ b/src/mame/video/cyberbal.c @@ -261,14 +261,14 @@ READ16_HANDLER( cyberbal_paletteram_1_r ) * *************************************/ -void cyberbal_scanline_update(const device_config *screen, int scanline) +void cyberbal_scanline_update(running_device *screen, int scanline) { cyberbal_state *state = (cyberbal_state *)screen->machine->driver_data; int i; - const device_config *update_screen; + running_device *update_screen; /* loop over screens */ - for (i = 0, update_screen = video_screen_first(screen->machine->config); update_screen != NULL; i++, update_screen = video_screen_next(update_screen)) + for (i = 0, update_screen = video_screen_first(screen->machine); update_screen != NULL; i++, update_screen = video_screen_next(update_screen)) { UINT16 *vram = i ? state->atarigen.alpha2 : state->atarigen.alpha; UINT16 *base = &vram[((scanline - 8) / 8) * 64 + 47]; @@ -333,7 +333,7 @@ void cyberbal_scanline_update(const device_config *screen, int scanline) * *************************************/ -static void update_one_screen(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) +static void update_one_screen(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { cyberbal_state *state = (cyberbal_state *)screen->machine->driver_data; atarimo_rect_list rectlist; @@ -343,7 +343,7 @@ static void update_one_screen(const device_config *screen, bitmap_t *bitmap, con rectangle *visarea = (rectangle *)video_screen_get_visible_area(screen); /* for 2p games, the left screen is the main screen */ - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); if (left_screen == NULL) left_screen = devtag_get_device(screen->machine, "screen"); diff --git a/src/mame/video/deco16ic.c b/src/mame/video/deco16ic.c index 9fae1232d37..5832b5066ea 100644 --- a/src/mame/video/deco16ic.c +++ b/src/mame/video/deco16ic.c @@ -901,7 +901,7 @@ void deco16_pdrawgfx( /*****************************************************************************************/ -void deco16_tilemap_1_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority) +void deco16_tilemap_1_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority) { if (use_custom_pf1) { @@ -914,7 +914,7 @@ void deco16_tilemap_1_draw(const device_config *screen, bitmap_t *bitmap, const } } -void deco16_tilemap_2_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority) +void deco16_tilemap_2_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority) { if (use_custom_pf2) { @@ -927,13 +927,13 @@ void deco16_tilemap_2_draw(const device_config *screen, bitmap_t *bitmap, const } } -void deco16_tilemap_3_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority) +void deco16_tilemap_3_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority) { if (use_custom_pf3) custom_tilemap_draw(screen->machine, bitmap,0,pf3_tilemap_16x16,0,0,pf3_rowscroll_ptr,deco16_pf34_control[1], deco16_pf34_control[2], deco16_pf34_control[5]&0xff, deco16_pf34_control[6]&0xff, 0, 0, deco16_pf3_trans_mask, flags, priority); else if (pf3_tilemap_16x16) tilemap_draw(bitmap,cliprect,pf3_tilemap_16x16,flags,priority); } -void deco16_tilemap_4_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority) +void deco16_tilemap_4_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority) { if (use_custom_pf4) custom_tilemap_draw(screen->machine, bitmap,0,pf4_tilemap_16x16,0,0,pf4_rowscroll_ptr,deco16_pf34_control[3], deco16_pf34_control[4], deco16_pf34_control[5]>>8, deco16_pf34_control[6]>>8, 0, 0, deco16_pf4_trans_mask, flags, priority); else if (pf4_tilemap_16x16) tilemap_draw(bitmap,cliprect,pf4_tilemap_16x16,flags,priority); @@ -942,7 +942,7 @@ void deco16_tilemap_4_draw(const device_config *screen, bitmap_t *bitmap, const /*****************************************************************************************/ // Combines the output of two 4BPP tilemaps into an 8BPP tilemap -void deco16_tilemap_34_combine_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority) +void deco16_tilemap_34_combine_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority) { custom_tilemap_draw(screen->machine, bitmap,0,pf3_tilemap_16x16,0,pf4_tilemap_16x16,pf3_rowscroll_ptr,deco16_pf34_control[1], deco16_pf34_control[2], deco16_pf34_control[5]&0xff, deco16_pf34_control[6]&0xff, 0xf, 4, 0xff, flags, priority); } diff --git a/src/mame/video/djmain.c b/src/mame/video/djmain.c index 2603fff431c..fa10dbd306e 100644 --- a/src/mame/video/djmain.c +++ b/src/mame/video/djmain.c @@ -14,7 +14,7 @@ UINT32 *djmain_obj_ram; static void draw_sprites(running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect) { - const device_config *k055555 = devtag_get_device(machine, "k055555"); + running_device *k055555 = devtag_get_device(machine, "k055555"); int offs, pri_code; int sortedlist[NUM_SPRITES]; @@ -135,7 +135,7 @@ void djmain_tile_callback(running_machine* machine, int layer, int *code, int *c VIDEO_START( djmain ) { - const device_config *k056832 = devtag_get_device(machine, "k056832"); + running_device *k056832 = devtag_get_device(machine, "k056832"); k056832_set_layer_offs(k056832, 0, -92, -27); // k056832_set_layer_offs(k056832, 1, -87, -27); @@ -144,8 +144,8 @@ VIDEO_START( djmain ) VIDEO_UPDATE( djmain ) { - const device_config *k056832 = devtag_get_device(screen->machine, "k056832"); - const device_config *k055555 = devtag_get_device(screen->machine, "k055555"); + running_device *k056832 = devtag_get_device(screen->machine, "k056832"); + running_device *k055555 = devtag_get_device(screen->machine, "k055555"); int enables = k055555_read_register(k055555, K55_INPUT_ENABLES); int pri[NUM_LAYERS + 1]; int order[NUM_LAYERS + 1]; diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c index b4c5985c37e..ceaa5258cdb 100644 --- a/src/mame/video/dynax.c +++ b/src/mame/video/dynax.c @@ -1216,8 +1216,8 @@ VIDEO_UPDATE( jantouki ) { int layers_ctrl = dynax_layer_enable; - const device_config *top_screen = devtag_get_device(screen->machine, "top"); - const device_config *bottom_screen = devtag_get_device(screen->machine, "bottom"); + running_device *top_screen = devtag_get_device(screen->machine, "top"); + running_device *bottom_screen = devtag_get_device(screen->machine, "bottom"); if (debug_viewer(screen->machine,bitmap,cliprect)) return 0; layers_ctrl &= debug_mask(screen->machine); diff --git a/src/mame/video/eprom.c b/src/mame/video/eprom.c index 90c4b02bc20..66bedbe29ce 100644 --- a/src/mame/video/eprom.c +++ b/src/mame/video/eprom.c @@ -210,7 +210,7 @@ VIDEO_START( guts ) * *************************************/ -void eprom_scanline_update(const device_config *screen, int scanline) +void eprom_scanline_update(running_device *screen, int scanline) { eprom_state *state = (eprom_state *)screen->machine->driver_data; diff --git a/src/mame/video/exidy440.c b/src/mame/video/exidy440.c index 09a0392d1d0..0a9cffd125b 100644 --- a/src/mame/video/exidy440.c +++ b/src/mame/video/exidy440.c @@ -306,7 +306,7 @@ static TIMER_CALLBACK( collide_firq_callback ) * *************************************/ -static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, +static void draw_sprites(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int scroll_offset, int check_collision) { int i; @@ -406,7 +406,7 @@ static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const re * *************************************/ -static void update_screen(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, +static void update_screen(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int scroll_offset, int check_collision) { int y, sy; diff --git a/src/mame/video/exterm.c b/src/mame/video/exterm.c index 7f5ce0dbe04..f9d3154549f 100644 --- a/src/mame/video/exterm.c +++ b/src/mame/video/exterm.c @@ -67,7 +67,7 @@ void exterm_from_shiftreg_slave(const address_space *space, UINT32 address, UINT * *************************************/ -void exterm_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void exterm_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *bgsrc = &exterm_master_videoram[(params->rowaddr << 8) & 0xff00]; UINT16 *fgsrc = NULL; diff --git a/src/mame/video/fromance.c b/src/mame/video/fromance.c index 2e812e78a58..fdbbb86a1aa 100644 --- a/src/mame/video/fromance.c +++ b/src/mame/video/fromance.c @@ -303,7 +303,7 @@ WRITE8_HANDLER( fromance_crtc_register_w ) * *************************************/ -static void draw_sprites( const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int draw_priority ) +static void draw_sprites( running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int draw_priority ) { fromance_state *state = (fromance_state *)screen->machine->driver_data; static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 }; diff --git a/src/mame/video/fuukifg2.c b/src/mame/video/fuukifg2.c index 920602fe4d0..5b15a127370 100644 --- a/src/mame/video/fuukifg2.c +++ b/src/mame/video/fuukifg2.c @@ -132,7 +132,7 @@ VIDEO_START( fuuki16 ) ***************************************************************************/ -static void draw_sprites( const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect ) +static void draw_sprites( running_device *screen, bitmap_t *bitmap, const rectangle *cliprect ) { fuuki16_state *state = (fuuki16_state *)screen->machine->driver_data; int offs; diff --git a/src/mame/video/fuukifg3.c b/src/mame/video/fuukifg3.c index fd214564e8a..a813770974b 100644 --- a/src/mame/video/fuukifg3.c +++ b/src/mame/video/fuukifg3.c @@ -149,7 +149,7 @@ VIDEO_START( fuuki32 ) ***************************************************************************/ -static void draw_sprites( const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect ) +static void draw_sprites( running_device *screen, bitmap_t *bitmap, const rectangle *cliprect ) { fuuki32_state *state = (fuuki32_state *)screen->machine->driver_data; int offs; diff --git a/src/mame/video/gaelco2.c b/src/mame/video/gaelco2.c index 41f1e47d3ef..7d250a462cc 100644 --- a/src/mame/video/gaelco2.c +++ b/src/mame/video/gaelco2.c @@ -339,7 +339,7 @@ VIDEO_START( gaelco2_dual ) ***************************************************************************/ -static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int mask, int xoffs) +static void draw_sprites(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int mask, int xoffs) { UINT16 *buffered_spriteram16 = screen->machine->generic.buffered_spriteram.u16; int j, x, y, ex, ey, px, py; @@ -468,8 +468,8 @@ VIDEO_UPDATE( gaelco2_dual ) { int i; - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); - const device_config *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); /* read scroll values */ int scroll0x = gaelco2_videoram[0x2802/2] + 0x14; diff --git a/src/mame/video/gaelco3d.c b/src/mame/video/gaelco3d.c index 0a998442e55..4bd91df2d5a 100644 --- a/src/mame/video/gaelco3d.c +++ b/src/mame/video/gaelco3d.c @@ -129,7 +129,7 @@ VIDEO_START( gaelco3d ) (repeat these two for each additional point in the fan) */ -static void render_poly(const device_config *screen, UINT32 *polydata) +static void render_poly(running_device *screen, UINT32 *polydata) { float midx = video_screen_get_width(screen) / 2; float midy = video_screen_get_height(screen) / 2; @@ -371,7 +371,7 @@ static void render_alphablend(void *destbase, INT32 scanline, const poly_extent * *************************************/ -void gaelco3d_render(const device_config *screen) +void gaelco3d_render(running_device *screen) { /* wait for any queued stuff to complete */ poly_wait(poly, "Time to render"); diff --git a/src/mame/video/galastrm.c b/src/mame/video/galastrm.c index 3bd438d2844..a1450fa7711 100644 --- a/src/mame/video/galastrm.c +++ b/src/mame/video/galastrm.c @@ -453,8 +453,8 @@ static void tc0610_rotate_draw(running_machine *machine, bitmap_t *bitmap, bitma VIDEO_UPDATE( galastrm ) { - const device_config *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); - const device_config *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); + running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; diff --git a/src/mame/video/galpanic.c b/src/mame/video/galpanic.c index 9769cd6d448..637e46bed76 100644 --- a/src/mame/video/galpanic.c +++ b/src/mame/video/galpanic.c @@ -101,7 +101,7 @@ static void draw_fgbitmap(bitmap_t *bitmap, const rectangle *cliprect) VIDEO_UPDATE( galpanic ) { - const device_config *pandora = devtag_get_device(screen->machine, "pandora"); + running_device *pandora = devtag_get_device(screen->machine, "pandora"); /* copy the temporary bitmap to the screen */ copybitmap(bitmap,screen->machine->generic.tmpbitmap,0,0,0,0,cliprect); diff --git a/src/mame/video/gameplan.c b/src/mame/video/gameplan.c index 8bf7ec0f233..d7155a1bbbf 100644 --- a/src/mame/video/gameplan.c +++ b/src/mame/video/gameplan.c @@ -218,7 +218,7 @@ static TIMER_CALLBACK( via_irq_delayed ) } -static void via_irq(const device_config *device, int state) +static void via_irq(running_device *device, int state) { /* Kaos sits in a tight loop polling the VIA irq flags register, but that register is cleared by the irq handler. Therefore, I wait a bit before triggering the irq to diff --git a/src/mame/video/genesis.c b/src/mame/video/genesis.c index 558c952879d..5ceea98d522 100644 --- a/src/mame/video/genesis.c +++ b/src/mame/video/genesis.c @@ -13,7 +13,7 @@ #include "includes/genesis.h" -static const device_config *genesis_screen; +static running_device *genesis_screen; /****************************************************************************** @@ -120,7 +120,7 @@ static UINT8 window_width; /* window width */ ******************************************************************************/ -static void start_genesis_vdp(const device_config *screen) +static void start_genesis_vdp(running_device *screen) { static const UINT8 vdp_init[24] = { @@ -362,7 +362,7 @@ READ16_HANDLER( genesis_vdp_r ) WRITE16_HANDLER( genesis_vdp_w ) { - const device_config *device; + running_device *device; switch (offset) { case 0x00: /* Write data */ diff --git a/src/mame/video/gottlieb.c b/src/mame/video/gottlieb.c index 1b7eb432ddf..433d736aee1 100644 --- a/src/mame/video/gottlieb.c +++ b/src/mame/video/gottlieb.c @@ -84,7 +84,7 @@ WRITE8_HANDLER( gottlieb_video_control_w ) WRITE8_HANDLER( gottlieb_laserdisc_video_control_w ) { - const device_config *laserdisc = space->machine->config->devicelist.first(LASERDISC); + running_device *laserdisc = space->machine->devicelist.first(LASERDISC); /* bit 0 works like the other games */ gottlieb_video_control_w(space, offset, data & 0x01); diff --git a/src/mame/video/groundfx.c b/src/mame/video/groundfx.c index ab795ad1aab..0360bf6eb1d 100644 --- a/src/mame/video/groundfx.c +++ b/src/mame/video/groundfx.c @@ -214,8 +214,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan VIDEO_UPDATE( groundfx ) { - const device_config *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); - const device_config *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); + running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; diff --git a/src/mame/video/gunbustr.c b/src/mame/video/gunbustr.c index 01fd51e67ec..befb372bc81 100644 --- a/src/mame/video/gunbustr.c +++ b/src/mame/video/gunbustr.c @@ -212,7 +212,7 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks); VIDEO_UPDATE( gunbustr ) { - const device_config *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); UINT8 layer[5]; UINT16 priority; static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0}; diff --git a/src/mame/video/harddriv.c b/src/mame/video/harddriv.c index c264bbefeb6..164f8a24a15 100644 --- a/src/mame/video/harddriv.c +++ b/src/mame/video/harddriv.c @@ -423,7 +423,7 @@ static void display_speedups(void) } -void harddriv_scanline_driver(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void harddriv_scanline_driver(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { harddriv_state *state = (harddriv_state *)screen->machine->driver_data; UINT8 *vram_base = &state->gsp_vram[(params->rowaddr << 12) & state->vram_mask]; @@ -439,7 +439,7 @@ void harddriv_scanline_driver(const device_config *screen, bitmap_t *bitmap, int } -void harddriv_scanline_multisync(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void harddriv_scanline_multisync(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { harddriv_state *state = (harddriv_state *)screen->machine->driver_data; UINT8 *vram_base = &state->gsp_vram[(params->rowaddr << 11) & state->vram_mask]; diff --git a/src/mame/video/hcastle.c b/src/mame/video/hcastle.c index c90174c1487..0a84a38699d 100644 --- a/src/mame/video/hcastle.c +++ b/src/mame/video/hcastle.c @@ -213,7 +213,7 @@ WRITE8_HANDLER( hcastle_pf2_control_w ) static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *sbank, int bank ) { hcastle_state *state = (hcastle_state *)machine->driver_data; - const device_config *k007121 = bank ? state->k007121_2 : state->k007121_1; + running_device *k007121 = bank ? state->k007121_2 : state->k007121_1; int base_color = (k007121_ctrlram_r(k007121, 6) & 0x30) * 2; int bank_base = (bank == 0) ? 0x4000 * (state->gfx_bank & 1) : 0; diff --git a/src/mame/video/jaguar.c b/src/mame/video/jaguar.c index 69a6cf58a95..d6329086be6 100644 --- a/src/mame/video/jaguar.c +++ b/src/mame/video/jaguar.c @@ -334,14 +334,14 @@ static void update_cpu_irq(running_machine *machine) } -void jaguar_gpu_cpu_int(const device_config *device) +void jaguar_gpu_cpu_int(running_device *device) { cpu_irq_state |= 2; update_cpu_irq(device->machine); } -void jaguar_dsp_cpu_int(const device_config *device) +void jaguar_dsp_cpu_int(running_device *device) { cpu_irq_state |= 16; update_cpu_irq(device->machine); diff --git a/src/mame/video/jpmimpct.c b/src/mame/video/jpmimpct.c index d1fb9e82537..8afa016f6bc 100644 --- a/src/mame/video/jpmimpct.c +++ b/src/mame/video/jpmimpct.c @@ -115,7 +115,7 @@ void jpmimpct_from_shiftreg(const address_space *space, UINT32 address, UINT16 * * *************************************/ -void jpmimpct_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void jpmimpct_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *vram = &jpmimpct_vram[(params->rowaddr << 8) & 0x3ff00]; UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0); diff --git a/src/mame/video/kan_pand.c b/src/mame/video/kan_pand.c index eab40eb6ba8..b515601bfeb 100644 --- a/src/mame/video/kan_pand.c +++ b/src/mame/video/kan_pand.c @@ -53,7 +53,7 @@ typedef struct _kaneko_pandora_state kaneko_pandora_state; struct _kaneko_pandora_state { - const device_config *screen; + running_device *screen; UINT8 * spriteram; bitmap_t *sprites_bitmap; /* bitmap to render sprites to, Pandora seems to be frame'buffered' */ int clear_bitmap; @@ -65,7 +65,7 @@ struct _kaneko_pandora_state INLINE FUNCTIONS *****************************************************************************/ -INLINE kaneko_pandora_state *get_safe_token( const device_config *device ) +INLINE kaneko_pandora_state *get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -74,24 +74,24 @@ INLINE kaneko_pandora_state *get_safe_token( const device_config *device ) return (kaneko_pandora_state *)device->token; } -INLINE const kaneko_pandora_interface *get_interface( const device_config *device ) +INLINE const kaneko_pandora_interface *get_interface( running_device *device ) { assert(device != NULL); assert((device->type == KANEKO_PANDORA)); - return (const kaneko_pandora_interface *) device->static_config; + return (const kaneko_pandora_interface *) device->baseconfig().static_config; } /***************************************************************************** IMPLEMENTATION *****************************************************************************/ -void pandora_set_clear_bitmap( const device_config *device, int clear ) +void pandora_set_clear_bitmap( running_device *device, int clear ) { kaneko_pandora_state *pandora = get_safe_token(device); pandora->clear_bitmap = clear; } -void pandora_update( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ) +void pandora_update( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ) { kaneko_pandora_state *pandora = get_safe_token(device); @@ -105,7 +105,7 @@ void pandora_update( const device_config *device, bitmap_t *bitmap, const rectan } -static void pandora_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ) +static void pandora_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ) { kaneko_pandora_state *pandora = get_safe_token(device); int sx = 0, sy = 0, x = 0, y = 0, offs; @@ -189,7 +189,7 @@ static void pandora_draw( const device_config *device, bitmap_t *bitmap, const r } } -void pandora_eof( const device_config *device ) +void pandora_eof( running_device *device ) { kaneko_pandora_state *pandora = get_safe_token(device); assert(pandora->spriteram != NULL); diff --git a/src/mame/video/kan_pand.h b/src/mame/video/kan_pand.h index 26c88f56d42..3b5f5f139fd 100644 --- a/src/mame/video/kan_pand.h +++ b/src/mame/video/kan_pand.h @@ -46,9 +46,9 @@ DEVICE_GET_INFO( kaneko_pandora ); DEVICE I/O FUNCTIONS ***************************************************************************/ -void pandora_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); -void pandora_eof(const device_config *device); -void pandora_set_clear_bitmap(const device_config *device, int clear); +void pandora_update(running_device *device, bitmap_t *bitmap, const rectangle *cliprect); +void pandora_eof(running_device *device); +void pandora_set_clear_bitmap(running_device *device, int clear); WRITE8_DEVICE_HANDLER ( pandora_spriteram_w ); READ8_DEVICE_HANDLER( pandora_spriteram_r ); diff --git a/src/mame/video/kaneko16.c b/src/mame/video/kaneko16.c index 50b07aff929..d095275c54a 100644 --- a/src/mame/video/kaneko16.c +++ b/src/mame/video/kaneko16.c @@ -1121,7 +1121,7 @@ VIDEO_UPDATE( galsnew ) VIDEO_UPDATE( sandscrp ) { - const device_config *pandora = devtag_get_device(screen->machine, "pandora"); + running_device *pandora = devtag_get_device(screen->machine, "pandora"); kaneko16_fill_bitmap(screen->machine,bitmap,cliprect); // if the display is disabled, do nothing? diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c index 52d1eceacb7..12fb9559882 100644 --- a/src/mame/video/konamigx.c +++ b/src/mame/video/konamigx.c @@ -2376,8 +2376,8 @@ VIDEO_UPDATE(konamigx) if (konamigx_has_dual_screen) { - const device_config *left_screen = devtag_get_device(screen->machine, "screen"); - const device_config *right_screen = devtag_get_device(screen->machine, "screen2"); + running_device *left_screen = devtag_get_device(screen->machine, "screen"); + running_device *right_screen = devtag_get_device(screen->machine, "screen2"); /* the video gets demuxed by a board which plugs into the jamma connector */ if (screen==left_screen) @@ -2587,8 +2587,8 @@ VIDEO_UPDATE(konamigx) if (konamigx_has_dual_screen) { - const device_config *left_screen = devtag_get_device(screen->machine, "screen"); - const device_config *right_screen = devtag_get_device(screen->machine, "screen2"); + running_device *left_screen = devtag_get_device(screen->machine, "screen"); + running_device *right_screen = devtag_get_device(screen->machine, "screen2"); if (screen==left_screen) { diff --git a/src/mame/video/konicdev.c b/src/mame/video/konicdev.c index 2207cb11fd0..1ad8244d6fe 100644 --- a/src/mame/video/konicdev.c +++ b/src/mame/video/konicdev.c @@ -1342,7 +1342,7 @@ struct _k007121_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k007121_state *k007121_get_safe_token( const device_config *device ) +INLINE k007121_state *k007121_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -1432,7 +1432,7 @@ WRITE8_DEVICE_HANDLER( k007121_ctrl_w ) * */ -void k007121_sprites_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx, colortable_t *ctable, +void k007121_sprites_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx, colortable_t *ctable, const UINT8 *source, int base_color, int global_x_offset, int bank_base, UINT32 pri_mask ) { k007121_state *k007121 = k007121_get_safe_token(device); @@ -1616,7 +1616,7 @@ struct _k007342_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k007342_state *k007342_get_safe_token( const device_config *device ) +INLINE k007342_state *k007342_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -1625,11 +1625,11 @@ INLINE k007342_state *k007342_get_safe_token( const device_config *device ) return (k007342_state *)device->token; } -INLINE const k007342_interface *k007342_get_interface( const device_config *device ) +INLINE const k007342_interface *k007342_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K007342)); - return (const k007342_interface *) device->static_config; + return (const k007342_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -1701,7 +1701,7 @@ WRITE8_DEVICE_HANDLER( k007342_vreg_w ) k007342->regs[offset] = data; } -void k007342_tilemap_update( const device_config *device ) +void k007342_tilemap_update( running_device *device ) { k007342_state *k007342 = k007342_get_safe_token(device); int offs; @@ -1759,19 +1759,19 @@ void k007342_tilemap_update( const device_config *device ) #endif } -void k007342_tilemap_set_enable( const device_config *device, int tmap, int enable ) +void k007342_tilemap_set_enable( running_device *device, int tmap, int enable ) { k007342_state *k007342 = k007342_get_safe_token(device); tilemap_set_enable(k007342->tilemap[tmap], enable); } -void k007342_tilemap_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int num, int flags, UINT32 priority ) +void k007342_tilemap_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int num, int flags, UINT32 priority ) { k007342_state *k007342 = k007342_get_safe_token(device); tilemap_draw(bitmap, cliprect, k007342->tilemap[num], flags, priority); } -int k007342_is_int_enabled( const device_config *device ) +int k007342_is_int_enabled( running_device *device ) { k007342_state *k007342 = k007342_get_safe_token(device); return k007342->int_enabled; @@ -1800,7 +1800,7 @@ static TILEMAP_MAPPER( k007342_scan ) return (col & 0x1f) + ((row & 0x1f) << 5) + ((col & 0x20) << 5); } -INLINE void k007342_get_tile_info( const device_config *device, tile_data *tileinfo, int tile_index, int layer, UINT8 *cram, UINT8 *vram ) +INLINE void k007342_get_tile_info( running_device *device, tile_data *tileinfo, int tile_index, int layer, UINT8 *cram, UINT8 *vram ) { k007342_state *k007342 = k007342_get_safe_token(device); int color, code, flags; @@ -1907,7 +1907,7 @@ struct _k007420_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k007420_state *k007420_get_safe_token( const device_config *device ) +INLINE k007420_state *k007420_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -1916,11 +1916,11 @@ INLINE k007420_state *k007420_get_safe_token( const device_config *device ) return (k007420_state *)device->token; } -INLINE const k007420_interface *k007420_get_interface( const device_config *device ) +INLINE const k007420_interface *k007420_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K007420)); - return (const k007420_interface *) device->static_config; + return (const k007420_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -1959,7 +1959,7 @@ WRITE8_DEVICE_HANDLER( k007420_w ) * 7 | xxxxxxxx | unused */ -void k007420_sprites_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx ) +void k007420_sprites_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx ) { k007420_state *k007420 = k007420_get_safe_token(device); int offs; @@ -2185,7 +2185,7 @@ struct _k052109_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k052109_state *k052109_get_safe_token( const device_config *device ) +INLINE k052109_state *k052109_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -2194,11 +2194,11 @@ INLINE k052109_state *k052109_get_safe_token( const device_config *device ) return (k052109_state *)device->token; } -INLINE const k052109_interface *k052109_get_interface( const device_config *device ) +INLINE const k052109_interface *k052109_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K052109)); - return (const k052109_interface *) device->static_config; + return (const k052109_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -2406,27 +2406,27 @@ WRITE16_DEVICE_HANDLER( k052109_lsb_w ) k052109_w(device, offset, data & 0xff); } -void k052109_set_rmrd_line( const device_config *device, int state ) +void k052109_set_rmrd_line( running_device *device, int state ) { k052109_state *k052109 = k052109_get_safe_token(device); k052109->rmrd_line = state; } -int k052109_get_rmrd_line(const device_config *device ) +int k052109_get_rmrd_line(running_device *device ) { k052109_state *k052109 = k052109_get_safe_token(device); return k052109->rmrd_line; } -void k052109_tilemap_mark_dirty( const device_config *device, int tmap_num ) +void k052109_tilemap_mark_dirty( running_device *device, int tmap_num ) { k052109_state *k052109 = k052109_get_safe_token(device); tilemap_mark_all_tiles_dirty(k052109->tilemap[tmap_num]); } -void k052109_tilemap_update( const device_config *device ) +void k052109_tilemap_update( running_device *device ) { k052109_state *k052109 = k052109_get_safe_token(device); int xscroll, yscroll, offs; @@ -2579,20 +2579,20 @@ if (input_code_pressed(machine, KEYCODE_F)) #endif } -void k052109_tilemap_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, UINT32 flags, UINT8 priority ) +void k052109_tilemap_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, UINT32 flags, UINT8 priority ) { k052109_state *k052109 = k052109_get_safe_token(device); tilemap_draw(bitmap, cliprect, k052109->tilemap[tmap_num], flags, priority); } -int k052109_is_irq_enabled( const device_config *device ) +int k052109_is_irq_enabled( running_device *device ) { k052109_state *k052109 = k052109_get_safe_token(device); return k052109->irq_enabled; } -void k052109_set_layer_offsets( const device_config *device, int layer, int dx, int dy ) +void k052109_set_layer_offsets( running_device *device, int layer, int dx, int dy ) { k052109_state *k052109 = k052109_get_safe_token(device); @@ -2618,7 +2618,7 @@ void k052109_set_layer_offsets( const device_config *device, int layer, int dx, color RAM ------xx depends on external connections (usually banking, flip) */ -INLINE void k052109_get_tile_info( const device_config *device, tile_data *tileinfo, int tile_index, int layer, UINT8 *cram, UINT8 *vram1, UINT8 *vram2 ) +INLINE void k052109_get_tile_info( running_device *device, tile_data *tileinfo, int tile_index, int layer, UINT8 *cram, UINT8 *vram1, UINT8 *vram2 ) { k052109_state *k052109 = k052109_get_safe_token(device); int flipy = 0; @@ -2821,7 +2821,7 @@ struct _k051960_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k051960_state *k051960_get_safe_token( const device_config *device ) +INLINE k051960_state *k051960_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -2830,18 +2830,18 @@ INLINE k051960_state *k051960_get_safe_token( const device_config *device ) return (k051960_state *)device->token; } -INLINE const k051960_interface *k051960_get_interface( const device_config *device ) +INLINE const k051960_interface *k051960_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K051960)); - return (const k051960_interface *) device->static_config; + return (const k051960_interface *) device->baseconfig().static_config; } /***************************************************************************** DEVICE HANDLERS *****************************************************************************/ -static int k051960_fetchromdata( const device_config *device, int byte ) +static int k051960_fetchromdata( running_device *device, int byte ) { k051960_state *k051960 = k051960_get_safe_token(device); int code, color, pri, shadow, off1, addr; @@ -2958,19 +2958,19 @@ WRITE8_DEVICE_HANDLER( k051937_w ) } } -int k051960_is_irq_enabled( const device_config *device ) +int k051960_is_irq_enabled( running_device *device ) { k051960_state *k051960 = k051960_get_safe_token(device); return k051960->irq_enabled; } -int k051960_is_nmi_enabled( const device_config *device ) +int k051960_is_nmi_enabled( running_device *device ) { k051960_state *k051960 = k051960_get_safe_token(device); return k051960->nmi_enabled; } -void k051960_set_sprite_offsets( const device_config *device, int dx, int dy ) +void k051960_set_sprite_offsets( running_device *device, int dx, int dy ) { k051960_state *k051960 = k051960_get_safe_token(device); k051960->dx = dx; @@ -3023,7 +3023,7 @@ WRITE16_DEVICE_HANDLER( k051937_word_w ) * Note that Aliens also uses the shadow bit to select the second sprite bank. */ -void k051960_sprites_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int min_priority, int max_priority ) +void k051960_sprites_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int min_priority, int max_priority ) { #define NUM_SPRITES 128 k051960_state *k051960 = k051960_get_safe_token(device); @@ -3364,7 +3364,7 @@ struct _k05324x_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k05324x_state *k05324x_get_safe_token( const device_config *device ) +INLINE k05324x_state *k05324x_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -3373,18 +3373,18 @@ INLINE k05324x_state *k05324x_get_safe_token( const device_config *device ) return (k05324x_state *)device->token; } -INLINE const k05324x_interface *k05324x_get_interface( const device_config *device ) +INLINE const k05324x_interface *k05324x_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K053244 || device->type == K053245)); - return (const k05324x_interface *) device->static_config; + return (const k05324x_interface *) device->baseconfig().static_config; } /***************************************************************************** DEVICE HANDLERS *****************************************************************************/ -void k053245_set_sprite_offs( const device_config *device, int offsx, int offsy ) +void k053245_set_sprite_offs( running_device *device, int offsx, int offsy ) { k05324x_state *k053245 = k05324x_get_safe_token(device); k053245->dx = offsx; @@ -3424,7 +3424,7 @@ WRITE8_DEVICE_HANDLER( k053245_w ) k053245->ram[offset >> 1] = (k053245->ram[offset >> 1] & 0x00ff) | (data << 8); } -void k053245_clear_buffer( const device_config *device ) +void k053245_clear_buffer( running_device *device ) { k05324x_state *k053245 = k05324x_get_safe_token(device); int i, e; @@ -3433,7 +3433,7 @@ void k053245_clear_buffer( const device_config *device ) k053245->buffer[i] = 0; } -INLINE void k053245_update_buffer( const device_config *device ) +INLINE void k053245_update_buffer( running_device *device ) { k05324x_state *k053245 = k05324x_get_safe_token(device); memcpy(k053245->buffer, k053245->ram, k053245->ramsize); @@ -3516,7 +3516,7 @@ WRITE16_DEVICE_HANDLER( k053244_word_w ) k053244_w(device, offset * 2 + 1, data & 0xff); } -void k053244_bankselect( const device_config *device, int bank ) +void k053244_bankselect( running_device *device, int bank ) { k05324x_state *k053244 = k05324x_get_safe_token(device); k053244->rombank = bank; @@ -3550,7 +3550,7 @@ void k053244_bankselect( const device_config *device, int bank ) * The rest of the sprite remains normal. */ -void k053245_sprites_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ) +void k053245_sprites_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ) { #define NUM_SPRITES 128 k05324x_state *k053245 = k05324x_get_safe_token(device); @@ -3804,7 +3804,7 @@ if (input_code_pressed(machine, KEYCODE_D)) /* Lethal Enforcers has 2 of these chips hooked up in parallel to give 6bpp gfx.. lets cheat a bit and make emulating it a little less messy by using a custom function instead */ -void k053245_sprites_draw_lethal( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ) +void k053245_sprites_draw_lethal( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ) { #define NUM_SPRITES 128 k05324x_state *k053245 = k05324x_get_safe_token(device); @@ -4146,7 +4146,7 @@ struct _k053247_state k05324x_callback callback; const char *memory_region; - const device_config *screen; + running_device *screen; }; @@ -4155,7 +4155,7 @@ struct _k053247_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k053247_state *k053247_get_safe_token( const device_config *device ) +INLINE k053247_state *k053247_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -4164,11 +4164,11 @@ INLINE k053247_state *k053247_get_safe_token( const device_config *device ) return (k053247_state *)device->token; } -INLINE const k053247_interface *k053247_get_interface( const device_config *device ) +INLINE const k053247_interface *k053247_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K053246 || device->type == K053247 || device->type == K055673)); - return (const k053247_interface *) device->static_config; + return (const k053247_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -4176,13 +4176,13 @@ INLINE const k053247_interface *k053247_get_interface( const device_config *devi *****************************************************************************/ #if 0 -void k053247_get_gfx( const device_config *device, gfx_element **gfx ) +void k053247_get_gfx( running_device *device, gfx_element **gfx ) { k053247_state *k053247 = k053247_get_safe_token(device); *gfx = k053247->gfx; } -void k053247_get_cb( const device_config *device, void (**callback)(int *, int *, int *) ) +void k053247_get_cb( running_device *device, void (**callback)(int *, int *, int *) ) { k053247_state *k053247 = k053247_get_safe_token(device); *callback = k053247->callback; @@ -4190,44 +4190,44 @@ void k053247_get_cb( const device_config *device, void (**callback)(int *, int * #endif -void k053247_get_ram( const device_config *device, UINT16 **ram ) +void k053247_get_ram( running_device *device, UINT16 **ram ) { k053247_state *k053247 = k053247_get_safe_token(device); *ram = k053247->ram; } -int k053247_get_dx( const device_config *device ) +int k053247_get_dx( running_device *device ) { k053247_state *k053247 = k053247_get_safe_token(device); return k053247->dx; } -int k053247_get_dy( const device_config *device ) +int k053247_get_dy( running_device *device ) { k053247_state *k053247 = k053247_get_safe_token(device); return k053247->dy; } -int k053246_read_register( const device_config *device, int regnum ) +int k053246_read_register( running_device *device, int regnum ) { k053247_state *k053247 = k053247_get_safe_token(device); return(k053247->kx46_regs[regnum]); } -int k053247_read_register( const device_config *device, int regnum ) +int k053247_read_register( running_device *device, int regnum ) { k053247_state *k053247 = k053247_get_safe_token(device); return(k053247->kx47_regs[regnum]); } -void k053247_set_sprite_offs( const device_config *device, int offsx, int offsy ) +void k053247_set_sprite_offs( running_device *device, int offsx, int offsy ) { k053247_state *k053247 = k053247_get_safe_token(device); k053247->dx = offsx; k053247->dy = offsy; } -void k053247_wraparound_enable( const device_config *device, int status ) +void k053247_wraparound_enable( running_device *device, int status ) { k053247_state *k053247 = k053247_get_safe_token(device); k053247->wraparound = status; @@ -4430,13 +4430,13 @@ WRITE32_DEVICE_HANDLER( k053246_long_w ) k053246_word_w(device, offset + 1, data, mem_mask); } -void k053246_set_objcha_line( const device_config *device, int state ) +void k053246_set_objcha_line( running_device *device, int state ) { k053247_state *k053246 = k053247_get_safe_token(device); k053246->objcha_line = state; } -int k053246_is_irq_enabled( const device_config *device ) +int k053246_is_irq_enabled( running_device *device ) { k053247_state *k053247 = k053247_get_safe_token(device); // This bit enables obj DMA rather than obj IRQ even though the two functions usually coincide. @@ -4472,7 +4472,7 @@ int k053246_is_irq_enabled( const device_config *device ) * The rest of the sprite remains normal. */ -void k053247_sprites_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ) +void k053247_sprites_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ) { #define NUM_SPRITES 256 k053247_state *k053246 = k053247_get_safe_token(device); @@ -5094,13 +5094,13 @@ static DEVICE_RESET( k053247 ) */ -void k05324x_set_z_rejection( const device_config *device, int zcode ) +void k05324x_set_z_rejection( running_device *device, int zcode ) { k05324x_state *k05324x = k05324x_get_safe_token(device); k05324x->z_rejection = zcode; } -void k053247_set_z_rejection( const device_config *device, int zcode ) +void k053247_set_z_rejection( running_device *device, int zcode ) { k053247_state *k053247 = k053247_get_safe_token(device); k053247->z_rejection = zcode; @@ -5132,7 +5132,7 @@ struct _k051316_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k051316_state *k051316_get_safe_token( const device_config *device ) +INLINE k051316_state *k051316_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -5141,11 +5141,11 @@ INLINE k051316_state *k051316_get_safe_token( const device_config *device ) return (k051316_state *)device->token; } -INLINE const k051316_interface *k051316_get_interface( const device_config *device ) +INLINE const k051316_interface *k051316_get_interface( running_device *device ) { assert(device != NULL); assert(device->type == K051316); - return (const k051316_interface *) device->static_config; + return (const k051316_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -5197,7 +5197,7 @@ WRITE8_DEVICE_HANDLER( k051316_ctrl_w ) } // a few games (ajax, rollerg, ultraman, etc.) can enable and disable wraparound after start -void k051316_wraparound_enable( const device_config *device, int status ) +void k051316_wraparound_enable( running_device *device, int status ) { k051316_state *k051316= k051316_get_safe_token(device); k051316->wraparound = status; @@ -5209,7 +5209,7 @@ void k051316_wraparound_enable( const device_config *device, int status ) ***************************************************************************/ -INLINE void k051316_get_tile_info( const device_config *device, tile_data *tileinfo, int tile_index ) +INLINE void k051316_get_tile_info( running_device *device, tile_data *tileinfo, int tile_index ) { k051316_state *k051316 = k051316_get_safe_token(device); int code = k051316->ram[tile_index]; @@ -5229,7 +5229,7 @@ INLINE void k051316_get_tile_info( const device_config *device, tile_data *tilei static TILE_GET_INFO_DEVICE( k051316_get_tile_info0 ) { k051316_get_tile_info(device, tileinfo, tile_index); } -void k051316_zoom_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority ) +void k051316_zoom_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority ) { k051316_state *k051316= k051316_get_safe_token(device); UINT32 startx, starty; @@ -5421,7 +5421,7 @@ struct _k053936_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k053936_state *k053936_get_safe_token( const device_config *device ) +INLINE k053936_state *k053936_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -5430,11 +5430,11 @@ INLINE k053936_state *k053936_get_safe_token( const device_config *device ) return (k053936_state *)device->token; } -INLINE const k053936_interface *k053936_get_interface( const device_config *device ) +INLINE const k053936_interface *k053936_get_interface( running_device *device ) { assert(device != NULL); assert(device->type == K053936); - return (const k053936_interface *) device->static_config; + return (const k053936_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -5468,7 +5468,7 @@ READ16_DEVICE_HANDLER( k053936_linectrl_r ) // there is another implementation of this in video/konamigx.c (!) // why? shall they be merged? -void k053936_zoom_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tmap, int flags, UINT32 priority, int glfgreat_hack ) +void k053936_zoom_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tmap, int flags, UINT32 priority, int glfgreat_hack ) { k053936_state *k053936= k053936_get_safe_token(device); if (!tmap) @@ -5647,7 +5647,7 @@ struct _k053251_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k053251_state *k053251_get_safe_token( const device_config *device ) +INLINE k053251_state *k053251_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -5717,26 +5717,26 @@ WRITE16_DEVICE_HANDLER( k053251_msb_w ) k053251_w(device, offset, (data >> 8) & 0xff); } -int k053251_get_priority( const device_config *device, int ci ) +int k053251_get_priority( running_device *device, int ci ) { k053251_state *k053251 = k053251_get_safe_token(device); return k053251->ram[ci]; } -int k053251_get_palette_index( const device_config *device, int ci ) +int k053251_get_palette_index( running_device *device, int ci ) { k053251_state *k053251 = k053251_get_safe_token(device); return k053251->palette_index[ci]; } -int k053251_get_tmap_dirty( const device_config *device, int tmap_num ) +int k053251_get_tmap_dirty( running_device *device, int tmap_num ) { k053251_state *k053251 = k053251_get_safe_token(device); assert(tmap_num < 5); return k053251->dirty_tmap[tmap_num]; } -void k053251_set_tmap_dirty( const device_config *device, int tmap_num, int data ) +void k053251_set_tmap_dirty( running_device *device, int tmap_num, int data ) { k053251_state *k053251 = k053251_get_safe_token(device); assert(tmap_num < 5); @@ -5801,7 +5801,7 @@ struct _k054000_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k054000_state *k054000_get_safe_token( const device_config *device ) +INLINE k054000_state *k054000_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -5913,7 +5913,7 @@ struct _k051733_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k051733_state *k051733_get_safe_token( const device_config *device ) +INLINE k051733_state *k051733_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -6111,14 +6111,14 @@ struct _k056832_state k056832_callback callback; - const device_config *k055555; /* used to choose colorbase */ + running_device *k055555; /* used to choose colorbase */ }; /***************************************************************************** INLINE FUNCTIONS *****************************************************************************/ -INLINE k056832_state *k056832_get_safe_token( const device_config *device ) +INLINE k056832_state *k056832_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -6127,11 +6127,11 @@ INLINE k056832_state *k056832_get_safe_token( const device_config *device ) return (k056832_state *)device->token; } -INLINE const k056832_interface *k056832_get_interface( const device_config *device ) +INLINE const k056832_interface *k056832_get_interface( running_device *device ) { assert(device != NULL); assert(device->type == K056832); - return (const k056832_interface *) device->static_config; + return (const k056832_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -6149,7 +6149,7 @@ static void k056832_mark_page_dirty( k056832_state *k056832, int page ) k056832_mark_all_lines_dirty(page); } -void k056832_mark_plane_dirty( const device_config *device, int layer ) +void k056832_mark_plane_dirty( running_device *device, int layer ) { k056832_state *k056832 = k056832_get_safe_token(device); int tilemode, i; @@ -6181,7 +6181,7 @@ static void k056832_mark_all_tilemaps_dirty( k056832_state *k056832 ) } /* moo.c needs to call this in its VIDEO_UPDATE */ -void k056832_mark_all_tmaps_dirty( const device_config *device ) +void k056832_mark_all_tmaps_dirty( running_device *device ) { k056832_state *k056832 = k056832_get_safe_token(device); k056832_mark_all_tilemaps_dirty(k056832); @@ -6240,7 +6240,7 @@ static void k056832_update_page_layout( k056832_state *k056832 ) k056832_mark_all_tilemaps_dirty(k056832); } -int k056832_get_lookup( const device_config *device, int bits ) +int k056832_get_lookup( running_device *device, int bits ) { k056832_state *k056832 = k056832_get_safe_token(device); int res; @@ -6253,7 +6253,7 @@ int k056832_get_lookup( const device_config *device, int bits ) return res; } -INLINE void k056832_get_tile_info( const device_config *device, tile_data *tileinfo, int tile_index, int pageIndex ) +INLINE void k056832_get_tile_info( running_device *device, tile_data *tileinfo, int tile_index, int pageIndex ) { k056832_state *k056832 = k056832_get_safe_token(device); static const struct K056832_SHIFTMASKS @@ -6334,7 +6334,7 @@ static void k056832_change_rambank( k056832_state *k056832 ) k056832_mark_all_tilemaps_dirty(k056832); } -int k056832_get_current_rambank( const device_config *device ) +int k056832_get_current_rambank( running_device *device ) { k056832_state *k056832 = k056832_get_safe_token(device); int bank = k056832->regs[0x19]; @@ -6354,7 +6354,7 @@ static void k056832_change_rombank( k056832_state *k056832 ) k056832->cur_gfx_banks = bank % k056832->num_gfx_banks; } -void k056832_set_tile_bank( const device_config *device, int bank ) +void k056832_set_tile_bank( running_device *device, int bank ) { k056832_state *k056832 = k056832_get_safe_token(device); k056832->uses_tile_banks = 1; @@ -6373,14 +6373,14 @@ void k056832_set_tile_bank( const device_config *device, int bank ) } /* call if a game uses external linescroll */ -void k056832_SetExtLinescroll( const device_config *device ) +void k056832_SetExtLinescroll( running_device *device ) { k056832_state *k056832 = k056832_get_safe_token(device); k056832->use_ext_linescroll = 1; } /* generic helper routine for ROM checksumming */ -static int k056832_rom_read_b( const device_config *device, int offset, int blksize, int blksize2, int zerosec ) +static int k056832_rom_read_b( running_device *device, int offset, int blksize, int blksize2, int zerosec ) { k056832_state *k056832 = k056832_get_safe_token(device); UINT8 *rombase; @@ -6965,7 +6965,7 @@ WRITE32_DEVICE_HANDLER( k056832_b_long_w ) } } -static int k056832_update_linemap( const device_config *device, bitmap_t *bitmap, int page, int flags ) +static int k056832_update_linemap( running_device *device, bitmap_t *bitmap, int page, int flags ) { k056832_state *k056832 = k056832_get_safe_token(device); @@ -7089,7 +7089,7 @@ static int k056832_update_linemap( const device_config *device, bitmap_t *bitmap return(0); } -void k056832_tilemap_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority ) +void k056832_tilemap_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority ) { k056832_state *k056832 = k056832_get_safe_token(device); UINT32 last_dx, last_visible, new_colorbase, last_active; @@ -7396,7 +7396,7 @@ void k056832_tilemap_draw( const device_config *device, bitmap_t *bitmap, const } // end of function -void k056832_tilemap_draw_dj( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority ) +void k056832_tilemap_draw_dj( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority ) { k056832_state *k056832 = k056832_get_safe_token(device); UINT32 last_dx, last_visible, new_colorbase, last_active; @@ -7671,52 +7671,52 @@ void k056832_tilemap_draw_dj( const device_config *device, bitmap_t *bitmap, con } // end of function -void k056832_set_layer_association( const device_config *device, int status ) +void k056832_set_layer_association( running_device *device, int status ) { k056832_state *k056832 = k056832_get_safe_token(device); k056832->default_layer_association = status; } -int k056832_get_layer_association( const device_config *device ) +int k056832_get_layer_association( running_device *device ) { k056832_state *k056832 = k056832_get_safe_token(device); return(k056832->layer_association); } -void k056832_set_layer_offs( const device_config *device, int layer, int offsx, int offsy ) +void k056832_set_layer_offs( running_device *device, int layer, int offsx, int offsy ) { k056832_state *k056832 = k056832_get_safe_token(device); k056832->layer_offs[layer][0] = offsx; k056832->layer_offs[layer][1] = offsy; } -void k056832_set_lsram_page( const device_config *device, int logical_page, int physical_page, int physical_offset ) +void k056832_set_lsram_page( running_device *device, int logical_page, int physical_page, int physical_offset ) { k056832_state *k056832 = k056832_get_safe_token(device); k056832->lsram_page[logical_page][0] = physical_page; k056832->lsram_page[logical_page][1] = physical_offset; } -void k056832_linemap_enable( const device_config *device, int enable ) +void k056832_linemap_enable( running_device *device, int enable ) { k056832_state *k056832 = k056832_get_safe_token(device); k056832->linemap_enabled = enable; } -int k056832_is_irq_enabled( const device_config *device, int irqline ) +int k056832_is_irq_enabled( running_device *device, int irqline ) { k056832_state *k056832 = k056832_get_safe_token(device); return(k056832->regs[0x06/2] & (1 << irqline & 7)); } -void k056832_read_avac( const device_config *device, int *mode, int *data ) +void k056832_read_avac( running_device *device, int *mode, int *data ) { k056832_state *k056832 = k056832_get_safe_token(device); *mode = k056832->regs[0x04/2] & 7; *data = k056832->regs[0x38/2]; } -int k056832_read_register( const device_config *device, int regnum ) +int k056832_read_register( running_device *device, int regnum ) { k056832_state *k056832 = k056832_get_safe_token(device); return(k056832->regs[regnum]); @@ -7989,7 +7989,7 @@ struct _k055555_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k055555_state *k055555_get_safe_token( const device_config *device ) +INLINE k055555_state *k055555_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -8002,7 +8002,7 @@ INLINE k055555_state *k055555_get_safe_token( const device_config *device ) DEVICE HANDLERS *****************************************************************************/ -void k055555_write_reg( const device_config *device, UINT8 regnum, UINT8 regdat ) +void k055555_write_reg( running_device *device, UINT8 regnum, UINT8 regdat ) { k055555_state *k055555 = k055555_get_safe_token(device); @@ -8062,13 +8062,13 @@ WRITE16_DEVICE_HANDLER( k055555_word_w ) } } -int k055555_read_register( const device_config *device, int regnum ) +int k055555_read_register( running_device *device, int regnum ) { k055555_state *k055555 = k055555_get_safe_token(device); return k055555->regs[regnum]; } -int k055555_get_palette_index( const device_config *device, int idx ) +int k055555_get_palette_index( running_device *device, int idx ) { k055555_state *k055555 = k055555_get_safe_token(device); return k055555->regs[K55_PALBASE_A + idx]; @@ -8109,15 +8109,15 @@ struct _k054338_state int shd_rgb[9]; int alphainverted; - const device_config *screen; - const device_config *k055555; /* used to fill BG color */ + running_device *screen; + running_device *k055555; /* used to fill BG color */ }; /***************************************************************************** INLINE FUNCTIONS *****************************************************************************/ -INLINE k054338_state *k054338_get_safe_token( const device_config *device ) +INLINE k054338_state *k054338_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -8126,11 +8126,11 @@ INLINE k054338_state *k054338_get_safe_token( const device_config *device ) return (k054338_state *)device->token; } -INLINE const k054338_interface *k054338_get_interface( const device_config *device ) +INLINE const k054338_interface *k054338_get_interface( running_device *device ) { assert(device != NULL); assert(device->type == K054338); - return (const k054338_interface *) device->static_config; + return (const k054338_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -8151,13 +8151,13 @@ WRITE32_DEVICE_HANDLER( k054338_long_w ) } // returns a 16-bit '338 register -int k054338_register_r( const device_config *device, int reg ) +int k054338_register_r( running_device *device, int reg ) { k054338_state *k054338 = k054338_get_safe_token(device); return k054338->regs[reg]; } -void k054338_update_all_shadows( const device_config *device, int rushingheroes_hack ) +void k054338_update_all_shadows( running_device *device, int rushingheroes_hack ) { k054338_state *k054338 = k054338_get_safe_token(device); running_machine *machine = device->machine; @@ -8187,7 +8187,7 @@ void k054338_update_all_shadows( const device_config *device, int rushingheroes_ } // k054338 BG color fill -void k054338_fill_solid_bg( const device_config *device, bitmap_t *bitmap ) +void k054338_fill_solid_bg( running_device *device, bitmap_t *bitmap ) { UINT32 bgcolor; UINT32 *pLine; @@ -8207,7 +8207,7 @@ void k054338_fill_solid_bg( const device_config *device, bitmap_t *bitmap ) } // Unified k054338/K055555 BG color fill -void k054338_fill_backcolor( const device_config *device, bitmap_t *bitmap, int mode ) // (see p.67) +void k054338_fill_backcolor( running_device *device, bitmap_t *bitmap, int mode ) // (see p.67) { k054338_state *k054338 = k054338_get_safe_token(device); int clipx, clipy, clipw, cliph, i, dst_pitch; @@ -8306,7 +8306,7 @@ void k054338_fill_backcolor( const device_config *device, bitmap_t *bitmap, int } // addition blending unimplemented (requires major changes to drawgfx and tilemap.c) -int k054338_set_alpha_level( const device_config *device, int pblend ) +int k054338_set_alpha_level( running_device *device, int pblend ) { k054338_state *k054338 = k054338_get_safe_token(device); UINT16 *regs; @@ -8354,7 +8354,7 @@ int k054338_set_alpha_level( const device_config *device, int pblend ) return mixlv; } -void k054338_invert_alpha( const device_config *device, int invert ) +void k054338_invert_alpha( running_device *device, int invert ) { k054338_state *k054338 = k054338_get_safe_token(device); k054338->alphainverted = invert; @@ -8363,7 +8363,7 @@ void k054338_invert_alpha( const device_config *device, int invert ) #if 0 // FIXME -void k054338->export_config( const device_config *device, int **shd_rgb ) +void k054338->export_config( running_device *device, int **shd_rgb ) { k054338_state *k054338 = k054338_get_safe_token(device); *shd_rgb = k054338->shd_rgb; @@ -8414,14 +8414,14 @@ struct _k053250_state int page; int frame, offsx, offsy; - const device_config *screen; + running_device *screen; }; /***************************************************************************** INLINE FUNCTIONS *****************************************************************************/ -INLINE k053250_state *k053250_get_safe_token( const device_config *device ) +INLINE k053250_state *k053250_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -8430,11 +8430,11 @@ INLINE k053250_state *k053250_get_safe_token( const device_config *device ) return (k053250_state *)device->token; } -INLINE const k053250_interface *k053250_get_interface( const device_config *device ) +INLINE const k053250_interface *k053250_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K053250)); - return (const k053250_interface *) device->static_config; + return (const k053250_interface *) device->baseconfig().static_config; } @@ -8444,7 +8444,7 @@ INLINE const k053250_interface *k053250_get_interface( const device_config *devi // The DMA process should be instantaneous but since rendering in MAME is performed at VIDEO_UPDATE() // the k053250 memory must be buffered to maintain visual integrity. -void k053250_dma( const device_config *device, int limiter ) +void k053250_dma( running_device *device, int limiter ) { k053250_state *k053250 = k053250_get_safe_token(device); int last_frame, current_frame; @@ -8689,7 +8689,7 @@ INLINE void k053250_pdraw_scanline32(bitmap_t *bitmap, const pen_t *palette, UIN #undef FIXPOINT_PRECISION_HALF } -void k053250_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int colorbase, int flags, int priority ) +void k053250_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int colorbase, int flags, int priority ) { k053250_state *k053250 = k053250_get_safe_token(device); UINT16 *line_ram; @@ -8965,7 +8965,7 @@ struct _k053252_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k053252_state *k053252_get_safe_token( const device_config *device ) +INLINE k053252_state *k053252_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -9036,7 +9036,7 @@ static DEVICE_RESET( k053252 ) typedef struct _k001006_state k001006_state; struct _k001006_state { - const device_config *screen; + running_device *screen; UINT16 * pal_ram; UINT16 * unknown_ram; @@ -9052,7 +9052,7 @@ struct _k001006_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k001006_state *k001006_get_safe_token( const device_config *device ) +INLINE k001006_state *k001006_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -9061,11 +9061,11 @@ INLINE k001006_state *k001006_get_safe_token( const device_config *device ) return (k001006_state *)device->token; } -INLINE const k001006_interface *k001006_get_interface( const device_config *device ) +INLINE const k001006_interface *k001006_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K001006)); - return (const k001006_interface *) device->static_config; + return (const k001006_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -9157,7 +9157,7 @@ WRITE32_DEVICE_HANDLER( k001006_w ) } } -UINT32 k001006_get_palette( const device_config *device, int index ) +UINT32 k001006_get_palette( running_device *device, int index ) { k001006_state *k001006 = k001006_get_safe_token(device); return k001006->palette[index]; @@ -9221,11 +9221,11 @@ struct _poly_extra_data typedef struct _k001005_state k001005_state; struct _k001005_state { - const device_config *screen; - const device_config *cpu; - const device_config *dsp; - const device_config *k001006_1; - const device_config *k001006_2; + running_device *screen; + running_device *cpu; + running_device *dsp; + running_device *k001006_1; + running_device *k001006_2; UINT8 * texture; UINT16 * ram[2]; @@ -9263,7 +9263,7 @@ static const int decode_y_zr107[16] = { 0, 8, 32, 40, 4, 12, 36, 44, 64, 72, 96 INLINE FUNCTIONS *****************************************************************************/ -INLINE k001005_state *k001005_get_safe_token( const device_config *device ) +INLINE k001005_state *k001005_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -9272,18 +9272,18 @@ INLINE k001005_state *k001005_get_safe_token( const device_config *device ) return (k001005_state *)device->token; } -INLINE const k001005_interface *k001005_get_interface( const device_config *device ) +INLINE const k001005_interface *k001005_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K001005)); - return (const k001005_interface *) device->static_config; + return (const k001005_interface *) device->baseconfig().static_config; } /***************************************************************************** DEVICE HANDLERS *****************************************************************************/ -static void k001005_render_polygons( const device_config *device ); +static void k001005_render_polygons( running_device *device ); // rearranges the texture data to a more practical order void k001005_preprocess_texture_data( UINT8 *rom, int length, int gticlub ) @@ -9337,7 +9337,7 @@ void k001005_preprocess_texture_data( UINT8 *rom, int length, int gticlub ) } } -void k001005_swap_buffers( const device_config *device ) +void k001005_swap_buffers( running_device *device ) { k001005_state *k001005 = k001005_get_safe_token(device); @@ -9516,7 +9516,7 @@ WRITE32_DEVICE_HANDLER( k001005_w ) #define POLY_DEVICE 0 #if POLY_DEVICE -static void draw_scanline( const device_config *device, void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid ) +static void draw_scanline( running_device *device, void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid ) { k001005_state *k001005 = k001005_get_safe_token(device); const poly_extra_data *extra = (const poly_extra_data *)extradata; @@ -9547,13 +9547,13 @@ static void draw_scanline( const device_config *device, void *dest, INT32 scanli #endif #if POLY_DEVICE -static void draw_scanline_tex( const device_config *device, void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid ) +static void draw_scanline_tex( running_device *device, void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid ) { k001005_state *k001005 = k001005_get_safe_token(device); const poly_extra_data *extra = (const poly_extra_data *)extradata; bitmap_t *destmap = (bitmap_t *)dest; UINT8 *texrom = k001005->gfxrom + (extra->texture_page * 0x40000); - const device_config *pal_device = (extra->texture_palette & 0x8) ? k001005->k001006_2 : k001005->k001006_1; + running_device *pal_device = (extra->texture_palette & 0x8) ? k001005->k001006_2 : k001005->k001006_1; int palette_index = (extra->texture_palette & 0x7) * 256; float z = extent->param[0].start; float u = extent->param[1].start; @@ -9609,7 +9609,7 @@ static void draw_scanline_tex( const device_config *device, void *dest, INT32 sc #endif -static void k001005_render_polygons( const device_config *device ) +static void k001005_render_polygons( running_device *device ) { k001005_state *k001005 = k001005_get_safe_token(device); int i, j; @@ -10014,7 +10014,7 @@ static void k001005_render_polygons( const device_config *device ) } } -void k001005_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ) +void k001005_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ) { k001005_state *k001005 = k001005_get_safe_token(device); int i, j; @@ -10134,7 +10134,7 @@ static DEVICE_STOP( k001005 ) typedef struct _k001604_state k001604_state; struct _k001604_state { - const device_config *screen; + running_device *screen; tilemap_t *layer_8x8[2]; tilemap_t *layer_roz[2]; int gfx_index[2]; @@ -10155,7 +10155,7 @@ struct _k001604_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k001604_state *k001604_get_safe_token( const device_config *device ) +INLINE k001604_state *k001604_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -10164,11 +10164,11 @@ INLINE k001604_state *k001604_get_safe_token( const device_config *device ) return (k001604_state *)device->token; } -INLINE const k001604_interface *k001604_get_interface( const device_config *device ) +INLINE const k001604_interface *k001604_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K001604)); - return (const k001604_interface *) device->static_config; + return (const k001604_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -10296,7 +10296,7 @@ static TILE_GET_INFO_DEVICE( k001604_tile_info_layer_roz ) } -void k001604_draw_back_layer( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ) +void k001604_draw_back_layer( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ) { k001604_state *k001604 = k001604_get_safe_token(device); int layer; @@ -10331,7 +10331,7 @@ void k001604_draw_back_layer( const device_config *device, bitmap_t *bitmap, con } } -void k001604_draw_front_layer( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ) +void k001604_draw_front_layer( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ) { k001604_state *k001604 = k001604_get_safe_token(device); @@ -10559,7 +10559,7 @@ static DEVICE_RESET( k001604 ) typedef struct _k037122_state k037122_state; struct _k037122_state { - const device_config *screen; + running_device *screen; tilemap_t *layer[2]; int gfx_index; @@ -10575,7 +10575,7 @@ struct _k037122_state INLINE FUNCTIONS *****************************************************************************/ -INLINE k037122_state *k037122_get_safe_token( const device_config *device ) +INLINE k037122_state *k037122_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -10584,11 +10584,11 @@ INLINE k037122_state *k037122_get_safe_token( const device_config *device ) return (k037122_state *)device->token; } -INLINE const k037122_interface *k037122_get_interface( const device_config *device ) +INLINE const k037122_interface *k037122_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == K037122)); - return (const k037122_interface *) device->static_config; + return (const k037122_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -10639,7 +10639,7 @@ static TILE_GET_INFO_DEVICE( k037122_tile_info_layer1 ) } -void k037122_tile_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ) +void k037122_tile_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ) { k037122_state *k037122 = k037122_get_safe_token(device); const rectangle *visarea = video_screen_get_visible_area(k037122->screen); @@ -10658,7 +10658,7 @@ void k037122_tile_draw( const device_config *device, bitmap_t *bitmap, const rec } } -static void update_palette_color( const device_config *device, UINT32 palette_base, int color ) +static void update_palette_color( running_device *device, UINT32 palette_base, int color ) { k037122_state *k037122 = k037122_get_safe_token(device); UINT32 data = k037122->tile_ram[(palette_base / 4) + color]; diff --git a/src/mame/video/konicdev.h b/src/mame/video/konicdev.h index 170b9646e09..12f6ef3c911 100644 --- a/src/mame/video/konicdev.h +++ b/src/mame/video/konicdev.h @@ -372,7 +372,7 @@ WRITE8_DEVICE_HANDLER( k007121_ctrl_w ); /* shall we move source in the interface? */ /* also notice that now we directly pass *gfx[chip] instead of **gfx !! */ -void k007121_sprites_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx, colortable_t *ctable, +void k007121_sprites_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx, colortable_t *ctable, const UINT8 *source, int base_color, int global_x_offset, int bank_base, UINT32 pri_mask ); @@ -383,10 +383,10 @@ READ8_DEVICE_HANDLER( k007342_scroll_r ); WRITE8_DEVICE_HANDLER( k007342_scroll_w ); WRITE8_DEVICE_HANDLER( k007342_vreg_w ); -void k007342_tilemap_update(const device_config *device); -void k007342_tilemap_set_enable(const device_config *device, int layer, int enable); -void k007342_tilemap_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int num, int flags, UINT32 priority); -int k007342_is_int_enabled(const device_config *device); +void k007342_tilemap_update(running_device *device); +void k007342_tilemap_set_enable(running_device *device, int layer, int enable); +void k007342_tilemap_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int num, int flags, UINT32 priority); +int k007342_is_int_enabled(running_device *device); /** Konami 007420 **/ @@ -394,7 +394,7 @@ int k007342_is_int_enabled(const device_config *device); READ8_DEVICE_HANDLER( k007420_r ); WRITE8_DEVICE_HANDLER( k007420_w ); -void k007420_sprites_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx); +void k007420_sprites_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, gfx_element *gfx); /** Konami 052109 **/ @@ -434,13 +434,13 @@ WRITE16_DEVICE_HANDLER( k052109_word_w ); READ16_DEVICE_HANDLER( k052109_lsb_r ); WRITE16_DEVICE_HANDLER( k052109_lsb_w ); -void k052109_set_rmrd_line(const device_config *device, int state); -int k052109_get_rmrd_line(const device_config *device); -void k052109_tilemap_update(const device_config *device); -int k052109_is_irq_enabled(const device_config *device); -void k052109_set_layer_offsets(const device_config *device, int layer, int dx, int dy); -void k052109_tilemap_mark_dirty(const device_config *device, int tmap_num); -void k052109_tilemap_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, UINT32 flags, UINT8 priority); +void k052109_set_rmrd_line(running_device *device, int state); +int k052109_get_rmrd_line(running_device *device); +void k052109_tilemap_update(running_device *device); +int k052109_is_irq_enabled(running_device *device); +void k052109_set_layer_offsets(running_device *device, int layer, int dx, int dy); +void k052109_tilemap_mark_dirty(running_device *device, int tmap_num); +void k052109_tilemap_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, UINT32 flags, UINT8 priority); /** Konami 051960 / 051937 **/ @@ -468,10 +468,10 @@ WRITE8_DEVICE_HANDLER( k051937_w ); READ16_DEVICE_HANDLER( k051937_word_r ); WRITE16_DEVICE_HANDLER( k051937_word_w ); -void k051960_sprites_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int min_priority, int max_priority); -int k051960_is_irq_enabled(const device_config *device); -int k051960_is_nmi_enabled(const device_config *device); -void k051960_set_sprite_offsets(const device_config *device, int dx, int dy); +void k051960_sprites_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int min_priority, int max_priority); +int k051960_is_irq_enabled(running_device *device); +int k051960_is_nmi_enabled(running_device *device); +void k051960_set_sprite_offsets(running_device *device, int dx, int dy); #if 0 // to be moved in the specific drivers! /* special handling for the chips sharing address space */ @@ -491,11 +491,11 @@ READ16_DEVICE_HANDLER( k053244_lsb_r ); WRITE16_DEVICE_HANDLER( k053244_lsb_w ); READ16_DEVICE_HANDLER( k053244_word_r ); WRITE16_DEVICE_HANDLER( k053244_word_w ); -void k053244_bankselect(const device_config *device, int bank); /* used by TMNT2, Asterix and Premier Soccer for ROM testing */ -void k053245_sprites_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); -void k053245_sprites_draw_lethal(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); /* for lethal enforcers */ -void k053245_clear_buffer(const device_config *device); -void k053245_set_sprite_offs(const device_config *device, int offsx, int offsy); +void k053244_bankselect(running_device *device, int bank); /* used by TMNT2, Asterix and Premier Soccer for ROM testing */ +void k053245_sprites_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect); +void k053245_sprites_draw_lethal(running_device *device, bitmap_t *bitmap, const rectangle *cliprect); /* for lethal enforcers */ +void k053245_clear_buffer(running_device *device); +void k053245_set_sprite_offs(running_device *device, int offsx, int offsy); @@ -527,15 +527,15 @@ WRITE32_DEVICE_HANDLER( k053247_long_w ); WRITE16_DEVICE_HANDLER( k053247_reg_word_w ); // "OBJSET2" registers WRITE32_DEVICE_HANDLER( k053247_reg_long_w ); -void k053247_sprites_draw(const device_config *device, bitmap_t *bitmap,const rectangle *cliprect); -int k053247_read_register(const device_config *device, int regnum); -void k053247_set_sprite_offs(const device_config *device, int offsx, int offsy); -void k053247_wraparound_enable(const device_config *device, int status); -void k05324x_set_z_rejection(const device_config *device, int zcode); // common to k053244/5 -void k053247_set_z_rejection(const device_config *device, int zcode); // common to k053246/7 -void k053247_get_ram(const device_config *device, UINT16 **ram); -int k053247_get_dx(const device_config *device); -int k053247_get_dy(const device_config *device); +void k053247_sprites_draw(running_device *device, bitmap_t *bitmap,const rectangle *cliprect); +int k053247_read_register(running_device *device, int regnum); +void k053247_set_sprite_offs(running_device *device, int offsx, int offsy); +void k053247_wraparound_enable(running_device *device, int status); +void k05324x_set_z_rejection(running_device *device, int zcode); // common to k053244/5 +void k053247_set_z_rejection(running_device *device, int zcode); // common to k053246/7 +void k053247_get_ram(running_device *device, UINT16 **ram); +int k053247_get_dx(running_device *device); +int k053247_get_dy(running_device *device); READ8_DEVICE_HANDLER( k053246_r ); WRITE8_DEVICE_HANDLER( k053246_w ); @@ -544,9 +544,9 @@ WRITE16_DEVICE_HANDLER( k053246_word_w ); READ32_DEVICE_HANDLER( k053246_long_r ); WRITE32_DEVICE_HANDLER( k053246_long_w ); -void k053246_set_objcha_line(const device_config *device, int state); -int k053246_is_irq_enabled(const device_config *device); -int k053246_read_register(const device_config *device, int regnum); +void k053246_set_objcha_line(running_device *device, int state); +int k053246_is_irq_enabled(running_device *device); +int k053246_read_register(running_device *device, int regnum); /** Konami 051316 **/ /* @@ -565,8 +565,8 @@ READ8_DEVICE_HANDLER( k051316_r ); WRITE8_DEVICE_HANDLER( k051316_w ); READ8_DEVICE_HANDLER( k051316_rom_r ); WRITE8_DEVICE_HANDLER( k051316_ctrl_w ); -void k051316_zoom_draw(const device_config *device, bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT32 priority); -void k051316_wraparound_enable(const device_config *device, int status); +void k051316_zoom_draw(running_device *device, bitmap_t *bitmap,const rectangle *cliprect,int flags,UINT32 priority); +void k051316_wraparound_enable(running_device *device, int status); /** Konami 053936 **/ @@ -574,9 +574,9 @@ WRITE16_DEVICE_HANDLER( k053936_ctrl_w ); READ16_DEVICE_HANDLER( k053936_ctrl_r ); // FIXME: this is probably unused... to be checked! WRITE16_DEVICE_HANDLER( k053936_linectrl_w ); READ16_DEVICE_HANDLER( k053936_linectrl_r ); -void k053936_zoom_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tmap, int flags, UINT32 priority, int glfgreat_hack); -void k053936_wraparound_enable(const device_config *device, int status); // shall we merge this into the configuration intf? -void k053936_set_offset(const device_config *device, int xoffs, int yoffs); // shall we merge this into the configuration intf? +void k053936_zoom_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t *tmap, int flags, UINT32 priority, int glfgreat_hack); +void k053936_wraparound_enable(running_device *device, int status); // shall we merge this into the configuration intf? +void k053936_set_offset(running_device *device, int xoffs, int yoffs); // shall we merge this into the configuration intf? /** Konami 053251 **/ @@ -588,10 +588,10 @@ void k053936_set_offset(const device_config *device, int xoffs, int yoffs); // s WRITE8_DEVICE_HANDLER( k053251_w ); WRITE16_DEVICE_HANDLER( k053251_lsb_w ); WRITE16_DEVICE_HANDLER( k053251_msb_w ); -int k053251_get_priority(const device_config *device, int ci); -int k053251_get_palette_index(const device_config *device, int ci); -int k053251_get_tmap_dirty(const device_config *device, int tmap_num); -void k053251_set_tmap_dirty(const device_config *device, int tmap_num, int data); +int k053251_get_priority(running_device *device, int ci); +int k053251_get_palette_index(running_device *device, int ci); +int k053251_get_tmap_dirty(running_device *device, int tmap_num); +void k053251_set_tmap_dirty(running_device *device, int tmap_num, int data); enum { @@ -615,7 +615,7 @@ READ8_DEVICE_HANDLER( k051733_r ); /** Konami 056832 **/ -void k056832_SetExtLinescroll(const device_config *device); /* Lethal Enforcers */ +void k056832_SetExtLinescroll(running_device *device); /* Lethal Enforcers */ #define K056832_DRAW_FLAG_FORCE_XYSCROLL 0x00800000 @@ -643,21 +643,21 @@ WRITE8_DEVICE_HANDLER( k056832_ram_attr_lo_w ); WRITE8_DEVICE_HANDLER( k056832_ram_attr_hi_w ); WRITE8_DEVICE_HANDLER( k056832_w ); WRITE8_DEVICE_HANDLER( k056832_b_w ); -void k056832_mark_plane_dirty(const device_config *device, int num); -void k056832_mark_all_tmaps_dirty(const device_config *device); -void k056832_tilemap_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int num, UINT32 flags, UINT32 priority); -void k056832_tilemap_draw_dj(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority); -void k056832_set_layer_association(const device_config *device, int status); -int k056832_get_layer_association(const device_config *device); -void k056832_set_layer_offs(const device_config *device, int layer, int offsx, int offsy); -void k056832_set_lsram_page(const device_config *device, int logical_page, int physical_page, int physical_offset); -void k056832_linemap_enable(const device_config *device, int enable); -int k056832_is_irq_enabled(const device_config *device, int irqline); -void k056832_read_avac(const device_config *device, int *mode, int *data); -int k056832_read_register(const device_config *device, int regnum); -int k056832_get_current_rambank(const device_config *device); -int k056832_get_lookup(const device_config *device, int bits); /* Asterix */ -void k056832_set_tile_bank(const device_config *device, int bank); /* Asterix */ +void k056832_mark_plane_dirty(running_device *device, int num); +void k056832_mark_all_tmaps_dirty(running_device *device); +void k056832_tilemap_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int num, UINT32 flags, UINT32 priority); +void k056832_tilemap_draw_dj(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, UINT32 flags, UINT32 priority); +void k056832_set_layer_association(running_device *device, int status); +int k056832_get_layer_association(running_device *device); +void k056832_set_layer_offs(running_device *device, int layer, int offsx, int offsy); +void k056832_set_lsram_page(running_device *device, int logical_page, int physical_page, int physical_offset); +void k056832_linemap_enable(running_device *device, int enable); +int k056832_is_irq_enabled(running_device *device, int irqline); +void k056832_read_avac(running_device *device, int *mode, int *data); +int k056832_read_register(running_device *device, int regnum); +int k056832_get_current_rambank(running_device *device); +int k056832_get_lookup(running_device *device, int bits); /* Asterix */ +void k056832_set_tile_bank(running_device *device, int bank); /* Asterix */ READ32_DEVICE_HANDLER( k056832_ram_long_r ); READ32_DEVICE_HANDLER( k056832_rom_long_r ); @@ -674,11 +674,11 @@ WRITE32_DEVICE_HANDLER( k056832_b_long_w ); #define K056832_BPP_8LE 5 /** Konami 055555 **/ -void k055555_write_reg(const device_config *device, UINT8 regnum, UINT8 regdat); +void k055555_write_reg(running_device *device, UINT8 regnum, UINT8 regdat); WRITE16_DEVICE_HANDLER( k055555_word_w ); WRITE32_DEVICE_HANDLER( k055555_long_w ); -int k055555_read_register(const device_config *device, int regnum); -int k055555_get_palette_index(const device_config *device, int idx); +int k055555_read_register(running_device *device, int regnum); +int k055555_get_palette_index(running_device *device, int idx); /* K055555 registers */ @@ -752,13 +752,13 @@ int k055555_get_palette_index(const device_config *device, int idx); WRITE16_DEVICE_HANDLER( k054338_word_w ); // "CLCT" registers WRITE32_DEVICE_HANDLER( k054338_long_w ); -int k054338_register_r(const device_config *device, int reg); -void k054338_update_all_shadows(const device_config *device, int rushingheroes_hack); // called at the beginning of VIDEO_UPDATE() -void k054338_fill_solid_bg(const device_config *device, bitmap_t *bitmap); // solid backcolor fill -void k054338_fill_backcolor(const device_config *device, bitmap_t *bitmap, int mode); // unified fill, 0=solid, 1=gradient (by using a k055555) -int k054338_set_alpha_level(const device_config *device, int pblend); // blend style 0-2 -void k054338_invert_alpha(const device_config *device, int invert); // 0=0x00(invis)-0x1f(solid), 1=0x1f(invis)-0x00(solod) -//void K054338_export_config(const device_config *device, int **shdRGB); +int k054338_register_r(running_device *device, int reg); +void k054338_update_all_shadows(running_device *device, int rushingheroes_hack); // called at the beginning of VIDEO_UPDATE() +void k054338_fill_solid_bg(running_device *device, bitmap_t *bitmap); // solid backcolor fill +void k054338_fill_backcolor(running_device *device, bitmap_t *bitmap, int mode); // unified fill, 0=solid, 1=gradient (by using a k055555) +int k054338_set_alpha_level(running_device *device, int pblend); // blend style 0-2 +void k054338_invert_alpha(running_device *device, int invert); // 0=0x00(invis)-0x1f(solid), 1=0x1f(invis)-0x00(solod) +//void K054338_export_config(running_device *device, int **shdRGB); #define K338_REG_BGC_R 0 #define K338_REG_BGC_GB 1 @@ -786,8 +786,8 @@ READ16_DEVICE_HANDLER( k053250_rom_r ); #define K053250_WRAP500 0x01 #define K053250_OVERDRIVE 0x02 -void k053250_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int colorbase, int flags, int pri); -void k053250_dma(const device_config *device, int limiter); +void k053250_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int colorbase, int flags, int pri); +void k053250_dma(running_device *device, int limiter); /** Konami 053252 **/ @@ -798,15 +798,15 @@ WRITE32_DEVICE_HANDLER( k053252_long_w ); /** Konami 001006 **/ -UINT32 k001006_get_palette(const device_config *device, int index); +UINT32 k001006_get_palette(running_device *device, int index); READ32_DEVICE_HANDLER( k001006_r ); WRITE32_DEVICE_HANDLER( k001006_w ); /** Konami 001005 **/ -void k001005_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); -void k001005_swap_buffers(const device_config *device); +void k001005_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect); +void k001005_swap_buffers(running_device *device); void k001005_preprocess_texture_data(UINT8 *rom, int length, int gticlub); READ32_DEVICE_HANDLER( k001005_r ); @@ -814,8 +814,8 @@ WRITE32_DEVICE_HANDLER( k001005_w ); /** Konami 001604 **/ -void k001604_draw_back_layer( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ); -void k001604_draw_front_layer( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ); +void k001604_draw_back_layer( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ); +void k001604_draw_front_layer( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ); WRITE32_DEVICE_HANDLER( k001604_tile_w ); READ32_DEVICE_HANDLER( k001604_tile_r ); WRITE32_DEVICE_HANDLER( k001604_char_w ); @@ -825,7 +825,7 @@ READ32_DEVICE_HANDLER( k001604_reg_r ); /** Konami 037122 **/ -void k037122_tile_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect ); +void k037122_tile_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect ); READ32_DEVICE_HANDLER( k037122_sram_r ); WRITE32_DEVICE_HANDLER( k037122_sram_w ); READ32_DEVICE_HANDLER( k037122_char_r ); diff --git a/src/mame/video/lethalj.c b/src/mame/video/lethalj.c index bf23e359413..fd558803474 100644 --- a/src/mame/video/lethalj.c +++ b/src/mame/video/lethalj.c @@ -181,7 +181,7 @@ WRITE16_HANDLER( lethalj_blitter_w ) * *************************************/ -void lethalj_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void lethalj_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *src = &screenram[(vispage << 17) | ((params->rowaddr << 9) & 0x3fe00)]; UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); diff --git a/src/mame/video/metro.c b/src/mame/video/metro.c index b58a63810ac..b0b5fc63e45 100644 --- a/src/mame/video/metro.c +++ b/src/mame/video/metro.c @@ -848,7 +848,7 @@ static void dirty_tiles(int layer,UINT16 *vram) VIDEO_UPDATE( metro ) { - const device_config *k053936 = devtag_get_device(screen->machine, "k053936"); + running_device *k053936 = devtag_get_device(screen->machine, "k053936"); int i,pri,layers_ctrl = -1; UINT16 screenctrl = *metro_screenctrl; diff --git a/src/mame/video/micro3d.c b/src/mame/video/micro3d.c index 0b42ebd77a4..b0271aff860 100644 --- a/src/mame/video/micro3d.c +++ b/src/mame/video/micro3d.c @@ -64,7 +64,7 @@ VIDEO_RESET( micro3d ) * *************************************/ -void micro3d_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void micro3d_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { micro3d_state *state = (micro3d_state*)screen->machine->driver_data; @@ -133,7 +133,7 @@ WRITE16_HANDLER( micro3d_xfer3dk_w ) state->xfer3dk = data; } -void micro3d_tms_interrupt(const device_config *device, int state) +void micro3d_tms_interrupt(running_device *device, int state) { // mc68901_int_gen(device->machine, GPIP4); } diff --git a/src/mame/video/midtunit.c b/src/mame/video/midtunit.c index 37510d0b482..4c0a2a502b3 100644 --- a/src/mame/video/midtunit.c +++ b/src/mame/video/midtunit.c @@ -806,7 +806,7 @@ skipdma: * *************************************/ -void midtunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void midtunit_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *src = &local_videoram[(params->rowaddr << 9) & 0x3fe00]; UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); @@ -818,7 +818,7 @@ void midtunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int dest[x] = src[coladdr++ & 0x1ff] & 0x7fff; } -void midxunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void midxunit_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT32 fulladdr = ((params->rowaddr << 16) | params->coladdr) >> 3; UINT16 *src = &local_videoram[fulladdr & 0x3fe00]; diff --git a/src/mame/video/midyunit.c b/src/mame/video/midyunit.c index 19c11c23857..fd2095cfcab 100644 --- a/src/mame/video/midyunit.c +++ b/src/mame/video/midyunit.c @@ -561,7 +561,7 @@ static TIMER_CALLBACK( autoerase_line ) } -void midyunit_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +void midyunit_scanline_update(running_device *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { UINT16 *src = &local_videoram[(params->rowaddr << 9) & 0x3fe00]; UINT16 *dest = BITMAP_ADDR16(bitmap, scanline, 0); diff --git a/src/mame/video/nbmj8688.c b/src/mame/video/nbmj8688.c index 0e1e3fd2b6d..b5614c214eb 100644 --- a/src/mame/video/nbmj8688.c +++ b/src/mame/video/nbmj8688.c @@ -717,9 +717,9 @@ VIDEO_UPDATE( mbmj8688_LCD ) { int x, y, b; - const device_config *main_screen = devtag_get_device(screen->machine, "screen"); - const device_config *lcd0_screen = devtag_get_device(screen->machine, "lcd0"); - const device_config *lcd1_screen = devtag_get_device(screen->machine, "lcd1"); + running_device *main_screen = devtag_get_device(screen->machine, "screen"); + running_device *lcd0_screen = devtag_get_device(screen->machine, "lcd0"); + running_device *lcd1_screen = devtag_get_device(screen->machine, "lcd1"); if (screen == main_screen) VIDEO_UPDATE_CALL(mbmj8688); diff --git a/src/mame/video/ninjaw.c b/src/mame/video/ninjaw.c index ccfb33c87b1..df72db79b06 100644 --- a/src/mame/video/ninjaw.c +++ b/src/mame/video/ninjaw.c @@ -102,7 +102,7 @@ VIDEO_UPDATE( ninjaw ) ninjaw_state *state = (ninjaw_state *)screen->machine->driver_data; int xoffs = 0; UINT8 layer[3], nodraw; - const device_config *tc0100scn = NULL; + running_device *tc0100scn = NULL; if (screen == state->lscreen) { diff --git a/src/mame/video/pk8000.c b/src/mame/video/pk8000.c index 0a09e031392..c84e836f7d9 100644 --- a/src/mame/video/pk8000.c +++ b/src/mame/video/pk8000.c @@ -95,7 +95,7 @@ PALETTE_INIT( pk8000 ) palette_set_colors(machine, 0, pk8000_palette, ARRAY_LENGTH(pk8000_palette)); } -UINT32 pk8000_video_update(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *videomem) +UINT32 pk8000_video_update(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *videomem) { int x,y,j,b; UINT16 offset = (pk8000_video_mode & 0xc0) << 8; diff --git a/src/mame/video/playch10.c b/src/mame/video/playch10.c index 6b95f3c8852..fbfb8e46357 100644 --- a/src/mame/video/playch10.c +++ b/src/mame/video/playch10.c @@ -57,7 +57,7 @@ PALETTE_INIT( playch10 ) ppu2c0x_init_palette(machine, 256 ); } -static void ppu_irq( const device_config *device, int *ppu_regs ) +static void ppu_irq( running_device *device, int *ppu_regs ) { cputag_set_input_line(device->machine, "cart", INPUT_LINE_NMI, PULSE_LINE ); pc10_int_detect = 1; @@ -118,12 +118,12 @@ VIDEO_START( playch10_hboard ) VIDEO_UPDATE( playch10 ) { - const device_config *ppu = devtag_get_device(screen->machine, "ppu"); + running_device *ppu = devtag_get_device(screen->machine, "ppu"); /* Dual monitor version */ if (pc10_bios == 1) { - const device_config *top_screen = devtag_get_device(screen->machine, "top"); + running_device *top_screen = devtag_get_device(screen->machine, "top"); /* On Playchoice 10 single monitor, this bit toggles */ /* between PPU and BIOS display. */ diff --git a/src/mame/video/plygonet.c b/src/mame/video/plygonet.c index 6e08643c541..b5666c90c34 100644 --- a/src/mame/video/plygonet.c +++ b/src/mame/video/plygonet.c @@ -123,7 +123,7 @@ VIDEO_START( polygonet ) VIDEO_UPDATE( polygonet ) { - const device_config *k053936 = devtag_get_device(screen->machine, "k053936"); + running_device *k053936 = devtag_get_device(screen->machine, "k053936"); bitmap_fill(screen->machine->priority_bitmap, NULL, 0); bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c index db2b090be76..ca0533ac749 100644 --- a/src/mame/video/ppu2c0x.c +++ b/src/mame/video/ppu2c0x.c @@ -116,13 +116,13 @@ typedef struct PROTOTYPES ***************************************************************************/ -static void update_scanline( const device_config *device ); +static void update_scanline( running_device *device ); static TIMER_CALLBACK( scanline_callback ); static TIMER_CALLBACK( hblank_callback ); static TIMER_CALLBACK( nmi_callback ); -void (*ppu_latch)( const device_config *device, offs_t offset ); +void (*ppu_latch)( running_device *device, offs_t offset ); /* palette handlers */ static WRITE8_HANDLER( ppu2c0x_palette_write ); @@ -133,7 +133,7 @@ static READ8_HANDLER( ppu2c0x_palette_read ); INLINE FUNCTIONS ***************************************************************************/ -INLINE ppu2c0x_chip *get_token( const device_config *device ) +INLINE ppu2c0x_chip *get_token( running_device *device ) { assert(device != NULL); assert((device->type == PPU_2C02) || (device->type == PPU_2C03B) @@ -143,13 +143,13 @@ INLINE ppu2c0x_chip *get_token( const device_config *device ) } -INLINE const ppu2c0x_interface *get_interface( const device_config *device ) +INLINE const ppu2c0x_interface *get_interface( running_device *device ) { assert(device != NULL); assert((device->type == PPU_2C02) || (device->type == PPU_2C03B) || (device->type == PPU_2C04) || (device->type == PPU_2C05) || (device->type == PPU_2C07)); - return (const ppu2c0x_interface *) device->static_config; + return (const ppu2c0x_interface *) device->baseconfig().static_config; } @@ -307,7 +307,7 @@ static DEVICE_START( ppu2c0x ) ppu2c0x_chip *chip = get_token(device); memset(chip, 0, sizeof(*chip)); - chip->scanlines_per_frame = (int) device_get_info_int(device, PPU2C0XINFO_INT_SCANLINES_PER_FRAME); + chip->scanlines_per_frame = (int) device->get_config_int(PPU2C0XINFO_INT_SCANLINES_PER_FRAME); /* initialize the scanline handling portion */ chip->scanline_timer = timer_alloc(device->machine, scanline_callback, (void *) device); @@ -325,7 +325,7 @@ static DEVICE_START( ppu2c0x ) static TIMER_CALLBACK( hblank_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; ppu2c0x_chip *this_ppu = get_token(device); int *ppu_regs = &this_ppu->regs[0]; @@ -342,7 +342,7 @@ static TIMER_CALLBACK( hblank_callback ) static TIMER_CALLBACK( nmi_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; ppu2c0x_chip *this_ppu = get_token(device); const ppu2c0x_interface *intf = get_interface(device); int *ppu_regs = &this_ppu->regs[0]; @@ -354,7 +354,7 @@ static TIMER_CALLBACK( nmi_callback ) timer_adjust_oneshot(this_ppu->nmi_timer, attotime_never, 0); } -static void draw_background( const device_config *device, UINT8 *line_priority ) +static void draw_background( running_device *device, UINT8 *line_priority ) { const ppu2c0x_interface *intf = get_interface(device); ppu2c0x_chip *this_ppu = get_token(device); @@ -501,7 +501,7 @@ static void draw_background( const device_config *device, UINT8 *line_priority ) } } -static void draw_sprites( const device_config *device, UINT8 *line_priority ) +static void draw_sprites( running_device *device, UINT8 *line_priority ) { ppu2c0x_chip *this_ppu = get_token(device); @@ -712,7 +712,7 @@ static void draw_sprites( const device_config *device, UINT8 *line_priority ) * *************************************/ -static void render_scanline( const device_config *device ) +static void render_scanline( running_device *device ) { ppu2c0x_chip *this_ppu = get_token(device); const ppu2c0x_interface *intf = get_interface(device); @@ -757,7 +757,7 @@ static void render_scanline( const device_config *device ) profiler_mark_end(); } -static void update_scanline( const device_config *device ) +static void update_scanline( running_device *device ) { ppu2c0x_chip *this_ppu = get_token(device); const ppu2c0x_interface *intf = get_interface(device); @@ -839,7 +839,7 @@ static void update_scanline( const device_config *device ) static TIMER_CALLBACK( scanline_callback ) { - const device_config *device = (const device_config *)ptr; + running_device *device = (running_device *)ptr; ppu2c0x_chip *this_ppu = get_token(device); int *ppu_regs = &this_ppu->regs[0]; int blanked = (ppu_regs[PPU_CONTROL1] & (PPU_CONTROL1_BACKGROUND | PPU_CONTROL1_SPRITES)) == 0; @@ -1103,7 +1103,7 @@ WRITE8_DEVICE_HANDLER( ppu2c0x_w ) #ifdef MAME_DEBUG if (this_ppu->scanline <= PPU_BOTTOM_VISIBLE_SCANLINE) { - const device_config *screen = device->machine->primary_screen; + running_device *screen = device->machine->primary_screen; logerror("PPU register %d write %02x during non-vblank scanline %d (MAME %d, beam pos: %d)\n", offset, data, this_ppu->scanline, video_screen_get_vpos(screen), video_screen_get_hpos(screen)); } #endif @@ -1237,7 +1237,7 @@ WRITE8_DEVICE_HANDLER( ppu2c0x_w ) * *************************************/ -void ppu2c0x_spriteram_dma( const address_space *space, const device_config *device, const UINT8 page ) +void ppu2c0x_spriteram_dma( const address_space *space, running_device *device, const UINT8 page ) { int i; int address = page << 8; @@ -1258,7 +1258,7 @@ void ppu2c0x_spriteram_dma( const address_space *space, const device_config *dev * *************************************/ -void ppu2c0x_render( const device_config *device, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy ) +void ppu2c0x_render( running_device *device, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy ) { ppu2c0x_chip *this_ppu = get_token(device); copybitmap(bitmap, this_ppu->bitmap, flipx, flipy, sx, sy, 0); @@ -1270,7 +1270,7 @@ void ppu2c0x_render( const device_config *device, bitmap_t *bitmap, int flipx, i * *************************************/ -int ppu2c0x_get_pixel( const device_config *device, int x, int y ) +int ppu2c0x_get_pixel( running_device *device, int x, int y ) { ppu2c0x_chip *this_ppu = get_token(device); @@ -1283,37 +1283,37 @@ int ppu2c0x_get_pixel( const device_config *device, int x, int y ) return *BITMAP_ADDR16(this_ppu->bitmap, y, x); } -int ppu2c0x_get_colorbase( const device_config *device ) +int ppu2c0x_get_colorbase( running_device *device ) { const ppu2c0x_interface *intf = get_interface(device); return intf->color_base; } -int ppu2c0x_get_current_scanline( const device_config *device ) +int ppu2c0x_get_current_scanline( running_device *device ) { ppu2c0x_chip *this_ppu = get_token(device); return this_ppu->scanline; } -void ppu2c0x_set_scanline_callback( const device_config *device, ppu2c0x_scanline_cb cb ) +void ppu2c0x_set_scanline_callback( running_device *device, ppu2c0x_scanline_cb cb ) { ppu2c0x_chip *this_ppu = get_token(device); this_ppu->scanline_callback_proc = cb; } -void ppu2c0x_set_hblank_callback( const device_config *device, ppu2c0x_hblank_cb cb ) +void ppu2c0x_set_hblank_callback( running_device *device, ppu2c0x_hblank_cb cb ) { ppu2c0x_chip *this_ppu = get_token(device); this_ppu->hblank_callback_proc = cb; } -void ppu2c0x_set_vidaccess_callback( const device_config *device, ppu2c0x_vidaccess_cb cb ) +void ppu2c0x_set_vidaccess_callback( running_device *device, ppu2c0x_vidaccess_cb cb ) { ppu2c0x_chip *this_ppu = get_token(device); this_ppu->vidaccess_callback_proc = cb; } -void ppu2c0x_set_scanlines_per_frame( const device_config *device, int scanlines ) +void ppu2c0x_set_scanlines_per_frame( running_device *device, int scanlines ) { ppu2c0x_chip *this_ppu = get_token(device); this_ppu->scanlines_per_frame = scanlines; diff --git a/src/mame/video/ppu2c0x.h b/src/mame/video/ppu2c0x.h index e16897ff7de..28fe8fece93 100644 --- a/src/mame/video/ppu2c0x.h +++ b/src/mame/video/ppu2c0x.h @@ -79,10 +79,10 @@ enum #define PPU_2C07 DEVICE_GET_INFO_NAME(ppu2c07) // PAL NES /* callback datatypes */ -typedef void (*ppu2c0x_scanline_cb)( const device_config *device, int scanline, int vblank, int blanked ); -typedef void (*ppu2c0x_hblank_cb)( const device_config *device, int scanline, int vblank, int blanked ); -typedef void (*ppu2c0x_nmi_cb)( const device_config *device, int *ppu_regs ); -typedef int (*ppu2c0x_vidaccess_cb)( const device_config *device, int address, int data ); +typedef void (*ppu2c0x_scanline_cb)( running_device *device, int scanline, int vblank, int blanked ); +typedef void (*ppu2c0x_hblank_cb)( running_device *device, int scanline, int vblank, int blanked ); +typedef void (*ppu2c0x_nmi_cb)( running_device *device, int *ppu_regs ); +typedef int (*ppu2c0x_vidaccess_cb)( running_device *device, int address, int data ); typedef struct _ppu2c0x_interface ppu2c0x_interface; struct _ppu2c0x_interface @@ -107,18 +107,18 @@ DEVICE_GET_INFO(ppu2c07); /* routines */ void ppu2c0x_init_palette(running_machine *machine, int first_entry ) ATTR_NONNULL(1); -void ppu2c0x_spriteram_dma(const address_space *space, const device_config *device, const UINT8 page ) ATTR_NONNULL(1); -void ppu2c0x_render( const device_config *device, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy ) ATTR_NONNULL(1); -int ppu2c0x_get_pixel( const device_config *device, int x, int y ) ATTR_NONNULL(1); -int ppu2c0x_get_colorbase( const device_config *device ) ATTR_NONNULL(1); -int ppu2c0x_get_current_scanline( const device_config *device ) ATTR_NONNULL(1); -void ppu2c0x_set_scanline_callback( const device_config *device, ppu2c0x_scanline_cb cb ) ATTR_NONNULL(1); -void ppu2c0x_set_hblank_callback( const device_config *device, ppu2c0x_scanline_cb cb ) ATTR_NONNULL(1); -void ppu2c0x_set_vidaccess_callback( const device_config *device, ppu2c0x_vidaccess_cb cb ) ATTR_NONNULL(1); -void ppu2c0x_set_scanlines_per_frame( const device_config *device, int scanlines ) ATTR_NONNULL(1); +void ppu2c0x_spriteram_dma(const address_space *space, running_device *device, const UINT8 page ) ATTR_NONNULL(1); +void ppu2c0x_render( running_device *device, bitmap_t *bitmap, int flipx, int flipy, int sx, int sy ) ATTR_NONNULL(1); +int ppu2c0x_get_pixel( running_device *device, int x, int y ) ATTR_NONNULL(1); +int ppu2c0x_get_colorbase( running_device *device ) ATTR_NONNULL(1); +int ppu2c0x_get_current_scanline( running_device *device ) ATTR_NONNULL(1); +void ppu2c0x_set_scanline_callback( running_device *device, ppu2c0x_scanline_cb cb ) ATTR_NONNULL(1); +void ppu2c0x_set_hblank_callback( running_device *device, ppu2c0x_scanline_cb cb ) ATTR_NONNULL(1); +void ppu2c0x_set_vidaccess_callback( running_device *device, ppu2c0x_vidaccess_cb cb ) ATTR_NONNULL(1); +void ppu2c0x_set_scanlines_per_frame( running_device *device, int scanlines ) ATTR_NONNULL(1); //27/12/2002 (HACK!) -extern void (*ppu_latch)( const device_config *device, offs_t offset ); +extern void (*ppu_latch)( running_device *device, offs_t offset ); WRITE8_DEVICE_HANDLER( ppu2c0x_w ); READ8_DEVICE_HANDLER( ppu2c0x_r ); diff --git a/src/mame/video/psikyo4.c b/src/mame/video/psikyo4.c index 776431c8045..8ef3e29d486 100644 --- a/src/mame/video/psikyo4.c +++ b/src/mame/video/psikyo4.c @@ -129,8 +129,8 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect VIDEO_UPDATE( psikyo4 ) { - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); - const device_config *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); if (screen == left_screen) { diff --git a/src/mame/video/punchout.c b/src/mame/video/punchout.c index ffa6e3c92e5..8980b8c0e8d 100644 --- a/src/mame/video/punchout.c +++ b/src/mame/video/punchout.c @@ -370,8 +370,8 @@ static void punchout_copy_bot_palette(running_machine *machine, int bank) VIDEO_UPDATE( punchout ) { - const device_config *top_screen = devtag_get_device(screen->machine, "top"); - const device_config *bottom_screen = devtag_get_device(screen->machine, "bottom"); + running_device *top_screen = devtag_get_device(screen->machine, "top"); + running_device *bottom_screen = devtag_get_device(screen->machine, "bottom"); if (screen == top_screen) { @@ -404,8 +404,8 @@ VIDEO_UPDATE( punchout ) VIDEO_UPDATE( armwrest ) { - const device_config *top_screen = devtag_get_device(screen->machine, "top"); - const device_config *bottom_screen = devtag_get_device(screen->machine, "bottom"); + running_device *top_screen = devtag_get_device(screen->machine, "top"); + running_device *bottom_screen = devtag_get_device(screen->machine, "bottom"); if (screen == top_screen) { diff --git a/src/mame/video/qdrmfgp.c b/src/mame/video/qdrmfgp.c index 0092344fcc4..6f3744f49ea 100644 --- a/src/mame/video/qdrmfgp.c +++ b/src/mame/video/qdrmfgp.c @@ -29,7 +29,7 @@ void qdrmfgp2_tile_callback(running_machine *machine, int layer, int *code, int VIDEO_START( qdrmfgp ) { - const device_config *k056832 = devtag_get_device(machine, "k056832"); + running_device *k056832 = devtag_get_device(machine, "k056832"); k056832_set_layer_association(k056832, 0); @@ -41,7 +41,7 @@ VIDEO_START( qdrmfgp ) VIDEO_START( qdrmfgp2 ) { - const device_config *k056832 = devtag_get_device(machine, "k056832"); + running_device *k056832 = devtag_get_device(machine, "k056832"); k056832_set_layer_association(k056832, 0); @@ -59,7 +59,7 @@ VIDEO_START( qdrmfgp2 ) VIDEO_UPDATE( qdrmfgp ) { - const device_config *k056832 = devtag_get_device(screen->machine, "k056832"); + running_device *k056832 = devtag_get_device(screen->machine, "k056832"); bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 1); diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c index 1cb9a2c7ef8..e38f31a1919 100644 --- a/src/mame/video/qix.c +++ b/src/mame/video/qix.c @@ -350,7 +350,7 @@ static MC6845_UPDATE_ROW( update_row ) static VIDEO_UPDATE( qix ) { - const device_config *mc6845 = devtag_get_device(screen->machine, MC6845_TAG); + running_device *mc6845 = devtag_get_device(screen->machine, MC6845_TAG); mc6845_update(mc6845, bitmap, cliprect); return 0; diff --git a/src/mame/video/rohga.c b/src/mame/video/rohga.c index 9e93b3230ac..044b7963fa3 100644 --- a/src/mame/video/rohga.c +++ b/src/mame/video/rohga.c @@ -432,7 +432,7 @@ sprite 2: /******************************************************************************/ -static void update_rohga(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int is_schmeisr) +static void update_rohga(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int is_schmeisr) { /* Update playfields */ flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 ); diff --git a/src/mame/video/segaic16.c b/src/mame/video/segaic16.c index a9a30f3f308..0f2fc3f6102 100644 --- a/src/mame/video/segaic16.c +++ b/src/mame/video/segaic16.c @@ -1307,7 +1307,7 @@ void segaic16_tilemap_init(running_machine *machine, int which, int type, int co * *************************************/ -void segaic16_tilemap_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark) +void segaic16_tilemap_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark) { running_machine *machine = screen->machine; struct tilemap_info *info = &bg_tilemap[which]; @@ -1351,7 +1351,7 @@ void segaic16_tilemap_set_bank(running_machine *machine, int which, int banknum, if (info->bank[banknum] != offset) { - const device_config *screen = machine->primary_screen; + running_device *screen = machine->primary_screen; video_screen_update_partial(screen, video_screen_get_vpos(screen)); info->bank[banknum] = offset; tilemap_mark_all_tiles_dirty_all(machine); @@ -1374,7 +1374,7 @@ void segaic16_tilemap_set_flip(running_machine *machine, int which, int flip) flip = (flip != 0); if (info->flip != flip) { - const device_config *screen = machine->primary_screen; + running_device *screen = machine->primary_screen; video_screen_update_partial(screen, video_screen_get_vpos(screen)); info->flip = flip; tilemap_set_flip(info->textmap, flip ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0); @@ -1398,7 +1398,7 @@ void segaic16_tilemap_set_rowscroll(running_machine *machine, int which, int ena enable = (enable != 0); if (info->rowscroll != enable) { - const device_config *screen = machine->primary_screen; + running_device *screen = machine->primary_screen; video_screen_update_partial(screen, video_screen_get_vpos(screen)); info->rowscroll = enable; } @@ -1419,7 +1419,7 @@ void segaic16_tilemap_set_colscroll(running_machine *machine, int which, int ena enable = (enable != 0); if (info->colscroll != enable) { - const device_config *screen = machine->primary_screen; + running_device *screen = machine->primary_screen; video_screen_update_partial(screen, video_screen_get_vpos(screen)); info->colscroll = enable; } @@ -2973,7 +2973,7 @@ void segaic16_sprites_init(running_machine *machine, int which, int type, int co * *************************************/ -void segaic16_sprites_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int which) +void segaic16_sprites_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int which) { struct sprite_info *info = &sprites[which]; (*info->draw)(screen->machine, info, bitmap, cliprect); @@ -2993,7 +2993,7 @@ void segaic16_sprites_set_bank(running_machine *machine, int which, int banknum, if (info->bank[banknum] != offset) { - const device_config *screen = machine->primary_screen; + running_device *screen = machine->primary_screen; video_screen_update_partial(screen, video_screen_get_vpos(screen)); info->bank[banknum] = offset; } @@ -3014,7 +3014,7 @@ void segaic16_sprites_set_flip(running_machine *machine, int which, int flip) flip = (flip != 0); if (info->flip != flip) { - const device_config *screen = machine->primary_screen; + running_device *screen = machine->primary_screen; video_screen_update_partial(screen, video_screen_get_vpos(screen)); info->flip = flip; } @@ -3035,7 +3035,7 @@ void segaic16_sprites_set_shadow(running_machine *machine, int which, int shadow shadow = (shadow != 0); if (info->shadow != shadow) { - const device_config *screen = machine->primary_screen; + running_device *screen = machine->primary_screen; video_screen_update_partial(screen, video_screen_get_vpos(screen)); info->shadow = shadow; } diff --git a/src/mame/video/segaic16.h b/src/mame/video/segaic16.h index 1404803b60e..563c624f286 100644 --- a/src/mame/video/segaic16.h +++ b/src/mame/video/segaic16.h @@ -35,7 +35,7 @@ WRITE16_HANDLER( segaic16_paletteram_w ); void segaic16_tilemap_init(running_machine *machine, int which, int type, int colorbase, int xoffs, int numbanks); void segaic16_tilemap_reset(running_machine *machine, int which); -void segaic16_tilemap_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark); +void segaic16_tilemap_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int which, int map, int priority, int priority_mark); void segaic16_tilemap_set_bank(running_machine *machine, int which, int banknum, int offset); void segaic16_tilemap_set_flip(running_machine *machine, int which, int flip); void segaic16_tilemap_set_rowscroll(running_machine *machine, int which, int enable); @@ -60,7 +60,7 @@ WRITE16_HANDLER( segaic16_textram_0_w ); #define SEGAIC16_SPRITES_16A_BOOTLEG_SHINOBLD 10 void segaic16_sprites_init(running_machine *machine, int which, int type, int colorbase, int xoffs); -void segaic16_sprites_draw(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int which); +void segaic16_sprites_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int which); void segaic16_sprites_set_bank(running_machine *machine, int which, int banknum, int offset); void segaic16_sprites_set_flip(running_machine *machine, int which, int flip); void segaic16_sprites_set_shadow(running_machine *machine, int which, int shadow); diff --git a/src/mame/video/segas18.c b/src/mame/video/segas18.c index b4650d8bad3..20f56cea2ca 100644 --- a/src/mame/video/segas18.c +++ b/src/mame/video/segas18.c @@ -122,7 +122,7 @@ void system18_set_vdp_mixing(running_machine *machine, int mixing) * *************************************/ -static void draw_vdp(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int priority) +static void draw_vdp(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int priority) { int x, y; bitmap_t *priority_bitmap = screen->machine->priority_bitmap; diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c index 99c33e4e436..fc3ff969f97 100644 --- a/src/mame/video/segas32.c +++ b/src/mame/video/segas32.c @@ -805,7 +805,7 @@ static TILE_GET_INFO( get_tile_info ) * *************************************/ -static int compute_clipping_extents(const device_config *screen, int enable, int clipout, int clipmask, const rectangle *cliprect, struct extents_list *list) +static int compute_clipping_extents(running_device *screen, int enable, int clipout, int clipmask, const rectangle *cliprect, struct extents_list *list) { int flip = (system32_videoram[0x1ff00/2] >> 9) & 1; rectangle tempclip; @@ -936,7 +936,7 @@ INLINE void get_tilemaps(int bgnum, tilemap_t **tilemaps) } -static void update_tilemap_zoom(const device_config *screen, struct layer_info *layer, const rectangle *cliprect, int bgnum) +static void update_tilemap_zoom(running_device *screen, struct layer_info *layer, const rectangle *cliprect, int bgnum) { int clipenable, clipout, clips, clipdraw_start; bitmap_t *bitmap = layer->bitmap; @@ -1089,7 +1089,7 @@ static void update_tilemap_zoom(const device_config *screen, struct layer_info * * *************************************/ -static void update_tilemap_rowscroll(const device_config *screen, struct layer_info *layer, const rectangle *cliprect, int bgnum) +static void update_tilemap_rowscroll(running_device *screen, struct layer_info *layer, const rectangle *cliprect, int bgnum) { int clipenable, clipout, clips, clipdraw_start; bitmap_t *bitmap = layer->bitmap; @@ -1241,7 +1241,7 @@ static void update_tilemap_rowscroll(const device_config *screen, struct layer_i * *************************************/ -static void update_tilemap_text(const device_config *screen, struct layer_info *layer, const rectangle *cliprect) +static void update_tilemap_text(running_device *screen, struct layer_info *layer, const rectangle *cliprect) { bitmap_t *bitmap = layer->bitmap; UINT16 *tilebase; @@ -1400,7 +1400,7 @@ static void update_tilemap_text(const device_config *screen, struct layer_info * * *************************************/ -static void update_bitmap(const device_config *screen, struct layer_info *layer, const rectangle *cliprect) +static void update_bitmap(running_device *screen, struct layer_info *layer, const rectangle *cliprect) { int clipenable, clipout, clips, clipdraw_start; bitmap_t *bitmap = layer->bitmap; @@ -1527,7 +1527,7 @@ static void update_background(struct layer_info *layer, const rectangle *cliprec } -static UINT8 update_tilemaps(const device_config *screen, const rectangle *cliprect) +static UINT8 update_tilemaps(running_device *screen, const rectangle *cliprect) { int enable0 = !(system32_videoram[0x1ff02/2] & 0x0001) && !(system32_videoram[0x1ff8e/2] & 0x0002); int enable1 = !(system32_videoram[0x1ff02/2] & 0x0002) && !(system32_videoram[0x1ff8e/2] & 0x0004); @@ -2624,7 +2624,7 @@ VIDEO_UPDATE( multi32 ) { UINT8 enablemask; - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); /* update the visible area */ if (system32_videoram[0x1ff00/2] & 0x8000) diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c index d56886e43c1..98af234d98f 100644 --- a/src/mame/video/seta.c +++ b/src/mame/video/seta.c @@ -279,7 +279,7 @@ WRITE16_HANDLER( seta_vregs_w ) ---- ---- ---- ---0 Coin #0 Counter */ if (ACCESSING_BITS_0_7) { - const device_config *x1_010 = devtag_get_device(space->machine, "x1snd"); + running_device *x1_010 = devtag_get_device(space->machine, "x1snd"); seta_coin_lockout_w (space->machine, data & 0x0f); if (x1_010 != NULL) seta_sound_enable_w (x1_010, data & 0x20); diff --git a/src/mame/video/skydiver.c b/src/mame/video/skydiver.c index a5f75f0f68d..01c28e055ec 100644 --- a/src/mame/video/skydiver.c +++ b/src/mame/video/skydiver.c @@ -130,7 +130,7 @@ WRITE8_HANDLER( skydiver_lamp_d_w ) WRITE8_HANDLER( skydiver_2000_201F_w ) { - const device_config *discrete = devtag_get_device(space->machine, "discrete"); + running_device *discrete = devtag_get_device(space->machine, "discrete"); int bit = offset & 0x01; watchdog_reset_w(space,0,0); diff --git a/src/mame/video/spacefb.c b/src/mame/video/spacefb.c index bff646b322d..25bb11167ef 100644 --- a/src/mame/video/spacefb.c +++ b/src/mame/video/spacefb.c @@ -147,7 +147,7 @@ static void get_starfield_pens(pen_t *pens) } -static void draw_starfield(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect) +static void draw_starfield(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect) { int y; pen_t pens[NUM_STARFIELD_PENS]; diff --git a/src/mame/video/sprint4.c b/src/mame/video/sprint4.c index 2a012c7182e..179e880ec64 100644 --- a/src/mame/video/sprint4.c +++ b/src/mame/video/sprint4.c @@ -94,7 +94,7 @@ VIDEO_EOF( sprint4 ) /* check for sprite-playfield collisions */ - const device_config *discrete = devtag_get_device(machine, "discrete"); + running_device *discrete = devtag_get_device(machine, "discrete"); for (i = 0; i < 4; i++) { diff --git a/src/mame/video/starcrus.c b/src/mame/video/starcrus.c index 0c91751ec4e..14bca060752 100644 --- a/src/mame/video/starcrus.c +++ b/src/mame/video/starcrus.c @@ -64,7 +64,7 @@ VIDEO_START( starcrus ) WRITE8_HANDLER( starcrus_ship_parm_1_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); s1_sprite = data&0x1f; engine1_on = ((data&0x20)>>5)^0x01; @@ -90,7 +90,7 @@ WRITE8_HANDLER( starcrus_ship_parm_1_w ) WRITE8_HANDLER( starcrus_ship_parm_2_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); s2_sprite = data&0x1f; set_led_status(space->machine, 2,~data & 0x80); /* game over lamp */ @@ -118,7 +118,7 @@ WRITE8_HANDLER( starcrus_ship_parm_2_w ) WRITE8_HANDLER( starcrus_proj_parm_1_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); p1_sprite = data&0x0f; launch1_on = ((data&0x20)>>5)^0x01; @@ -157,7 +157,7 @@ WRITE8_HANDLER( starcrus_proj_parm_1_w ) WRITE8_HANDLER( starcrus_proj_parm_2_w ) { - const device_config *samples = devtag_get_device(space->machine, "samples"); + running_device *samples = devtag_get_device(space->machine, "samples"); p2_sprite = data&0x0f; launch2_on = ((data&0x20)>>5)^0x01; diff --git a/src/mame/video/subs.c b/src/mame/video/subs.c index 84c822d30ef..e6bef04b05d 100644 --- a/src/mame/video/subs.c +++ b/src/mame/video/subs.c @@ -42,9 +42,9 @@ VIDEO_UPDATE( subs ) UINT8 *spriteram = screen->machine->generic.spriteram.u8; int offs; - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); - const device_config *right_screen = devtag_get_device(screen->machine, "rscreen"); - const device_config *discrete = devtag_get_device(screen->machine, "discrete"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *discrete = devtag_get_device(screen->machine, "discrete"); /* for every character in the Video RAM, check if it has been modified */ /* since last time and update it accordingly. */ diff --git a/src/mame/video/superchs.c b/src/mame/video/superchs.c index e53c5b76015..b7011a9f006 100644 --- a/src/mame/video/superchs.c +++ b/src/mame/video/superchs.c @@ -209,7 +209,7 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks); VIDEO_UPDATE( superchs ) { - const device_config *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); UINT8 layer[5]; UINT16 priority; static const int primasks[4] = {0xfffc, 0xfff0, 0xff00, 0x0}; diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c index 1f7a91aa75c..7662f2264de 100644 --- a/src/mame/video/system1.c +++ b/src/mame/video/system1.c @@ -244,7 +244,7 @@ WRITE8_HANDLER( system1_sprite_collision_reset_w ) * *************************************/ -INLINE void videoram_wait_states(const device_config *cpu) +INLINE void videoram_wait_states(running_device *cpu) { /* The main Z80's CPU clock is halted whenever an access to VRAM happens, and is only restarted by the FIXST signal, which occurs once every @@ -486,7 +486,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta * *************************************/ -static void video_update_common(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *fgpixmap, bitmap_t **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs) +static void video_update_common(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, bitmap_t *fgpixmap, bitmap_t **bgpixmaps, const int *bgrowscroll, int bgyscroll, int spritexoffs) { const UINT8 *lookup = memory_region(screen->machine, "proms"); int x, y; diff --git a/src/mame/video/taito_f2.c b/src/mame/video/taito_f2.c index cd222f8098e..c10d9375006 100644 --- a/src/mame/video/taito_f2.c +++ b/src/mame/video/taito_f2.c @@ -1188,7 +1188,7 @@ VIDEO_UPDATE( taitof2_thundfox ) while (drawn[0] < 2 && drawn[1] < 2) { int pick; - const device_config *tc0100scn; + running_device *tc0100scn; if (tilepri[0][drawn[0]] < tilepri[1][drawn[1]]) { diff --git a/src/mame/video/taitoic.c b/src/mame/video/taitoic.c index 555e16b9aef..0c6d710e86f 100644 --- a/src/mame/video/taitoic.c +++ b/src/mame/video/taitoic.c @@ -567,7 +567,7 @@ struct _pc080sn_state INLINE FUNCTIONS *****************************************************************************/ -INLINE pc080sn_state *pc080sn_get_safe_token( const device_config *device ) +INLINE pc080sn_state *pc080sn_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -576,18 +576,18 @@ INLINE pc080sn_state *pc080sn_get_safe_token( const device_config *device ) return (pc080sn_state *)device->token; } -INLINE const pc080sn_interface *pc080sn_get_interface( const device_config *device ) +INLINE const pc080sn_interface *pc080sn_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == PC080SN)); - return (const pc080sn_interface *) device->static_config; + return (const pc080sn_interface *) device->baseconfig().static_config; } /***************************************************************************** DEVICE HANDLERS *****************************************************************************/ -INLINE void common_get_pc080sn_bg_tile_info( const device_config *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum ) +INLINE void common_get_pc080sn_bg_tile_info( running_device *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum ) { pc080sn_state *pc080sn = pc080sn_get_safe_token(device); UINT16 code, attr; @@ -610,7 +610,7 @@ INLINE void common_get_pc080sn_bg_tile_info( const device_config *device, tile_d TILE_FLIPYX((attr & 0xc000) >> 14)); } -INLINE void common_get_pc080sn_fg_tile_info( const device_config *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum ) +INLINE void common_get_pc080sn_fg_tile_info( running_device *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum ) { pc080sn_state *pc080sn = pc080sn_get_safe_token(device); UINT16 code,attr; @@ -745,7 +745,7 @@ WRITE16_DEVICE_HANDLER( pc080sn_ctrl_word_w ) /* This routine is needed as an override by Jumping, which doesn't set proper scroll values for foreground tilemap */ -void pc080sn_set_scroll( const device_config *device, int tilemap_num, int scrollx, int scrolly ) +void pc080sn_set_scroll( running_device *device, int tilemap_num, int scrollx, int scrolly ) { pc080sn_state *pc080sn = pc080sn_get_safe_token(device); @@ -755,14 +755,14 @@ void pc080sn_set_scroll( const device_config *device, int tilemap_num, int scrol /* This routine is needed as an override by Jumping */ -void pc080sn_set_trans_pen( const device_config *device, int tilemap_num, int pen ) +void pc080sn_set_trans_pen( running_device *device, int tilemap_num, int pen ) { pc080sn_state *pc080sn = pc080sn_get_safe_token(device); tilemap_set_transparent_pen(pc080sn->tilemap[tilemap_num], pen); } -void pc080sn_tilemap_update( const device_config *device ) +void pc080sn_tilemap_update( running_device *device ) { pc080sn_state *pc080sn = pc080sn_get_safe_token(device); int j; @@ -835,7 +835,7 @@ static UINT16 topspeed_get_road_pixel_color( UINT16 pixel, UINT16 color ) } -static void topspeed_custom_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, +static void topspeed_custom_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, UINT16 *color_ctrl_ram ) { pc080sn_state *pc080sn = pc080sn_get_safe_token(device); @@ -929,13 +929,13 @@ static void topspeed_custom_draw( const device_config *device, bitmap_t *bitmap, while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y)); } -void pc080sn_tilemap_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) +void pc080sn_tilemap_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) { pc080sn_state *pc080sn = pc080sn_get_safe_token(device); tilemap_draw(bitmap, cliprect, pc080sn->tilemap[layer], flags, priority); } -void pc080sn_tilemap_draw_offset( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, int xoffs, int yoffs ) +void pc080sn_tilemap_draw_offset( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, int xoffs, int yoffs ) { pc080sn_state *pc080sn = pc080sn_get_safe_token(device); int basedx = -16 - pc080sn->xoffs; @@ -950,7 +950,7 @@ void pc080sn_tilemap_draw_offset( const device_config *device, bitmap_t *bitmap, tilemap_set_scrolldy(pc080sn->tilemap[layer], basedy, basedyflip); } -void pc080sn_tilemap_draw_special( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, UINT16 *ram ) +void pc080sn_tilemap_draw_special( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, UINT16 *ram ) { topspeed_custom_draw(device, bitmap, cliprect, layer, flags, priority, ram); } @@ -1061,7 +1061,7 @@ struct _pc090oj_state INLINE FUNCTIONS *****************************************************************************/ -INLINE pc090oj_state *pc090oj_get_safe_token( const device_config *device ) +INLINE pc090oj_state *pc090oj_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -1070,18 +1070,18 @@ INLINE pc090oj_state *pc090oj_get_safe_token( const device_config *device ) return (pc090oj_state *)device->token; } -INLINE const pc090oj_interface *pc090oj_get_interface( const device_config *device ) +INLINE const pc090oj_interface *pc090oj_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == PC090OJ)); - return (const pc090oj_interface *) device->static_config; + return (const pc090oj_interface *) device->baseconfig().static_config; } /***************************************************************************** DEVICE HANDLERS *****************************************************************************/ -void pc090oj_set_sprite_ctrl( const device_config *device, UINT16 sprctrl ) +void pc090oj_set_sprite_ctrl( running_device *device, UINT16 sprctrl ) { pc090oj_state *pc090oj = pc090oj_get_safe_token(device); pc090oj->sprite_ctrl = sprctrl; @@ -1113,7 +1113,7 @@ WRITE16_DEVICE_HANDLER( pc090oj_word_w ) } } -void pc090oj_eof_callback( const device_config *device ) +void pc090oj_eof_callback( running_device *device ) { pc090oj_state *pc090oj = pc090oj_get_safe_token(device); if (pc090oj->buffer) @@ -1125,7 +1125,7 @@ void pc090oj_eof_callback( const device_config *device ) } -void pc090oj_draw_sprites( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int pri_type ) +void pc090oj_draw_sprites( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int pri_type ) { pc090oj_state *pc090oj = pc090oj_get_safe_token(device); int offs, priority = 0; @@ -1270,7 +1270,7 @@ struct _tc0080vco_state INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0080vco_state *tc0080vco_get_safe_token( const device_config *device ) +INLINE tc0080vco_state *tc0080vco_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -1279,11 +1279,11 @@ INLINE tc0080vco_state *tc0080vco_get_safe_token( const device_config *device ) return (tc0080vco_state *)device->token; } -INLINE const tc0080vco_interface *tc0080vco_get_interface( const device_config *device ) +INLINE const tc0080vco_interface *tc0080vco_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == TC0080VCO)); - return (const tc0080vco_interface *) device->static_config; + return (const tc0080vco_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -1506,7 +1506,7 @@ WRITE16_DEVICE_HANDLER( tc0080vco_word_w ) tc0080vco_scrollram_w(device, offset - (0x20800 / 2), tc0080vco->ram[offset], mem_mask); } -void tc0080vco_tilemap_update( const device_config *device ) +void tc0080vco_tilemap_update( running_device *device ) { tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); int j; @@ -1532,7 +1532,7 @@ void tc0080vco_tilemap_update( const device_config *device ) /* NB: orientation_flipx code in following routine has not been tested */ -static void tc0080vco_bg0_tilemap_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority ) +static void tc0080vco_bg0_tilemap_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority ) { tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); UINT16 zoom = tc0080vco->scroll_ram[6]; @@ -1685,7 +1685,7 @@ do \ } \ while (0) \ -static void tc0080vco_bg1_tilemap_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority ) +static void tc0080vco_bg1_tilemap_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority ) { tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); UINT8 layer = 1; @@ -1771,7 +1771,7 @@ static void tc0080vco_bg1_tilemap_draw( const device_config *device, bitmap_t *b } -void tc0080vco_tilemap_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) +void tc0080vco_tilemap_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) { tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); int disable = 0x00; /* possibly layer disable bits do exist ?? */ @@ -1945,7 +1945,7 @@ struct _tc0100scn_state INT32 bg0_colbank, bg1_colbank, tx_colbank; int dblwidth; - const device_config *screen; + running_device *screen; }; #define TC0100SCN_RAM_SIZE 0x14000 /* enough for double-width tilemaps */ @@ -1955,7 +1955,7 @@ struct _tc0100scn_state INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0100scn_state *tc0100scn_get_safe_token( const device_config *device ) +INLINE tc0100scn_state *tc0100scn_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -1964,18 +1964,18 @@ INLINE tc0100scn_state *tc0100scn_get_safe_token( const device_config *device ) return (tc0100scn_state *)device->token; } -INLINE const tc0100scn_interface *tc0100scn_get_interface( const device_config *device ) +INLINE const tc0100scn_interface *tc0100scn_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == TC0100SCN)); - return (const tc0100scn_interface *) device->static_config; + return (const tc0100scn_interface *) device->baseconfig().static_config; } /***************************************************************************** DEVICE HANDLERS *****************************************************************************/ -INLINE void common_get_bg0_tile_info( const device_config *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) +INLINE void common_get_bg0_tile_info( running_device *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) { tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); int code, attr; @@ -1999,7 +1999,7 @@ INLINE void common_get_bg0_tile_info( const device_config *device, tile_data *ti TILE_FLIPYX((attr & 0xc000) >> 14)); } -INLINE void common_get_bg1_tile_info( const device_config *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) +INLINE void common_get_bg1_tile_info( running_device *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) { tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); int code, attr; @@ -2023,7 +2023,7 @@ INLINE void common_get_bg1_tile_info( const device_config *device, tile_data *ti TILE_FLIPYX((attr & 0xc000) >> 14)); } -INLINE void common_get_tx_tile_info( const device_config *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) +INLINE void common_get_tx_tile_info( running_device *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) { tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); int attr = ram[tile_index]; @@ -2065,13 +2065,13 @@ static const gfx_layout tc0100scn_charlayout = }; -void tc0100scn_set_colbank( const device_config *device, int col ) +void tc0100scn_set_colbank( running_device *device, int col ) { tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); tc0100scn->colbank = col; } -void tc0100scn_set_colbanks( const device_config *device, int bg0, int bg1, int tx ) +void tc0100scn_set_colbanks( running_device *device, int bg0, int bg1, int tx ) { tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); tc0100scn->bg0_colbank = bg0; @@ -2079,7 +2079,7 @@ void tc0100scn_set_colbanks( const device_config *device, int bg0, int bg1, int tc0100scn->tx_colbank = tx; } -void tc0100scn_set_bg_tilemask( const device_config *device, int mask ) +void tc0100scn_set_bg_tilemask( running_device *device, int mask ) { tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); tc0100scn->bg_tilemask = mask; @@ -2115,7 +2115,7 @@ static void tc0100scn_set_layer_ptrs( tc0100scn_state *tc0100scn ) } } -static void tc0100scn_dirty_tilemaps( const device_config *device ) +static void tc0100scn_dirty_tilemaps( running_device *device ) { tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); @@ -2320,7 +2320,7 @@ WRITE32_DEVICE_HANDLER( tc0100scn_long_w ) } -void tc0100scn_tilemap_update( const device_config *device ) +void tc0100scn_tilemap_update( running_device *device ) { tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); int j; @@ -2334,7 +2334,7 @@ void tc0100scn_tilemap_update( const device_config *device ) tilemap_set_scrollx(tc0100scn->tilemap[1][tc0100scn->dblwidth], (j + tc0100scn->fgscrolly) & 0x1ff, tc0100scn->fgscrollx - tc0100scn->fgscroll_ram[j]); } -static void tc0100scn_tilemap_draw_fg( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t* tmap, int flags, UINT32 priority ) +static void tc0100scn_tilemap_draw_fg( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, tilemap_t* tmap, int flags, UINT32 priority ) { tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); const bitmap_t *src_bitmap = tilemap_get_pixmap(tmap); @@ -2380,7 +2380,7 @@ static void tc0100scn_tilemap_draw_fg( const device_config *device, bitmap_t *bi } } -int tc0100scn_tilemap_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) +int tc0100scn_tilemap_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) { tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); int disable = tc0100scn->ctrl[6] & 0xf7; @@ -2413,7 +2413,7 @@ if (disable != 0 && disable != 3 && disable != 7) return 0; } -int tc0100scn_bottomlayer( const device_config *device ) +int tc0100scn_bottomlayer( running_device *device ) { tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); return (tc0100scn->ctrl[6] & 0x8) >> 3; @@ -2562,7 +2562,7 @@ struct _tc0280grd_state INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0280grd_state *tc0280grd_get_safe_token( const device_config *device ) +INLINE tc0280grd_state *tc0280grd_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -2571,11 +2571,11 @@ INLINE tc0280grd_state *tc0280grd_get_safe_token( const device_config *device ) return (tc0280grd_state *)device->token; } -INLINE const tc0280grd_interface *tc0280grd_get_interface( const device_config *device ) +INLINE const tc0280grd_interface *tc0280grd_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == TC0280GRD) || (device->type == TC0430GRW)); - return (const tc0280grd_interface *) device->static_config; + return (const tc0280grd_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -2627,7 +2627,7 @@ WRITE16_DEVICE_HANDLER( tc0430grw_ctrl_word_w ) tc0280grd_ctrl_word_w(device, offset, data, mem_mask); } -void tc0280grd_tilemap_update( const device_config *device, int base_color ) +void tc0280grd_tilemap_update( running_device *device, int base_color ) { tc0280grd_state *tc0280grd = tc0280grd_get_safe_token(device); if (tc0280grd->base_color != base_color) @@ -2637,12 +2637,12 @@ void tc0280grd_tilemap_update( const device_config *device, int base_color ) } } -void tc0430grw_tilemap_update( const device_config *device, int base_color ) +void tc0430grw_tilemap_update( running_device *device, int base_color ) { tc0280grd_tilemap_update(device, base_color); } -static void zoom_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority, int xmultiply ) +static void zoom_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority, int xmultiply ) { tc0280grd_state *tc0280grd = tc0280grd_get_safe_token(device); UINT32 startx, starty; @@ -2677,12 +2677,12 @@ static void zoom_draw( const device_config *device, bitmap_t *bitmap, const rect 0, priority); } -void tc0280grd_zoom_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority ) +void tc0280grd_zoom_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority ) { zoom_draw(device, bitmap, cliprect, xoffset, yoffset, priority, 2); } -void tc0430grw_zoom_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority ) +void tc0430grw_zoom_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority ) { zoom_draw(device, bitmap, cliprect, xoffset, yoffset, priority, 1); } @@ -2733,7 +2733,7 @@ struct _tc0360pri_state INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0360pri_state *tc0360pri_get_safe_token( const device_config *device ) +INLINE tc0360pri_state *tc0360pri_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -2826,7 +2826,7 @@ struct _tc0480scp_state INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0480scp_state *tc0480scp_get_safe_token( const device_config *device ) +INLINE tc0480scp_state *tc0480scp_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -2835,11 +2835,11 @@ INLINE tc0480scp_state *tc0480scp_get_safe_token( const device_config *device ) return (tc0480scp_state *)device->token; } -INLINE const tc0480scp_interface *tc0480scp_get_interface( const device_config *device ) +INLINE const tc0480scp_interface *tc0480scp_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == TC0480SCP)); - return (const tc0480scp_interface *) device->static_config; + return (const tc0480scp_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -2847,7 +2847,7 @@ INLINE const tc0480scp_interface *tc0480scp_get_interface( const device_config * *****************************************************************************/ -INLINE void common_get_tc0480bg_tile_info( const device_config *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum ) +INLINE void common_get_tc0480bg_tile_info( running_device *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum ) { tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device); int code = ram[2 * tile_index + 1] & 0x7fff; @@ -2859,7 +2859,7 @@ INLINE void common_get_tc0480bg_tile_info( const device_config *device, tile_dat TILE_FLIPYX((attr & 0xc000) >> 14)); } -INLINE void common_get_tc0480tx_tile_info( const device_config *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum ) +INLINE void common_get_tc0480tx_tile_info( running_device *device, tile_data *tileinfo, int tile_index, UINT16 *ram, int gfxnum ) { tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device); int attr = ram[tile_index]; @@ -3180,7 +3180,7 @@ WRITE32_DEVICE_HANDLER( tc0480scp_long_w ) } -void tc0480scp_tilemap_update( const device_config *device ) +void tc0480scp_tilemap_update( running_device *device ) { tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device); int layer, zoom, i, j; @@ -3247,7 +3247,7 @@ Historical Issues **********************************************************************/ -static void tc0480scp_bg01_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) +static void tc0480scp_bg01_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) { /* X-axis zoom offers expansion only: 0 = no zoom, 0xff = max Y-axis zoom offers expansion/compression: 0x7f = no zoom, 0xff = max @@ -3396,7 +3396,7 @@ flipscreen. ****************************************************************/ -static void tc0480scp_bg23_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) +static void tc0480scp_bg23_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) { tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device); bitmap_t *srcbitmap = tilemap_get_pixmap(tc0480scp->tilemap[layer][tc0480scp->dblwidth]); @@ -3518,7 +3518,7 @@ static void tc0480scp_bg23_draw( const device_config *device, bitmap_t *bitmap, } -void tc0480scp_tilemap_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) +void tc0480scp_tilemap_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority ) { tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device); @@ -3557,7 +3557,7 @@ static const UINT16 tc0480scp_bg_pri_lookup[8] = 0x0321 }; -int tc0480scp_get_bg_priority( const device_config *device ) +int tc0480scp_get_bg_priority( running_device *device ) { tc0480scp_state *tc0480scp = tc0480scp_get_safe_token(device); return tc0480scp_bg_pri_lookup[(tc0480scp->pri_reg & 0x1c) >> 2]; @@ -3769,7 +3769,7 @@ struct _tc0150rod_state INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0150rod_state *tc0150rod_get_safe_token( const device_config *device ) +INLINE tc0150rod_state *tc0150rod_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -3778,11 +3778,11 @@ INLINE tc0150rod_state *tc0150rod_get_safe_token( const device_config *device ) return (tc0150rod_state *)device->token; } -INLINE const tc0150rod_interface *tc0150rod_get_interface( const device_config *device ) +INLINE const tc0150rod_interface *tc0150rod_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == TC0150ROD)); - return (const tc0150rod_interface *) device->static_config; + return (const tc0150rod_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -3964,7 +3964,7 @@ lookup table from rom for the TaitoZ sprites. ******************************************************************************/ -void tc0150rod_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority ) +void tc0150rod_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority ) { tc0150rod_state *tc0150rod = tc0150rod_get_safe_token(device); @@ -4577,7 +4577,7 @@ struct _tc0110pcr_state INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0110pcr_state *tc0110pcr_get_safe_token( const device_config *device ) +INLINE tc0110pcr_state *tc0110pcr_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -4586,11 +4586,11 @@ INLINE tc0110pcr_state *tc0110pcr_get_safe_token( const device_config *device ) return (tc0110pcr_state *)device->token; } -INLINE const tc0110pcr_interface *tc0110pcr_get_interface( const device_config *device ) +INLINE const tc0110pcr_interface *tc0110pcr_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == TC0110PCR)); - return (const tc0110pcr_interface *) device->static_config; + return (const tc0110pcr_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -4808,7 +4808,7 @@ struct _tc0180vcu_state INLINE FUNCTIONS *****************************************************************************/ -INLINE tc0180vcu_state *tc0180vcu_get_safe_token( const device_config *device ) +INLINE tc0180vcu_state *tc0180vcu_get_safe_token( running_device *device ) { assert(device != NULL); assert(device->token != NULL); @@ -4817,11 +4817,11 @@ INLINE tc0180vcu_state *tc0180vcu_get_safe_token( const device_config *device ) return (tc0180vcu_state *)device->token; } -INLINE const tc0180vcu_interface *tc0180vcu_get_interface( const device_config *device ) +INLINE const tc0180vcu_interface *tc0180vcu_get_interface( running_device *device ) { assert(device != NULL); assert((device->type == TC0180VCU)); - return (const tc0180vcu_interface *) device->static_config; + return (const tc0180vcu_interface *) device->baseconfig().static_config; } /***************************************************************************** @@ -4889,7 +4889,7 @@ READ8_DEVICE_HANDLER( tc0180vcu_get_videoctrl ) return tc0180vcu->video_control; } -static void tc0180vcu_video_control( const device_config *device, UINT8 data ) +static void tc0180vcu_video_control( running_device *device, UINT8 data ) { tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device); #if 0 @@ -5023,7 +5023,7 @@ WRITE16_DEVICE_HANDLER( tc0180vcu_word_w ) tilemap_mark_tile_dirty(tc0180vcu->tilemap[2], offset & 0x7ff); } -void tc0180vcu_tilemap_draw( const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, int plane ) +void tc0180vcu_tilemap_draw( running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, int plane ) { tc0180vcu_state *tc0180vcu = tc0180vcu_get_safe_token(device); diff --git a/src/mame/video/taitoic.h b/src/mame/video/taitoic.h index 0160c84146f..455c00d8236 100644 --- a/src/mame/video/taitoic.h +++ b/src/mame/video/taitoic.h @@ -202,31 +202,31 @@ WRITE16_DEVICE_HANDLER( pc080sn_xscroll_word_w ); WRITE16_DEVICE_HANDLER( pc080sn_yscroll_word_w ); WRITE16_DEVICE_HANDLER( pc080sn_ctrl_word_w ); -void pc080sn_set_scroll(const device_config *device, int tilemap_num, int scrollx, int scrolly); -void pc080sn_set_trans_pen(const device_config *device, int tilemap_num, int pen); -void pc080sn_tilemap_update(const device_config *device); -void pc080sn_tilemap_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority); -void pc080sn_tilemap_draw_offset(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, int xoffs, int yoffs); +void pc080sn_set_scroll(running_device *device, int tilemap_num, int scrollx, int scrolly); +void pc080sn_set_trans_pen(running_device *device, int tilemap_num, int pen); +void pc080sn_tilemap_update(running_device *device); +void pc080sn_tilemap_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority); +void pc080sn_tilemap_draw_offset(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, int xoffs, int yoffs); /* For Topspeed */ -void pc080sn_tilemap_draw_special(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, UINT16 *ram); +void pc080sn_tilemap_draw_special(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority, UINT16 *ram); /** PC090OJ **/ READ16_DEVICE_HANDLER( pc090oj_word_r ); WRITE16_DEVICE_HANDLER( pc090oj_word_w ); -void pc090oj_set_sprite_ctrl(const device_config *device, UINT16 sprctrl); -void pc090oj_eof_callback(const device_config *device); -void pc090oj_draw_sprites(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int pri_type); +void pc090oj_set_sprite_ctrl(running_device *device, UINT16 sprctrl); +void pc090oj_eof_callback(running_device *device); +void pc090oj_draw_sprites(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int pri_type); /** TC0080VCO **/ READ16_DEVICE_HANDLER( tc0080vco_word_r ); WRITE16_DEVICE_HANDLER( tc0080vco_word_w ); -void tc0080vco_tilemap_update(const device_config *device); -void tc0080vco_tilemap_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority); +void tc0080vco_tilemap_update(running_device *device); +void tc0080vco_tilemap_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority); READ16_DEVICE_HANDLER( tc0080vco_cram_0_r ); READ16_DEVICE_HANDLER( tc0080vco_cram_1_r ); @@ -240,14 +240,14 @@ READ_LINE_DEVICE_HANDLER( tc0080vco_flipscreen_r ); /* Function to set separate color banks for the three tilemapped layers. To change from the default (0,0,0) use after calling TC0100SCN_vh_start */ -void tc0100scn_set_colbanks(const device_config *device, int bg0, int bg1, int tx); +void tc0100scn_set_colbanks(running_device *device, int bg0, int bg1, int tx); /* Function to set separate color banks for each TC0100SCN. To change from the default (0,0,0) use after calling TC0100SCN_vh_start */ -void tc0100scn_set_colbank(const device_config *device, int colbank); +void tc0100scn_set_colbank(running_device *device, int colbank); /* Function to set bg tilemask < 0xffff */ -void tc0100scn_set_bg_tilemask(const device_config *device, int mask); +void tc0100scn_set_bg_tilemask(running_device *device, int mask); /* Function to for Mjnquest to select gfx bank */ WRITE16_DEVICE_HANDLER( tc0100scn_gfxbank_w ); @@ -263,26 +263,26 @@ WRITE32_DEVICE_HANDLER( tc0100scn_long_w ); READ32_DEVICE_HANDLER( tc0100scn_ctrl_long_r ); WRITE32_DEVICE_HANDLER( tc0100scn_ctrl_long_w ); -void tc0100scn_tilemap_update(const device_config *device); -int tc0100scn_tilemap_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority); +void tc0100scn_tilemap_update(running_device *device); +int tc0100scn_tilemap_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority); /* returns 0 or 1 depending on the lowest priority tilemap set in the internal register. Use this function to draw tilemaps in the correct order. */ -int tc0100scn_bottomlayer(const device_config *device); +int tc0100scn_bottomlayer(running_device *device); /** TC0280GRD & TC0430GRW **/ READ16_DEVICE_HANDLER( tc0280grd_word_r ); WRITE16_DEVICE_HANDLER( tc0280grd_word_w ); WRITE16_DEVICE_HANDLER( tc0280grd_ctrl_word_w ); -void tc0280grd_tilemap_update(const device_config *device, int base_color); -void tc0280grd_zoom_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority); +void tc0280grd_tilemap_update(running_device *device, int base_color); +void tc0280grd_zoom_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority); READ16_DEVICE_HANDLER( tc0430grw_word_r ); WRITE16_DEVICE_HANDLER( tc0430grw_word_w ); WRITE16_DEVICE_HANDLER( tc0430grw_ctrl_word_w ); -void tc0430grw_tilemap_update(const device_config *device, int base_color); -void tc0430grw_zoom_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority); +void tc0430grw_tilemap_update(running_device *device, int base_color); +void tc0430grw_zoom_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int xoffset, int yoffset, UINT32 priority); /** TC0360PRI **/ @@ -306,13 +306,13 @@ WRITE32_DEVICE_HANDLER( tc0480scp_long_w ); READ32_DEVICE_HANDLER( tc0480scp_ctrl_long_r ); WRITE32_DEVICE_HANDLER( tc0480scp_ctrl_long_w ); -void tc0480scp_tilemap_update(const device_config *device); -void tc0480scp_tilemap_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority); +void tc0480scp_tilemap_update(running_device *device); +void tc0480scp_tilemap_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int layer, int flags, UINT32 priority); /* Returns the priority order of the bg tilemaps set in the internal register. The order in which the four layers should be drawn is returned in the lowest four nibbles (msn = bottom layer; lsn = top) */ -int tc0480scp_get_bg_priority(const device_config *device); +int tc0480scp_get_bg_priority(running_device *device); /* Undrfire needs to read this for a sprite/tile priority hack */ READ8_DEVICE_HANDLER( tc0480scp_pri_reg_r ); @@ -321,7 +321,7 @@ READ8_DEVICE_HANDLER( tc0480scp_pri_reg_r ); /** TC0150ROD **/ READ16_DEVICE_HANDLER( tc0150rod_word_r ); WRITE16_DEVICE_HANDLER( tc0150rod_word_w ); -void tc0150rod_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority); +void tc0150rod_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int y_offs, int palette_offs, int type, int road_trans, UINT32 low_priority, UINT32 high_priority); /** TC0110PCR **/ @@ -342,4 +342,4 @@ READ16_DEVICE_HANDLER( tc0180vcu_scroll_r ); WRITE16_DEVICE_HANDLER( tc0180vcu_scroll_w ); READ16_DEVICE_HANDLER( tc0180vcu_word_r ); WRITE16_DEVICE_HANDLER( tc0180vcu_word_w ); -void tc0180vcu_tilemap_draw(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, int plane); +void tc0180vcu_tilemap_draw(running_device *device, bitmap_t *bitmap, const rectangle *cliprect, int tmap_num, int plane); diff --git a/src/mame/video/tbowl.c b/src/mame/video/tbowl.c index 1ef0504b0a6..1380d6815d3 100644 --- a/src/mame/video/tbowl.c +++ b/src/mame/video/tbowl.c @@ -212,8 +212,8 @@ VIDEO_START( tbowl ) VIDEO_UPDATE( tbowl ) { - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); - const device_config *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); if (screen == left_screen) { diff --git a/src/mame/video/tceptor.c b/src/mame/video/tceptor.c index 33cc9284c5b..dfd57c1cd41 100644 --- a/src/mame/video/tceptor.c +++ b/src/mame/video/tceptor.c @@ -534,9 +534,9 @@ VIDEO_UPDATE( tceptor ) int pri; int bg_center = 144 - ((((bg1_scroll_x + bg2_scroll_x ) & 0x1ff) - 288) / 2); - const device_config *_2d_screen = devtag_get_device(screen->machine, "2dscreen"); - const device_config *_3d_left_screen = devtag_get_device(screen->machine, "3dleft"); - const device_config *_3d_right_screen = devtag_get_device(screen->machine, "3dright"); + running_device *_2d_screen = devtag_get_device(screen->machine, "2dscreen"); + running_device *_3d_left_screen = devtag_get_device(screen->machine, "3dleft"); + running_device *_3d_right_screen = devtag_get_device(screen->machine, "3dright"); if (screen != _2d_screen) { diff --git a/src/mame/video/tetrisp2.c b/src/mame/video/tetrisp2.c index 1f9ed7bec90..f0c96c7b8ff 100644 --- a/src/mame/video/tetrisp2.c +++ b/src/mame/video/tetrisp2.c @@ -680,8 +680,8 @@ VIDEO_UPDATE( rocknms ) int scr_pri; int rot_pri; - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); - const device_config *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); /* Black background color */ if (screen == left_screen) diff --git a/src/mame/video/toaplan2.c b/src/mame/video/toaplan2.c index 583cb7332f0..1479d6bd122 100644 --- a/src/mame/video/toaplan2.c +++ b/src/mame/video/toaplan2.c @@ -1023,7 +1023,7 @@ static void toaplan2_scroll_reg_data_w(running_machine *machine, offs_t offset, if ((toaplan2_sub_cpu == CPU_2_Z80) && (data == 3)) { /* HACK! When tilted, sound CPU needs to be reset. */ - const device_config *ym = devtag_get_device(machine, "ymsnd"); + running_device *ym = devtag_get_device(machine, "ymsnd"); if (ym && (sound_get_type(ym) == SOUND_YM3812)) { diff --git a/src/mame/video/triplhnt.c b/src/mame/video/triplhnt.c index 9212faefd0f..95937ddf010 100644 --- a/src/mame/video/triplhnt.c +++ b/src/mame/video/triplhnt.c @@ -130,7 +130,7 @@ static void draw_sprites(running_machine *machine, bitmap_t* bitmap, const recta VIDEO_UPDATE( triplhnt ) { - const device_config *discrete = devtag_get_device(screen->machine, "discrete"); + running_device *discrete = devtag_get_device(screen->machine, "discrete"); tilemap_mark_all_tiles_dirty(bg_tilemap); diff --git a/src/mame/video/twin16.c b/src/mame/video/twin16.c index d36757565fc..d8e3adf21db 100644 --- a/src/mame/video/twin16.c +++ b/src/mame/video/twin16.c @@ -156,7 +156,7 @@ static int twin16_set_sprite_timer( running_machine *machine ) // sprite system busy, maybe a dma? time is guessed, assume 4 scanlines twin16_sprite_busy = 1; - timer_adjust_oneshot(twin16_sprite_timer, attotime_make(0,(((screen_config *)(machine->primary_screen)->inline_config)->refresh) / video_screen_get_height(machine->primary_screen) * 4), 0); + timer_adjust_oneshot(twin16_sprite_timer, attotime_make(0,(((screen_config *)(machine->primary_screen->baseconfig()).inline_config)->refresh) / video_screen_get_height(machine->primary_screen) * 4), 0); return 0; } diff --git a/src/mame/video/tx1.c b/src/mame/video/tx1.c index dfc1147fd61..c5f10ab88d2 100644 --- a/src/mame/video/tx1.c +++ b/src/mame/video/tx1.c @@ -1194,9 +1194,9 @@ static void tx1_combine_layers(running_machine *machine, bitmap_t *bitmap, int s VIDEO_UPDATE( tx1 ) { - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); - const device_config *centre_screen = devtag_get_device(screen->machine, "cscreen"); - const device_config *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *centre_screen = devtag_get_device(screen->machine, "cscreen"); + running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); if (screen == left_screen) { @@ -3081,9 +3081,9 @@ VIDEO_EOF( buggyboy ) VIDEO_UPDATE( buggyboy ) { - const device_config *left_screen = devtag_get_device(screen->machine, "lscreen"); - const device_config *center_screen = devtag_get_device(screen->machine, "cscreen"); - const device_config *right_screen = devtag_get_device(screen->machine, "rscreen"); + running_device *left_screen = devtag_get_device(screen->machine, "lscreen"); + running_device *center_screen = devtag_get_device(screen->machine, "cscreen"); + running_device *right_screen = devtag_get_device(screen->machine, "rscreen"); if (screen == left_screen) { diff --git a/src/mame/video/ultratnk.c b/src/mame/video/ultratnk.c index 2336d5c0816..7650d244f7f 100644 --- a/src/mame/video/ultratnk.c +++ b/src/mame/video/ultratnk.c @@ -96,7 +96,7 @@ VIDEO_EOF( ultratnk ) { int i; UINT16 BG = colortable_entry_get_value(machine->colortable, 0); - const device_config *discrete = devtag_get_device(machine, "discrete"); + running_device *discrete = devtag_get_device(machine, "discrete"); UINT8 *videoram = machine->generic.videoram.u8; /* check for sprite-playfield collisions */ diff --git a/src/mame/video/undrfire.c b/src/mame/video/undrfire.c index ac3483d9683..83d7548e525 100644 --- a/src/mame/video/undrfire.c +++ b/src/mame/video/undrfire.c @@ -357,8 +357,8 @@ static void draw_sprites_cbombers(running_machine *machine, bitmap_t *bitmap,con VIDEO_UPDATE( undrfire ) { - const device_config *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); - const device_config *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); + running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; @@ -503,8 +503,8 @@ VIDEO_UPDATE( undrfire ) VIDEO_UPDATE( cbombers ) { - const device_config *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); - const device_config *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); + running_device *tc0100scn = devtag_get_device(screen->machine, "tc0100scn"); + running_device *tc0480scp = devtag_get_device(screen->machine, "tc0480scp"); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; diff --git a/src/mame/video/vindictr.c b/src/mame/video/vindictr.c index ecd954b0b7f..83d0bd617f0 100644 --- a/src/mame/video/vindictr.c +++ b/src/mame/video/vindictr.c @@ -138,7 +138,7 @@ WRITE16_HANDLER( vindictr_paletteram_w ) * *************************************/ -void vindictr_scanline_update(const device_config *screen, int scanline) +void vindictr_scanline_update(running_device *screen, int scanline) { vindictr_state *state = (vindictr_state *)screen->machine->driver_data; UINT16 *base = &state->atarigen.alpha[((scanline - 8) / 8) * 64 + 42]; diff --git a/src/mame/video/vsnes.c b/src/mame/video/vsnes.c index 3eb3b43d35d..8bf6b748684 100644 --- a/src/mame/video/vsnes.c +++ b/src/mame/video/vsnes.c @@ -14,12 +14,12 @@ PALETTE_INIT( vsdual ) ppu2c0x_init_palette(machine, 8*4*16 ); } -static void ppu_irq_1( const device_config *device, int *ppu_regs ) +static void ppu_irq_1( running_device *device, int *ppu_regs ) { cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE ); } -static void ppu_irq_2( const device_config *device, int *ppu_regs ) +static void ppu_irq_2( running_device *device, int *ppu_regs ) { cputag_set_input_line(device->machine, "sub", INPUT_LINE_NMI, PULSE_LINE ); } @@ -65,8 +65,8 @@ VIDEO_UPDATE( vsnes ) VIDEO_UPDATE( vsdual ) { - const device_config *top_screen = devtag_get_device(screen->machine, "top"); - const device_config *bottom_screen = devtag_get_device(screen->machine, "bottom"); + running_device *top_screen = devtag_get_device(screen->machine, "top"); + running_device *bottom_screen = devtag_get_device(screen->machine, "bottom"); /* render the ppu's */ if (screen == top_screen) diff --git a/src/mame/video/warriorb.c b/src/mame/video/warriorb.c index ca259d56b4d..c3f498897b6 100644 --- a/src/mame/video/warriorb.c +++ b/src/mame/video/warriorb.c @@ -89,7 +89,7 @@ VIDEO_UPDATE( warriorb ) warriorb_state *state = (warriorb_state *)screen->machine->driver_data; int xoffs = 0; UINT8 layer[3], nodraw; - const device_config *tc0100scn = NULL; + running_device *tc0100scn = NULL; if (screen == state->lscreen) { diff --git a/src/mame/video/wecleman.c b/src/mame/video/wecleman.c index 3ad6b3172b0..ce277c83025 100644 --- a/src/mame/video/wecleman.c +++ b/src/mame/video/wecleman.c @@ -1125,8 +1125,8 @@ VIDEO_UPDATE ( wecleman ) VIDEO_UPDATE( hotchase ) { - const device_config *k051316_1 = devtag_get_device(screen->machine, "k051316_1"); - const device_config *k051316_2 = devtag_get_device(screen->machine, "k051316_2"); + running_device *k051316_1 = devtag_get_device(screen->machine, "k051316_1"); + running_device *k051316_2 = devtag_get_device(screen->machine, "k051316_2"); int video_on; video_on = wecleman_irqctrl & 0x40; diff --git a/src/osd/osdepend.h b/src/osd/osdepend.h index 25d01c7d8d9..a45152ff916 100644 --- a/src/osd/osdepend.h +++ b/src/osd/osdepend.h @@ -71,7 +71,7 @@ class input_type_desc; -class device_config; +class running_device; /*----------------------------------------------------------------------------- @@ -126,7 +126,7 @@ class device_config; -----------------------------------------------------------------------------*/ void osd_init(running_machine *machine); -void osd_wait_for_debugger(const device_config *device, int firststop); +void osd_wait_for_debugger(running_device *device, int firststop); diff --git a/src/osd/osdmini/minimain.c b/src/osd/osdmini/minimain.c index a68fbed958c..08b769d2056 100644 --- a/src/osd/osdmini/minimain.c +++ b/src/osd/osdmini/minimain.c @@ -139,7 +139,7 @@ void osd_init(running_machine *machine) // osd_wait_for_debugger //============================================================ -void osd_wait_for_debugger(const device_config *device, int firststop) +void osd_wait_for_debugger(running_device *device, int firststop) { // we don't have a debugger, so we just return here } diff --git a/src/osd/sdl/debugosx.h b/src/osd/sdl/debugosx.h index 35eedc4291d..9ffc81d6089 100644 --- a/src/osd/sdl/debugosx.h +++ b/src/osd/sdl/debugosx.h @@ -62,7 +62,7 @@ typedef float CGFloat; - (NSString *)selectedSubviewName; - (int)selectedSubviewIndex; - (void)selectSubviewAtIndex:(int)index; -- (void)selectSubviewForCPU:(const device_config *)device; +- (void)selectSubviewForCPU:(running_device *)device; @end @@ -143,7 +143,7 @@ typedef float CGFloat; - (NSString *)selectedSubviewName; - (int)selectedSubviewIndex; - (void)selectSubviewAtIndex:(int)index; -- (void)selectSubviewForCPU:(const device_config *)device; +- (void)selectSubviewForCPU:(running_device *)device; - (NSString *)expression; - (void)setExpression:(NSString *)exp; @@ -171,7 +171,7 @@ typedef float CGFloat; - (NSString *)selectedSubviewName; - (int)selectedSubviewIndex; - (void)selectSubviewAtIndex:(int)index; -- (void)selectSubviewForCPU:(const device_config *)device; +- (void)selectSubviewForCPU:(running_device *)device; - (NSString *)expression; - (void)setExpression:(NSString *)exp; @@ -199,7 +199,7 @@ typedef float CGFloat; - (NSString *)selectedSubviewName; - (int)selectedSubviewIndex; - (void)selectSubviewAtIndex:(int)index; -- (void)selectSubviewForCPU:(const device_config *)device; +- (void)selectSubviewForCPU:(running_device *)device; @end @@ -269,7 +269,7 @@ typedef float CGFloat; - (id)initWithMachine:(running_machine *)m; -- (void)setCPU:(const device_config *)device; +- (void)setCPU:(running_device *)device; - (IBAction)doCommand:(id)sender; diff --git a/src/osd/sdl/debugwin.c b/src/osd/sdl/debugwin.c index f44fb75926a..0be5318285e 100644 --- a/src/osd/sdl/debugwin.c +++ b/src/osd/sdl/debugwin.c @@ -41,7 +41,7 @@ typedef struct { debug_view *console; debug_view *disasm; debug_view *registers; - const device_config *cpu; // current CPU + running_device *cpu; // current CPU running_machine *machine; // machine } debugmain_i; @@ -81,7 +81,7 @@ typedef struct memorycombo_item UINT8 prefsize; running_machine *machine; // machine const memory_subview_item *subview; // subview - const device_config *device; // CPU device + running_device *device; // CPU device } memorycombo_item; @@ -281,7 +281,7 @@ void debugmain_comments_activate(GtkMenuItem *item, gpointer user_data) } } -static void debugmain_set_cpu(const device_config *cpu) +static void debugmain_set_cpu(running_device *cpu) { if (cpu != dmain->cpu) { @@ -315,7 +315,7 @@ static void debugmain_set_cpu(const device_config *cpu) // The entry point -void osd_wait_for_debugger(const device_config *device, int firststop) +void osd_wait_for_debugger(running_device *device, int firststop) { // create a console window if(!dmain) @@ -439,7 +439,7 @@ static void memorywin_new(running_machine *machine) { memorywin_i *mem; int item, cursel; - const device_config *curcpu = debug_cpu_get_visible_cpu(machine); + running_device *curcpu = debug_cpu_get_visible_cpu(machine); const memory_subview_item *subview; mem = (memorywin_i *) malloc(sizeof(*mem)); @@ -566,7 +566,7 @@ static void disasmwin_new(running_machine *machine) { disasmwin_i *dis; int item, cursel; - const device_config *curcpu = debug_cpu_get_visible_cpu(machine); + running_device *curcpu = debug_cpu_get_visible_cpu(machine); const disasm_subview_item *subview; char title[256]; @@ -782,7 +782,7 @@ void on_dbpl_activate(GtkMenuItem *item, gpointer user_data) #include "emu.h" // win32 stubs for linking -void osd_wait_for_debugger(const device_config *device, int firststop) +void osd_wait_for_debugger(running_device *device, int firststop) { } diff --git a/src/osd/windows/debugwin.c b/src/osd/windows/debugwin.c index a1760ff7796..0f0dd03110c 100644 --- a/src/osd/windows/debugwin.c +++ b/src/osd/windows/debugwin.c @@ -246,7 +246,7 @@ static void disasm_update_caption(running_machine *machine, HWND wnd); static void console_create_window(running_machine *machine); static void console_recompute_children(debugwin_info *info); static void console_process_string(debugwin_info *info, const char *string); -static void console_set_cpu(const device_config *device); +static void console_set_cpu(running_device *device); static HMENU create_standard_menubar(void); static int global_handle_command(debugwin_info *info, WPARAM wparam, LPARAM lparam); @@ -261,7 +261,7 @@ static void smart_show_all(BOOL show); // osd_wait_for_debugger //============================================================ -void osd_wait_for_debugger(const device_config *device, int firststop) +void osd_wait_for_debugger(running_device *device, int firststop) { MSG message; @@ -1719,7 +1719,7 @@ static void log_create_window(running_machine *machine) static void memory_create_window(running_machine *machine) { - const device_config *curcpu = debug_cpu_get_visible_cpu(machine); + running_device *curcpu = debug_cpu_get_visible_cpu(machine); const memory_subview_item *subview; debugwin_info *info; HMENU optionsmenu; @@ -2034,7 +2034,7 @@ static void memory_update_caption(running_machine *machine, HWND wnd) static void disasm_create_window(running_machine *machine) { - const device_config *curcpu = debug_cpu_get_visible_cpu(machine); + running_device *curcpu = debug_cpu_get_visible_cpu(machine); const disasm_subview_item *subview; debugwin_info *info; HMENU optionsmenu; @@ -2562,7 +2562,7 @@ static void console_process_string(debugwin_info *info, const char *string) // console_set_cpu //============================================================ -static void console_set_cpu(const device_config *device) +static void console_set_cpu(running_device *device) { const registers_subview_item *regsubitem = NULL; const disasm_subview_item *dasmsubitem; |