summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/emu/addrmap.c168
-rw-r--r--src/emu/addrmap.h364
-rw-r--r--src/emu/audit.c35
-rw-r--r--src/emu/cheat.c2
-rw-r--r--src/emu/clifront.c36
-rw-r--r--src/emu/cpu/adsp2100/2100ops.c14
-rw-r--r--src/emu/cpu/adsp2100/adsp2100.c379
-rw-r--r--src/emu/cpu/adsp2100/adsp2100.h201
-rw-r--r--src/emu/cpu/asap/asap.c187
-rw-r--r--src/emu/cpu/asap/asap.h48
-rw-r--r--src/emu/cpu/ccpu/ccpu.c2
-rw-r--r--src/emu/cpu/cop400/cop400.c4
-rw-r--r--src/emu/cpu/cosmac/cosmac.c259
-rw-r--r--src/emu/cpu/cosmac/cosmac.h92
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.c6
-rw-r--r--src/emu/cpu/dsp16/dsp16.c180
-rw-r--r--src/emu/cpu/dsp16/dsp16.h68
-rw-r--r--src/emu/cpu/dsp32/dsp32.c218
-rw-r--r--src/emu/cpu/dsp32/dsp32.h71
-rw-r--r--src/emu/cpu/dsp56k/dsp56k.c2
-rw-r--r--src/emu/cpu/esrip/esrip.c2
-rw-r--r--src/emu/cpu/hd61700/hd61700.c138
-rw-r--r--src/emu/cpu/hd61700/hd61700.h66
-rw-r--r--src/emu/cpu/i8085/i8085.c4
-rw-r--r--src/emu/cpu/i86/i286.c4
-rw-r--r--src/emu/cpu/i86/i86.c2
-rw-r--r--src/emu/cpu/jaguar/jaguar.c2
-rw-r--r--src/emu/cpu/lh5801/lh5801.c2
-rw-r--r--src/emu/cpu/lr35902/lr35902.c2
-rw-r--r--src/emu/cpu/m6502/m4510.c2
-rw-r--r--src/emu/cpu/m6502/m6502.c2
-rw-r--r--src/emu/cpu/m6502/m6509.c2
-rw-r--r--src/emu/cpu/m6502/m65ce02.c2
-rw-r--r--src/emu/cpu/m6800/m6800.c8
-rw-r--r--src/emu/cpu/m6809/6809dasm.c2
-rw-r--r--src/emu/cpu/m6809/m6809.c2
-rw-r--r--src/emu/cpu/mb86233/mb86233.c2
-rw-r--r--src/emu/cpu/mb88xx/mb88xx.c4
-rw-r--r--src/emu/cpu/mc68hc11/mc68hc11.c2
-rw-r--r--src/emu/cpu/mcs48/mcs48.c40
-rw-r--r--src/emu/cpu/mcs51/mcs51.c2
-rw-r--r--src/emu/cpu/minx/minx.c2
-rw-r--r--src/emu/cpu/mips/mips3com.c2
-rw-r--r--src/emu/cpu/mips/psx.c64
-rw-r--r--src/emu/cpu/mips/psx.h90
-rw-r--r--src/emu/cpu/mips/r3000.c2
-rw-r--r--src/emu/cpu/nec/v25.c2
-rw-r--r--src/emu/cpu/pdp1/pdp1.c2
-rw-r--r--src/emu/cpu/pdp1/tx0.c2
-rw-r--r--src/emu/cpu/powerpc/ppc.c12
-rw-r--r--src/emu/cpu/powerpc/ppccom.c2
-rw-r--r--src/emu/cpu/rsp/rsp.c2
-rw-r--r--src/emu/cpu/rsp/rspdrc.c2
-rw-r--r--src/emu/cpu/saturn/saturn.c2
-rw-r--r--src/emu/cpu/sc61860/sc61860.c2
-rw-r--r--src/emu/cpu/scmp/scmp.c4
-rw-r--r--src/emu/cpu/sh2/sh2comn.c2
-rw-r--r--src/emu/cpu/sh4/sh4.c2
-rw-r--r--src/emu/cpu/sharc/sharc.c2
-rw-r--r--src/emu/cpu/sm8500/sm8500.c6
-rw-r--r--src/emu/cpu/superfx/superfx.c4
-rw-r--r--src/emu/cpu/t11/t11.c2
-rw-r--r--src/emu/cpu/tlcs900/tlcs900.c2
-rw-r--r--src/emu/cpu/tms0980/tms0980.c2
-rw-r--r--src/emu/cpu/tms32031/32031ops.c26
-rw-r--r--src/emu/cpu/tms32031/tms32031.c250
-rw-r--r--src/emu/cpu/tms32031/tms32031.h130
-rw-r--r--src/emu/cpu/tms34010/tms34010.c4
-rw-r--r--src/emu/cpu/tms9900/99xxcore.h4
-rwxr-xr-xsrc/emu/cpu/upd7725/upd7725.c253
-rwxr-xr-xsrc/emu/cpu/upd7725/upd7725.h114
-rw-r--r--src/emu/cpu/upd7810/upd7810.c2
-rw-r--r--src/emu/cpu/vtlb.c2
-rw-r--r--src/emu/cpu/z180/z180.c4
-rw-r--r--src/emu/cpu/z80/z80.c4
-rw-r--r--src/emu/cpu/z80/z80daisy.c29
-rw-r--r--src/emu/cpu/z80/z80daisy.h18
-rw-r--r--src/emu/debug/debugcmd.c36
-rw-r--r--src/emu/debug/debugcpu.c10
-rw-r--r--src/emu/debug/dvdisasm.c2
-rw-r--r--src/emu/debug/dvmemory.c2
-rw-r--r--src/emu/debug/dvstate.c2
-rw-r--r--src/emu/deprecat.h2
-rw-r--r--src/emu/devcb.h4
-rw-r--r--src/emu/devcpu.c325
-rw-r--r--src/emu/devcpu.h135
-rw-r--r--src/emu/devimage.c154
-rw-r--r--src/emu/devintrf.c904
-rw-r--r--src/emu/devintrf.h392
-rw-r--r--src/emu/devlegcy.c205
-rw-r--r--src/emu/devlegcy.h273
-rw-r--r--src/emu/didisasm.c29
-rw-r--r--src/emu/didisasm.h33
-rw-r--r--src/emu/diexec.c453
-rw-r--r--src/emu/diexec.h104
-rw-r--r--src/emu/diimage.c102
-rw-r--r--src/emu/diimage.h47
-rw-r--r--src/emu/dimemory.c230
-rw-r--r--src/emu/dimemory.h58
-rw-r--r--src/emu/dinvram.c29
-rw-r--r--src/emu/dinvram.h21
-rw-r--r--src/emu/dirtc.c29
-rw-r--r--src/emu/dirtc.h21
-rw-r--r--src/emu/disound.c168
-rw-r--r--src/emu/disound.h47
-rw-r--r--src/emu/distate.c136
-rw-r--r--src/emu/distate.h17
-rw-r--r--src/emu/driver.c30
-rw-r--r--src/emu/driver.h25
-rw-r--r--src/emu/emu.h3
-rw-r--r--src/emu/emuopts.c10
-rw-r--r--src/emu/image.c55
-rw-r--r--src/emu/imagedev/bitbngr.c2
-rw-r--r--src/emu/imagedev/cartslot.c80
-rw-r--r--src/emu/imagedev/cartslot.h49
-rw-r--r--src/emu/imagedev/cassette.c10
-rw-r--r--src/emu/imagedev/chd_cd.c8
-rw-r--r--src/emu/imagedev/flopdrv.c12
-rw-r--r--src/emu/imagedev/harddriv.c2
-rw-r--r--src/emu/imagedev/printer.c4
-rw-r--r--src/emu/imagedev/snapquik.c10
-rw-r--r--src/emu/info.c84
-rw-r--r--src/emu/inptport.c18
-rw-r--r--src/emu/inptport.h6
-rw-r--r--src/emu/machine.c170
-rw-r--r--src/emu/machine.h92
-rw-r--r--src/emu/machine/6522via.c104
-rw-r--r--src/emu/machine/6522via.h58
-rw-r--r--src/emu/machine/6526cia.c131
-rw-r--r--src/emu/machine/6526cia.h66
-rw-r--r--src/emu/machine/6532riot.c118
-rw-r--r--src/emu/machine/6532riot.h44
-rw-r--r--src/emu/machine/6821pia.c96
-rw-r--r--src/emu/machine/6821pia.h59
-rw-r--r--src/emu/machine/6840ptm.c44
-rw-r--r--src/emu/machine/6840ptm.h42
-rw-r--r--src/emu/machine/6850acia.c56
-rw-r--r--src/emu/machine/6850acia.h50
-rw-r--r--src/emu/machine/68681.c2
-rw-r--r--src/emu/machine/74123.c77
-rw-r--r--src/emu/machine/74123.h38
-rw-r--r--src/emu/machine/74148.c2
-rw-r--r--src/emu/machine/74153.c2
-rw-r--r--src/emu/machine/7474.c91
-rw-r--r--src/emu/machine/7474.h54
-rw-r--r--src/emu/machine/8237dma.c79
-rw-r--r--src/emu/machine/8237dma.h49
-rw-r--r--src/emu/machine/8255ppi.c49
-rw-r--r--src/emu/machine/8255ppi.h34
-rw-r--r--src/emu/machine/8257dma.c92
-rw-r--r--src/emu/machine/8257dma.h49
-rw-r--r--src/emu/machine/adc0808.c59
-rw-r--r--src/emu/machine/adc0808.h35
-rw-r--r--src/emu/machine/adc083x.c2
-rw-r--r--src/emu/machine/adc1038.c2
-rw-r--r--src/emu/machine/adc1213x.c2
-rw-r--r--src/emu/machine/at28c16.c69
-rw-r--r--src/emu/machine/at28c16.h53
-rw-r--r--src/emu/machine/cdp1852.c80
-rw-r--r--src/emu/machine/cdp1852.h41
-rw-r--r--src/emu/machine/cdp1871.c92
-rw-r--r--src/emu/machine/cdp1871.h67
-rw-r--r--src/emu/machine/com8116.c53
-rw-r--r--src/emu/machine/com8116.h40
-rw-r--r--src/emu/machine/devhelpr.h31
-rw-r--r--src/emu/machine/ds1302.c43
-rw-r--r--src/emu/machine/ds1302.h26
-rw-r--r--src/emu/machine/ds2401.c29
-rw-r--r--src/emu/machine/ds2401.h21
-rw-r--r--src/emu/machine/ds2404.c76
-rw-r--r--src/emu/machine/ds2404.h54
-rw-r--r--src/emu/machine/e0516.c55
-rw-r--r--src/emu/machine/e0516.h27
-rw-r--r--src/emu/machine/eeprom.c212
-rw-r--r--src/emu/machine/eeprom.h97
-rw-r--r--src/emu/machine/er2055.c74
-rw-r--r--src/emu/machine/er2055.h39
-rw-r--r--src/emu/machine/f3853.c57
-rw-r--r--src/emu/machine/f3853.h34
-rw-r--r--src/emu/machine/generic.c6
-rw-r--r--src/emu/machine/i2cmem.c133
-rw-r--r--src/emu/machine/i2cmem.h60
-rw-r--r--src/emu/machine/i8155.c143
-rw-r--r--src/emu/machine/i8155.h57
-rw-r--r--src/emu/machine/i8212.c53
-rw-r--r--src/emu/machine/i8212.h39
-rw-r--r--src/emu/machine/i8214.c74
-rw-r--r--src/emu/machine/i8214.h37
-rw-r--r--src/emu/machine/i8243.c62
-rw-r--r--src/emu/machine/i8243.h43
-rw-r--r--src/emu/machine/i8255.c81
-rw-r--r--src/emu/machine/i8255.h45
-rw-r--r--src/emu/machine/i8355.c130
-rw-r--r--src/emu/machine/i8355.h52
-rw-r--r--src/emu/machine/idectrl.c10
-rw-r--r--src/emu/machine/ins8154.c59
-rw-r--r--src/emu/machine/ins8154.h45
-rw-r--r--src/emu/machine/ins8250.c2
-rw-r--r--src/emu/machine/intelfsh.c209
-rw-r--r--src/emu/machine/intelfsh.h188
-rw-r--r--src/emu/machine/k033906.c37
-rw-r--r--src/emu/machine/k033906.h35
-rw-r--r--src/emu/machine/k056230.c46
-rw-r--r--src/emu/machine/k056230.h45
-rw-r--r--src/emu/machine/latch8.c2
-rw-r--r--src/emu/machine/ldcore.c16
-rw-r--r--src/emu/machine/mb3773.c62
-rw-r--r--src/emu/machine/mb3773.h31
-rw-r--r--src/emu/machine/mb87078.c2
-rw-r--r--src/emu/machine/mc146818.c90
-rw-r--r--src/emu/machine/mc146818.h45
-rw-r--r--src/emu/machine/mc6852.c95
-rw-r--r--src/emu/machine/mc6852.h49
-rw-r--r--src/emu/machine/mc68901.c98
-rw-r--r--src/emu/machine/mc68901.h63
-rw-r--r--src/emu/machine/mm74c922.c109
-rw-r--r--src/emu/machine/mm74c922.h58
-rw-r--r--src/emu/machine/mos6529.c46
-rw-r--r--src/emu/machine/mos6529.h37
-rw-r--r--src/emu/machine/msm5832.c57
-rw-r--r--src/emu/machine/msm5832.h26
-rw-r--r--src/emu/machine/msm58321.c99
-rw-r--r--src/emu/machine/msm58321.h37
-rw-r--r--src/emu/machine/nmc9306.c57
-rw-r--r--src/emu/machine/nmc9306.h28
-rw-r--r--src/emu/machine/nvram.c93
-rw-r--r--src/emu/machine/nvram.h64
-rw-r--r--src/emu/machine/pci.c8
-rw-r--r--src/emu/machine/pci.h2
-rw-r--r--src/emu/machine/pic8259.c2
-rw-r--r--src/emu/machine/pit8253.c2
-rw-r--r--src/emu/machine/ram.c4
-rw-r--r--src/emu/machine/rp5c01.c105
-rw-r--r--src/emu/machine/rp5c01.h38
-rw-r--r--src/emu/machine/rp5c15.c96
-rw-r--r--src/emu/machine/rp5c15.h39
-rw-r--r--src/emu/machine/rp5h01.c2
-rw-r--r--src/emu/machine/rtc65271.c2
-rw-r--r--src/emu/machine/s3c24xx.c2
-rw-r--r--src/emu/machine/secflash.c13
-rw-r--r--src/emu/machine/secflash.h9
-rw-r--r--src/emu/machine/smc91c9x.c6
-rw-r--r--src/emu/machine/timekpr.c208
-rw-r--r--src/emu/machine/timekpr.h72
-rw-r--r--src/emu/machine/tms6100.c2
-rw-r--r--src/emu/machine/upd1990a.c102
-rw-r--r--src/emu/machine/upd1990a.h39
-rw-r--r--src/emu/machine/upd7201.c69
-rw-r--r--src/emu/machine/upd7201.h56
-rw-r--r--src/emu/machine/x2212.c88
-rw-r--r--src/emu/machine/x2212.h55
-rw-r--r--src/emu/machine/x76f041.c25
-rw-r--r--src/emu/machine/x76f041.h20
-rw-r--r--src/emu/machine/x76f100.c29
-rw-r--r--src/emu/machine/x76f100.h20
-rw-r--r--src/emu/machine/z80ctc.c77
-rw-r--r--src/emu/machine/z80ctc.h42
-rw-r--r--src/emu/machine/z80dart.c121
-rw-r--r--src/emu/machine/z80dart.h63
-rw-r--r--src/emu/machine/z80dma.c87
-rw-r--r--src/emu/machine/z80dma.h49
-rw-r--r--src/emu/machine/z80pio.c79
-rw-r--r--src/emu/machine/z80pio.h50
-rw-r--r--src/emu/machine/z80sio.c89
-rw-r--r--src/emu/machine/z80sio.h34
-rw-r--r--src/emu/machine/z80sti.c105
-rw-r--r--src/emu/machine/z80sti.h54
-rw-r--r--src/emu/machine/z8536.c92
-rw-r--r--src/emu/machine/z8536.h47
-rw-r--r--src/emu/mconfig.c37
-rw-r--r--src/emu/mconfig.h54
-rw-r--r--src/emu/memory.c4
-rw-r--r--src/emu/memory.h3
-rw-r--r--src/emu/profiler.c2
-rw-r--r--src/emu/render.c6
-rw-r--r--src/emu/rendlay.c18
-rw-r--r--src/emu/romload.c12
-rw-r--r--src/emu/romload.h2
-rw-r--r--src/emu/schedule.c2
-rw-r--r--src/emu/screen.c298
-rw-r--r--src/emu/screen.h177
-rw-r--r--src/emu/softlist.c18
-rw-r--r--src/emu/sound.c8
-rw-r--r--src/emu/sound/2151intf.c2
-rw-r--r--src/emu/sound/2203intf.c2
-rw-r--r--src/emu/sound/2608intf.c2
-rw-r--r--src/emu/sound/2610intf.c2
-rw-r--r--src/emu/sound/2612intf.c2
-rw-r--r--src/emu/sound/262intf.c2
-rw-r--r--src/emu/sound/3526intf.c2
-rw-r--r--src/emu/sound/3812intf.c2
-rw-r--r--src/emu/sound/8950intf.c2
-rw-r--r--src/emu/sound/aica.c2
-rw-r--r--src/emu/sound/asc.c85
-rw-r--r--src/emu/sound/asc.h44
-rw-r--r--src/emu/sound/ay8910.c4
-rw-r--r--src/emu/sound/bsmt2000.c116
-rw-r--r--src/emu/sound/bsmt2000.h62
-rw-r--r--src/emu/sound/c140.c2
-rw-r--r--src/emu/sound/c6280.c2
-rw-r--r--src/emu/sound/cdda.c4
-rw-r--r--src/emu/sound/cdp1863.c62
-rw-r--r--src/emu/sound/cdp1863.h36
-rw-r--r--src/emu/sound/cdp1864.c135
-rw-r--r--src/emu/sound/cdp1864.h51
-rw-r--r--src/emu/sound/cdp1869.c138
-rw-r--r--src/emu/sound/cdp1869.h57
-rw-r--r--src/emu/sound/cem3394.c2
-rw-r--r--src/emu/sound/discrete.c135
-rw-r--r--src/emu/sound/discrete.h65
-rw-r--r--src/emu/sound/es5503.c2
-rw-r--r--src/emu/sound/es5506.c4
-rw-r--r--src/emu/sound/flt_rc.c2
-rw-r--r--src/emu/sound/gaelco.c2
-rw-r--r--src/emu/sound/ics2115.c34
-rw-r--r--src/emu/sound/ics2115.h35
-rw-r--r--src/emu/sound/k007232.c2
-rw-r--r--src/emu/sound/k053260.c2
-rw-r--r--src/emu/sound/k054539.c2
-rw-r--r--src/emu/sound/k056800.c2
-rw-r--r--src/emu/sound/lmc1992.c46
-rw-r--r--src/emu/sound/lmc1992.h31
-rw-r--r--src/emu/sound/mas3507d.c27
-rw-r--r--src/emu/sound/mas3507d.h19
-rw-r--r--src/emu/sound/mos6560.c4
-rw-r--r--src/emu/sound/msm5205.c2
-rw-r--r--src/emu/sound/msm5232.c2
-rw-r--r--src/emu/sound/namco.c2
-rw-r--r--src/emu/sound/nes_apu.c2
-rw-r--r--src/emu/sound/okim6258.c2
-rw-r--r--src/emu/sound/okim6295.c99
-rw-r--r--src/emu/sound/okim6295.h54
-rw-r--r--src/emu/sound/okim9810.c77
-rw-r--r--src/emu/sound/okim9810.h40
-rw-r--r--src/emu/sound/pokey.c4
-rw-r--r--src/emu/sound/rf5c68.c2
-rw-r--r--src/emu/sound/samples.c2
-rw-r--r--src/emu/sound/scsp.c2
-rw-r--r--src/emu/sound/segapcm.c2
-rw-r--r--src/emu/sound/sid6581.c2
-rw-r--r--src/emu/sound/sn76477.c2
-rw-r--r--src/emu/sound/snkwave.c2
-rw-r--r--src/emu/sound/sp0250.c2
-rw-r--r--src/emu/sound/sp0256.c2
-rw-r--r--src/emu/sound/speaker.c2
-rw-r--r--src/emu/sound/spu.c67
-rw-r--r--src/emu/sound/spu.h33
-rw-r--r--src/emu/sound/st0016.c2
-rw-r--r--src/emu/sound/tms36xx.c2
-rw-r--r--src/emu/sound/tms5110.c6
-rw-r--r--src/emu/sound/tms5220.c2
-rw-r--r--src/emu/sound/upd7759.c2
-rw-r--r--src/emu/sound/vlm5030.c2
-rw-r--r--src/emu/sound/vrender0.c2
-rw-r--r--src/emu/sound/wave.c8
-rw-r--r--src/emu/sound/x1_010.c2
-rw-r--r--src/emu/sound/ymf271.c2
-rw-r--r--src/emu/sound/ymf278b.c2
-rw-r--r--src/emu/sound/ymz280b.c2
-rw-r--r--src/emu/sound/zsg2.c2
-rw-r--r--src/emu/speaker.c93
-rw-r--r--src/emu/speaker.h44
-rw-r--r--src/emu/timer.c175
-rw-r--r--src/emu/timer.h117
-rw-r--r--src/emu/ui.c28
-rw-r--r--src/emu/uiimage.c18
-rw-r--r--src/emu/uimenu.c6
-rw-r--r--src/emu/uiswlist.c16
-rw-r--r--src/emu/validity.c24
-rw-r--r--src/emu/video.c6
-rw-r--r--src/emu/video/cdp1861.c53
-rw-r--r--src/emu/video/cdp1861.h40
-rw-r--r--src/emu/video/cdp1862.c89
-rw-r--r--src/emu/video/cdp1862.h40
-rw-r--r--src/emu/video/crt9007.c159
-rw-r--r--src/emu/video/crt9007.h68
-rw-r--r--src/emu/video/crt9021.c76
-rw-r--r--src/emu/video/crt9021.h40
-rw-r--r--src/emu/video/crt9212.c79
-rw-r--r--src/emu/video/crt9212.h44
-rw-r--r--src/emu/video/dm9368.c79
-rw-r--r--src/emu/video/dm9368.h38
-rw-r--r--src/emu/video/hd44102.c63
-rw-r--r--src/emu/video/hd44102.h39
-rw-r--r--src/emu/video/hd61830.c114
-rw-r--r--src/emu/video/hd61830.h51
-rw-r--r--src/emu/video/hd63484.c2
-rw-r--r--src/emu/video/mc6845.c2
-rw-r--r--src/emu/video/msm6255.c63
-rw-r--r--src/emu/video/msm6255.h35
-rw-r--r--src/emu/video/s2636.c2
-rw-r--r--src/emu/video/saa5050.c2
-rw-r--r--src/emu/video/sed1330.c122
-rw-r--r--src/emu/video/sed1330.h53
-rw-r--r--src/emu/video/tlc34076.c2
-rw-r--r--src/emu/video/tms9927.c2
-rw-r--r--src/emu/video/upd3301.c93
-rw-r--r--src/emu/video/upd3301.h44
-rw-r--r--src/emu/video/voodoo.c12
-rw-r--r--src/ldplayer/ldplayer.c8
-rw-r--r--src/mame/audio/namco52.c2
-rw-r--r--src/mame/audio/namco54.c2
-rw-r--r--src/mame/audio/taitosnd.c2
-rw-r--r--src/mame/drivers/1945kiii.c4
-rw-r--r--src/mame/drivers/2mindril.c4
-rw-r--r--src/mame/drivers/39in1.c4
-rw-r--r--src/mame/drivers/4roses.c4
-rw-r--r--src/mame/drivers/5clown.c4
-rw-r--r--src/mame/drivers/ace.c4
-rw-r--r--src/mame/drivers/acefruit.c4
-rw-r--r--src/mame/drivers/acommand.c4
-rw-r--r--src/mame/drivers/actfancr.c24
-rw-r--r--src/mame/drivers/adp.c4
-rw-r--r--src/mame/drivers/albazc.c4
-rw-r--r--src/mame/drivers/albazg.c4
-rw-r--r--src/mame/drivers/alg.c4
-rw-r--r--src/mame/drivers/alien.c4
-rw-r--r--src/mame/drivers/allied.c4
-rw-r--r--src/mame/drivers/alvg.c4
-rw-r--r--src/mame/drivers/amaticmg.c4
-rw-r--r--src/mame/drivers/arcadia.c4
-rw-r--r--src/mame/drivers/aristmk4.c4
-rw-r--r--src/mame/drivers/aristmk5.c4
-rw-r--r--src/mame/drivers/astinvad.c4
-rw-r--r--src/mame/drivers/astrocorp.c4
-rw-r--r--src/mame/drivers/atari_s1.c4
-rw-r--r--src/mame/drivers/atari_s2.c4
-rw-r--r--src/mame/drivers/atari_s3.c4
-rw-r--r--src/mame/drivers/atarisy4.c4
-rw-r--r--src/mame/drivers/attckufo.c4
-rw-r--r--src/mame/drivers/atvtrack.c4
-rw-r--r--src/mame/drivers/avt.c4
-rw-r--r--src/mame/drivers/backfire.c16
-rw-r--r--src/mame/drivers/bartop52.c4
-rw-r--r--src/mame/drivers/beaminv.c4
-rw-r--r--src/mame/drivers/berzerk.c4
-rw-r--r--src/mame/drivers/bestleag.c4
-rw-r--r--src/mame/drivers/bfcobra.c4
-rw-r--r--src/mame/drivers/bfm_sc1.c4
-rw-r--r--src/mame/drivers/bfm_sc2.c4
-rw-r--r--src/mame/drivers/bfmsys85.c4
-rw-r--r--src/mame/drivers/big10.c4
-rw-r--r--src/mame/drivers/bingo.c4
-rw-r--r--src/mame/drivers/bingoc.c4
-rw-r--r--src/mame/drivers/bingor.c4
-rw-r--r--src/mame/drivers/blackt96.c4
-rw-r--r--src/mame/drivers/blitz.c4
-rw-r--r--src/mame/drivers/blitz68k.c4
-rw-r--r--src/mame/drivers/bmcbowl.c4
-rw-r--r--src/mame/drivers/bnstars.c4
-rw-r--r--src/mame/drivers/boxer.c4
-rw-r--r--src/mame/drivers/buster.c4
-rw-r--r--src/mame/drivers/bwidow.c4
-rw-r--r--src/mame/drivers/by17.c4
-rw-r--r--src/mame/drivers/by35.c4
-rw-r--r--src/mame/drivers/by6803.c4
-rw-r--r--src/mame/drivers/by68701.c4
-rw-r--r--src/mame/drivers/byvid.c4
-rw-r--r--src/mame/drivers/cabaret.c4
-rw-r--r--src/mame/drivers/calchase.c4
-rw-r--r--src/mame/drivers/calorie.c4
-rw-r--r--src/mame/drivers/capcom.c4
-rw-r--r--src/mame/drivers/cardline.c4
-rw-r--r--src/mame/drivers/carrera.c4
-rw-r--r--src/mame/drivers/caswin.c4
-rw-r--r--src/mame/drivers/cb2001.c4
-rw-r--r--src/mame/drivers/cball.c4
-rw-r--r--src/mame/drivers/cbuster.c4
-rw-r--r--src/mame/drivers/cchance.c4
-rw-r--r--src/mame/drivers/cesclass.c4
-rw-r--r--src/mame/drivers/cham24.c4
-rw-r--r--src/mame/drivers/champbwl.c4
-rw-r--r--src/mame/drivers/chanbara.c4
-rw-r--r--src/mame/drivers/chihiro.c4
-rw-r--r--src/mame/drivers/chinsan.c4
-rw-r--r--src/mame/drivers/chsuper.c4
-rw-r--r--src/mame/drivers/clayshoo.c4
-rw-r--r--src/mame/drivers/cmmb.c4
-rw-r--r--src/mame/drivers/cninja.c32
-rw-r--r--src/mame/drivers/cntsteer.c4
-rw-r--r--src/mame/drivers/coinmstr.c4
-rw-r--r--src/mame/drivers/coinmvga.c4
-rw-r--r--src/mame/drivers/comebaby.c4
-rw-r--r--src/mame/drivers/coolridr.c4
-rw-r--r--src/mame/drivers/corona.c4
-rw-r--r--src/mame/drivers/crystal.c4
-rw-r--r--src/mame/drivers/cshooter.c4
-rw-r--r--src/mame/drivers/csplayh5.c4
-rw-r--r--src/mame/drivers/cubeqst.c4
-rw-r--r--src/mame/drivers/cultures.c4
-rw-r--r--src/mame/drivers/cybertnk.c4
-rw-r--r--src/mame/drivers/cyclemb.c4
-rw-r--r--src/mame/drivers/d9final.c4
-rw-r--r--src/mame/drivers/dacholer.c4
-rw-r--r--src/mame/drivers/dai3wksi.c4
-rw-r--r--src/mame/drivers/dambustr.c4
-rw-r--r--src/mame/drivers/darkhors.c4
-rw-r--r--src/mame/drivers/darkseal.c4
-rw-r--r--src/mame/drivers/dblewing.c10
-rw-r--r--src/mame/drivers/ddayjlc.c4
-rw-r--r--src/mame/drivers/ddealer.c4
-rw-r--r--src/mame/drivers/ddz.c4
-rw-r--r--src/mame/drivers/de_1.c4
-rw-r--r--src/mame/drivers/de_2.c4
-rw-r--r--src/mame/drivers/de_3.c4
-rw-r--r--src/mame/drivers/de_3b.c4
-rw-r--r--src/mame/drivers/dec0.c18
-rw-r--r--src/mame/drivers/dec8.c48
-rw-r--r--src/mame/drivers/deco156.c16
-rw-r--r--src/mame/drivers/deco32.c30
-rw-r--r--src/mame/drivers/deco_ld.c4
-rw-r--r--src/mame/drivers/deshoros.c4
-rw-r--r--src/mame/drivers/destroyr.c4
-rw-r--r--src/mame/drivers/dfruit.c4
-rw-r--r--src/mame/drivers/dgpix.c4
-rw-r--r--src/mame/drivers/dietgo.c4
-rw-r--r--src/mame/drivers/discoboy.c4
-rw-r--r--src/mame/drivers/diverboy.c4
-rw-r--r--src/mame/drivers/dlair.c4
-rw-r--r--src/mame/drivers/dmndrby.c4
-rw-r--r--src/mame/drivers/dominob.c4
-rw-r--r--src/mame/drivers/dorachan.c4
-rw-r--r--src/mame/drivers/dotrikun.c4
-rw-r--r--src/mame/drivers/dreamwld.c4
-rw-r--r--src/mame/drivers/drtomy.c4
-rw-r--r--src/mame/drivers/drw80pkr.c4
-rw-r--r--src/mame/drivers/dunhuang.c4
-rw-r--r--src/mame/drivers/dwarfd.c4
-rw-r--r--src/mame/drivers/dynadice.c4
-rw-r--r--src/mame/drivers/egghunt.c4
-rw-r--r--src/mame/drivers/embargo.c4
-rw-r--r--src/mame/drivers/enigma2.c4
-rw-r--r--src/mame/drivers/eolith16.c4
-rw-r--r--src/mame/drivers/ertictac.c4
-rw-r--r--src/mame/drivers/esh.c4
-rw-r--r--src/mame/drivers/ettrivia.c4
-rw-r--r--src/mame/drivers/expro02.c4
-rw-r--r--src/mame/drivers/f-32.c4
-rw-r--r--src/mame/drivers/famibox.c4
-rw-r--r--src/mame/drivers/feversoc.c4
-rw-r--r--src/mame/drivers/firebeat.c8
-rw-r--r--src/mame/drivers/firefox.c4
-rw-r--r--src/mame/drivers/flicker.c4
-rw-r--r--src/mame/drivers/flyball.c4
-rw-r--r--src/mame/drivers/forte2.c4
-rw-r--r--src/mame/drivers/fortecar.c4
-rw-r--r--src/mame/drivers/funkball.c4
-rw-r--r--src/mame/drivers/funkyjet.c4
-rw-r--r--src/mame/drivers/g627.c4
-rw-r--r--src/mame/drivers/gal3.c4
-rw-r--r--src/mame/drivers/galaxi.c4
-rw-r--r--src/mame/drivers/galaxia.c4
-rw-r--r--src/mame/drivers/galpani3.c6
-rw-r--r--src/mame/drivers/gamecstl.c4
-rw-r--r--src/mame/drivers/gei.c4
-rw-r--r--src/mame/drivers/ggconnie.c4
-rw-r--r--src/mame/drivers/ghosteo.c4
-rw-r--r--src/mame/drivers/go2000.c4
-rw-r--r--src/mame/drivers/goldngam.c4
-rw-r--r--src/mame/drivers/goldnpkr.c4
-rw-r--r--src/mame/drivers/good.c4
-rw-r--r--src/mame/drivers/goodejan.c4
-rw-r--r--src/mame/drivers/gottlieb.c2
-rw-r--r--src/mame/drivers/gp_1.c4
-rw-r--r--src/mame/drivers/gp_2.c4
-rw-r--r--src/mame/drivers/gpworld.c4
-rw-r--r--src/mame/drivers/gstream.c4
-rw-r--r--src/mame/drivers/gticlub.c4
-rw-r--r--src/mame/drivers/gts1.c4
-rw-r--r--src/mame/drivers/gts3.c4
-rw-r--r--src/mame/drivers/gts80.c4
-rw-r--r--src/mame/drivers/gts80a.c4
-rw-r--r--src/mame/drivers/gts80b.c4
-rw-r--r--src/mame/drivers/guab.c4
-rw-r--r--src/mame/drivers/gunpey.c4
-rw-r--r--src/mame/drivers/halleys.c4
-rw-r--r--src/mame/drivers/hankin.c4
-rw-r--r--src/mame/drivers/highvdeo.c4
-rw-r--r--src/mame/drivers/hitpoker.c4
-rw-r--r--src/mame/drivers/hornet.c4
-rw-r--r--src/mame/drivers/hotblock.c4
-rw-r--r--src/mame/drivers/hotstuff.c4
-rw-r--r--src/mame/drivers/hvyunit.c4
-rw-r--r--src/mame/drivers/icecold.c4
-rw-r--r--src/mame/drivers/igs009.c4
-rw-r--r--src/mame/drivers/igs011.c4
-rw-r--r--src/mame/drivers/igs017.c4
-rw-r--r--src/mame/drivers/igs_m027.c4
-rw-r--r--src/mame/drivers/igspoker.c4
-rw-r--r--src/mame/drivers/imolagp.c4
-rw-r--r--src/mame/drivers/inder.c4
-rw-r--r--src/mame/drivers/intrscti.c4
-rw-r--r--src/mame/drivers/istellar.c4
-rw-r--r--src/mame/drivers/itgambl2.c4
-rw-r--r--src/mame/drivers/itgambl3.c4
-rw-r--r--src/mame/drivers/itgamble.c4
-rw-r--r--src/mame/drivers/jackie.c4
-rw-r--r--src/mame/drivers/jackpool.c4
-rw-r--r--src/mame/drivers/jaguar.c4
-rw-r--r--src/mame/drivers/jalmah.c4
-rw-r--r--src/mame/drivers/jangou.c4
-rw-r--r--src/mame/drivers/jantotsu.c4
-rw-r--r--src/mame/drivers/jchan.c8
-rw-r--r--src/mame/drivers/jokrwild.c4
-rw-r--r--src/mame/drivers/jollyjgr.c4
-rw-r--r--src/mame/drivers/jongkyo.c4
-rw-r--r--src/mame/drivers/jp.c4
-rw-r--r--src/mame/drivers/jpmsys5.c4
-rw-r--r--src/mame/drivers/jrpacman.c4
-rw-r--r--src/mame/drivers/jubilee.c4
-rw-r--r--src/mame/drivers/junofrst.c4
-rw-r--r--src/mame/drivers/jvh.c4
-rw-r--r--src/mame/drivers/karnov.c8
-rw-r--r--src/mame/drivers/kingdrby.c4
-rw-r--r--src/mame/drivers/kingpin.c4
-rw-r--r--src/mame/drivers/kinst.c4
-rw-r--r--src/mame/drivers/kissproto.c4
-rw-r--r--src/mame/drivers/koftball.c4
-rw-r--r--src/mame/drivers/koikoi.c4
-rw-r--r--src/mame/drivers/konamigq.c4
-rw-r--r--src/mame/drivers/konamigv.c4
-rw-r--r--src/mame/drivers/konamim2.c4
-rw-r--r--src/mame/drivers/kongambl.c4
-rw-r--r--src/mame/drivers/ksys573.c4
-rw-r--r--src/mame/drivers/kungfur.c4
-rw-r--r--src/mame/drivers/laserbas.c4
-rw-r--r--src/mame/drivers/lastbank.c4
-rw-r--r--src/mame/drivers/lastfght.c4
-rw-r--r--src/mame/drivers/lgp.c4
-rw-r--r--src/mame/drivers/limenko.c4
-rw-r--r--src/mame/drivers/littlerb.c42
-rw-r--r--src/mame/drivers/looping.c4
-rw-r--r--src/mame/drivers/ltcasino.c4
-rw-r--r--src/mame/drivers/ltd.c4
-rw-r--r--src/mame/drivers/luckgrln.c4
-rw-r--r--src/mame/drivers/m14.c4
-rw-r--r--src/mame/drivers/m63.c4
-rw-r--r--src/mame/drivers/m79amb.c4
-rw-r--r--src/mame/drivers/macs.c4
-rw-r--r--src/mame/drivers/madmotor.c18
-rw-r--r--src/mame/drivers/magic10.c4
-rw-r--r--src/mame/drivers/magicard.c4
-rw-r--r--src/mame/drivers/magicfly.c4
-rw-r--r--src/mame/drivers/magictg.c4
-rw-r--r--src/mame/drivers/magtouch.c4
-rw-r--r--src/mame/drivers/majorpkr.c2
-rw-r--r--src/mame/drivers/marinedt.c4
-rw-r--r--src/mame/drivers/mastboy.c4
-rw-r--r--src/mame/drivers/maxaflex.c4
-rw-r--r--src/mame/drivers/maygay1b.c4
-rw-r--r--src/mame/drivers/maygayv1.c4
-rw-r--r--src/mame/drivers/mayumi.c4
-rw-r--r--src/mame/drivers/mazerbla.c4
-rw-r--r--src/mame/drivers/mediagx.c4
-rw-r--r--src/mame/drivers/meijinsn.c4
-rw-r--r--src/mame/drivers/mephisto.c4
-rw-r--r--src/mame/drivers/merit.c4
-rw-r--r--src/mame/drivers/meritm.c4
-rw-r--r--src/mame/drivers/mgolf.c4
-rw-r--r--src/mame/drivers/micropin.c4
-rw-r--r--src/mame/drivers/midas.c4
-rw-r--r--src/mame/drivers/midqslvr.c4
-rw-r--r--src/mame/drivers/mil4000.c4
-rw-r--r--src/mame/drivers/miniboy7.c4
-rw-r--r--src/mame/drivers/minivadr.c4
-rw-r--r--src/mame/drivers/mirage.c8
-rw-r--r--src/mame/drivers/mirax.c4
-rw-r--r--src/mame/drivers/missb2.c4
-rw-r--r--src/mame/drivers/missile.c4
-rw-r--r--src/mame/drivers/mjsister.c4
-rw-r--r--src/mame/drivers/mlanding.c4
-rw-r--r--src/mame/drivers/mogura.c4
-rw-r--r--src/mame/drivers/mole.c4
-rw-r--r--src/mame/drivers/monzagp.c4
-rw-r--r--src/mame/drivers/mpoker.c4
-rw-r--r--src/mame/drivers/mpu3.c4
-rw-r--r--src/mame/drivers/mpu4.c4
-rw-r--r--src/mame/drivers/mpu5.c4
-rw-r--r--src/mame/drivers/mrgame.c4
-rw-r--r--src/mame/drivers/multfish.c4
-rw-r--r--src/mame/drivers/multigam.c4
-rw-r--r--src/mame/drivers/murogem.c4
-rw-r--r--src/mame/drivers/murogmbl.c4
-rw-r--r--src/mame/drivers/mw18w.c4
-rw-r--r--src/mame/drivers/mwarr.c4
-rw-r--r--src/mame/drivers/namcops2.c4
-rw-r--r--src/mame/drivers/namcos10.c4
-rw-r--r--src/mame/drivers/namcos11.c4
-rw-r--r--src/mame/drivers/namcos12.c4
-rw-r--r--src/mame/drivers/namcos23.c4
-rw-r--r--src/mame/drivers/neoprint.c4
-rw-r--r--src/mame/drivers/neptunp2.c4
-rw-r--r--src/mame/drivers/nightgal.c4
-rw-r--r--src/mame/drivers/nmg5.c4
-rw-r--r--src/mame/drivers/nsm.c4
-rw-r--r--src/mame/drivers/nsmpoker.c4
-rw-r--r--src/mame/drivers/nss.c4
-rw-r--r--src/mame/drivers/nwk-tr.c4
-rw-r--r--src/mame/drivers/nyny.c4
-rw-r--r--src/mame/drivers/olibochu.c4
-rw-r--r--src/mame/drivers/omegrace.c4
-rw-r--r--src/mame/drivers/onetwo.c4
-rw-r--r--src/mame/drivers/othello.c4
-rw-r--r--src/mame/drivers/pachifev.c4
-rw-r--r--src/mame/drivers/pangofun.c4
-rw-r--r--src/mame/drivers/panicr.c4
-rw-r--r--src/mame/drivers/paranoia.c4
-rw-r--r--src/mame/drivers/pasha2.c4
-rw-r--r--src/mame/drivers/pcat_dyn.c4
-rw-r--r--src/mame/drivers/pcat_nit.c4
-rw-r--r--src/mame/drivers/pcktgal.c4
-rw-r--r--src/mame/drivers/pcxt.c4
-rw-r--r--src/mame/drivers/pengadvb.c4
-rw-r--r--src/mame/drivers/pengo.c4
-rw-r--r--src/mame/drivers/peplus.c4
-rw-r--r--src/mame/drivers/peyper.c4
-rw-r--r--src/mame/drivers/pgm.c4
-rw-r--r--src/mame/drivers/photon.c4
-rw-r--r--src/mame/drivers/photon2.c4
-rw-r--r--src/mame/drivers/photoply.c4
-rw-r--r--src/mame/drivers/pinkiri8.c64
-rw-r--r--src/mame/drivers/pipeline.c4
-rw-r--r--src/mame/drivers/pkscram.c4
-rw-r--r--src/mame/drivers/pktgaldx.c4
-rw-r--r--src/mame/drivers/play_1.c4
-rw-r--r--src/mame/drivers/play_2.c4
-rw-r--r--src/mame/drivers/play_3.c4
-rw-r--r--src/mame/drivers/play_5.c4
-rw-r--r--src/mame/drivers/pntnpuzl.c4
-rw-r--r--src/mame/drivers/poker72.c4
-rw-r--r--src/mame/drivers/poo.c4
-rw-r--r--src/mame/drivers/ppmast93.c4
-rw-r--r--src/mame/drivers/progolf.c4
-rw-r--r--src/mame/drivers/psattack.c4
-rw-r--r--src/mame/drivers/pturn.c4
-rw-r--r--src/mame/drivers/pzletime.c4
-rw-r--r--src/mame/drivers/quakeat.c4
-rw-r--r--src/mame/drivers/quantum.c4
-rw-r--r--src/mame/drivers/queen.c4
-rw-r--r--src/mame/drivers/quizo.c4
-rw-r--r--src/mame/drivers/quizpun2.c4
-rw-r--r--src/mame/drivers/r2dtank.c4
-rw-r--r--src/mame/drivers/r2dx_v33.c4
-rw-r--r--src/mame/drivers/rabbit.c4
-rw-r--r--src/mame/drivers/rbmk.c4
-rw-r--r--src/mame/drivers/rcorsair.c4
-rw-r--r--src/mame/drivers/re900.c4
-rw-r--r--src/mame/drivers/rgum.c4
-rw-r--r--src/mame/drivers/rmhaihai.c4
-rw-r--r--src/mame/drivers/rotaryf.c4
-rw-r--r--src/mame/drivers/roul.c4
-rw-r--r--src/mame/drivers/rowamet.c4
-rw-r--r--src/mame/drivers/royalmah.c4
-rw-r--r--src/mame/drivers/s11.c4
-rw-r--r--src/mame/drivers/s11a.c4
-rw-r--r--src/mame/drivers/s11b.c4
-rw-r--r--src/mame/drivers/s11c.c4
-rw-r--r--src/mame/drivers/s3.c4
-rw-r--r--src/mame/drivers/s4.c4
-rw-r--r--src/mame/drivers/s6.c4
-rw-r--r--src/mame/drivers/s6a.c4
-rw-r--r--src/mame/drivers/s7.c4
-rw-r--r--src/mame/drivers/s8.c4
-rw-r--r--src/mame/drivers/s9.c4
-rw-r--r--src/mame/drivers/safarir.c4
-rw-r--r--src/mame/drivers/sandscrp.c4
-rw-r--r--src/mame/drivers/sangho.c4
-rw-r--r--src/mame/drivers/savquest.c4
-rw-r--r--src/mame/drivers/sbowling.c4
-rw-r--r--src/mame/drivers/sbrkout.c4
-rw-r--r--src/mame/drivers/scobra.c4
-rw-r--r--src/mame/drivers/seattle.c4
-rw-r--r--src/mame/drivers/segald.c4
-rw-r--r--src/mame/drivers/sengokmj.c4
-rw-r--r--src/mame/drivers/sfbonus.c4
-rw-r--r--src/mame/drivers/sfkick.c4
-rw-r--r--src/mame/drivers/sg1000a.c4
-rw-r--r--src/mame/drivers/shanghai.c4
-rw-r--r--src/mame/drivers/shougi.c4
-rw-r--r--src/mame/drivers/sigmab52.c4
-rw-r--r--src/mame/drivers/sigmab98.c4
-rw-r--r--src/mame/drivers/simpl156.c6
-rw-r--r--src/mame/drivers/skeetsht.c4
-rw-r--r--src/mame/drivers/skimaxx.c4
-rw-r--r--src/mame/drivers/skyarmy.c4
-rw-r--r--src/mame/drivers/skylncr.c4
-rw-r--r--src/mame/drivers/sleic.c4
-rw-r--r--src/mame/drivers/sliver.c4
-rw-r--r--src/mame/drivers/slotcarn.c4
-rw-r--r--src/mame/drivers/sms.c4
-rw-r--r--src/mame/drivers/snesb.c4
-rw-r--r--src/mame/drivers/sothello.c4
-rw-r--r--src/mame/drivers/spaceg.c4
-rw-r--r--src/mame/drivers/speglsht.c4
-rw-r--r--src/mame/drivers/spinb.c4
-rw-r--r--src/mame/drivers/spoker.c4
-rw-r--r--src/mame/drivers/spool99.c4
-rw-r--r--src/mame/drivers/srmp5.c4
-rw-r--r--src/mame/drivers/srmp6.c4
-rw-r--r--src/mame/drivers/ssfindo.c4
-rw-r--r--src/mame/drivers/sshangha.c8
-rw-r--r--src/mame/drivers/ssingles.c4
-rw-r--r--src/mame/drivers/sstrangr.c4
-rw-r--r--src/mame/drivers/st_mp100.c4
-rw-r--r--src/mame/drivers/st_mp200.c4
-rw-r--r--src/mame/drivers/stadhero.c8
-rw-r--r--src/mame/drivers/statriv2.c4
-rw-r--r--src/mame/drivers/stepstag.c4
-rw-r--r--src/mame/drivers/sub.c4
-rw-r--r--src/mame/drivers/subsino.c4
-rw-r--r--src/mame/drivers/subsino2.c4
-rw-r--r--src/mame/drivers/supbtime.c8
-rw-r--r--src/mame/drivers/supdrapo.c4
-rw-r--r--src/mame/drivers/superdq.c4
-rw-r--r--src/mame/drivers/supertnk.c4
-rw-r--r--src/mame/drivers/suprgolf.c4
-rw-r--r--src/mame/drivers/suprnova.c2
-rw-r--r--src/mame/drivers/taito.c4
-rw-r--r--src/mame/drivers/taito_x.c4
-rw-r--r--src/mame/drivers/taitogn.c4
-rw-r--r--src/mame/drivers/taitopjc.c4
-rw-r--r--src/mame/drivers/taitotz.c4
-rw-r--r--src/mame/drivers/taitowlf.c4
-rw-r--r--src/mame/drivers/tattack.c4
-rw-r--r--src/mame/drivers/tcl.c4
-rw-r--r--src/mame/drivers/techno.c4
-rw-r--r--src/mame/drivers/tempest.c4
-rw-r--r--src/mame/drivers/tgtpanic.c4
-rw-r--r--src/mame/drivers/thayers.c4
-rw-r--r--src/mame/drivers/tickee.c4
-rw-r--r--src/mame/drivers/timetrv.c4
-rw-r--r--src/mame/drivers/tmaster.c4
-rw-r--r--src/mame/drivers/tmmjprd.c4
-rw-r--r--src/mame/drivers/tokyocop.c4
-rw-r--r--src/mame/drivers/tomcat.c4
-rw-r--r--src/mame/drivers/toratora.c4
-rw-r--r--src/mame/drivers/tourtabl.c4
-rw-r--r--src/mame/drivers/trvmadns.c4
-rw-r--r--src/mame/drivers/ttchamp.c4
-rw-r--r--src/mame/drivers/tugboat.c4
-rw-r--r--src/mame/drivers/tumblep.c4
-rw-r--r--src/mame/drivers/turrett.c4
-rw-r--r--src/mame/drivers/twinkle.c4
-rw-r--r--src/mame/drivers/twins.c4
-rw-r--r--src/mame/drivers/uapce.c4
-rw-r--r--src/mame/drivers/ultrsprt.c4
-rw-r--r--src/mame/drivers/upscope.c4
-rw-r--r--src/mame/drivers/vamphalf.c4
-rw-r--r--src/mame/drivers/vaportra.c4
-rw-r--r--src/mame/drivers/vcombat.c4
-rw-r--r--src/mame/drivers/vd.c4
-rw-r--r--src/mame/drivers/vega.c4
-rw-r--r--src/mame/drivers/vegaeo.c4
-rw-r--r--src/mame/drivers/vegas.c4
-rw-r--r--src/mame/drivers/videopkr.c4
-rw-r--r--src/mame/drivers/viper.c6
-rw-r--r--src/mame/drivers/vmetal.c4
-rw-r--r--src/mame/drivers/vp101.c4
-rw-r--r--src/mame/drivers/vpoker.c4
-rw-r--r--src/mame/drivers/vroulet.c4
-rw-r--r--src/mame/drivers/wallc.c4
-rw-r--r--src/mame/drivers/wardner.c4
-rw-r--r--src/mame/drivers/wheelfir.c4
-rw-r--r--src/mame/drivers/white_mod.c4
-rw-r--r--src/mame/drivers/whitestar.c4
-rw-r--r--src/mame/drivers/wico.c4
-rw-r--r--src/mame/drivers/wink.c4
-rw-r--r--src/mame/drivers/witch.c4
-rw-r--r--src/mame/drivers/wldarrow.c4
-rw-r--r--src/mame/drivers/wpc_95.c4
-rw-r--r--src/mame/drivers/wpc_an.c4
-rw-r--r--src/mame/drivers/wpc_dcs.c4
-rw-r--r--src/mame/drivers/wpc_dot.c4
-rw-r--r--src/mame/drivers/wpc_flip1.c4
-rw-r--r--src/mame/drivers/wpc_flip2.c4
-rw-r--r--src/mame/drivers/wpc_s.c4
-rw-r--r--src/mame/drivers/xtheball.c4
-rw-r--r--src/mame/drivers/xtom3d.c4
-rw-r--r--src/mame/drivers/zac_1.c4
-rw-r--r--src/mame/drivers/zac_2.c4
-rw-r--r--src/mame/drivers/zac_proto.c4
-rw-r--r--src/mame/drivers/zn.c4
-rw-r--r--src/mame/drivers/zr107.c4
-rw-r--r--src/mame/includes/1942.h4
-rw-r--r--src/mame/includes/1943.h4
-rw-r--r--src/mame/includes/20pacgal.h4
-rw-r--r--src/mame/includes/40love.h4
-rw-r--r--src/mame/includes/4enraya.h4
-rw-r--r--src/mame/includes/8080bw.h4
-rw-r--r--src/mame/includes/88games.h4
-rw-r--r--src/mame/includes/actfancr.h4
-rw-r--r--src/mame/includes/aeroboto.h4
-rw-r--r--src/mame/includes/aerofgt.h4
-rw-r--r--src/mame/includes/airbustr.h4
-rw-r--r--src/mame/includes/ajax.h4
-rw-r--r--src/mame/includes/aliens.h4
-rw-r--r--src/mame/includes/alpha68k.h4
-rw-r--r--src/mame/includes/ambush.h4
-rw-r--r--src/mame/includes/amiga.h4
-rw-r--r--src/mame/includes/ampoker2.h4
-rw-r--r--src/mame/includes/amspdwy.h4
-rw-r--r--src/mame/includes/angelkds.h4
-rw-r--r--src/mame/includes/appoooh.h4
-rw-r--r--src/mame/includes/aquarium.h4
-rw-r--r--src/mame/includes/arabian.h4
-rw-r--r--src/mame/includes/arcadecl.h4
-rw-r--r--src/mame/includes/argus.h4
-rw-r--r--src/mame/includes/arkanoid.h4
-rw-r--r--src/mame/includes/armedf.h8
-rw-r--r--src/mame/includes/artmagic.h4
-rw-r--r--src/mame/includes/ashnojoe.h4
-rw-r--r--src/mame/includes/asterix.h4
-rw-r--r--src/mame/includes/asteroid.h4
-rw-r--r--src/mame/includes/astrocde.h4
-rw-r--r--src/mame/includes/astrof.h4
-rw-r--r--src/mame/includes/asuka.h4
-rw-r--r--src/mame/includes/atarifb.h4
-rw-r--r--src/mame/includes/atarig1.h4
-rw-r--r--src/mame/includes/atarig42.h4
-rw-r--r--src/mame/includes/atarigt.h4
-rw-r--r--src/mame/includes/atarigx2.h4
-rw-r--r--src/mame/includes/atarisy1.h4
-rw-r--r--src/mame/includes/atarisy2.h4
-rw-r--r--src/mame/includes/atetris.h4
-rw-r--r--src/mame/includes/avalnche.h4
-rw-r--r--src/mame/includes/aztarac.h4
-rw-r--r--src/mame/includes/badlands.h4
-rw-r--r--src/mame/includes/bagman.h4
-rw-r--r--src/mame/includes/balsente.h4
-rw-r--r--src/mame/includes/bankp.h4
-rw-r--r--src/mame/includes/baraduke.h4
-rw-r--r--src/mame/includes/batman.h4
-rw-r--r--src/mame/includes/battlane.h4
-rw-r--r--src/mame/includes/battlera.h4
-rw-r--r--src/mame/includes/battlex.h4
-rw-r--r--src/mame/includes/battlnts.h4
-rw-r--r--src/mame/includes/bbusters.h4
-rw-r--r--src/mame/includes/beathead.h4
-rw-r--r--src/mame/includes/beezer.h4
-rw-r--r--src/mame/includes/bigevglf.h4
-rw-r--r--src/mame/includes/bigstrkb.h4
-rw-r--r--src/mame/includes/bionicc.h4
-rw-r--r--src/mame/includes/bishi.h4
-rw-r--r--src/mame/includes/bking.h4
-rw-r--r--src/mame/includes/bladestl.h4
-rw-r--r--src/mame/includes/blktiger.h4
-rw-r--r--src/mame/includes/blmbycar.h4
-rw-r--r--src/mame/includes/blockade.h4
-rw-r--r--src/mame/includes/blockhl.h4
-rw-r--r--src/mame/includes/blockout.h4
-rw-r--r--src/mame/includes/bloodbro.h4
-rw-r--r--src/mame/includes/blstroid.h4
-rw-r--r--src/mame/includes/blueprnt.h4
-rw-r--r--src/mame/includes/bogeyman.h4
-rw-r--r--src/mame/includes/bombjack.h4
-rw-r--r--src/mame/includes/boogwing.h4
-rw-r--r--src/mame/includes/bottom9.h4
-rw-r--r--src/mame/includes/brkthru.h4
-rw-r--r--src/mame/includes/bsktball.h4
-rw-r--r--src/mame/includes/btime.h4
-rw-r--r--src/mame/includes/btoads.h4
-rw-r--r--src/mame/includes/bublbobl.h4
-rw-r--r--src/mame/includes/buggychl.h4
-rw-r--r--src/mame/includes/bwing.h4
-rw-r--r--src/mame/includes/bzone.h4
-rw-r--r--src/mame/includes/cabal.h4
-rw-r--r--src/mame/includes/calomega.h4
-rw-r--r--src/mame/includes/canyon.h4
-rw-r--r--src/mame/includes/capbowl.h4
-rw-r--r--src/mame/includes/carjmbre.h4
-rw-r--r--src/mame/includes/carpolo.h4
-rw-r--r--src/mame/includes/cave.h4
-rw-r--r--src/mame/includes/cbasebal.h4
-rw-r--r--src/mame/includes/cbuster.h4
-rw-r--r--src/mame/includes/ccastles.h4
-rw-r--r--src/mame/includes/cchasm.h4
-rw-r--r--src/mame/includes/cclimber.h4
-rw-r--r--src/mame/includes/cd32.h4
-rw-r--r--src/mame/includes/cdi.h4
-rw-r--r--src/mame/includes/centiped.h4
-rw-r--r--src/mame/includes/chaknpop.h4
-rw-r--r--src/mame/includes/champbas.h4
-rw-r--r--src/mame/includes/changela.h4
-rw-r--r--src/mame/includes/cheekyms.h4
-rw-r--r--src/mame/includes/chqflag.h4
-rw-r--r--src/mame/includes/cidelsa.h8
-rw-r--r--src/mame/includes/cinemat.h4
-rw-r--r--src/mame/includes/circus.h4
-rw-r--r--src/mame/includes/circusc.h4
-rw-r--r--src/mame/includes/cischeat.h4
-rw-r--r--src/mame/includes/citycon.h4
-rw-r--r--src/mame/includes/cloak.h4
-rw-r--r--src/mame/includes/cloud9.h4
-rw-r--r--src/mame/includes/clshroad.h4
-rw-r--r--src/mame/includes/cninja.h4
-rw-r--r--src/mame/includes/combatsc.h4
-rw-r--r--src/mame/includes/commando.h4
-rw-r--r--src/mame/includes/compgolf.h4
-rw-r--r--src/mame/includes/contra.h4
-rw-r--r--src/mame/includes/coolpool.h4
-rw-r--r--src/mame/includes/cop01.h4
-rw-r--r--src/mame/includes/copsnrob.h4
-rw-r--r--src/mame/includes/cosmic.h4
-rw-r--r--src/mame/includes/cps1.h4
-rw-r--r--src/mame/includes/cps3.h4
-rw-r--r--src/mame/includes/crbaloon.h4
-rw-r--r--src/mame/includes/crgolf.h4
-rw-r--r--src/mame/includes/crimfght.h4
-rw-r--r--src/mame/includes/crospang.h4
-rw-r--r--src/mame/includes/crshrace.h4
-rw-r--r--src/mame/includes/cvs.h8
-rw-r--r--src/mame/includes/cyberbal.h4
-rw-r--r--src/mame/includes/darius.h4
-rw-r--r--src/mame/includes/darkmist.h4
-rw-r--r--src/mame/includes/darkseal.h4
-rw-r--r--src/mame/includes/dassault.h4
-rw-r--r--src/mame/includes/dbz.h4
-rw-r--r--src/mame/includes/dcheese.h4
-rw-r--r--src/mame/includes/dcon.h4
-rw-r--r--src/mame/includes/dday.h4
-rw-r--r--src/mame/includes/ddragon.h4
-rw-r--r--src/mame/includes/ddragon3.h4
-rw-r--r--src/mame/includes/ddribble.h4
-rw-r--r--src/mame/includes/deadang.h4
-rw-r--r--src/mame/includes/dec0.h4
-rw-r--r--src/mame/includes/dec8.h4
-rw-r--r--src/mame/includes/deco32.h8
-rw-r--r--src/mame/includes/deco_mlc.h4
-rw-r--r--src/mame/includes/deniam.h4
-rw-r--r--src/mame/includes/dietgo.h4
-rw-r--r--src/mame/includes/djboy.h4
-rw-r--r--src/mame/includes/djmain.h4
-rw-r--r--src/mame/includes/dkong.h4
-rw-r--r--src/mame/includes/docastle.h4
-rw-r--r--src/mame/includes/dogfgt.h4
-rw-r--r--src/mame/includes/dooyong.h4
-rw-r--r--src/mame/includes/dragrace.h4
-rw-r--r--src/mame/includes/drgnmst.h4
-rw-r--r--src/mame/includes/dribling.h4
-rw-r--r--src/mame/includes/drmicro.h4
-rw-r--r--src/mame/includes/dynax.h4
-rw-r--r--src/mame/includes/dynduke.h4
-rw-r--r--src/mame/includes/eolith.h4
-rw-r--r--src/mame/includes/epos.h4
-rw-r--r--src/mame/includes/eprom.h4
-rw-r--r--src/mame/includes/equites.h4
-rw-r--r--src/mame/includes/esd16.h4
-rw-r--r--src/mame/includes/espial.h4
-rw-r--r--src/mame/includes/esripsys.h4
-rw-r--r--src/mame/includes/exedexes.h4
-rw-r--r--src/mame/includes/exerion.h4
-rw-r--r--src/mame/includes/exidy.h4
-rw-r--r--src/mame/includes/exidy440.h4
-rw-r--r--src/mame/includes/exprraid.h4
-rw-r--r--src/mame/includes/exterm.h4
-rw-r--r--src/mame/includes/exzisus.h4
-rw-r--r--src/mame/includes/f1gp.h4
-rw-r--r--src/mame/includes/fantland.h4
-rw-r--r--src/mame/includes/fastfred.h4
-rw-r--r--src/mame/includes/fastlane.h4
-rw-r--r--src/mame/includes/fcombat.h4
-rw-r--r--src/mame/includes/fgoal.h4
-rw-r--r--src/mame/includes/finalizr.h4
-rw-r--r--src/mame/includes/firetrap.h4
-rw-r--r--src/mame/includes/firetrk.h4
-rw-r--r--src/mame/includes/fitfight.h4
-rw-r--r--src/mame/includes/flkatck.h4
-rw-r--r--src/mame/includes/flower.h4
-rw-r--r--src/mame/includes/flstory.h4
-rw-r--r--src/mame/includes/foodf.h4
-rw-r--r--src/mame/includes/freekick.h4
-rw-r--r--src/mame/includes/fromanc2.h4
-rw-r--r--src/mame/includes/fromance.h4
-rw-r--r--src/mame/includes/funkybee.h4
-rw-r--r--src/mame/includes/funkyjet.h4
-rw-r--r--src/mame/includes/funworld.h4
-rw-r--r--src/mame/includes/funybubl.h4
-rw-r--r--src/mame/includes/fuukifg2.h4
-rw-r--r--src/mame/includes/fuukifg3.h4
-rw-r--r--src/mame/includes/gaelco.h4
-rw-r--r--src/mame/includes/gaelco2.h4
-rw-r--r--src/mame/includes/gaelco3d.h4
-rw-r--r--src/mame/includes/gaiden.h4
-rw-r--r--src/mame/includes/galaga.h16
-rw-r--r--src/mame/includes/galastrm.h4
-rw-r--r--src/mame/includes/galaxian.h4
-rw-r--r--src/mame/includes/galaxold.h4
-rw-r--r--src/mame/includes/galivan.h4
-rw-r--r--src/mame/includes/galpani2.h4
-rw-r--r--src/mame/includes/galpanic.h4
-rw-r--r--src/mame/includes/galspnbl.h4
-rw-r--r--src/mame/includes/gameplan.h4
-rw-r--r--src/mame/includes/gaplus.h4
-rw-r--r--src/mame/includes/gatron.h4
-rw-r--r--src/mame/includes/gauntlet.h4
-rw-r--r--src/mame/includes/gberet.h4
-rw-r--r--src/mame/includes/gbusters.h4
-rw-r--r--src/mame/includes/gcpinbal.h4
-rw-r--r--src/mame/includes/gijoe.h4
-rw-r--r--src/mame/includes/ginganin.h4
-rw-r--r--src/mame/includes/gladiatr.h4
-rw-r--r--src/mame/includes/glass.h4
-rw-r--r--src/mame/includes/gng.h4
-rw-r--r--src/mame/includes/goal92.h4
-rw-r--r--src/mame/includes/goindol.h4
-rw-r--r--src/mame/includes/goldstar.h4
-rw-r--r--src/mame/includes/gomoku.h4
-rw-r--r--src/mame/includes/gotcha.h4
-rw-r--r--src/mame/includes/gottlieb.h4
-rw-r--r--src/mame/includes/gotya.h4
-rw-r--r--src/mame/includes/gradius3.h4
-rw-r--r--src/mame/includes/grchamp.h4
-rw-r--r--src/mame/includes/gridlee.h4
-rw-r--r--src/mame/includes/groundfx.h4
-rw-r--r--src/mame/includes/gstriker.h4
-rw-r--r--src/mame/includes/gsword.h4
-rw-r--r--src/mame/includes/gumbo.h4
-rw-r--r--src/mame/includes/gunbustr.h4
-rw-r--r--src/mame/includes/gundealr.h4
-rw-r--r--src/mame/includes/gunsmoke.h4
-rw-r--r--src/mame/includes/gyruss.h4
-rw-r--r--src/mame/includes/hanaawas.h4
-rw-r--r--src/mame/includes/harddriv.h4
-rw-r--r--src/mame/includes/hcastle.h4
-rw-r--r--src/mame/includes/hexion.h4
-rw-r--r--src/mame/includes/higemaru.h4
-rw-r--r--src/mame/includes/himesiki.h4
-rw-r--r--src/mame/includes/hitme.h4
-rw-r--r--src/mame/includes/hnayayoi.h4
-rw-r--r--src/mame/includes/hng64.h4
-rw-r--r--src/mame/includes/holeland.h4
-rw-r--r--src/mame/includes/homedata.h4
-rw-r--r--src/mame/includes/homerun.h4
-rw-r--r--src/mame/includes/hyhoo.h4
-rw-r--r--src/mame/includes/hyperspt.h4
-rw-r--r--src/mame/includes/hyprduel.h4
-rw-r--r--src/mame/includes/ikki.h4
-rw-r--r--src/mame/includes/inufuku.h4
-rw-r--r--src/mame/includes/iqblock.h4
-rw-r--r--src/mame/includes/irobot.h4
-rw-r--r--src/mame/includes/ironhors.h4
-rw-r--r--src/mame/includes/itech32.h4
-rw-r--r--src/mame/includes/itech8.h4
-rw-r--r--src/mame/includes/jack.h4
-rw-r--r--src/mame/includes/jackal.h4
-rw-r--r--src/mame/includes/jailbrek.h4
-rw-r--r--src/mame/includes/jedi.h4
-rw-r--r--src/mame/includes/jpmimpct.h4
-rw-r--r--src/mame/includes/kaneko16.h4
-rw-r--r--src/mame/includes/kangaroo.h4
-rw-r--r--src/mame/includes/karnov.h4
-rw-r--r--src/mame/includes/kchamp.h4
-rw-r--r--src/mame/includes/kickgoal.h4
-rw-r--r--src/mame/includes/kingobox.h4
-rw-r--r--src/mame/includes/klax.h4
-rw-r--r--src/mame/includes/kncljoe.h4
-rw-r--r--src/mame/includes/kopunch.h4
-rw-r--r--src/mame/includes/ksayakyu.h4
-rw-r--r--src/mame/includes/kyugo.h4
-rw-r--r--src/mame/includes/labyrunr.h4
-rw-r--r--src/mame/includes/ladybug.h4
-rw-r--r--src/mame/includes/ladyfrog.h4
-rw-r--r--src/mame/includes/laserbat.h4
-rw-r--r--src/mame/includes/lasso.h4
-rw-r--r--src/mame/includes/lastduel.h4
-rw-r--r--src/mame/includes/lazercmd.h4
-rw-r--r--src/mame/includes/legionna.h4
-rw-r--r--src/mame/includes/leland.h4
-rw-r--r--src/mame/includes/lemmings.h4
-rw-r--r--src/mame/includes/lethal.h4
-rw-r--r--src/mame/includes/lethalj.h4
-rw-r--r--src/mame/includes/liberate.h4
-rw-r--r--src/mame/includes/liberatr.h4
-rw-r--r--src/mame/includes/lkage.h4
-rw-r--r--src/mame/includes/lockon.h4
-rw-r--r--src/mame/includes/lordgun.h4
-rw-r--r--src/mame/includes/lsasquad.h4
-rw-r--r--src/mame/includes/lucky74.h4
-rw-r--r--src/mame/includes/lvcards.h4
-rw-r--r--src/mame/includes/lwings.h4
-rw-r--r--src/mame/includes/m10.h4
-rw-r--r--src/mame/includes/m107.h4
-rw-r--r--src/mame/includes/m52.h4
-rw-r--r--src/mame/includes/m57.h4
-rw-r--r--src/mame/includes/m58.h4
-rw-r--r--src/mame/includes/m62.h4
-rw-r--r--src/mame/includes/m72.h4
-rw-r--r--src/mame/includes/m90.h4
-rw-r--r--src/mame/includes/m92.h4
-rw-r--r--src/mame/includes/macrossp.h4
-rw-r--r--src/mame/includes/madalien.h4
-rw-r--r--src/mame/includes/madmotor.h4
-rw-r--r--src/mame/includes/magmax.h4
-rw-r--r--src/mame/includes/mainevt.h4
-rw-r--r--src/mame/includes/mainsnk.h4
-rw-r--r--src/mame/includes/malzak.h4
-rw-r--r--src/mame/includes/mappy.h4
-rw-r--r--src/mame/includes/marineb.h4
-rw-r--r--src/mame/includes/mario.h4
-rw-r--r--src/mame/includes/markham.h4
-rw-r--r--src/mame/includes/matmania.h4
-rw-r--r--src/mame/includes/mcatadv.h4
-rw-r--r--src/mame/includes/mcr.h4
-rw-r--r--src/mame/includes/mcr3.h4
-rw-r--r--src/mame/includes/mcr68.h4
-rw-r--r--src/mame/includes/meadows.h4
-rw-r--r--src/mame/includes/megadriv.h40
-rw-r--r--src/mame/includes/megasys1.h4
-rw-r--r--src/mame/includes/megazone.h4
-rw-r--r--src/mame/includes/mermaid.h4
-rw-r--r--src/mame/includes/metalmx.h4
-rw-r--r--src/mame/includes/metlclsh.h4
-rw-r--r--src/mame/includes/metro.h4
-rw-r--r--src/mame/includes/mexico86.h4
-rw-r--r--src/mame/includes/mhavoc.h4
-rw-r--r--src/mame/includes/micro3d.h4
-rw-r--r--src/mame/includes/midtunit.h4
-rw-r--r--src/mame/includes/midvunit.h4
-rw-r--r--src/mame/includes/midwunit.h4
-rw-r--r--src/mame/includes/midxunit.h4
-rw-r--r--src/mame/includes/midyunit.h4
-rw-r--r--src/mame/includes/midzeus.h4
-rw-r--r--src/mame/includes/mikie.h4
-rw-r--r--src/mame/includes/mitchell.h4
-rw-r--r--src/mame/includes/mjkjidai.h4
-rw-r--r--src/mame/includes/model1.h4
-rw-r--r--src/mame/includes/model2.h4
-rw-r--r--src/mame/includes/model3.h4
-rw-r--r--src/mame/includes/momoko.h4
-rw-r--r--src/mame/includes/moo.h4
-rw-r--r--src/mame/includes/mosaic.h4
-rw-r--r--src/mame/includes/mouser.h4
-rw-r--r--src/mame/includes/mrdo.h4
-rw-r--r--src/mame/includes/mrflea.h4
-rw-r--r--src/mame/includes/mrjong.h4
-rw-r--r--src/mame/includes/ms32.h4
-rw-r--r--src/mame/includes/msisaac.h4
-rw-r--r--src/mame/includes/mugsmash.h4
-rw-r--r--src/mame/includes/multfish.h4
-rw-r--r--src/mame/includes/munchmo.h4
-rw-r--r--src/mame/includes/mustache.h4
-rw-r--r--src/mame/includes/mw8080bw.h4
-rw-r--r--src/mame/includes/mystston.h4
-rw-r--r--src/mame/includes/mystwarr.h4
-rw-r--r--src/mame/includes/n64.h4
-rw-r--r--src/mame/includes/n8080.h4
-rw-r--r--src/mame/includes/namcofl.h4
-rw-r--r--src/mame/includes/namcona1.h4
-rw-r--r--src/mame/includes/namconb1.h4
-rw-r--r--src/mame/includes/namcond1.h4
-rw-r--r--src/mame/includes/namcos1.h4
-rw-r--r--src/mame/includes/namcos21.h4
-rw-r--r--src/mame/includes/namcos22.h4
-rw-r--r--src/mame/includes/namcos86.h4
-rw-r--r--src/mame/includes/naughtyb.h4
-rw-r--r--src/mame/includes/nbmj8688.h4
-rw-r--r--src/mame/includes/nbmj8891.h4
-rw-r--r--src/mame/includes/nbmj8900.h4
-rw-r--r--src/mame/includes/nbmj8991.h4
-rw-r--r--src/mame/includes/nbmj9195.h4
-rw-r--r--src/mame/includes/nemesis.h4
-rw-r--r--src/mame/includes/neogeo.h4
-rw-r--r--src/mame/includes/news.h4
-rw-r--r--src/mame/includes/ninjakd2.h4
-rw-r--r--src/mame/includes/ninjaw.h4
-rw-r--r--src/mame/includes/nitedrvr.h4
-rw-r--r--src/mame/includes/niyanpai.h4
-rw-r--r--src/mame/includes/nmk16.h4
-rw-r--r--src/mame/includes/norautp.h4
-rw-r--r--src/mame/includes/nova2001.h4
-rw-r--r--src/mame/includes/nycaptor.h4
-rw-r--r--src/mame/includes/offtwall.h4
-rw-r--r--src/mame/includes/ohmygod.h4
-rw-r--r--src/mame/includes/ojankohs.h4
-rw-r--r--src/mame/includes/oneshot.h4
-rw-r--r--src/mame/includes/opwolf.h4
-rw-r--r--src/mame/includes/orbit.h4
-rw-r--r--src/mame/includes/othldrby.h4
-rw-r--r--src/mame/includes/othunder.h4
-rw-r--r--src/mame/includes/overdriv.h4
-rw-r--r--src/mame/includes/pacland.h4
-rw-r--r--src/mame/includes/pacman.h4
-rw-r--r--src/mame/includes/pandoras.h4
-rw-r--r--src/mame/includes/paradise.h4
-rw-r--r--src/mame/includes/parodius.h4
-rw-r--r--src/mame/includes/pass.h4
-rw-r--r--src/mame/includes/pastelg.h4
-rw-r--r--src/mame/includes/pbaction.h4
-rw-r--r--src/mame/includes/pcktgal.h4
-rw-r--r--src/mame/includes/pgm.h4
-rw-r--r--src/mame/includes/phoenix.h4
-rw-r--r--src/mame/includes/pingpong.h4
-rw-r--r--src/mame/includes/pirates.h4
-rw-r--r--src/mame/includes/pitnrun.h4
-rw-r--r--src/mame/includes/pktgaldx.h4
-rw-r--r--src/mame/includes/playch10.h4
-rw-r--r--src/mame/includes/playmark.h4
-rw-r--r--src/mame/includes/plygonet.h4
-rw-r--r--src/mame/includes/pokechmp.h4
-rw-r--r--src/mame/includes/polepos.h4
-rw-r--r--src/mame/includes/policetr.h4
-rw-r--r--src/mame/includes/polyplay.h4
-rw-r--r--src/mame/includes/poolshrk.h4
-rw-r--r--src/mame/includes/pooyan.h4
-rw-r--r--src/mame/includes/popeye.h4
-rw-r--r--src/mame/includes/popper.h4
-rw-r--r--src/mame/includes/portrait.h4
-rw-r--r--src/mame/includes/powerins.h4
-rw-r--r--src/mame/includes/prehisle.h4
-rw-r--r--src/mame/includes/psikyo.h4
-rw-r--r--src/mame/includes/psikyo4.h4
-rw-r--r--src/mame/includes/psikyosh.h4
-rw-r--r--src/mame/includes/psx.h4
-rw-r--r--src/mame/includes/psychic5.h4
-rw-r--r--src/mame/includes/punchout.h4
-rw-r--r--src/mame/includes/pushman.h4
-rw-r--r--src/mame/includes/qdrmfgp.h4
-rw-r--r--src/mame/includes/qix.h4
-rw-r--r--src/mame/includes/quizdna.h4
-rw-r--r--src/mame/includes/quizpani.h4
-rw-r--r--src/mame/includes/raiden.h4
-rw-r--r--src/mame/includes/raiden2.h4
-rw-r--r--src/mame/includes/rainbow.h4
-rw-r--r--src/mame/includes/rallyx.h4
-rw-r--r--src/mame/includes/rampart.h4
-rw-r--r--src/mame/includes/rastan.h4
-rw-r--r--src/mame/includes/realbrk.h4
-rw-r--r--src/mame/includes/redalert.h4
-rw-r--r--src/mame/includes/relief.h4
-rw-r--r--src/mame/includes/renegade.h4
-rw-r--r--src/mame/includes/retofinv.h4
-rw-r--r--src/mame/includes/rockrage.h4
-rw-r--r--src/mame/includes/rocnrope.h4
-rw-r--r--src/mame/includes/rohga.h4
-rw-r--r--src/mame/includes/rollerg.h4
-rw-r--r--src/mame/includes/rollrace.h4
-rw-r--r--src/mame/includes/route16.h4
-rw-r--r--src/mame/includes/rpunch.h4
-rw-r--r--src/mame/includes/runaway.h4
-rw-r--r--src/mame/includes/rungun.h4
-rw-r--r--src/mame/includes/sauro.h4
-rw-r--r--src/mame/includes/sbasketb.h4
-rw-r--r--src/mame/includes/sbugger.h4
-rw-r--r--src/mame/includes/scotrsht.h4
-rw-r--r--src/mame/includes/scramble.h4
-rw-r--r--src/mame/includes/sderby.h4
-rw-r--r--src/mame/includes/segag80r.h4
-rw-r--r--src/mame/includes/segag80v.h4
-rw-r--r--src/mame/includes/segas16.h4
-rw-r--r--src/mame/includes/segas24.h4
-rw-r--r--src/mame/includes/segas32.h4
-rw-r--r--src/mame/includes/seibuspi.h4
-rw-r--r--src/mame/includes/seicross.h4
-rw-r--r--src/mame/includes/senjyo.h4
-rw-r--r--src/mame/includes/seta.h4
-rw-r--r--src/mame/includes/seta2.h4
-rw-r--r--src/mame/includes/sf.h4
-rw-r--r--src/mame/includes/shadfrce.h4
-rw-r--r--src/mame/includes/shangha3.h4
-rw-r--r--src/mame/includes/shangkid.h4
-rw-r--r--src/mame/includes/shaolins.h4
-rw-r--r--src/mame/includes/shisen.h4
-rw-r--r--src/mame/includes/shootout.h4
-rw-r--r--src/mame/includes/shuuz.h4
-rw-r--r--src/mame/includes/sidearms.h4
-rw-r--r--src/mame/includes/sidepckt.h4
-rw-r--r--src/mame/includes/silkroad.h4
-rw-r--r--src/mame/includes/simpl156.h4
-rw-r--r--src/mame/includes/simpsons.h4
-rw-r--r--src/mame/includes/skullxbo.h4
-rw-r--r--src/mame/includes/skydiver.h4
-rw-r--r--src/mame/includes/skyfox.h4
-rw-r--r--src/mame/includes/skykid.h4
-rw-r--r--src/mame/includes/skyraid.h4
-rw-r--r--src/mame/includes/slapfght.h4
-rw-r--r--src/mame/includes/slapshot.h4
-rw-r--r--src/mame/includes/snes.h4
-rw-r--r--src/mame/includes/snk.h4
-rw-r--r--src/mame/includes/snk6502.h4
-rw-r--r--src/mame/includes/snk68.h4
-rw-r--r--src/mame/includes/snookr10.h4
-rw-r--r--src/mame/includes/snowbros.h4
-rw-r--r--src/mame/includes/solomon.h4
-rw-r--r--src/mame/includes/sonson.h4
-rw-r--r--src/mame/includes/spacefb.h4
-rw-r--r--src/mame/includes/spbactn.h4
-rw-r--r--src/mame/includes/spcforce.h4
-rw-r--r--src/mame/includes/spdodgeb.h4
-rw-r--r--src/mame/includes/speedatk.h4
-rw-r--r--src/mame/includes/speedbal.h4
-rw-r--r--src/mame/includes/speedspn.h4
-rw-r--r--src/mame/includes/spiders.h4
-rw-r--r--src/mame/includes/splash.h4
-rw-r--r--src/mame/includes/sprcros2.h4
-rw-r--r--src/mame/includes/sprint2.h4
-rw-r--r--src/mame/includes/sprint4.h4
-rw-r--r--src/mame/includes/sprint8.h4
-rw-r--r--src/mame/includes/spy.h4
-rw-r--r--src/mame/includes/srmp2.h4
-rw-r--r--src/mame/includes/srumbler.h4
-rw-r--r--src/mame/includes/sshangha.h4
-rw-r--r--src/mame/includes/sslam.h4
-rw-r--r--src/mame/includes/ssozumo.h4
-rw-r--r--src/mame/includes/sspeedr.h4
-rw-r--r--src/mame/includes/ssrj.h4
-rw-r--r--src/mame/includes/ssv.h4
-rw-r--r--src/mame/includes/stactics.h4
-rw-r--r--src/mame/includes/stadhero.h4
-rw-r--r--src/mame/includes/starcrus.h4
-rw-r--r--src/mame/includes/starfire.h4
-rw-r--r--src/mame/includes/starshp1.h4
-rw-r--r--src/mame/includes/starwars.h4
-rw-r--r--src/mame/includes/stfight.h4
-rw-r--r--src/mame/includes/stlforce.h4
-rw-r--r--src/mame/includes/strnskil.h4
-rw-r--r--src/mame/includes/subs.h4
-rw-r--r--src/mame/includes/suna16.h4
-rw-r--r--src/mame/includes/suna8.h4
-rw-r--r--src/mame/includes/supbtime.h4
-rw-r--r--src/mame/includes/superchs.h4
-rw-r--r--src/mame/includes/superqix.h4
-rw-r--r--src/mame/includes/suprloco.h4
-rw-r--r--src/mame/includes/suprnova.h4
-rw-r--r--src/mame/includes/suprridr.h4
-rw-r--r--src/mame/includes/suprslam.h4
-rw-r--r--src/mame/includes/surpratk.h4
-rw-r--r--src/mame/includes/system1.h4
-rw-r--r--src/mame/includes/system16.h4
-rw-r--r--src/mame/includes/tagteam.h4
-rw-r--r--src/mame/includes/tail2nos.h4
-rw-r--r--src/mame/includes/taito_b.h4
-rw-r--r--src/mame/includes/taito_f2.h4
-rw-r--r--src/mame/includes/taito_f3.h4
-rw-r--r--src/mame/includes/taito_h.h4
-rw-r--r--src/mame/includes/taito_l.h4
-rw-r--r--src/mame/includes/taito_o.h4
-rw-r--r--src/mame/includes/taito_z.h4
-rw-r--r--src/mame/includes/taitoair.h4
-rw-r--r--src/mame/includes/taitojc.h4
-rw-r--r--src/mame/includes/taitosj.h4
-rw-r--r--src/mame/includes/tank8.h4
-rw-r--r--src/mame/includes/tankbatt.h4
-rw-r--r--src/mame/includes/tankbust.h4
-rw-r--r--src/mame/includes/taotaido.h4
-rw-r--r--src/mame/includes/targeth.h4
-rw-r--r--src/mame/includes/tatsumi.h4
-rw-r--r--src/mame/includes/taxidrvr.h4
-rw-r--r--src/mame/includes/tbowl.h4
-rw-r--r--src/mame/includes/tceptor.h4
-rw-r--r--src/mame/includes/tecmo.h4
-rw-r--r--src/mame/includes/tecmo16.h4
-rw-r--r--src/mame/includes/tecmosys.h4
-rw-r--r--src/mame/includes/tehkanwc.h4
-rw-r--r--src/mame/includes/terracre.h4
-rw-r--r--src/mame/includes/tetrisp2.h4
-rw-r--r--src/mame/includes/thedeep.h4
-rw-r--r--src/mame/includes/thepit.h4
-rw-r--r--src/mame/includes/thief.h4
-rw-r--r--src/mame/includes/thoop2.h4
-rw-r--r--src/mame/includes/thunderj.h4
-rw-r--r--src/mame/includes/thunderx.h4
-rw-r--r--src/mame/includes/tiamc1.h4
-rw-r--r--src/mame/includes/tigeroad.h4
-rw-r--r--src/mame/includes/timelimt.h4
-rw-r--r--src/mame/includes/timeplt.h4
-rw-r--r--src/mame/includes/tmnt.h4
-rw-r--r--src/mame/includes/tnzs.h4
-rw-r--r--src/mame/includes/toaplan1.h4
-rw-r--r--src/mame/includes/toaplan2.h4
-rw-r--r--src/mame/includes/toki.h4
-rw-r--r--src/mame/includes/toobin.h4
-rw-r--r--src/mame/includes/topspeed.h4
-rw-r--r--src/mame/includes/toypop.h4
-rw-r--r--src/mame/includes/tp84.h4
-rw-r--r--src/mame/includes/trackfld.h4
-rw-r--r--src/mame/includes/travrusa.h4
-rw-r--r--src/mame/includes/triplhnt.h4
-rw-r--r--src/mame/includes/truco.h4
-rw-r--r--src/mame/includes/trucocl.h4
-rw-r--r--src/mame/includes/tryout.h4
-rw-r--r--src/mame/includes/tsamurai.h4
-rw-r--r--src/mame/includes/tubep.h4
-rw-r--r--src/mame/includes/tumbleb.h4
-rw-r--r--src/mame/includes/tumblep.h4
-rw-r--r--src/mame/includes/tunhunt.h4
-rw-r--r--src/mame/includes/turbo.h4
-rw-r--r--src/mame/includes/tutankhm.h4
-rw-r--r--src/mame/includes/twin16.h4
-rw-r--r--src/mame/includes/twincobr.h4
-rw-r--r--src/mame/includes/tx1.h4
-rw-r--r--src/mame/includes/ultraman.h4
-rw-r--r--src/mame/includes/ultratnk.h4
-rw-r--r--src/mame/includes/undrfire.h4
-rw-r--r--src/mame/includes/unico.h4
-rw-r--r--src/mame/includes/usgames.h4
-rw-r--r--src/mame/includes/vaportra.h4
-rw-r--r--src/mame/includes/vastar.h4
-rw-r--r--src/mame/includes/vball.h4
-rw-r--r--src/mame/includes/vendetta.h4
-rw-r--r--src/mame/includes/vertigo.h13
-rw-r--r--src/mame/includes/vicdual.h4
-rw-r--r--src/mame/includes/victory.h4
-rw-r--r--src/mame/includes/videopin.h4
-rw-r--r--src/mame/includes/vigilant.h4
-rw-r--r--src/mame/includes/vindictr.h4
-rw-r--r--src/mame/includes/volfied.h4
-rw-r--r--src/mame/includes/vsnes.h4
-rw-r--r--src/mame/includes/vulgus.h4
-rw-r--r--src/mame/includes/warpwarp.h4
-rw-r--r--src/mame/includes/warriorb.h4
-rw-r--r--src/mame/includes/wc90.h4
-rw-r--r--src/mame/includes/wc90b.h4
-rw-r--r--src/mame/includes/wecleman.h4
-rw-r--r--src/mame/includes/welltris.h4
-rw-r--r--src/mame/includes/wgp.h4
-rw-r--r--src/mame/includes/williams.h4
-rw-r--r--src/mame/includes/wiping.h4
-rw-r--r--src/mame/includes/wiz.h4
-rw-r--r--src/mame/includes/wolfpack.h4
-rw-r--r--src/mame/includes/wrally.h4
-rw-r--r--src/mame/includes/wwfsstar.h4
-rw-r--r--src/mame/includes/wwfwfest.h4
-rw-r--r--src/mame/includes/xain.h4
-rw-r--r--src/mame/includes/xexex.h4
-rw-r--r--src/mame/includes/xmen.h4
-rw-r--r--src/mame/includes/xorworld.h4
-rw-r--r--src/mame/includes/xxmissio.h4
-rw-r--r--src/mame/includes/xybots.h4
-rw-r--r--src/mame/includes/xyonix.h4
-rw-r--r--src/mame/includes/yiear.h4
-rw-r--r--src/mame/includes/yunsun16.h4
-rw-r--r--src/mame/includes/yunsung8.h4
-rw-r--r--src/mame/includes/zac2650.h4
-rw-r--r--src/mame/includes/zaccaria.h4
-rw-r--r--src/mame/includes/zaxxon.h4
-rw-r--r--src/mame/includes/zerozone.h4
-rw-r--r--src/mame/includes/zodiack.h4
-rw-r--r--src/mame/machine/atarigen.c4
-rw-r--r--src/mame/machine/atarigen.h4
-rw-r--r--src/mame/machine/cdicdic.c46
-rw-r--r--src/mame/machine/cdicdic.h34
-rw-r--r--src/mame/machine/cdislave.c47
-rw-r--r--src/mame/machine/cdislave.h35
-rw-r--r--src/mame/machine/decocass.c4
-rw-r--r--src/mame/machine/decocass.h4
-rw-r--r--src/mame/machine/gaelco3d.c2
-rw-r--r--src/mame/machine/namco06.c2
-rw-r--r--src/mame/machine/namco51.c2
-rw-r--r--src/mame/machine/namco53.c2
-rw-r--r--src/mame/machine/namco62.c2
-rw-r--r--src/mame/machine/namcoio.c2
-rw-r--r--src/mame/machine/naomibd.c12
-rw-r--r--src/mame/machine/nmk112.c2
-rw-r--r--src/mame/machine/segaic16.c2
-rw-r--r--src/mame/machine/taitoio.c6
-rw-r--r--src/mame/machine/ticket.c2
-rw-r--r--src/mame/machine/zs01.c37
-rw-r--r--src/mame/machine/zs01.h31
-rw-r--r--src/mame/video/atarirle.c2
-rw-r--r--src/mame/video/decbac06.c38
-rw-r--r--src/mame/video/decbac06.h22
-rw-r--r--src/mame/video/deckarn.c30
-rw-r--r--src/mame/video/deckarn.h20
-rw-r--r--src/mame/video/decmxc06.c29
-rw-r--r--src/mame/video/decmxc06.h20
-rw-r--r--src/mame/video/deco16ic.c2
-rw-r--r--src/mame/video/decocomn.c2
-rw-r--r--src/mame/video/decospr.c41
-rw-r--r--src/mame/video/decospr.h23
-rw-r--r--src/mame/video/gottlieb.c2
-rw-r--r--src/mame/video/gp9001.c37
-rw-r--r--src/mame/video/gp9001.h39
-rw-r--r--src/mame/video/kan_pand.c2
-rw-r--r--src/mame/video/konicdev.c30
-rw-r--r--src/mame/video/ppu2c0x.c2
-rw-r--r--src/mame/video/sega16sp.c2
-rw-r--r--src/mame/video/segaic24.c77
-rw-r--r--src/mame/video/segaic24.h73
-rw-r--r--src/mame/video/sknsspr.c20
-rw-r--r--src/mame/video/sknsspr.h16
-rw-r--r--src/mame/video/taitoic.c18
-rw-r--r--src/mame/video/vertigo.c1
-rw-r--r--src/mame/video/vrender0.c2
-rw-r--r--src/osd/windows/drawd3d.c4
-rw-r--r--src/osd/windows/drawdd.c4
1585 files changed, 9897 insertions, 16553 deletions
diff --git a/src/emu/addrmap.c b/src/emu/addrmap.c
index a989d1e548a..419e16b056a 100644
--- a/src/emu/addrmap.c
+++ b/src/emu/addrmap.c
@@ -48,19 +48,19 @@
// set_tag - set the appropriate tag for a device
//-------------------------------------------------
-inline void map_handler_data::set_tag(const device_config &devconfig, const char *tag)
+inline void map_handler_data::set_tag(const device_t &device, const char *tag)
{
if (tag == NULL)
m_tag = NULL;
else if (strcmp(tag, DEVICE_SELF) == 0)
- m_tag = devconfig.tag();
+ m_tag = device.tag();
else if (strcmp(tag, DEVICE_SELF_OWNER) == 0)
{
- assert(devconfig.owner() != NULL);
- m_tag = devconfig.owner()->tag();
+ assert(device.owner() != NULL);
+ m_tag = device.owner()->tag();
}
else
- m_tag = devconfig.siblingtag(m_derived_tag, tag);
+ m_tag = device.siblingtag(m_derived_tag, tag);
}
@@ -131,10 +131,10 @@ void address_map_entry::set_mask(offs_t _mask)
// an I/O port
//-------------------------------------------------
-void address_map_entry::set_read_port(const device_config &devconfig, const char *tag)
+void address_map_entry::set_read_port(const device_t &device, const char *tag)
{
m_read.m_type = AMH_PORT;
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
}
@@ -143,10 +143,10 @@ void address_map_entry::set_read_port(const device_config &devconfig, const char
// an I/O port
//-------------------------------------------------
-void address_map_entry::set_write_port(const device_config &devconfig, const char *tag)
+void address_map_entry::set_write_port(const device_t &device, const char *tag)
{
m_write.m_type = AMH_PORT;
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
}
@@ -155,12 +155,12 @@ void address_map_entry::set_write_port(const device_config &devconfig, const cha
// reading and writing an I/O port
//-------------------------------------------------
-void address_map_entry::set_readwrite_port(const device_config &devconfig, const char *tag)
+void address_map_entry::set_readwrite_port(const device_t &device, const char *tag)
{
m_read.m_type = AMH_PORT;
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
m_write.m_type = AMH_PORT;
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
}
@@ -169,10 +169,10 @@ void address_map_entry::set_readwrite_port(const device_config &devconfig, const
// from a memory bank
//-------------------------------------------------
-void address_map_entry::set_read_bank(const device_config &devconfig, const char *tag)
+void address_map_entry::set_read_bank(const device_t &device, const char *tag)
{
m_read.m_type = AMH_BANK;
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
}
@@ -181,10 +181,10 @@ void address_map_entry::set_read_bank(const device_config &devconfig, const char
// to a memory bank
//-------------------------------------------------
-void address_map_entry::set_write_bank(const device_config &devconfig, const char *tag)
+void address_map_entry::set_write_bank(const device_t &device, const char *tag)
{
m_write.m_type = AMH_BANK;
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
}
@@ -193,12 +193,12 @@ void address_map_entry::set_write_bank(const device_config &devconfig, const cha
// writing to a memory bank
//-------------------------------------------------
-void address_map_entry::set_readwrite_bank(const device_config &devconfig, const char *tag)
+void address_map_entry::set_readwrite_bank(const device_t &device, const char *tag)
{
m_read.m_type = AMH_BANK;
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
m_write.m_type = AMH_BANK;
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
}
@@ -238,7 +238,7 @@ void address_map_entry::internal_set_handler(read8_space_func rfunc, const char
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read8_device_func func, const char *string, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT64 unitmask)
{
assert(func != NULL);
assert(unitmask_is_appropriate(8, unitmask, string));
@@ -246,12 +246,12 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_read.m_bits = 8;
m_read.m_mask = unitmask;
m_read.m_name = string;
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
m_rdevice8 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, write8_device_func func, const char *string, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT64 unitmask)
{
assert(func != NULL);
assert(unitmask_is_appropriate(8, unitmask, string));
@@ -259,19 +259,19 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_write.m_bits = 8;
m_write.m_mask = unitmask;
m_write.m_name = string;
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
m_wdevice8 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 unitmask)
{
- internal_set_handler(devconfig, tag, rfunc, rstring, unitmask);
- internal_set_handler(devconfig, tag, wfunc, wstring, unitmask);
+ internal_set_handler(device, tag, rfunc, rstring, unitmask);
+ internal_set_handler(device, tag, wfunc, wstring, unitmask);
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read8_delegate func, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read8_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
assert(unitmask_is_appropriate(8, unitmask, func.name()));
@@ -279,12 +279,12 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_read.m_bits = 8;
m_read.m_mask = unitmask;
m_read.m_name = func.name();
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
m_rproto8 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, write8_delegate func, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write8_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
assert(unitmask_is_appropriate(8, unitmask, func.name()));
@@ -292,15 +292,15 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_write.m_bits = 8;
m_write.m_mask = unitmask;
m_write.m_name = func.name();
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
m_wproto8 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 unitmask)
{
- internal_set_handler(devconfig, tag, rfunc, unitmask);
- internal_set_handler(devconfig, tag, wfunc, unitmask);
+ internal_set_handler(device, tag, rfunc, unitmask);
+ internal_set_handler(device, tag, wfunc, unitmask);
}
@@ -340,7 +340,7 @@ void address_map_entry::internal_set_handler(read16_space_func rfunc, const char
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read16_device_func func, const char *string, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT64 unitmask)
{
assert(func != NULL);
assert(unitmask_is_appropriate(16, unitmask, string));
@@ -348,12 +348,12 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_read.m_bits = 16;
m_read.m_mask = unitmask;
m_read.m_name = string;
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
m_rdevice16 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, write16_device_func func, const char *string, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT64 unitmask)
{
assert(func != NULL);
assert(unitmask_is_appropriate(16, unitmask, string));
@@ -361,19 +361,19 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_write.m_bits = 16;
m_write.m_mask = unitmask;
m_write.m_name = string;
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
m_wdevice16 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 unitmask)
{
- internal_set_handler(devconfig, tag, rfunc, rstring, unitmask);
- internal_set_handler(devconfig, tag, wfunc, wstring, unitmask);
+ internal_set_handler(device, tag, rfunc, rstring, unitmask);
+ internal_set_handler(device, tag, wfunc, wstring, unitmask);
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read16_delegate func, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read16_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
assert(unitmask_is_appropriate(16, unitmask, func.name()));
@@ -381,12 +381,12 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_read.m_bits = 16;
m_read.m_mask = unitmask;
m_read.m_name = func.name();
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
m_rproto16 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, write16_delegate func, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write16_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
assert(unitmask_is_appropriate(16, unitmask, func.name()));
@@ -394,15 +394,15 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_write.m_bits = 16;
m_write.m_mask = unitmask;
m_write.m_name = func.name();
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
m_wproto16 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 unitmask)
{
- internal_set_handler(devconfig, tag, rfunc, unitmask);
- internal_set_handler(devconfig, tag, wfunc, unitmask);
+ internal_set_handler(device, tag, rfunc, unitmask);
+ internal_set_handler(device, tag, wfunc, unitmask);
}
@@ -442,7 +442,7 @@ void address_map_entry::internal_set_handler(read32_space_func rfunc, const char
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read32_device_func func, const char *string, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string, UINT64 unitmask)
{
assert(func != NULL);
assert(unitmask_is_appropriate(32, unitmask, string));
@@ -450,12 +450,12 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_read.m_bits = 32;
m_read.m_mask = unitmask;
m_read.m_name = string;
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
m_rdevice32 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, write32_device_func func, const char *string, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string, UINT64 unitmask)
{
assert(func != NULL);
assert(unitmask_is_appropriate(32, unitmask, string));
@@ -463,19 +463,19 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_write.m_bits = 32;
m_write.m_mask = unitmask;
m_write.m_name = string;
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
m_wdevice32 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 unitmask)
{
- internal_set_handler(devconfig, tag, rfunc, rstring, unitmask);
- internal_set_handler(devconfig, tag, wfunc, wstring, unitmask);
+ internal_set_handler(device, tag, rfunc, rstring, unitmask);
+ internal_set_handler(device, tag, wfunc, wstring, unitmask);
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read32_delegate func, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read32_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
assert(unitmask_is_appropriate(32, unitmask, func.name()));
@@ -483,12 +483,12 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_read.m_bits = 32;
m_read.m_mask = unitmask;
m_read.m_name = func.name();
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
m_rproto32 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, write32_delegate func, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write32_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
assert(unitmask_is_appropriate(32, unitmask, func.name()));
@@ -496,15 +496,15 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_write.m_bits = 32;
m_write.m_mask = unitmask;
m_write.m_name = func.name();
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
m_wproto32 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 unitmask)
{
- internal_set_handler(devconfig, tag, rfunc, unitmask);
- internal_set_handler(devconfig, tag, wfunc, unitmask);
+ internal_set_handler(device, tag, rfunc, unitmask);
+ internal_set_handler(device, tag, wfunc, unitmask);
}
@@ -544,7 +544,7 @@ void address_map_entry::internal_set_handler(read64_space_func rfunc, const char
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read64_device_func func, const char *string, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read64_device_func func, const char *string, UINT64 unitmask)
{
assert(func != NULL);
assert(unitmask_is_appropriate(64, unitmask, string));
@@ -552,12 +552,12 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_read.m_bits = 64;
m_read.m_mask = 0;
m_read.m_name = string;
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
m_rdevice64 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, write64_device_func func, const char *string, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write64_device_func func, const char *string, UINT64 unitmask)
{
assert(func != NULL);
assert(unitmask_is_appropriate(64, unitmask, string));
@@ -565,19 +565,19 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_write.m_bits = 64;
m_write.m_mask = 0;
m_write.m_name = string;
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
m_wdevice64 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring, UINT64 unitmask)
{
- internal_set_handler(devconfig, tag, rfunc, rstring, unitmask);
- internal_set_handler(devconfig, tag, wfunc, wstring, unitmask);
+ internal_set_handler(device, tag, rfunc, rstring, unitmask);
+ internal_set_handler(device, tag, wfunc, wstring, unitmask);
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read64_delegate func, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read64_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
assert(unitmask_is_appropriate(64, unitmask, func.name()));
@@ -585,12 +585,12 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_read.m_bits = 64;
m_read.m_mask = 0;
m_read.m_name = func.name();
- m_read.set_tag(devconfig, tag);
+ m_read.set_tag(device, tag);
m_rproto64 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, write64_delegate func, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, write64_delegate func, UINT64 unitmask)
{
assert(!func.isnull());
assert(unitmask_is_appropriate(64, unitmask, func.name()));
@@ -598,15 +598,15 @@ void address_map_entry::internal_set_handler(const device_config &devconfig, con
m_write.m_bits = 64;
m_write.m_mask = 0;
m_write.m_name = func.name();
- m_write.set_tag(devconfig, tag);
+ m_write.set_tag(device, tag);
m_wproto64 = func;
}
-void address_map_entry::internal_set_handler(const device_config &devconfig, const char *tag, read64_delegate rfunc, write64_delegate wfunc, UINT64 unitmask)
+void address_map_entry::internal_set_handler(const device_t &device, const char *tag, read64_delegate rfunc, write64_delegate wfunc, UINT64 unitmask)
{
- internal_set_handler(devconfig, tag, rfunc, unitmask);
- internal_set_handler(devconfig, tag, wfunc, unitmask);
+ internal_set_handler(device, tag, rfunc, unitmask);
+ internal_set_handler(device, tag, wfunc, unitmask);
}
@@ -696,33 +696,33 @@ address_map_entry64::address_map_entry64(address_map &map, offs_t start, offs_t
// address_map - constructor
//-------------------------------------------------
-address_map::address_map(const device_config &devconfig, address_spacenum spacenum)
+address_map::address_map(const device_t &device, address_spacenum spacenum)
: m_spacenum(spacenum),
m_databits(0xff),
m_unmapval(0),
m_globalmask(0)
{
// get our memory interface
- const device_config_memory_interface *memintf;
- if (!devconfig.interface(memintf))
- throw emu_fatalerror("No memory interface defined for device '%s'\n", devconfig.tag());
+ const device_memory_interface *memintf;
+ if (!device.interface(memintf))
+ throw emu_fatalerror("No memory interface defined for device '%s'\n", device.tag());
// and then the configuration for the current address space
const address_space_config *spaceconfig = memintf->space_config(spacenum);
- if (!devconfig.interface(memintf))
- throw emu_fatalerror("No memory address space configuration found for device '%s', space %d\n", devconfig.tag(), spacenum);
+ if (!device.interface(memintf))
+ throw emu_fatalerror("No memory address space configuration found for device '%s', space %d\n", device.tag(), spacenum);
// append the internal device map (first so it takes priority) */
if (spaceconfig->m_internal_map != NULL)
- (*spaceconfig->m_internal_map)(*this, devconfig);
+ (*spaceconfig->m_internal_map)(*this, device);
// construct the standard map */
if (memintf->address_map(spacenum) != NULL)
- (*memintf->address_map(spacenum))(*this, devconfig);
+ (*memintf->address_map(spacenum))(*this, device);
// append the default device map (last so it can be overridden) */
if (spaceconfig->m_default_map != NULL)
- (*spaceconfig->m_default_map)(*this, devconfig);
+ (*spaceconfig->m_default_map)(*this, device);
}
diff --git a/src/emu/addrmap.h b/src/emu/addrmap.h
index 9593b66ab05..9f297b61b21 100644
--- a/src/emu/addrmap.h
+++ b/src/emu/addrmap.h
@@ -92,7 +92,7 @@ public:
const char * m_tag; // tag pointing to a reference
astring m_derived_tag; // string used to hold derived names
- void set_tag(const device_config &devconfig, const char *tag);
+ void set_tag(const device_t &device, const char *tag);
};
@@ -125,14 +125,14 @@ public:
void set_mask(offs_t _mask);
// I/O port configuration
- void set_read_port(const device_config &devconfig, const char *tag);
- void set_write_port(const device_config &devconfig, const char *tag);
- void set_readwrite_port(const device_config &devconfig, const char *tag);
+ void set_read_port(const device_t &device, const char *tag);
+ void set_write_port(const device_t &device, const char *tag);
+ void set_readwrite_port(const device_t &device, const char *tag);
// memory bank configuration
- void set_read_bank(const device_config &devconfig, const char *tag);
- void set_write_bank(const device_config &devconfig, const char *tag);
- void set_readwrite_bank(const device_config &devconfig, const char *tag);
+ void set_read_bank(const device_t &device, const char *tag);
+ void set_write_bank(const device_t &device, const char *tag);
+ void set_readwrite_bank(const device_t &device, const char *tag);
// public state
address_map_entry * m_next; // pointer to the next entry
@@ -197,45 +197,45 @@ protected:
void internal_set_handler(read8_space_func func, const char *string, UINT64 mask);
void internal_set_handler(write8_space_func func, const char *string, UINT64 mask);
void internal_set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read8_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, write8_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read8_delegate func, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, write8_delegate func, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read8_delegate func, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, write8_delegate func, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 mask);
// internal handler setters for 16-bit functions
void internal_set_handler(read16_space_func func, const char *string, UINT64 mask);
void internal_set_handler(write16_space_func func, const char *string, UINT64 mask);
void internal_set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read16_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, write16_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read16_delegate func, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, write16_delegate func, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read16_delegate func, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, write16_delegate func, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 mask);
// internal handler setters for 32-bit functions
void internal_set_handler(read32_space_func func, const char *string, UINT64 mask);
void internal_set_handler(write32_space_func func, const char *string, UINT64 mask);
void internal_set_handler(read32_space_func rfunc, const char *rstring, write32_space_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read32_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, write32_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read32_delegate func, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, write32_delegate func, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read32_delegate func, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, write32_delegate func, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 mask);
// internal handler setters for 64-bit functions
void internal_set_handler(read64_space_func func, const char *string, UINT64 mask);
void internal_set_handler(write64_space_func func, const char *string, UINT64 mask);
void internal_set_handler(read64_space_func rfunc, const char *rstring, write64_space_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read64_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, write64_device_func func, const char *string, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read64_delegate func, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, write64_delegate func, UINT64 mask);
- void internal_set_handler(const device_config &devconfig, const char *tag, read64_delegate rfunc, write64_delegate wfunc, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read64_device_func func, const char *string, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, write64_device_func func, const char *string, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read64_delegate func, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, write64_delegate func, UINT64 mask);
+ void internal_set_handler(const device_t &device, const char *tag, read64_delegate rfunc, write64_delegate wfunc, UINT64 mask);
private:
// helper functions
@@ -257,12 +257,12 @@ public:
void set_handler(read8_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(write8_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read8_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); }
- void set_handler(const device_config &devconfig, const char *tag, write8_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read8_delegate func) { internal_set_handler(devconfig, tag, func, 0); }
- void set_handler(const device_config &devconfig, const char *tag, write8_delegate func) { internal_set_handler(devconfig, tag, func, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read8_delegate rfunc, write8_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); }
+ void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
+ void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
+ void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
+ void set_handler(const device_t &device, const char *tag, read8_delegate func) { internal_set_handler(device, tag, func, 0); }
+ void set_handler(const device_t &device, const char *tag, write8_delegate func) { internal_set_handler(device, tag, func, 0); }
+ void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
};
@@ -280,23 +280,23 @@ public:
void set_handler(read16_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(write16_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read16_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); }
- void set_handler(const device_config &devconfig, const char *tag, write16_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read16_delegate func) { internal_set_handler(devconfig, tag, func, 0); }
- void set_handler(const device_config &devconfig, const char *tag, write16_delegate func) { internal_set_handler(devconfig, tag, func, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read16_delegate rfunc, write16_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); }
+ void set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
+ void set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
+ void set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
+ void set_handler(const device_t &device, const char *tag, read16_delegate func) { internal_set_handler(device, tag, func, 0); }
+ void set_handler(const device_t &device, const char *tag, write16_delegate func) { internal_set_handler(device, tag, func, 0); }
+ void set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
// 8-bit handlers
void set_handler(read8_space_func func, const char *string, UINT16 mask) { internal_set_handler(func, string, mask); }
void set_handler(write8_space_func func, const char *string, UINT16 mask) { internal_set_handler(func, string, mask); }
void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring, UINT16 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_device_func func, const char *string, UINT16 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write8_device_func func, const char *string, UINT16 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT16 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_delegate func, UINT16 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write8_delegate func, UINT16 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT16 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT16 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT16 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT16 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_delegate func, UINT16 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, write8_delegate func, UINT16 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT16 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
};
@@ -314,34 +314,34 @@ public:
void set_handler(read32_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(write32_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(read32_space_func rfunc, const char *rstring, write32_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read32_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); }
- void set_handler(const device_config &devconfig, const char *tag, write32_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read32_delegate func) { internal_set_handler(devconfig, tag, func, 0); }
- void set_handler(const device_config &devconfig, const char *tag, write32_delegate func) { internal_set_handler(devconfig, tag, func, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read32_delegate rfunc, write32_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); }
+ void set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
+ void set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
+ void set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
+ void set_handler(const device_t &device, const char *tag, read32_delegate func) { internal_set_handler(device, tag, func, 0); }
+ void set_handler(const device_t &device, const char *tag, write32_delegate func) { internal_set_handler(device, tag, func, 0); }
+ void set_handler(const device_t &device, const char *tag, read32_delegate rfunc, write32_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
// 16-bit handlers
void set_handler(read16_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
void set_handler(write16_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
void set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read16_device_func func, const char *string, UINT32 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write16_device_func func, const char *string, UINT32 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read16_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write16_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT32 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); }
+ void set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
+ void set_handler(const device_t &device, const char *tag, read16_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, write16_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT32 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
// 8-bit handlers
void set_handler(read8_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
void set_handler(write8_space_func func, const char *string, UINT32 mask) { internal_set_handler(func, string, mask); }
void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_device_func func, const char *string, UINT32 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write8_device_func func, const char *string, UINT32 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write8_delegate func, UINT32 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT32 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT32 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT32 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, write8_delegate func, UINT32 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT32 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
};
@@ -359,45 +359,45 @@ public:
void set_handler(read64_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(write64_space_func func, const char *string) { internal_set_handler(func, string, 0); }
void set_handler(read64_space_func rfunc, const char *rstring, write64_space_func wfunc, const char *wstring) { internal_set_handler(rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read64_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); }
- void set_handler(const device_config &devconfig, const char *tag, write64_device_func func, const char *string) { internal_set_handler(devconfig, tag, func, string, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read64_delegate func) { internal_set_handler(devconfig, tag, func, 0); }
- void set_handler(const device_config &devconfig, const char *tag, write64_delegate func) { internal_set_handler(devconfig, tag, func, 0); }
- void set_handler(const device_config &devconfig, const char *tag, read64_delegate rfunc, write64_delegate wfunc) { internal_set_handler(devconfig, tag, rfunc, wfunc, 0); }
+ void set_handler(const device_t &device, const char *tag, read64_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
+ void set_handler(const device_t &device, const char *tag, write64_device_func func, const char *string) { internal_set_handler(device, tag, func, string, 0); }
+ void set_handler(const device_t &device, const char *tag, read64_device_func rfunc, const char *rstring, write64_device_func wfunc, const char *wstring) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, 0); }
+ void set_handler(const device_t &device, const char *tag, read64_delegate func) { internal_set_handler(device, tag, func, 0); }
+ void set_handler(const device_t &device, const char *tag, write64_delegate func) { internal_set_handler(device, tag, func, 0); }
+ void set_handler(const device_t &device, const char *tag, read64_delegate rfunc, write64_delegate wfunc) { internal_set_handler(device, tag, rfunc, wfunc, 0); }
// 32-bit handlers
void set_handler(read32_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(write32_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(read32_space_func rfunc, const char *rstring, write32_space_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read32_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write32_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read32_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write32_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); }
+ void set_handler(const device_t &device, const char *tag, read32_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, write32_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, read32_device_func rfunc, const char *rstring, write32_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
+ void set_handler(const device_t &device, const char *tag, read32_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, write32_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, read32_delegate rfunc, write32_delegate wfunc, UINT64 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
// 16-bit handlers
void set_handler(read16_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(write16_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(read16_space_func rfunc, const char *rstring, write16_space_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read16_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write16_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read16_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write16_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); }
+ void set_handler(const device_t &device, const char *tag, read16_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, write16_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, read16_device_func rfunc, const char *rstring, write16_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
+ void set_handler(const device_t &device, const char *tag, read16_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, write16_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, read16_delegate rfunc, write16_delegate wfunc, UINT64 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
// 8-bit handlers
void set_handler(read8_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(write8_space_func func, const char *string, UINT64 mask) { internal_set_handler(func, string, mask); }
void set_handler(read8_space_func rfunc, const char *rstring, write8_space_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write8_device_func func, const char *string, UINT64 mask) { internal_set_handler(devconfig, tag, func, string, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, rstring, wfunc, wstring, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, write8_delegate func, UINT64 mask) { internal_set_handler(devconfig, tag, func, mask); }
- void set_handler(const device_config &devconfig, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 mask) { internal_set_handler(devconfig, tag, rfunc, wfunc, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, write8_device_func func, const char *string, UINT64 mask) { internal_set_handler(device, tag, func, string, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_device_func rfunc, const char *rstring, write8_device_func wfunc, const char *wstring, UINT64 mask) { internal_set_handler(device, tag, rfunc, rstring, wfunc, wstring, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, write8_delegate func, UINT64 mask) { internal_set_handler(device, tag, func, mask); }
+ void set_handler(const device_t &device, const char *tag, read8_delegate rfunc, write8_delegate wfunc, UINT64 mask) { internal_set_handler(device, tag, rfunc, wfunc, mask); }
};
@@ -408,7 +408,7 @@ class address_map
{
public:
// construction/destruction
- address_map(const device_config &devconfig, address_spacenum spacenum);
+ address_map(const device_t &device, address_spacenum spacenum);
~address_map();
// configuration
@@ -459,7 +459,7 @@ public:
#define ADDRESS_MAP_NAME(_name) construct_address_map_##_name
#define ADDRESS_MAP_START(_name, _space, _bits) \
-void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
+void ADDRESS_MAP_NAME(_name)(address_map &map, const device_t &device) \
{ \
typedef read##_bits##_delegate read_delegate; \
typedef write##_bits##_delegate write_delegate; \
@@ -472,7 +472,7 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
// use this to declare external references to an address map
#define ADDRESS_MAP_EXTERN(_name, _bits) \
- extern void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig)
+ extern void ADDRESS_MAP_NAME(_name)(address_map &map, const device_t &device)
// global controls
@@ -488,7 +488,7 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
// importing data from other address maps
#define AM_IMPORT_FROM(_name) \
- ADDRESS_MAP_NAME(_name)(map, devconfig); \
+ ADDRESS_MAP_NAME(_name)(map, device); \
// address ranges
@@ -546,86 +546,86 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
// legacy device reads
#define AM_DEVREAD(_tag, _handler) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler); \
+ curentry->set_handler(device, _tag, _handler, #_handler); \
#define AM_DEVREAD8(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVREAD16(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVREAD32(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
// legacy device writes
#define AM_DEVWRITE(_tag, _handler) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler); \
+ curentry->set_handler(device, _tag, _handler, #_handler); \
#define AM_DEVWRITE8(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVWRITE16(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVWRITE32(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
// legacy device reads/writes
#define AM_DEVREADWRITE(_tag, _rhandler, _whandler) \
- curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler); \
+ curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler); \
#define AM_DEVREADWRITE8(_tag, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
+ curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
#define AM_DEVREADWRITE16(_tag, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
+ curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
#define AM_DEVREADWRITE32(_tag, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
+ curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
// device reads
#define AM_DEVREAD_MODERN(_tag, _class, _handler) \
- curentry->set_handler(devconfig, _tag, read_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \
+ curentry->set_handler(device, _tag, read_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \
#define AM_DEVREAD8_MODERN(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
#define AM_DEVREAD16_MODERN(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
#define AM_DEVREAD32_MODERN(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
// device writes
#define AM_DEVWRITE_MODERN(_tag, _class, _handler) \
- curentry->set_handler(devconfig, _tag, write_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \
+ curentry->set_handler(device, _tag, write_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \
#define AM_DEVWRITE8_MODERN(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, write8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, write8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
#define AM_DEVWRITE16_MODERN(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, write16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, write16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
#define AM_DEVWRITE32_MODERN(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, write32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, write32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
// device reads/writes
#define AM_DEVREADWRITE_MODERN(_tag, _class, _rhandler, _whandler) \
- curentry->set_handler(devconfig, _tag, read_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0)); \
+ curentry->set_handler(device, _tag, read_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0)); \
#define AM_DEVREADWRITE8_MODERN(_tag, _class, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read8_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write8_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read8_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write8_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
#define AM_DEVREADWRITE16_MODERN(_tag, _class, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read16_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write16_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read16_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write16_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
#define AM_DEVREADWRITE32_MODERN(_tag, _class, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read32_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write32_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read32_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write32_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
// special-case accesses
@@ -659,24 +659,24 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
// port accesses
#define AM_READ_PORT(_tag) \
- curentry->set_read_port(devconfig, _tag); \
+ curentry->set_read_port(device, _tag); \
#define AM_WRITE_PORT(_tag) \
- curentry->set_write_port(devconfig, _tag); \
+ curentry->set_write_port(device, _tag); \
#define AM_READWRITE_PORT(_tag) \
- curentry->set_readwrite_port(devconfig, _tag); \
+ curentry->set_readwrite_port(device, _tag); \
// bank accesses
#define AM_READ_BANK(_tag) \
- curentry->set_read_bank(devconfig, _tag); \
+ curentry->set_read_bank(device, _tag); \
#define AM_WRITE_BANK(_tag) \
- curentry->set_write_bank(devconfig, _tag); \
+ curentry->set_write_bank(device, _tag); \
#define AM_READWRITE_BANK(_tag) \
- curentry->set_readwrite_bank(devconfig, _tag); \
+ curentry->set_readwrite_bank(device, _tag); \
// attributes for accesses
@@ -728,7 +728,7 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
#define ADDRESS_MAP_NAME(_name) construct_address_map_##_name
#define ADDRESS_MAP_START(_name, _space, _bits, _class) \
-void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
+void ADDRESS_MAP_NAME(_name)(address_map &map, const device_t &device) \
{ \
typedef read##_bits##_delegate read_delegate; \
typedef write##_bits##_delegate write_delegate; \
@@ -742,7 +742,7 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
// use this to declare external references to an address map
#define ADDRESS_MAP_EXTERN(_name, _bits) \
- extern void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig)
+ extern void ADDRESS_MAP_NAME(_name)(address_map &map, const device_t &device)
// global controls
@@ -758,7 +758,7 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
// importing data from other address maps
#define AM_IMPORT_FROM(_name) \
- ADDRESS_MAP_NAME(_name)(map, devconfig); \
+ ADDRESS_MAP_NAME(_name)(map, device); \
// address ranges
@@ -816,170 +816,170 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
// legacy device reads
#define AM_DEVREAD_LEGACY(_tag, _handler) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler); \
+ curentry->set_handler(device, _tag, _handler, #_handler); \
#define AM_DEVREAD8_LEGACY(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVREAD16_LEGACY(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVREAD32_LEGACY(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
// legacy device writes
#define AM_DEVWRITE_LEGACY(_tag, _handler) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler); \
+ curentry->set_handler(device, _tag, _handler, #_handler); \
#define AM_DEVWRITE8_LEGACY(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVWRITE16_LEGACY(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
#define AM_DEVWRITE32_LEGACY(_tag, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _handler, #_handler, _unitmask); \
+ curentry->set_handler(device, _tag, _handler, #_handler, _unitmask); \
// legacy device reads/writes
#define AM_DEVREADWRITE_LEGACY(_tag, _rhandler, _whandler) \
- curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler); \
+ curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler); \
#define AM_DEVREADWRITE8_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
+ curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
#define AM_DEVREADWRITE16_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
+ curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
#define AM_DEVREADWRITE32_LEGACY(_tag, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
+ curentry->set_handler(device, _tag, _rhandler, #_rhandler, _whandler, #_whandler, _unitmask); \
// driver data base reads
#define AM_READ_BASE(_class, _handler) \
- curentry->set_handler(devconfig, NULL, read_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0)); \
+ curentry->set_handler(device, NULL, read_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0)); \
#define AM_READ8_BASE(_class, _handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read8_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read8_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
#define AM_READ16_BASE(_class, _handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read16_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read16_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
#define AM_READ32_BASE(_class, _handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read32_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read32_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
// driver data base writes
#define AM_WRITE_BASE(_class, _handler) \
- curentry->set_handler(devconfig, NULL, write_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0)); \
+ curentry->set_handler(device, NULL, write_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0)); \
#define AM_WRITE8_BASE(_class, _handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, write8_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, write8_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
#define AM_WRITE16_BASE(_class, _handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, write16_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, write16_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
#define AM_WRITE32_BASE(_class, _handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, write32_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, write32_delegate(&_class::_handler, "driver_data::" #_handler, (_class *)0), _unitmask); \
// driver data base reads/writes
#define AM_READWRITE_BASE(_class, _rhandler, _whandler) \
- curentry->set_handler(devconfig, NULL, read_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0)); \
+ curentry->set_handler(device, NULL, read_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0)); \
#define AM_READWRITE8_BASE(_class, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read8_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write8_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read8_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write8_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0), _unitmask); \
#define AM_READWRITE16_BASE(_class, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read16_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write16_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read16_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write16_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0), _unitmask); \
#define AM_READWRITE32_BASE(_class, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read32_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write32_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read32_delegate(&_class::_rhandler, "driver_data::" #_rhandler, (_class *)0), write32_delegate(&_class::_whandler, "driver_data::" #_whandler, (_class *)0), _unitmask); \
// driver data reads
#define AM_READ(_handler) \
- curentry->set_handler(devconfig, NULL, read_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0)); \
+ curentry->set_handler(device, NULL, read_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0)); \
#define AM_READ8(_handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read8_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read8_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
#define AM_READ16(_handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read16_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read16_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
#define AM_READ32(_handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read32_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read32_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
// driver data writes
#define AM_WRITE(_handler) \
- curentry->set_handler(devconfig, NULL, write_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0)); \
+ curentry->set_handler(device, NULL, write_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0)); \
#define AM_WRITE8(_handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, write8_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, write8_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
#define AM_WRITE16(_handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, write16_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, write16_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
#define AM_WRITE32(_handler, _unitmask) \
- curentry->set_handler(devconfig, NULL, write32_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, write32_delegate(&drivdata_class::_handler, "driver_data::" #_handler, (drivdata_class *)0), _unitmask); \
// driver data reads/writes
#define AM_READWRITE(_rhandler, _whandler) \
- curentry->set_handler(devconfig, NULL, read_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0)); \
+ curentry->set_handler(device, NULL, read_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0)); \
#define AM_READWRITE8(_rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read8_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write8_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read8_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write8_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0), _unitmask); \
#define AM_READWRITE16(_rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read16_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write16_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read16_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write16_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0), _unitmask); \
#define AM_READWRITE32(_rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, NULL, read32_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write32_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0), _unitmask); \
+ curentry->set_handler(device, NULL, read32_delegate(&drivdata_class::_rhandler, "driver_data::" #_rhandler, (drivdata_class *)0), write32_delegate(&drivdata_class::_whandler, "driver_data::" #_whandler, (drivdata_class *)0), _unitmask); \
// device reads
#define AM_DEVREAD(_tag, _class, _handler) \
- curentry->set_handler(devconfig, _tag, read_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \
+ curentry->set_handler(device, _tag, read_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \
#define AM_DEVREAD8(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
#define AM_DEVREAD16(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
#define AM_DEVREAD32(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
// device writes
#define AM_DEVWRITE(_tag, _class, _handler) \
- curentry->set_handler(devconfig, _tag, write_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \
+ curentry->set_handler(device, _tag, write_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0)); \
#define AM_DEVWRITE8(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, write8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, write8_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
#define AM_DEVWRITE16(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, write16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, write16_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
#define AM_DEVWRITE32(_tag, _class, _handler, _unitmask) \
- curentry->set_handler(devconfig, _tag, write32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, write32_delegate(&_class::_handler, #_class "::" #_handler, (_class *)0), _unitmask); \
// device reads/writes
#define AM_DEVREADWRITE(_tag, _class, _rhandler, _whandler) \
- curentry->set_handler(devconfig, _tag, read_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0)); \
+ curentry->set_handler(device, _tag, read_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0)); \
#define AM_DEVREADWRITE8(_tag, _class, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read8_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write8_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read8_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write8_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
#define AM_DEVREADWRITE16(_tag, _class, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read16_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write16_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read16_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write16_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
#define AM_DEVREADWRITE32(_tag, _class, _rhandler, _whandler, _unitmask) \
- curentry->set_handler(devconfig, _tag, read32_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write32_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
+ curentry->set_handler(device, _tag, read32_delegate(&_class::_rhandler, #_class "::" #_rhandler, (_class *)0), write32_delegate(&_class::_whandler, #_class "::" #_whandler, (_class *)0), _unitmask); \
// special-case accesses
@@ -1013,24 +1013,24 @@ void ADDRESS_MAP_NAME(_name)(address_map &map, const device_config &devconfig) \
// port accesses
#define AM_READ_PORT(_tag) \
- curentry->set_read_port(devconfig, _tag); \
+ curentry->set_read_port(device, _tag); \
#define AM_WRITE_PORT(_tag) \
- curentry->set_write_port(devconfig, _tag); \
+ curentry->set_write_port(device, _tag); \
#define AM_READWRITE_PORT(_tag) \
- curentry->set_readwrite_port(devconfig, _tag); \
+ curentry->set_readwrite_port(device, _tag); \
// bank accesses
#define AM_READ_BANK(_tag) \
- curentry->set_read_bank(devconfig, _tag); \
+ curentry->set_read_bank(device, _tag); \
#define AM_WRITE_BANK(_tag) \
- curentry->set_write_bank(devconfig, _tag); \
+ curentry->set_write_bank(device, _tag); \
#define AM_READWRITE_BANK(_tag) \
- curentry->set_readwrite_bank(devconfig, _tag); \
+ curentry->set_readwrite_bank(device, _tag); \
// attributes for accesses
diff --git a/src/emu/audit.c b/src/emu/audit.c
index 08141355d70..8fa3287d4c5 100644
--- a/src/emu/audit.c
+++ b/src/emu/audit.c
@@ -76,41 +76,46 @@ media_auditor::summary media_auditor::audit_media(const char *validation)
// temporary hack until romload is update: get the driver path and support it for
// all searches
-const char *driverpath = m_enumerator.config().m_devicelist.find("root")->searchpath();
+const char *driverpath = m_enumerator.config().devicelist().find("root")->searchpath();
// iterate over ROM sources and regions
int found = 0;
int required = 0;
- int shared_found = 0;
- int shared_required = 0;
+ int sharedFound = 0;
+ int sharedRequired = 0;
for (const rom_source *source = rom_first_source(m_enumerator.config()); source != NULL; source = rom_next_source(*source))
{
// determine the search path for this source and iterate through the regions
m_searchpath = source->searchpath();
// also determine if this is the driver's specific ROMs or not
- bool source_is_gamedrv = (dynamic_cast<const driver_device_config_base *>(source) != NULL);
+ bool source_is_gamedrv = (dynamic_cast<const driver_device *>(source) != NULL);
// now iterate over regions and ROMs within
for (const rom_entry *region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
{
// temporary hack: add the driver path & region name
-astring combinedpath(source->searchpath(), ";", driverpath);
-if (ROMREGION_ISLOADBYNAME(region))
- combinedpath.cat(";").cat(ROMREGION_GETTAG(region));
+astring combinedpath(m_searchpath, ";", driverpath);
+if(ROMREGION_ISLOADBYNAME(region))
+{
+ combinedpath=combinedpath.cat(";");
+ combinedpath=combinedpath.cat(ROMREGION_GETTAG(region));
+}
m_searchpath = combinedpath;
for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
{
hash_collection hashes(ROM_GETHASHDATA(rom));
- bool shared = (also_used_by_parent(hashes) != -1);
+ bool shared = also_used_by_parent(hashes) >= 0;
// if a dump exists, then at least one entry is required
if (!hashes.flag(hash_collection::FLAG_NO_DUMP))
{
required++;
if (shared)
- shared_required++;
+ {
+ sharedRequired++;
+ }
}
// audit a file
@@ -131,14 +136,16 @@ m_searchpath = combinedpath;
{
found++;
if (shared)
- shared_found++;
+ {
+ sharedFound++;
+ }
}
}
}
}
// if we found nothing unique to this set & the set needs roms that aren't in the parent or the parent isn't found either, then we don't have the set at all
- if (found == shared_found && required > 0 && (required != shared_required || shared_found == 0))
+ if (found == sharedFound && required > 0 && (required != sharedRequired || sharedFound == 0))
m_record_list.reset();
// return a summary
@@ -157,10 +164,10 @@ media_auditor::summary media_auditor::audit_samples()
m_record_list.reset();
// iterate over sample entries
- for (const device_config *devconfig = m_enumerator.config().first_device(); devconfig != NULL; devconfig = devconfig->next())
- if (devconfig->type() == SAMPLES)
+ for (const device_t *device = m_enumerator.config().first_device(); device != NULL; device = device->next())
+ if (device->type() == SAMPLES)
{
- const samples_interface *intf = reinterpret_cast<const samples_interface *>(devconfig->static_config());
+ const samples_interface *intf = reinterpret_cast<const samples_interface *>(device->static_config());
if (intf->samplenames != NULL)
{
// by default we just search using the driver name
diff --git a/src/emu/cheat.c b/src/emu/cheat.c
index 34e27803f8e..f2280ed64f8 100644
--- a/src/emu/cheat.c
+++ b/src/emu/cheat.c
@@ -1175,7 +1175,7 @@ void cheat_manager::reload()
// load the cheat file, MESS will load a crc32.xml ( eg. 01234567.xml )
// and MAME will load gamename.xml
device_image_interface *image = NULL;
- for (bool gotone = machine().m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine().devicelist().first(image); gotone; gotone = image->next(image))
if (image->exists())
{
// if we are loading through software lists, try to load shortname.xml
diff --git a/src/emu/clifront.c b/src/emu/clifront.c
index b37fed41a28..da8997460c9 100644
--- a/src/emu/clifront.c
+++ b/src/emu/clifront.c
@@ -485,11 +485,11 @@ void cli_frontend::listsamples(const char *gamename)
while (drivlist.next())
{
// see if we have samples
- const device_config *devconfig;
- for (devconfig = drivlist.config().first_device(); devconfig != NULL; devconfig = devconfig->next())
- if (devconfig->type() == SAMPLES)
+ const device_t *device;
+ for (device = drivlist.config().first_device(); device != NULL; device = device->next())
+ if (device->type() == SAMPLES)
break;
- if (devconfig == NULL)
+ if (device == NULL)
continue;
// print a header
@@ -499,11 +499,11 @@ void cli_frontend::listsamples(const char *gamename)
mame_printf_info("Samples required for driver \"%s\".\n", drivlist.driver().name);
// iterate over samples devices
- for ( ; devconfig != NULL; devconfig = devconfig->next())
- if (devconfig->type() == SAMPLES)
+ for ( ; device != NULL; device = device->next())
+ if (device->type() == SAMPLES)
{
// if the list is legit, walk it and print the sample info
- const char *const *samplenames = reinterpret_cast<const samples_interface *>(devconfig->static_config())->samplenames;
+ const char *const *samplenames = reinterpret_cast<const samples_interface *>(device->static_config())->samplenames;
if (samplenames != NULL)
for (int sampnum = 0; samplenames[sampnum] != NULL; sampnum++)
if (samplenames[sampnum][0] != '*')
@@ -536,11 +536,11 @@ void cli_frontend::listdevices(const char *gamename)
printf("Driver %s (%s):\n", drivlist.driver().name, drivlist.driver().description);
// iterate through devices
- for (const device_config *devconfig = drivlist.config().first_device(); devconfig != NULL; devconfig = devconfig->next())
+ for (const device_t *device = drivlist.config().first_device(); device != NULL; device = device->next())
{
- printf(" %s ('%s')", devconfig->name(), devconfig->tag());
+ printf(" %s ('%s')", device->name(), device->tag());
- UINT32 clock = devconfig->clock();
+ UINT32 clock = device->clock();
if (clock >= 1000000000)
printf(" @ %d.%02d GHz\n", clock / 1000000000, (clock / 10000000) % 100);
else if (clock >= 1000000)
@@ -576,9 +576,9 @@ void cli_frontend::listmedia(const char *gamename)
while (drivlist.next())
{
// iterate
- const device_config_image_interface *imagedev = NULL;
+ const device_image_interface *imagedev = NULL;
bool first = true;
- for (bool gotone = drivlist.config().m_devicelist.first(imagedev); gotone; gotone = imagedev->next(imagedev))
+ for (bool gotone = drivlist.config().devicelist().first(imagedev); gotone; gotone = imagedev->next(imagedev))
{
// extract the shortname with parentheses
astring paren_shortname;
@@ -809,9 +809,9 @@ static void info_listsoftware(const char *gamename)
// first determine the maximum number of lists we might encounter
int list_count = 0;
while (drivlist.next())
- for (const device_config *dev = drivlist.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
+ for (const device_t *dev = drivlist.config().devicelist().first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
- software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
+ software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config();
for (int listnum = 0; listnum < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; listnum++)
if (swlist->list_name[listnum] && *swlist->list_name[listnum] && swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM)
@@ -898,9 +898,9 @@ static void info_listsoftware(const char *gamename)
drivlist.reset();
list_count = 0;
while (drivlist.next())
- for (const device_config *dev = drivlist.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
+ for (const device_t *dev = drivlist.config().devicelist().first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
- software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
+ software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config();
for (int listnum = 0; listnum < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; listnum++)
{
@@ -1452,9 +1452,9 @@ int media_identifier::find_by_hash(const hash_collection &hashes, int length)
}
// next iterate over softlists
- for (const device_config *dev = m_drivlist.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
+ for (const device_t *dev = m_drivlist.config().devicelist().first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
- software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
+ software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config();
for (int listnum = 0; listnum < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; listnum++)
if (swlist->list_name[listnum] != NULL)
diff --git a/src/emu/cpu/adsp2100/2100ops.c b/src/emu/cpu/adsp2100/2100ops.c
index 18d6f155a31..0c14e8f7b15 100644
--- a/src/emu/cpu/adsp2100/2100ops.c
+++ b/src/emu/cpu/adsp2100/2100ops.c
@@ -80,8 +80,8 @@ inline void adsp21xx_device::update_mstat()
m_alt = temp;
}
if ((m_mstat ^ m_mstat_prev) & MSTAT_TIMER)
- if (m_config.m_timer_fired != NULL)
- (*m_config.m_timer_fired)(*this, (m_mstat & MSTAT_TIMER) != 0);
+ if (m_timer_fired != NULL)
+ (*m_timer_fired)(*this, (m_mstat & MSTAT_TIMER) != 0);
if (m_mstat & MSTAT_STICKYV)
m_astat_clear = ~(CFLAG | NFLAG | ZFLAG);
else
@@ -419,11 +419,11 @@ void adsp21xx_device::write_reg3(int regnum, INT32 val)
case 0x05: cntr_stack_push(); m_cntr = val & 0x3fff; break;
case 0x06: m_core.sb.s = (INT32)(val << 27) >> 27; break;
case 0x07: m_px = val; break;
- case 0x09: if (m_config.m_sport_tx_callback != NULL) (*m_config.m_sport_tx_callback)(*this, 0, val); break;
- case 0x0b: if (m_config.m_sport_tx_callback != NULL) (*m_config.m_sport_tx_callback)(*this, 1, val); break;
+ case 0x09: if (m_sport_tx_callback != NULL) (*m_sport_tx_callback)(*this, 0, val); break;
+ case 0x0b: if (m_sport_tx_callback != NULL) (*m_sport_tx_callback)(*this, 1, val); break;
case 0x0c:
m_ifc = val;
- if (m_config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2181)
+ if (m_chip_type >= CHIP_TYPE_ADSP2181)
{
/* clear timer */
if (val & 0x0002) m_irq_latch[ADSP2181_IRQ0] = 0;
@@ -500,8 +500,8 @@ INT32 adsp21xx_device::read_reg3(int regnum)
case 0x05: return m_cntr;
case 0x06: return m_core.sb.s;
case 0x07: return m_px;
- case 0x08: if (m_config.m_sport_rx_callback) return (*m_config.m_sport_rx_callback)(*this, 0); else return 0;
- case 0x0a: if (m_config.m_sport_rx_callback) return (*m_config.m_sport_rx_callback)(*this, 1); else return 0;
+ case 0x08: if (m_sport_rx_callback) return (*m_sport_rx_callback)(*this, 0); else return 0;
+ case 0x0a: if (m_sport_rx_callback) return (*m_sport_rx_callback)(*this, 1); else return 0;
case 0x0f: return pc_stack_pop_val();
default: logerror("ADSP %04x: Reading from an invalid register!\n", m_ppc); return 0;
}
diff --git a/src/emu/cpu/adsp2100/adsp2100.c b/src/emu/cpu/adsp2100/adsp2100.c
index e5c261f21e2..bdc335e1057 100644
--- a/src/emu/cpu/adsp2100/adsp2100.c
+++ b/src/emu/cpu/adsp2100/adsp2100.c
@@ -131,205 +131,13 @@
#include "adsp2100.h"
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type ADSP2100 = adsp2100_device_config::static_alloc_device_config;
-const device_type ADSP2101 = adsp2101_device_config::static_alloc_device_config;
-const device_type ADSP2104 = adsp2104_device_config::static_alloc_device_config;
-const device_type ADSP2105 = adsp2105_device_config::static_alloc_device_config;
-const device_type ADSP2115 = adsp2115_device_config::static_alloc_device_config;
-const device_type ADSP2181 = adsp2181_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// TRIVIAL IMPLEMENTATIONS
-//**************************************************************************
-
-DEFINE_TRIVIAL_DERIVED_DEVICE(adsp2104_device_config, adsp2101_device_config, adsp2104_device, adsp2101_device, "ADSP-2104", CHIP_TYPE_ADSP2104)
-DEFINE_TRIVIAL_DERIVED_DEVICE(adsp2105_device_config, adsp2101_device_config, adsp2105_device, adsp2101_device, "ADSP-2105", CHIP_TYPE_ADSP2105)
-DEFINE_TRIVIAL_DERIVED_DEVICE(adsp2115_device_config, adsp2101_device_config, adsp2115_device, adsp2101_device, "ADSP-2115", CHIP_TYPE_ADSP2115)
-
-
-
-//**************************************************************************
-// ADSP21XX DEVICE CONFIG
-//**************************************************************************
-
-//-------------------------------------------------
-// adsp21xx_device_config - constructor
-//-------------------------------------------------
-
-adsp21xx_device_config::adsp21xx_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 chiptype)
- : cpu_device_config(mconfig, type, name, tag, owner, clock),
- m_program_config("program", ENDIANNESS_LITTLE, 32, 14, -2),
- m_data_config("data", ENDIANNESS_LITTLE, 16, 14, -1),
- m_chip_type(chiptype)
-{
- m_sport_rx_callback = NULL;
- m_sport_tx_callback = NULL;
- m_timer_fired = NULL;
-}
-
-adsp2100_device_config::adsp2100_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : adsp21xx_device_config(mconfig, static_alloc_device_config, "ADSP-2100", tag, owner, clock, CHIP_TYPE_ADSP2100) { }
-
-adsp2101_device_config::adsp2101_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 chiptype)
- : adsp21xx_device_config(mconfig, type, name, tag, owner, clock, chiptype) { }
-
-adsp2181_device_config::adsp2181_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : adsp21xx_device_config(mconfig, static_alloc_device_config, "ADSP-2181", tag, owner, clock, CHIP_TYPE_ADSP2181),
- m_io_config("I/O", ENDIANNESS_LITTLE, 16, 11, -1) { }
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *adsp2100_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(adsp2100_device_config(mconfig, tag, owner, clock));
-}
-
-device_config *adsp2101_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(adsp2101_device_config(mconfig, static_alloc_device_config, "ADSP-2101", tag, owner, clock, CHIP_TYPE_ADSP2101));
-}
-
-device_config *adsp2181_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(adsp2181_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *adsp2100_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, adsp2100_device(machine, *this));
-}
-
-device_t *adsp2101_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, adsp2101_device(machine, *this));
-}
-
-device_t *adsp2181_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, adsp2181_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// static_set_config - set the configuration
-// structure
-//-------------------------------------------------
-
-void adsp21xx_device_config::static_set_config(device_config *device, const adsp21xx_config &config)
-{
- adsp21xx_device_config *adsp = downcast<adsp21xx_device_config *>(device);
- *static_cast<adsp21xx_config *>(adsp) = config;
-}
-
-
-//-------------------------------------------------
-// execute_min_cycles - return minimum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 adsp21xx_device_config::execute_min_cycles() const
-{
- return 1;
-}
-
-
-//-------------------------------------------------
-// execute_max_cycles - return maximum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 adsp21xx_device_config::execute_max_cycles() const
-{
- return 1;
-}
-
-
-//-------------------------------------------------
-// execute_input_lines - return the number of
-// input/interrupt lines
-//-------------------------------------------------
-
-UINT32 adsp2100_device_config::execute_input_lines() const
-{
- return 4;
-}
-
-UINT32 adsp2101_device_config::execute_input_lines() const
-{
- return 5;
-}
-
-UINT32 adsp2181_device_config::execute_input_lines() const
-{
- return 9;
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return the configuration
-// of the specified address space, or NULL if
-// the space doesn't exist
-//-------------------------------------------------
-
-const address_space_config *adsp2100_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_PROGRAM) ? &m_program_config :
- (spacenum == AS_DATA) ? &m_data_config :
- NULL;
-}
-
-const address_space_config *adsp2101_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_PROGRAM) ? &m_program_config :
- (spacenum == AS_DATA) ? &m_data_config :
- NULL;
-}
-
-const address_space_config *adsp2181_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_PROGRAM) ? &m_program_config :
- (spacenum == AS_DATA) ? &m_data_config :
- (spacenum == AS_IO) ? &m_io_config :
- NULL;
-}
-
-
-//-------------------------------------------------
-// disasm_min_opcode_bytes - return the length
-// of the shortest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 adsp21xx_device_config::disasm_min_opcode_bytes() const
-{
- return 4;
-}
-
-
-//-------------------------------------------------
-// disasm_max_opcode_bytes - return the length
-// of the longest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 adsp21xx_device_config::disasm_max_opcode_bytes() const
-{
- return 4;
-}
-
+// device type definitions
+const device_type ADSP2100 = &device_creator<adsp2100_device>;
+const device_type ADSP2101 = &device_creator<adsp2101_device>;
+const device_type ADSP2104 = &device_creator<adsp2104_device>;
+const device_type ADSP2105 = &device_creator<adsp2105_device>;
+const device_type ADSP2115 = &device_creator<adsp2115_device>;
+const device_type ADSP2181 = &device_creator<adsp2181_device>;
//**************************************************************************
@@ -340,9 +148,11 @@ UINT32 adsp21xx_device_config::disasm_max_opcode_bytes() const
// adsp21xx_device - constructor
//-------------------------------------------------
-adsp21xx_device::adsp21xx_device(running_machine &_machine, const adsp21xx_device_config &config)
- : cpu_device(_machine, config),
- m_config(config),
+adsp21xx_device::adsp21xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype)
+ : cpu_device(mconfig, type, name, tag, owner, clock),
+ m_program_config("program", ENDIANNESS_LITTLE, 32, 14, -2),
+ m_data_config("data", ENDIANNESS_LITTLE, 16, 14, -1),
+ m_chip_type(chiptype),
m_pc(0),
m_ppc(0),
m_loop(0),
@@ -371,9 +181,9 @@ adsp21xx_device::adsp21xx_device(running_machine &_machine, const adsp21xx_devic
m_icntl(0),
m_ifc(0),
m_icount(0),
- m_mstat_mask((config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2101) ? 0x7f : 0x0f),
- m_imask_mask((config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2181) ? 0x3ff :
- (config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2101) ? 0x3f : 0x0f)
+ m_mstat_mask((m_chip_type >= CHIP_TYPE_ADSP2101) ? 0x7f : 0x0f),
+ m_imask_mask((m_chip_type >= CHIP_TYPE_ADSP2181) ? 0x3ff :
+ (m_chip_type >= CHIP_TYPE_ADSP2101) ? 0x3f : 0x0f)
{
// initialize remaining state
memset(&m_core, 0, sizeof(m_core));
@@ -390,6 +200,10 @@ adsp21xx_device::adsp21xx_device(running_machine &_machine, const adsp21xx_devic
memset(&m_irq_state, 0, sizeof(m_irq_state));
memset(&m_irq_latch, 0, sizeof(m_irq_latch));
+ m_sport_rx_callback = NULL;
+ m_sport_tx_callback = NULL;
+ m_timer_fired = NULL;
+
// create the tables
create_tables();
@@ -463,14 +277,27 @@ adsp21xx_device::adsp21xx_device(running_machine &_machine, const adsp21xx_devic
m_shift_xregs[7] = &m_core.sr.srx.sr1;
}
-adsp2100_device::adsp2100_device(running_machine &_machine, const adsp2100_device_config &config)
- : adsp21xx_device(_machine, config) { }
+adsp2100_device::adsp2100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : adsp21xx_device(mconfig, ADSP2100, "ADSP-2100", tag, owner, clock, CHIP_TYPE_ADSP2100) { }
-adsp2101_device::adsp2101_device(running_machine &_machine, const adsp2101_device_config &config)
- : adsp21xx_device(_machine, config) { }
+adsp2101_device::adsp2101_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : adsp21xx_device(mconfig, ADSP2101, "ADSP-2101", tag, owner, clock, CHIP_TYPE_ADSP2101) { }
-adsp2181_device::adsp2181_device(running_machine &_machine, const adsp2181_device_config &config)
- : adsp21xx_device(_machine, config) { }
+adsp2101_device::adsp2101_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype)
+ : adsp21xx_device(mconfig, type, name, tag, owner, clock, chiptype) { }
+
+adsp2104_device::adsp2104_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : adsp2101_device(mconfig, ADSP2104, "ADSP-2104", tag, owner, clock, CHIP_TYPE_ADSP2104) { }
+
+adsp2105_device::adsp2105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : adsp2101_device(mconfig, ADSP2105, "ADSP-2105", tag, owner, clock, CHIP_TYPE_ADSP2105) { }
+
+adsp2115_device::adsp2115_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : adsp2101_device(mconfig, ADSP2115, "ADSP-2115", tag, owner, clock, CHIP_TYPE_ADSP2115) { }
+
+adsp2181_device::adsp2181_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : adsp21xx_device(mconfig, ADSP2181, "ADSP-2181", tag, owner, clock, CHIP_TYPE_ADSP2181),
+ m_io_config("I/O", ENDIANNESS_LITTLE, 16, 11, -1) { }
//-------------------------------------------------
@@ -498,6 +325,18 @@ adsp21xx_device::~adsp21xx_device()
//-------------------------------------------------
+// static_set_config - set the configuration
+// structure
+//-------------------------------------------------
+
+void adsp21xx_device::static_set_config(device_t &device, const adsp21xx_config &config)
+{
+ adsp21xx_device &adsp = downcast<adsp21xx_device &>(device);
+ static_cast<adsp21xx_config &>(adsp) = config;
+}
+
+
+//-------------------------------------------------
// load_boot_data - load the boot data from an
// 8-bit ROM
//-------------------------------------------------
@@ -757,7 +596,7 @@ void adsp21xx_device::device_start()
state_add(ADSP2100_CNTR, "CNTR", m_cntr).mask(0x3fff);
state_add(ADSP2100_ASTAT, "ASTAT", m_astat).mask(0xff);
state_add(ADSP2100_SSTAT, "SSTAT", m_sstat).mask(0xff);
- state_add(ADSP2100_MSTAT, "MSTAT", m_mstat).mask((m_config.m_chip_type == adsp21xx_device_config::CHIP_TYPE_ADSP2100) ? 0x0f : 0x7f).callimport();
+ state_add(ADSP2100_MSTAT, "MSTAT", m_mstat).mask((m_chip_type == CHIP_TYPE_ADSP2100) ? 0x0f : 0x7f).callimport();
state_add(ADSP2100_PCSP, "PCSP", m_pc_sp).mask(0xff);
state_add(STATE_GENSP, "GENSP", m_pc_sp).mask(0xff).noshow();
@@ -765,11 +604,11 @@ void adsp21xx_device::device_start()
state_add(ADSP2100_STATSP, "STATSP", m_stat_sp).mask(0xf);
state_add(ADSP2100_LOOPSP, "LOOPSP", m_loop_sp).mask(0xf);
- state_add(ADSP2100_IMASK, "IMASK", m_imask).mask((m_config.m_chip_type == adsp21xx_device_config::CHIP_TYPE_ADSP2100) ? 0x00f : (m_config.m_chip_type == adsp21xx_device_config::CHIP_TYPE_ADSP2181) ? 0x3ff : 0x07f).callimport();
+ state_add(ADSP2100_IMASK, "IMASK", m_imask).mask((m_chip_type == CHIP_TYPE_ADSP2100) ? 0x00f : (m_chip_type == CHIP_TYPE_ADSP2181) ? 0x3ff : 0x07f).callimport();
state_add(ADSP2100_ICNTL, "ICNTL", m_icntl).mask(0x1f).callimport();
for (int irqnum = 0; irqnum < 4; irqnum++)
- if (irqnum < 4 || m_config.m_chip_type == adsp21xx_device_config::CHIP_TYPE_ADSP2100)
+ if (irqnum < 4 || m_chip_type == CHIP_TYPE_ADSP2100)
state_add(ADSP2100_IRQSTATE0 + irqnum, tempstring.format("IRQ%d", irqnum), m_irq_state[irqnum]).mask(1).callimport();
state_add(ADSP2100_FLAGIN, "FLAGIN", m_flagin).mask(1);
@@ -803,7 +642,7 @@ void adsp21xx_device::device_reset()
write_reg2(0x0b, m_l[7]); write_reg2(0x03, m_i[7]);
// reset PC and loops
- m_pc = (m_config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2101) ? 0 : 4;
+ m_pc = (m_chip_type >= CHIP_TYPE_ADSP2101) ? 0 : 4;
m_ppc = -1;
m_loop = 0xffff;
m_loop_condition = 0;
@@ -836,6 +675,35 @@ void adsp21xx_device::device_reset()
//-------------------------------------------------
+// memory_space_config - return the configuration
+// of the specified address space, or NULL if
+// the space doesn't exist
+//-------------------------------------------------
+
+const address_space_config *adsp2100_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_PROGRAM) ? &m_program_config :
+ (spacenum == AS_DATA) ? &m_data_config :
+ NULL;
+}
+
+const address_space_config *adsp2101_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_PROGRAM) ? &m_program_config :
+ (spacenum == AS_DATA) ? &m_data_config :
+ NULL;
+}
+
+const address_space_config *adsp2181_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_PROGRAM) ? &m_program_config :
+ (spacenum == AS_DATA) ? &m_data_config :
+ (spacenum == AS_IO) ? &m_io_config :
+ NULL;
+}
+
+
+//-------------------------------------------------
// state_import - import state into the device,
// after it has been set
//-------------------------------------------------
@@ -911,6 +779,28 @@ void adsp21xx_device::state_string_export(const device_state_entry &entry, astri
//-------------------------------------------------
+// disasm_min_opcode_bytes - return the length
+// of the shortest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 adsp21xx_device::disasm_min_opcode_bytes() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
+// disasm_max_opcode_bytes - return the length
+// of the longest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 adsp21xx_device::disasm_max_opcode_bytes() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
// disasm_disassemble - call the disassembly
// helper function
//-------------------------------------------------
@@ -1250,6 +1140,49 @@ void adsp21xx_device::create_tables()
CORE EXECUTION LOOP
***************************************************************************/
+//-------------------------------------------------
+// execute_min_cycles - return minimum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 adsp21xx_device::execute_min_cycles() const
+{
+ return 1;
+}
+
+
+//-------------------------------------------------
+// execute_max_cycles - return maximum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 adsp21xx_device::execute_max_cycles() const
+{
+ return 1;
+}
+
+
+//-------------------------------------------------
+// execute_input_lines - return the number of
+// input/interrupt lines
+//-------------------------------------------------
+
+UINT32 adsp2100_device::execute_input_lines() const
+{
+ return 4;
+}
+
+UINT32 adsp2101_device::execute_input_lines() const
+{
+ return 5;
+}
+
+UINT32 adsp2181_device::execute_input_lines() const
+{
+ return 9;
+}
+
+
void adsp21xx_device::execute_set_input(int inputnum, int state)
{
// update the latched state
@@ -1312,7 +1245,7 @@ void adsp21xx_device::execute_run()
// 00000001 0xxxxxxx xxxxxxxx dst = IO(x)
// 00000001 1xxxxxxx xxxxxxxx IO(x) = dst
// ADSP-218x only
- if (m_config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2181)
+ if (m_chip_type >= CHIP_TYPE_ADSP2181)
{
if ((op & 0x008000) == 0x000000)
write_reg0(op & 15, io_read((op >> 4) & 0x7ff));
@@ -1335,7 +1268,7 @@ void adsp21xx_device::execute_run()
{
if (op & 0x020) m_flagout = 0;
if (op & 0x010) m_flagout ^= 1;
- if (m_config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2101)
+ if (m_chip_type >= CHIP_TYPE_ADSP2101)
{
if (op & 0x080) m_fl0 = 0;
if (op & 0x040) m_fl0 ^= 1;
@@ -1453,7 +1386,7 @@ void adsp21xx_device::execute_run()
break;
case 0x0c:
// 00001100 xxxxxxxx xxxxxxxx mode control
- if (m_config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2101)
+ if (m_chip_type >= CHIP_TYPE_ADSP2101)
{
if (op & 0x000008) m_mstat = (m_mstat & ~MSTAT_GOMODE) | ((op << 5) & MSTAT_GOMODE);
if (op & 0x002000) m_mstat = (m_mstat & ~MSTAT_INTEGER) | ((op >> 8) & MSTAT_INTEGER);
@@ -1567,7 +1500,7 @@ void adsp21xx_device::execute_run()
// 0010000x xxxxxxxx xxxxxxxx conditional MAC to MR
if (condition(op & 15))
{
- if (m_config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2181 && (op & 0x0018f0) == 0x000010)
+ if (m_chip_type >= CHIP_TYPE_ADSP2181 && (op & 0x0018f0) == 0x000010)
mac_op_mr_xop(op);
else
mac_op_mr(op);
@@ -1577,7 +1510,7 @@ void adsp21xx_device::execute_run()
// 0010001x xxxxxxxx xxxxxxxx conditional ALU to AR
if (condition(op & 15))
{
- if (m_config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2181 && (op & 0x000010) == 0x000010)
+ if (m_chip_type >= CHIP_TYPE_ADSP2181 && (op & 0x000010) == 0x000010)
alu_op_ar_const(op);
else
alu_op_ar(op);
@@ -1587,7 +1520,7 @@ void adsp21xx_device::execute_run()
// 0010010x xxxxxxxx xxxxxxxx conditional MAC to MF
if (condition(op & 15))
{
- if (m_config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2181 && (op & 0x0018f0) == 0x000010)
+ if (m_chip_type >= CHIP_TYPE_ADSP2181 && (op & 0x0018f0) == 0x000010)
mac_op_mf_xop(op);
else
mac_op_mf(op);
@@ -1597,7 +1530,7 @@ void adsp21xx_device::execute_run()
// 0010011x xxxxxxxx xxxxxxxx conditional ALU to AF
if (condition(op & 15))
{
- if (m_config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2181 && (op & 0x000010) == 0x000010)
+ if (m_chip_type >= CHIP_TYPE_ADSP2181 && (op & 0x000010) == 0x000010)
alu_op_af_const(op);
else
alu_op_af(op);
@@ -1611,7 +1544,7 @@ void adsp21xx_device::execute_run()
break;
case 0x2a: case 0x2b:
// 0010101x xxxxxxxx xxxxxxxx ALU to AR with internal data register move
- if (m_config.m_chip_type >= adsp21xx_device_config::CHIP_TYPE_ADSP2181 && (op & 0x0000ff) == 0x0000aa)
+ if (m_chip_type >= CHIP_TYPE_ADSP2181 && (op & 0x0000ff) == 0x0000aa)
alu_op_none(op);
else
{
diff --git a/src/emu/cpu/adsp2100/adsp2100.h b/src/emu/cpu/adsp2100/adsp2100.h
index 71c22755cf0..4e39cf2cddf 100644
--- a/src/emu/cpu/adsp2100/adsp2100.h
+++ b/src/emu/cpu/adsp2100/adsp2100.h
@@ -213,21 +213,7 @@ enum
//**************************************************************************
#define MCFG_ADSP21XX_CONFIG(_config) \
- adsp21xx_device_config::static_set_config(device, _config); \
-
-
-
-//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// device type definition
-extern const device_type ADSP2100;
-extern const device_type ADSP2101;
-extern const device_type ADSP2104;
-extern const device_type ADSP2105;
-extern const device_type ADSP2115;
-extern const device_type ADSP2181;
+ adsp21xx_device::static_set_config(*device, _config); \
@@ -236,9 +222,6 @@ extern const device_type ADSP2181;
//**************************************************************************
class adsp21xx_device;
-class adsp2100_device;
-class adsp2101_device;
-class adsp2181_device;
// transmit and receive data callbacks types
typedef INT32 (*adsp21xx_rx_func)(adsp21xx_device &device, int port);
@@ -257,13 +240,11 @@ struct adsp21xx_config
-// ======================> adsp21xx_device_config
+// ======================> adsp21xx_device
-class adsp21xx_device_config : public cpu_device_config,
- public adsp21xx_config
+class adsp21xx_device : public cpu_device,
+ public adsp21xx_config
{
- friend class adsp21xx_device;
-
protected:
enum
{
@@ -276,43 +257,13 @@ protected:
};
// construction/destruction
- adsp21xx_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 chiptype);
+ adsp21xx_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype);
+ virtual ~adsp21xx_device();
public:
// inline configuration helpers
- static void static_set_config(device_config *device, const adsp21xx_config &config);
-
-protected:
- // device_config_execute_interface overrides
- virtual UINT32 execute_min_cycles() const;
- virtual UINT32 execute_max_cycles() const;
-
- // device_config_disasm_interface overrides
- virtual UINT32 disasm_min_opcode_bytes() const;
- virtual UINT32 disasm_max_opcode_bytes() const;
-
- // address spaces
- const address_space_config m_program_config;
- const address_space_config m_data_config;
-
- // internal state
- UINT32 m_chip_type;
-};
-
+ static void static_set_config(device_t &device, const adsp21xx_config &config);
-
-// ======================> adsp21xx_device
-
-class adsp21xx_device : public cpu_device
-{
- friend class adsp21xx_device_config;
-
-protected:
- // construction/destruction
- adsp21xx_device(running_machine &_machine, const adsp21xx_device_config &config);
- virtual ~adsp21xx_device();
-
-public:
// public interfaces
void load_boot_data(UINT8 *srcdata, UINT32 *dstdata);
@@ -322,6 +273,8 @@ protected:
virtual void device_reset();
// device_execute_interface overrides
+ virtual UINT32 execute_min_cycles() const;
+ virtual UINT32 execute_max_cycles() const;
virtual void execute_run();
virtual void execute_set_input(int inputnum, int state);
@@ -330,6 +283,8 @@ protected:
virtual void state_string_export(const device_state_entry &entry, astring &string);
// device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const;
+ virtual UINT32 disasm_max_opcode_bytes() const;
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
// helpers
@@ -458,7 +413,9 @@ protected:
};
// configuration
- const adsp21xx_device_config &m_config;
+ const address_space_config m_program_config;
+ const address_space_config m_data_config;
+ UINT32 m_chip_type;
// other CPU registers
UINT32 m_pc;
@@ -559,37 +516,20 @@ protected:
};
-// ======================> adsp2100_device_config
+// ======================> adsp2100_device
-class adsp2100_device_config : public adsp21xx_device_config
+class adsp2100_device : public adsp21xx_device
{
- friend class adsp2100_device;
-
- // construction/destruction
- adsp2100_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
+ // construction/destruction
+ adsp2100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
- // device_config_execute_interface overrides
+ // device_execute_interface overrides
virtual UINT32 execute_input_lines() const;
- // device_config_memory_interface overrides
+ // device_memory_interface overrides
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-};
-
-
-// ======================> adsp2100_device
-
-class adsp2100_device : public adsp21xx_device
-{
- friend class adsp2100_device_config;
-
- // construction/destruction
- adsp2100_device(running_machine &_machine, const adsp2100_device_config &config);
// interrupts
virtual bool generate_irq(int which, int indx);
@@ -597,42 +537,22 @@ class adsp2100_device : public adsp21xx_device
};
-// ======================> adsp2101_device_config
+// ======================> adsp2101_device
-class adsp2101_device_config : public adsp21xx_device_config
+class adsp2101_device : public adsp21xx_device
{
- friend class adsp2101_device;
-
-protected:
- // construction/destruction
- adsp2101_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 chiptype);
-
public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
+ // construction/destruction
+ adsp2101_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
- // device_config_execute_interface overrides
+ adsp2101_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype);
+
+ // device_execute_interface overrides
virtual UINT32 execute_input_lines() const;
- // device_config_memory_interface overrides
+ // device_memory_interface overrides
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-};
-
-
-// ======================> adsp2101_device
-
-class adsp2101_device : public adsp21xx_device
-{
- friend class adsp2101_device_config;
- friend class adsp2104_device_config;
- friend class adsp2105_device_config;
- friend class adsp2115_device_config;
-
-protected:
- // construction/destruction
- adsp2101_device(running_machine &_machine, const adsp2101_device_config &config);
// interrupts
virtual bool generate_irq(int which, int indx);
@@ -640,45 +560,28 @@ protected:
};
-// ======================> adsp2181_device_config
+// ======================> adsp2181_device
-class adsp2181_device_config : public adsp21xx_device_config
+class adsp2181_device : public adsp21xx_device
{
- friend class adsp2181_device;
-
- // construction/destruction
- adsp2181_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
+ // construction/destruction
+ adsp2181_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
- // device_config_execute_interface overrides
+ // device_execute_interface overrides
virtual UINT32 execute_input_lines() const;
- // device_config_memory_interface overrides
+ // device_memory_interface overrides
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
- // address spaces
- const address_space_config m_io_config;
-};
-
-
-// ======================> adsp2181_device
-
-class adsp2181_device : public adsp21xx_device
-{
- friend class adsp2181_device_config;
-
- // construction/destruction
- adsp2181_device(running_machine &_machine, const adsp2181_device_config &config);
-
// interrupts
virtual bool generate_irq(int which, int indx);
virtual void check_irqs();
+ // address spaces
+ const address_space_config m_io_config;
+
public:
// public interfaces
void idma_addr_w(UINT16 data);
@@ -690,9 +593,33 @@ public:
// ======================> trivial variants
-DECLARE_TRIVIAL_DERIVED_DEVICE(adsp2104_device_config, adsp2101_device_config, adsp2104_device, adsp2101_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(adsp2105_device_config, adsp2101_device_config, adsp2105_device, adsp2101_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(adsp2115_device_config, adsp2101_device_config, adsp2115_device, adsp2101_device)
+class adsp2104_device : public adsp2101_device
+{
+public:
+ adsp2104_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class adsp2105_device : public adsp2101_device
+{
+public:
+ adsp2105_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class adsp2115_device : public adsp2101_device
+{
+public:
+ adsp2115_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+
+
+// device type definition
+extern const device_type ADSP2100;
+extern const device_type ADSP2101;
+extern const device_type ADSP2104;
+extern const device_type ADSP2105;
+extern const device_type ADSP2115;
+extern const device_type ADSP2181;
#endif /* __ADSP2100_H__ */
diff --git a/src/emu/cpu/asap/asap.c b/src/emu/cpu/asap/asap.c
index 538fe8621a6..115278ec9a9 100644
--- a/src/emu/cpu/asap/asap.c
+++ b/src/emu/cpu/asap/asap.c
@@ -46,14 +46,6 @@
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type ASAP = asap_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
// CONSTANTS
//**************************************************************************
@@ -163,119 +155,19 @@ const asap_device::ophandler asap_device::s_conditiontable[16] =
//**************************************************************************
-// ASAP DEVICE CONFIG
-//**************************************************************************
-
-//-------------------------------------------------
-// asap_device_config - constructor
-//-------------------------------------------------
-
-asap_device_config::asap_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : cpu_device_config(mconfig, static_alloc_device_config, "ASAP", tag, owner, clock),
- m_program_config("program", ENDIANNESS_LITTLE, 32, 32)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *asap_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(asap_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *asap_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, asap_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// execute_min_cycles - return minimum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 asap_device_config::execute_min_cycles() const
-{
- return 1;
-}
-
-
-//-------------------------------------------------
-// execute_max_cycles - return maximum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 asap_device_config::execute_max_cycles() const
-{
- return 2;
-}
-
-
-//-------------------------------------------------
-// execute_input_lines - return the number of
-// input/interrupt lines
-//-------------------------------------------------
-
-UINT32 asap_device_config::execute_input_lines() const
-{
- return 1;
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return the configuration
-// of the specified address space, or NULL if
-// the space doesn't exist
-//-------------------------------------------------
-
-const address_space_config *asap_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_PROGRAM) ? &m_program_config : NULL;
-}
-
-
-//-------------------------------------------------
-// disasm_min_opcode_bytes - return the length
-// of the shortest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 asap_device_config::disasm_min_opcode_bytes() const
-{
- return 4;
-}
-
-
-//-------------------------------------------------
-// disasm_max_opcode_bytes - return the length
-// of the longest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 asap_device_config::disasm_max_opcode_bytes() const
-{
- return 12;
-}
-
-
-
-//**************************************************************************
// DEVICE INTERFACE
//**************************************************************************
+// device type definition
+const device_type ASAP = &device_creator<asap_device>;
+
//-------------------------------------------------
// asap_device - constructor
//-------------------------------------------------
-asap_device::asap_device(running_machine &_machine, const asap_device_config &config)
- : cpu_device(_machine, config),
+asap_device::asap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : cpu_device(mconfig, ASAP, "ASAP", tag, owner, clock),
+ m_program_config("program", ENDIANNESS_LITTLE, 32, 32),
m_pc(0),
m_pflag(0),
m_iflag(0),
@@ -368,6 +260,18 @@ void asap_device::device_reset()
//-------------------------------------------------
+// memory_space_config - return the configuration
+// of the specified address space, or NULL if
+// the space doesn't exist
+//-------------------------------------------------
+
+const address_space_config *asap_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_PROGRAM) ? &m_program_config : NULL;
+}
+
+
+//-------------------------------------------------
// state_import - import state into the device,
// after it has been set
//-------------------------------------------------
@@ -424,6 +328,28 @@ void asap_device::state_string_export(const device_state_entry &entry, astring &
//-------------------------------------------------
+// disasm_min_opcode_bytes - return the length
+// of the shortest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 asap_device::disasm_min_opcode_bytes() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
+// disasm_max_opcode_bytes - return the length
+// of the longest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 asap_device::disasm_max_opcode_bytes() const
+{
+ return 12;
+}
+
+
+//-------------------------------------------------
// disasm_disassemble - call the disassembly
// helper function
//-------------------------------------------------
@@ -623,6 +549,39 @@ inline void asap_device::execute_instruction()
}
+//-------------------------------------------------
+// execute_min_cycles - return minimum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 asap_device::execute_min_cycles() const
+{
+ return 1;
+}
+
+
+//-------------------------------------------------
+// execute_max_cycles - return maximum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 asap_device::execute_max_cycles() const
+{
+ return 2;
+}
+
+
+//-------------------------------------------------
+// execute_input_lines - return the number of
+// input/interrupt lines
+//-------------------------------------------------
+
+UINT32 asap_device::execute_input_lines() const
+{
+ return 1;
+}
+
+
void asap_device::execute_set_input(int inputnum, int state)
{
m_irq_state = (state != CLEAR_LINE);
diff --git a/src/emu/cpu/asap/asap.h b/src/emu/cpu/asap/asap.h
index 03a93574cb6..8728470579e 100644
--- a/src/emu/cpu/asap/asap.h
+++ b/src/emu/cpu/asap/asap.h
@@ -49,49 +49,14 @@
//**************************************************************************
-// ======================> asap_device_config
-
-class asap_device_config : public cpu_device_config
-{
- friend class asap_device;
-
- // construction/destruction
- asap_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config_execute_interface overrides
- virtual UINT32 execute_min_cycles() const;
- virtual UINT32 execute_max_cycles() const;
- virtual UINT32 execute_input_lines() const;
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // device_config_disasm_interface overrides
- virtual UINT32 disasm_min_opcode_bytes() const;
- virtual UINT32 disasm_max_opcode_bytes() const;
-
- // inline data
- const address_space_config m_program_config;
-};
-
-
-
// ======================> asap_device
class asap_device : public cpu_device
{
- friend class asap_device_config;
-
+public:
// construction/destruction
- asap_device(running_machine &_machine, const asap_device_config &config);
+ asap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
// public interfaces
protected:
@@ -100,15 +65,23 @@ protected:
virtual void device_reset();
// device_execute_interface overrides
+ virtual UINT32 execute_min_cycles() const;
+ virtual UINT32 execute_max_cycles() const;
+ virtual UINT32 execute_input_lines() const;
virtual void execute_run();
virtual void execute_set_input(int inputnum, int state);
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
// device_state_interface overrides
virtual void state_import(const device_state_entry &entry);
virtual void state_export(const device_state_entry &entry);
virtual void state_string_export(const device_state_entry &entry, astring &string);
// device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const;
+ virtual UINT32 disasm_max_opcode_bytes() const;
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
// helpers
@@ -240,6 +213,7 @@ protected:
void trapf();
// internal state
+ const address_space_config m_program_config;
UINT32 m_pc;
// expanded flags
diff --git a/src/emu/cpu/ccpu/ccpu.c b/src/emu/cpu/ccpu/ccpu.c
index c4920b40d37..0df55522816 100644
--- a/src/emu/cpu/ccpu/ccpu.c
+++ b/src/emu/cpu/ccpu/ccpu.c
@@ -124,7 +124,7 @@ void ccpu_wdt_timer_trigger(device_t *device)
static CPU_INIT( ccpu )
{
- const ccpu_config *configdata = (const ccpu_config *)device->baseconfig().static_config();
+ const ccpu_config *configdata = (const ccpu_config *)device->static_config();
ccpu_state *cpustate = get_safe_token(device);
/* copy input params */
diff --git a/src/emu/cpu/cop400/cop400.c b/src/emu/cpu/cop400/cop400.c
index 3a0c74a10aa..f629e7913bd 100644
--- a/src/emu/cpu/cop400/cop400.c
+++ b/src/emu/cpu/cop400/cop400.c
@@ -869,7 +869,7 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
{
cop400_state *cpustate = get_safe_token(device);
- cpustate->intf = (cop400_interface *) device->baseconfig().static_config();
+ cpustate->intf = (cop400_interface *) device->static_config();
/* find address spaces */
@@ -1380,7 +1380,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 = (devconfig->static_config() != NULL) ? (cop400_interface *)devconfig->static_config() : NULL;
+ cop400_interface *intf = (device->static_config() != NULL) ? (cop400_interface *)device->static_config() : NULL;
switch (state)
{
diff --git a/src/emu/cpu/cosmac/cosmac.c b/src/emu/cpu/cosmac/cosmac.c
index df6b5a3c7eb..cc20ab3e138 100644
--- a/src/emu/cpu/cosmac/cosmac.c
+++ b/src/emu/cpu/cosmac/cosmac.c
@@ -28,14 +28,6 @@ ALLOW_SAVE_TYPE(cosmac_device::cosmac_state);
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type COSMAC = cosmac_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
// CONSTANTS
//**************************************************************************
@@ -182,116 +174,33 @@ const cosmac_device::ophandler cosmac_device::s_opcodetable[256] =
//**************************************************************************
-// COSMAC DEVICE CONFIG
+// DEVICE INTERFACE
//**************************************************************************
-//-------------------------------------------------
-// cosmac_device_config - constructor
-//-------------------------------------------------
-
-cosmac_device_config::cosmac_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : cpu_device_config(mconfig, static_alloc_device_config, "COSMAC", tag, owner, clock),
- m_program_config("program", ENDIANNESS_LITTLE, 8, 16),
- m_io_config("io", ENDIANNESS_LITTLE, 8, 3)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *cosmac_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(cosmac_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *cosmac_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, cosmac_device(machine, *this));
-}
+// device type definition
+const device_type COSMAC = &device_creator<cosmac_device>;
//-------------------------------------------------
-// execute_min_cycles - return minimum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 cosmac_device_config::execute_min_cycles() const
-{
- return 8 * 2;
-}
-
-
-//-------------------------------------------------
-// execute_max_cycles - return maximum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 cosmac_device_config::execute_max_cycles() const
-{
- return 8 * 3;
-}
-
-
-//-------------------------------------------------
-// execute_input_lines - return the number of
-// input/interrupt lines
-//-------------------------------------------------
-
-UINT32 cosmac_device_config::execute_input_lines() const
-{
- return 7;
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return the configuration
-// of the specified address space, or NULL if
-// the space doesn't exist
-//-------------------------------------------------
-
-const address_space_config *cosmac_device_config::memory_space_config(address_spacenum spacenum) const
-{
- switch (spacenum)
- {
- case AS_PROGRAM:
- return &m_program_config;
-
- case AS_IO:
- return &m_io_config;
-
- default:
- return NULL;
- }
-}
-
-
-//-------------------------------------------------
-// disasm_min_opcode_bytes - return the length
-// of the shortest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 cosmac_device_config::disasm_min_opcode_bytes() const
-{
- return 1;
-}
-
-
-//-------------------------------------------------
-// disasm_max_opcode_bytes - return the length
-// of the longest instruction, in bytes
+// cosmac_device - constructor
//-------------------------------------------------
-UINT32 cosmac_device_config::disasm_max_opcode_bytes() const
+cosmac_device::cosmac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : cpu_device(mconfig, COSMAC, "COSMAC", tag, owner, clock),
+ m_program_config("program", ENDIANNESS_LITTLE, 8, 16),
+ m_io_config("io", ENDIANNESS_LITTLE, 8, 3),
+ m_op(0),
+ m_state(COSMAC_STATE_1_RESET),
+ m_mode(COSMAC_MODE_RESET),
+ m_irq(0),
+ m_dmain(0),
+ m_dmaout(0),
+ m_program(NULL),
+ m_io(NULL),
+ m_direct(NULL)
{
- return 3;
+ for (int i = 0; i < 4; i++)
+ EF[i] = 0;
}
@@ -301,7 +210,7 @@ UINT32 cosmac_device_config::disasm_max_opcode_bytes() const
// complete
//-------------------------------------------------
-void cosmac_device_config::device_config_complete()
+void cosmac_device::device_config_complete()
{
// inherit a copy of the static data
const cosmac_interface *intf = reinterpret_cast<const cosmac_interface *>(static_config());
@@ -324,33 +233,6 @@ void cosmac_device_config::device_config_complete()
}
-
-//**************************************************************************
-// DEVICE INTERFACE
-//**************************************************************************
-
-//-------------------------------------------------
-// cosmac_device - constructor
-//-------------------------------------------------
-
-cosmac_device::cosmac_device(running_machine &_machine, const cosmac_device_config &config)
- : cpu_device(_machine, config),
- m_op(0),
- m_state(COSMAC_STATE_1_RESET),
- m_mode(COSMAC_MODE_RESET),
- m_irq(0),
- m_dmain(0),
- m_dmaout(0),
- m_program(NULL),
- m_io(NULL),
- m_direct(NULL),
- m_config(config)
-{
- for (int i = 0; i < 4; i++)
- EF[i] = 0;
-}
-
-
//-------------------------------------------------
// device_start - start up the device
//-------------------------------------------------
@@ -384,18 +266,18 @@ void cosmac_device::device_start()
state_add(COSMAC_Q, "Q", m_q).mask(0x1).noshow();
// resolve callbacks
- devcb_resolve_read_line(&m_in_wait_func, &m_config.m_in_wait_func, this);
- devcb_resolve_read_line(&m_in_clear_func, &m_config.m_in_clear_func, this);
- devcb_resolve_read_line(&m_in_ef_func[0], &m_config.m_in_ef1_func, this);
- devcb_resolve_read_line(&m_in_ef_func[1], &m_config.m_in_ef2_func, this);
- devcb_resolve_read_line(&m_in_ef_func[2], &m_config.m_in_ef3_func, this);
- devcb_resolve_read_line(&m_in_ef_func[3], &m_config.m_in_ef4_func, this);
- devcb_resolve_write_line(&m_out_q_func, &m_config.m_out_q_func, this);
- devcb_resolve_read8(&m_in_dma_func, &m_config.m_in_dma_func, this);
- devcb_resolve_write8(&m_out_dma_func, &m_config.m_out_dma_func, this);
- m_out_sc_func = m_config.m_out_sc_func;
- devcb_resolve_write_line(&m_out_tpa_func, &m_config.m_out_tpa_func, this);
- devcb_resolve_write_line(&m_out_tpb_func, &m_config.m_out_tpb_func, this);
+ devcb_resolve_read_line(&m_in_wait_func, &m_in_wait_cb, this);
+ devcb_resolve_read_line(&m_in_clear_func, &m_in_clear_cb, this);
+ devcb_resolve_read_line(&m_in_ef_func[0], &m_in_ef1_cb, this);
+ devcb_resolve_read_line(&m_in_ef_func[1], &m_in_ef2_cb, this);
+ devcb_resolve_read_line(&m_in_ef_func[2], &m_in_ef3_cb, this);
+ devcb_resolve_read_line(&m_in_ef_func[3], &m_in_ef4_cb, this);
+ devcb_resolve_write_line(&m_out_q_func, &m_out_q_cb, this);
+ devcb_resolve_read8(&m_in_dma_func, &m_in_dma_cb, this);
+ devcb_resolve_write8(&m_out_dma_func, &m_out_dma_cb, this);
+ m_out_sc_func = m_out_sc_cb;
+ devcb_resolve_write_line(&m_out_tpa_func, &m_out_tpa_cb, this);
+ devcb_resolve_write_line(&m_out_tpb_func, &m_out_tpb_cb, this);
// register our state for saving
save_item(NAME(m_op));
@@ -435,6 +317,28 @@ void cosmac_device::device_reset()
//-------------------------------------------------
+// memory_space_config - return the configuration
+// of the specified address space, or NULL if
+// the space doesn't exist
+//-------------------------------------------------
+
+const address_space_config *cosmac_device::memory_space_config(address_spacenum spacenum) const
+{
+ switch (spacenum)
+ {
+ case AS_PROGRAM:
+ return &m_program_config;
+
+ case AS_IO:
+ return &m_io_config;
+
+ default:
+ return NULL;
+ }
+}
+
+
+//-------------------------------------------------
// state_import - import state into the device,
// after it has been set
//-------------------------------------------------
@@ -486,6 +390,28 @@ void cosmac_device::state_string_export(const device_state_entry &entry, astring
//-------------------------------------------------
+// disasm_min_opcode_bytes - return the length
+// of the shortest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 cosmac_device::disasm_min_opcode_bytes() const
+{
+ return 1;
+}
+
+
+//-------------------------------------------------
+// disasm_max_opcode_bytes - return the length
+// of the longest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 cosmac_device::disasm_max_opcode_bytes() const
+{
+ return 3;
+}
+
+
+//-------------------------------------------------
// disasm_disassemble - call the disassembly
// helper function
//-------------------------------------------------
@@ -570,6 +496,39 @@ offs_t cosmac_device::get_memory_address()
}
//-------------------------------------------------
+// execute_min_cycles - return minimum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 cosmac_device::execute_min_cycles() const
+{
+ return 8 * 2;
+}
+
+
+//-------------------------------------------------
+// execute_max_cycles - return maximum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 cosmac_device::execute_max_cycles() const
+{
+ return 8 * 3;
+}
+
+
+//-------------------------------------------------
+// execute_input_lines - return the number of
+// input/interrupt lines
+//-------------------------------------------------
+
+UINT32 cosmac_device::execute_input_lines() const
+{
+ return 7;
+}
+
+
+//-------------------------------------------------
// execute_set_input -
//-------------------------------------------------
diff --git a/src/emu/cpu/cosmac/cosmac.h b/src/emu/cpu/cosmac/cosmac.h
index ed755d1496a..f461256bf22 100644
--- a/src/emu/cpu/cosmac/cosmac.h
+++ b/src/emu/cpu/cosmac/cosmac.h
@@ -105,9 +105,6 @@ enum cosmac_state_code
};
-// device type definition
-extern const device_type COSMAC;
-
//**************************************************************************
@@ -122,90 +119,60 @@ typedef void (*cosmac_out_sc_func)(device_t *device, cosmac_state_code sc);
struct cosmac_interface
{
- devcb_read_line m_in_wait_func;
- devcb_read_line m_in_clear_func;
- devcb_read_line m_in_ef1_func;
- devcb_read_line m_in_ef2_func;
- devcb_read_line m_in_ef3_func;
- devcb_read_line m_in_ef4_func;
- devcb_write_line m_out_q_func;
- devcb_read8 m_in_dma_func;
- devcb_write8 m_out_dma_func;
- cosmac_out_sc_func m_out_sc_func;
- devcb_write_line m_out_tpa_func;
- devcb_write_line m_out_tpb_func;
+ devcb_read_line m_in_wait_cb;
+ devcb_read_line m_in_clear_cb;
+ devcb_read_line m_in_ef1_cb;
+ devcb_read_line m_in_ef2_cb;
+ devcb_read_line m_in_ef3_cb;
+ devcb_read_line m_in_ef4_cb;
+ devcb_write_line m_out_q_cb;
+ devcb_read8 m_in_dma_cb;
+ devcb_write8 m_out_dma_cb;
+ cosmac_out_sc_func m_out_sc_cb;
+ devcb_write_line m_out_tpa_cb;
+ devcb_write_line m_out_tpb_cb;
};
#define COSMAC_INTERFACE(name) \
const cosmac_interface (name) =
-// ======================> cosmac_device_config
-
-class cosmac_device_config : public cpu_device_config,
- public cosmac_interface
-{
- friend class cosmac_device;
-
- // construction/destruction
- cosmac_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-
- // device_config_execute_interface overrides
- virtual UINT32 execute_min_cycles() const;
- virtual UINT32 execute_max_cycles() const;
- virtual UINT32 execute_input_lines() const;
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // device_config_disasm_interface overrides
- virtual UINT32 disasm_min_opcode_bytes() const;
- virtual UINT32 disasm_max_opcode_bytes() const;
-
- // inline data
- const address_space_config m_program_config;
- const address_space_config m_io_config;
-};
-
-
-
// ======================> cosmac_device
-class cosmac_device : public cpu_device
+class cosmac_device : public cpu_device,
+ public cosmac_interface
{
- friend class cosmac_device_config;
-
+public:
// construction/destruction
- cosmac_device(running_machine &_machine, const cosmac_device_config &config);
+ cosmac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
// public interfaces
offs_t get_memory_address();
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
// device_execute_interface overrides
+ virtual UINT32 execute_min_cycles() const;
+ virtual UINT32 execute_max_cycles() const;
+ virtual UINT32 execute_input_lines() const;
virtual void execute_run();
virtual void execute_set_input(int inputnum, int state);
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
// device_state_interface overrides
virtual void state_import(const device_state_entry &entry);
virtual void state_export(const device_state_entry &entry);
virtual void state_string_export(const device_state_entry &entry, astring &string);
// device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const;
+ virtual UINT32 disasm_max_opcode_bytes() const;
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
// helpers
@@ -336,6 +303,9 @@ protected:
void out();
void inp();
+ const address_space_config m_program_config;
+ const address_space_config m_io_config;
+
// device callbacks
devcb_resolved_read_line m_in_wait_func;
devcb_resolved_read_line m_in_clear_func;
@@ -404,9 +374,11 @@ protected:
typedef void (cosmac_device::*ophandler)();
static const ophandler s_opcodetable[256];
-
- const cosmac_device_config &m_config;
};
+// device type definition
+extern const device_type COSMAC;
+
+
#endif /* __COSMAC_H__ */
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.c b/src/emu/cpu/cubeqcpu/cubeqcpu.c
index c6bbfc8fc17..3b27ffc0c7e 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.c
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.c
@@ -281,7 +281,7 @@ static void cquestsnd_state_register(device_t *device)
static CPU_INIT( cquestsnd )
{
cquestsnd_state *cpustate = get_safe_token_snd(device);
- cubeqst_snd_config* _config = (cubeqst_snd_config*)device->baseconfig().static_config();
+ cubeqst_snd_config* _config = (cubeqst_snd_config*)device->static_config();
memset(cpustate, 0, sizeof(*cpustate));
@@ -354,7 +354,7 @@ static void cquestrot_state_register(device_t *device)
static CPU_INIT( cquestrot )
{
- const cubeqst_rot_config *rotconfig = (const cubeqst_rot_config *)device->baseconfig().static_config();
+ const cubeqst_rot_config *rotconfig = (const cubeqst_rot_config *)device->static_config();
cquestrot_state *cpustate = get_safe_token_rot(device);
memset(cpustate, 0, sizeof(*cpustate));
@@ -438,7 +438,7 @@ static void cquestlin_state_register(device_t *device)
static CPU_INIT( cquestlin )
{
- const cubeqst_lin_config *linconfig = (const cubeqst_lin_config *)device->baseconfig().static_config();
+ const cubeqst_lin_config *linconfig = (const cubeqst_lin_config *)device->static_config();
cquestlin_state *cpustate = get_safe_token_lin(device);
memset(cpustate, 0, sizeof(*cpustate));
diff --git a/src/emu/cpu/dsp16/dsp16.c b/src/emu/cpu/dsp16/dsp16.c
index 9b0e5a8b13a..61c160a3366 100644
--- a/src/emu/cpu/dsp16/dsp16.c
+++ b/src/emu/cpu/dsp16/dsp16.c
@@ -10,123 +10,22 @@
#include "debugger.h"
#include "dsp16.h"
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type DSP16 = dsp16_device_config::static_alloc_device_config;
-
-
//**************************************************************************
-// DSP16 DEVICE CONFIG
+// DEVICE INTERFACE
//**************************************************************************
-dsp16_device_config::dsp16_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : cpu_device_config(mconfig, static_alloc_device_config, "DSP16", tag, owner, clock),
- m_program_config("program", ENDIANNESS_LITTLE, 16, 16, -1)
-{ }
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *dsp16_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(dsp16_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *dsp16_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, dsp16_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// execute_min_cycles - return minimum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 dsp16_device_config::execute_min_cycles() const
-{
- return 1;
-}
-
-
-//-------------------------------------------------
-// execute_max_cycles - return maximum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 dsp16_device_config::execute_max_cycles() const
-{
- return 1;
-}
-
-
-//-------------------------------------------------
-// execute_input_lines - return the number of
-// input/interrupt lines
-//-------------------------------------------------
+// device type definition
+const device_type DSP16 = &device_creator<dsp16_device>;
-UINT32 dsp16_device_config::execute_input_lines() const
-{
- return 1; // TODO
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return the configuration
-// of the specified address space, or NULL if
-// the space doesn't exist
-//-------------------------------------------------
-
-const address_space_config *dsp16_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_PROGRAM) ? &m_program_config : NULL;
-}
-
-
-//-------------------------------------------------
-// disasm_min_opcode_bytes - return the length
-// of the shortest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 dsp16_device_config::disasm_min_opcode_bytes() const
-{
- return 2;
-}
-
-
-//-------------------------------------------------
-// disasm_max_opcode_bytes - return the length
-// of the longest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 dsp16_device_config::disasm_max_opcode_bytes() const
-{
- return 4;
-}
-
-
-
-//**************************************************************************
-// DEVICE INTERFACE
-//**************************************************************************
//-------------------------------------------------
// dsp16_device - constructor
//-------------------------------------------------
-dsp16_device::dsp16_device(running_machine &_machine, const dsp16_device_config &config)
- : cpu_device(_machine, config),
+dsp16_device::dsp16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : cpu_device(mconfig, DSP16, "DSP16", tag, owner, clock),
+ m_program_config("program", ENDIANNESS_LITTLE, 16, 16, -1),
m_pc(0),
m_ppc(0),
m_icount(0)
@@ -167,6 +66,18 @@ void dsp16_device::device_reset()
//-------------------------------------------------
+// memory_space_config - return the configuration
+// of the specified address space, or NULL if
+// the space doesn't exist
+//-------------------------------------------------
+
+const address_space_config *dsp16_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_PROGRAM) ? &m_program_config : NULL;
+}
+
+
+//-------------------------------------------------
// state_import - import state into the device,
// after it has been set
//-------------------------------------------------
@@ -189,6 +100,28 @@ void dsp16_device::state_string_export(const device_state_entry &entry, astring
//-------------------------------------------------
+// disasm_min_opcode_bytes - return the length
+// of the shortest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 dsp16_device::disasm_min_opcode_bytes() const
+{
+ return 2;
+}
+
+
+//-------------------------------------------------
+// disasm_max_opcode_bytes - return the length
+// of the longest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 dsp16_device::disasm_max_opcode_bytes() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
// disasm_disassemble - call the disassembly
// helper function
//-------------------------------------------------
@@ -225,6 +158,39 @@ inline UINT32 dsp16_device::opcode_read()
CORE EXECUTION LOOP
***************************************************************************/
+//-------------------------------------------------
+// execute_min_cycles - return minimum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 dsp16_device::execute_min_cycles() const
+{
+ return 1;
+}
+
+
+//-------------------------------------------------
+// execute_max_cycles - return maximum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 dsp16_device::execute_max_cycles() const
+{
+ return 1;
+}
+
+
+//-------------------------------------------------
+// execute_input_lines - return the number of
+// input/interrupt lines
+//-------------------------------------------------
+
+UINT32 dsp16_device::execute_input_lines() const
+{
+ return 1; // TODO
+}
+
+
void dsp16_device::execute_set_input(int inputnum, int state)
{
}
diff --git a/src/emu/cpu/dsp16/dsp16.h b/src/emu/cpu/dsp16/dsp16.h
index 9a4be99be5f..ff063ba8164 100644
--- a/src/emu/cpu/dsp16/dsp16.h
+++ b/src/emu/cpu/dsp16/dsp16.h
@@ -17,16 +17,7 @@
//**************************************************************************
//#define MCFG_DSP16_CONFIG(_config)
-// dsp16_device_config::static_set_config(device, _config);
-
-
-
-//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// device type definition
-extern const device_type DSP16;
+// dsp16_device::static_set_config(*device, _config);
@@ -34,52 +25,14 @@ extern const device_type DSP16;
// TYPE DEFINITIONS
//**************************************************************************
-class dsp16_device;
-
-
-// ======================> dsp16_device_config
-
-class dsp16_device_config : public cpu_device_config
-{
- friend class dsp16_device;
-
- // construction/destruction
- dsp16_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config_execute_interface overrides
- virtual UINT32 execute_min_cycles() const;
- virtual UINT32 execute_max_cycles() const;
- virtual UINT32 execute_input_lines() const;
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // device_config_disasm_interface overrides
- virtual UINT32 disasm_min_opcode_bytes() const;
- virtual UINT32 disasm_max_opcode_bytes() const;
-
- // address spaces
- const address_space_config m_program_config;
-};
-
-
-
// ======================> dsp16_device
class dsp16_device : public cpu_device
{
- friend class dsp16_device_config;
-
+public:
// construction/destruction
- dsp16_device(running_machine &_machine, const dsp16_device_config &config);
+ dsp16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
// public interfaces
protected:
@@ -88,18 +41,27 @@ protected:
virtual void device_reset();
// device_execute_interface overrides
+ virtual UINT32 execute_min_cycles() const;
+ virtual UINT32 execute_max_cycles() const;
+ virtual UINT32 execute_input_lines() const;
virtual void execute_run();
virtual void execute_set_input(int inputnum, int state);
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
// device_state_interface overrides
virtual void state_import(const device_state_entry &entry);
virtual void state_export(const device_state_entry &entry);
virtual void state_string_export(const device_state_entry &entry, astring &string);
// device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const;
+ virtual UINT32 disasm_max_opcode_bytes() const;
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
-
+ // address spaces
+ const address_space_config m_program_config;
// CPU registers
UINT16 m_pc;
@@ -121,6 +83,10 @@ protected:
};
+// device type definition
+extern const device_type DSP16;
+
+
/***************************************************************************
REGISTER ENUMERATION
***************************************************************************/
diff --git a/src/emu/cpu/dsp32/dsp32.c b/src/emu/cpu/dsp32/dsp32.c
index 8c61ac81546..5bd0cd810fb 100644
--- a/src/emu/cpu/dsp32/dsp32.c
+++ b/src/emu/cpu/dsp32/dsp32.c
@@ -71,14 +71,6 @@
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type DSP32C = dsp32c_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
// CONSTANTS
//**************************************************************************
@@ -170,133 +162,18 @@ const device_type DSP32C = dsp32c_device_config::static_alloc_device_config;
//**************************************************************************
-// DSP32C DEVICE CONFIG
-//**************************************************************************
-
-//-------------------------------------------------
-// dsp32c_device_config - constructor
-//-------------------------------------------------
-
-dsp32c_device_config::dsp32c_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : cpu_device_config(mconfig, static_alloc_device_config, "DSP32C", tag, owner, clock),
- m_program_config("program", ENDIANNESS_LITTLE, 32, 24)
-{
- m_output_pins_changed = NULL;
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *dsp32c_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(dsp32c_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *dsp32c_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, dsp32c_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// static_set_config - set the configuration
-// structure
-//-------------------------------------------------
-
-void dsp32c_device_config::static_set_config(device_config *device, const dsp32_config &config)
-{
- dsp32c_device_config *dsp = downcast<dsp32c_device_config *>(device);
- *static_cast<dsp32_config *>(dsp) = config;
-}
-
-
-//-------------------------------------------------
-// execute_min_cycles - return minimum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 dsp32c_device_config::execute_min_cycles() const
-{
- return 4;
-}
-
-
-//-------------------------------------------------
-// execute_max_cycles - return maximum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 dsp32c_device_config::execute_max_cycles() const
-{
- return 4;
-}
-
-
-//-------------------------------------------------
-// execute_input_lines - return the number of
-// input/interrupt lines
-//-------------------------------------------------
-
-UINT32 dsp32c_device_config::execute_input_lines() const
-{
- return 2;
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return the configuration
-// of the specified address space, or NULL if
-// the space doesn't exist
-//-------------------------------------------------
-
-const address_space_config *dsp32c_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_PROGRAM) ? &m_program_config : NULL;
-}
-
-
-//-------------------------------------------------
-// disasm_min_opcode_bytes - return the length
-// of the shortest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 dsp32c_device_config::disasm_min_opcode_bytes() const
-{
- return 4;
-}
-
-
-//-------------------------------------------------
-// disasm_max_opcode_bytes - return the length
-// of the longest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 dsp32c_device_config::disasm_max_opcode_bytes() const
-{
- return 4;
-}
-
-
-
-//**************************************************************************
// DEVICE INTERFACE
//**************************************************************************
+const device_type DSP32C = &device_creator<dsp32c_device>;
+
//-------------------------------------------------
// dsp32c_device - constructor
//-------------------------------------------------
-dsp32c_device::dsp32c_device(running_machine &_machine, const dsp32c_device_config &config)
- : cpu_device(_machine, config),
- m_config(config),
+dsp32c_device::dsp32c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : cpu_device(mconfig, DSP32C, "DSP32C", tag, owner, clock),
+ m_program_config("program", ENDIANNESS_LITTLE, 32, 24),
m_pin(0),
m_pout(0),
m_ivtp(0),
@@ -328,12 +205,26 @@ dsp32c_device::dsp32c_device(running_machine &_machine, const dsp32c_device_conf
m_program(NULL),
m_direct(NULL)
{
+ m_output_pins_changed = NULL;
+
// set our instruction counter
m_icountptr = &m_icount;
}
//-------------------------------------------------
+// static_set_config - set the configuration
+// structure
+//-------------------------------------------------
+
+void dsp32c_device::static_set_config(device_t &device, const dsp32_config &config)
+{
+ dsp32c_device &dsp = downcast<dsp32c_device &>(device);
+ static_cast<dsp32_config &>(dsp) = config;
+}
+
+
+//-------------------------------------------------
// device_start - start up the device
//-------------------------------------------------
@@ -448,6 +339,18 @@ void dsp32c_device::device_reset()
//-------------------------------------------------
+// memory_space_config - return the configuration
+// of the specified address space, or NULL if
+// the space doesn't exist
+//-------------------------------------------------
+
+const address_space_config *dsp32c_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_PROGRAM) ? &m_program_config : NULL;
+}
+
+
+//-------------------------------------------------
// state_import - import state into the device,
// after it has been set
//-------------------------------------------------
@@ -533,6 +436,28 @@ void dsp32c_device::state_string_export(const device_state_entry &entry, astring
//-------------------------------------------------
+// disasm_min_opcode_bytes - return the length
+// of the shortest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 dsp32c_device::disasm_min_opcode_bytes() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
+// disasm_max_opcode_bytes - return the length
+// of the longest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 dsp32c_device::disasm_max_opcode_bytes() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
// disasm_disassemble - call the disassembly
// helper function
//-------------------------------------------------
@@ -630,13 +555,13 @@ void dsp32c_device::update_pcr(UINT16 newval)
reset();
// track the state of the output pins
- if (m_config.m_output_pins_changed != NULL)
+ if (m_output_pins_changed != NULL)
{
UINT16 newoutput = ((newval & (PCR_PIFs | PCR_ENI)) == (PCR_PIFs | PCR_ENI)) ? DSP32_OUTPUT_PIF : 0;
if (newoutput != m_lastpins)
{
m_lastpins = newoutput;
- (*m_config.m_output_pins_changed)(*this, newoutput);
+ (*m_output_pins_changed)(*this, newoutput);
}
}
}
@@ -655,6 +580,39 @@ void dsp32c_device::update_pcr(UINT16 newval)
// CORE EXECUTION LOOP
//**************************************************************************
+//-------------------------------------------------
+// execute_min_cycles - return minimum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 dsp32c_device::execute_min_cycles() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
+// execute_max_cycles - return maximum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 dsp32c_device::execute_max_cycles() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
+// execute_input_lines - return the number of
+// input/interrupt lines
+//-------------------------------------------------
+
+UINT32 dsp32c_device::execute_input_lines() const
+{
+ return 2;
+}
+
+
void dsp32c_device::execute_set_input(int inputnum, int state)
{
}
diff --git a/src/emu/cpu/dsp32/dsp32.h b/src/emu/cpu/dsp32/dsp32.h
index e5e0ffa8ca5..b5cd059d256 100644
--- a/src/emu/cpu/dsp32/dsp32.h
+++ b/src/emu/cpu/dsp32/dsp32.h
@@ -47,7 +47,7 @@
//**************************************************************************
#define MCFG_DSP32C_CONFIG(_config) \
- dsp32c_device_config::static_set_config(device, _config); \
+ dsp32c_device::static_set_config(*device, _config); \
@@ -121,14 +121,6 @@ enum
//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-extern const device_type DSP32C;
-
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -144,53 +136,18 @@ struct dsp32_config
-// ======================> dsp32c_device_config
+// ======================> dsp32c_device
-class dsp32c_device_config : public cpu_device_config,
- public dsp32_config
+class dsp32c_device : public cpu_device,
+ public dsp32_config
{
- friend class dsp32c_device;
-
- // construction/destruction
- dsp32c_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
+ // construction/destruction
+ dsp32c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// inline configuration helpers
- static void static_set_config(device_config *device, const dsp32_config &config);
-
-protected:
- // device_config_execute_interface overrides
- virtual UINT32 execute_min_cycles() const;
- virtual UINT32 execute_max_cycles() const;
- virtual UINT32 execute_input_lines() const;
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // device_config_disasm_interface overrides
- virtual UINT32 disasm_min_opcode_bytes() const;
- virtual UINT32 disasm_max_opcode_bytes() const;
-
- // inline data
- const address_space_config m_program_config;
-};
-
-
-
-// ======================> dsp32c_device
+ static void static_set_config(device_t &device, const dsp32_config &config);
-class dsp32c_device : public cpu_device
-{
- friend class dsp32c_device_config;
-
- // construction/destruction
- dsp32c_device(running_machine &_machine, const dsp32c_device_config &config);
-
-public:
// public interfaces
void pio_w(int reg, int data);
int pio_r(int reg);
@@ -201,15 +158,23 @@ protected:
virtual void device_reset();
// device_execute_interface overrides
+ virtual UINT32 execute_min_cycles() const;
+ virtual UINT32 execute_max_cycles() const;
+ virtual UINT32 execute_input_lines() const;
virtual void execute_run();
virtual void execute_set_input(int inputnum, int state);
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
// device_state_interface overrides
virtual void state_import(const device_state_entry &entry);
virtual void state_export(const device_state_entry &entry);
virtual void state_string_export(const device_state_entry &entry, astring &string);
// device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const;
+ virtual UINT32 disasm_max_opcode_bytes() const;
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
// memory accessors
@@ -456,7 +421,7 @@ protected:
void dma_store();
// configuration
- const dsp32c_device_config &m_config;
+ const address_space_config m_program_config;
// internal state
UINT32 m_r[32];
@@ -512,4 +477,8 @@ protected:
};
+extern const device_type DSP32C;
+
+
+
#endif /* __DSP32_H__ */
diff --git a/src/emu/cpu/dsp56k/dsp56k.c b/src/emu/cpu/dsp56k/dsp56k.c
index 589493d35fe..565ac5484e8 100644
--- a/src/emu/cpu/dsp56k/dsp56k.c
+++ b/src/emu/cpu/dsp56k/dsp56k.c
@@ -229,7 +229,7 @@ static CPU_INIT( dsp56k )
device->save_item(NAME(cpustate->HI.trxl));
device->save_item(NAME(cpustate->HI.bootstrap_offset));
- //cpustate->config = device->baseconfig().static_config();
+ //cpustate->config = device->static_config();
//cpustate->irq_callback = irqcallback;
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c
index a69939fa430..4de2fa06a20 100644
--- a/src/emu/cpu/esrip/esrip.c
+++ b/src/emu/cpu/esrip/esrip.c
@@ -249,7 +249,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->baseconfig().static_config();
+ esrip_config* _config = (esrip_config*)device->static_config();
memset(cpustate, 0, sizeof(cpustate));
diff --git a/src/emu/cpu/hd61700/hd61700.c b/src/emu/cpu/hd61700/hd61700.c
index bebddfe52e2..7d7e7da92ab 100644
--- a/src/emu/cpu/hd61700/hd61700.c
+++ b/src/emu/cpu/hd61700/hd61700.c
@@ -90,45 +90,20 @@
static const UINT16 irq_vector[] = {0x0032, 0x0042, 0x0052, 0x0062, 0x0072};
//**************************************************************************
-// DEVICE DEFINITIONS
+// HD61700 DEVICE
//**************************************************************************
-const device_type HD61700 = hd61700_cpu_device_config::static_alloc_device_config;
-
-
-//**************************************************************************
-// HD61700 DEVICE CONFIG
-//**************************************************************************
+const device_type HD61700 = &device_creator<hd61700_cpu_device>;
//-------------------------------------------------
-// hd61700_cpu_device_config - constructor
+// hd61700_cpu_device - constructor
//-------------------------------------------------
-hd61700_cpu_device_config::hd61700_cpu_device_config(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock)
- : cpu_device_config(mconfig, type, "HD61700", tag, owner, clock),
+hd61700_cpu_device::hd61700_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : cpu_device(mconfig, HD61700, "HD61700", tag, owner, clock),
m_program_config("program", ENDIANNESS_BIG, 16, 18, -1)
{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *hd61700_cpu_device_config::static_alloc_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock )
-{
- return global_alloc(hd61700_cpu_device_config(mconfig, HD61700, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *hd61700_cpu_device_config::alloc_device(running_machine &machine) const
-{
- return pool_alloc(machine_get_pool(machine), hd61700_cpu_device(machine, *this));
+ memset(&m_partial_frame_period, 0, sizeof(m_partial_frame_period));
}
@@ -137,29 +112,12 @@ device_t *hd61700_cpu_device_config::alloc_device(running_machine &machine) cons
// structure
//-------------------------------------------------
-void hd61700_cpu_device_config::static_set_config(device_config *device, const hd61700_config &config)
+void hd61700_cpu_device::static_set_config(device_t &device, const hd61700_config &config)
{
- hd61700_cpu_device_config *conf = downcast<hd61700_cpu_device_config *>(device);
- *static_cast<hd61700_config *>(conf) = config;
+ hd61700_cpu_device &conf = downcast<hd61700_cpu_device &>(device);
+ static_cast<hd61700_config &>(conf) = config;
}
-
-//**************************************************************************
-// HD61700 DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// hd61700_cpu_device - constructor
-//-------------------------------------------------
-
-hd61700_cpu_device::hd61700_cpu_device(running_machine &machine, const hd61700_cpu_device_config &config)
- : cpu_device(machine, config),
- m_cpu_config(config)
-{
- memset(&m_partial_frame_period, 0, sizeof(m_partial_frame_period));
-}
-
-
//-------------------------------------------------
// device_start - start up the device
//-------------------------------------------------
@@ -498,8 +456,8 @@ void hd61700_cpu_device::execute_run()
{
UINT8 arg = read_op();
- if (m_cpu_config.m_lcd_data_w)
- (*m_cpu_config.m_lcd_data_w)(*this, READ_REG(arg));
+ if (m_lcd_data_w)
+ (*m_lcd_data_w)(*this, READ_REG(arg));
check_optional_jr(arg);
m_icount -= 11;
@@ -511,8 +469,8 @@ void hd61700_cpu_device::execute_run()
UINT8 arg = read_op();
UINT8 res = 0xff;
- if (m_cpu_config.m_lcd_data_r)
- res = (*m_cpu_config.m_lcd_data_r)(*this);
+ if (m_lcd_data_r)
+ res = (*m_lcd_data_r)(*this);
WRITE_REG(arg, res);
@@ -531,8 +489,8 @@ void hd61700_cpu_device::execute_run()
}
else
{
- if (m_cpu_config.m_lcd_control)
- (*m_cpu_config.m_lcd_control)(*this, READ_REG(arg));
+ if (m_lcd_control)
+ (*m_lcd_control)(*this, READ_REG(arg));
}
check_optional_jr(arg);
@@ -562,8 +520,8 @@ void hd61700_cpu_device::execute_run()
case 0: //PE
case 1: //PD
WRITE_REG8(idx, src);
- if (m_cpu_config.m_port_w)
- (*m_cpu_config.m_port_w)(*this, REG_PD & REG_PE);
+ if (m_port_w)
+ (*m_port_w)(*this, REG_PD & REG_PE);
break;
case 2: //IB
REG_IB = (REG_IB & 0x1f) | (src & 0xe0);
@@ -572,8 +530,8 @@ void hd61700_cpu_device::execute_run()
WRITE_REG8(idx, src);
break;
case 4: //IA
- if (m_cpu_config.m_kb_w)
- (*m_cpu_config.m_kb_w)(*this, src);
+ if (m_kb_w)
+ (*m_kb_w)(*this, src);
WRITE_REG8(idx, src);
break;
case 5: //IE
@@ -706,8 +664,8 @@ void hd61700_cpu_device::execute_run()
}
else
{
- if (m_cpu_config.m_port_r)
- src = (*m_cpu_config.m_port_r)(*this);
+ if (m_port_r)
+ src = (*m_port_r)(*this);
src&=(~REG_PE);
}
@@ -1051,8 +1009,8 @@ void hd61700_cpu_device::execute_run()
{
UINT8 arg = read_op();
- if (m_cpu_config.m_lcd_data_w)
- (*m_cpu_config.m_lcd_data_w)(*this, arg);
+ if (m_lcd_data_w)
+ (*m_lcd_data_w)(*this, arg);
m_icount -= 12;
}
@@ -1069,8 +1027,8 @@ void hd61700_cpu_device::execute_run()
}
else
{
- if (m_cpu_config.m_lcd_control)
- (*m_cpu_config.m_lcd_control)(*this, src);
+ if (m_lcd_control)
+ (*m_lcd_control)(*this, src);
}
m_icount -= 3;
@@ -1098,8 +1056,8 @@ void hd61700_cpu_device::execute_run()
case 0: //PE
case 1: //PD
WRITE_REG8(idx, src);
- if (m_cpu_config.m_port_w)
- (*m_cpu_config.m_port_w)(*this, REG_PD & REG_PE);
+ if (m_port_w)
+ (*m_port_w)(*this, REG_PD & REG_PE);
break;
case 2: //IB
REG_IB = (REG_IB & 0x1f) | (src & 0xe0);
@@ -1108,8 +1066,8 @@ void hd61700_cpu_device::execute_run()
WRITE_REG8(idx, src);
break;
case 4: //IA
- if (m_cpu_config.m_kb_w)
- (*m_cpu_config.m_kb_w)(*this, src);
+ if (m_kb_w)
+ (*m_kb_w)(*this, src);
WRITE_REG8(idx, src);
break;
case 5: //IE
@@ -1482,10 +1440,10 @@ void hd61700_cpu_device::execute_run()
{
UINT8 arg = read_op();
- if (m_cpu_config.m_lcd_data_w)
+ if (m_lcd_data_w)
{
- (*m_cpu_config.m_lcd_data_w)(*this, READ_REG(arg));
- (*m_cpu_config.m_lcd_data_w)(*this, READ_REG(arg+1));
+ (*m_lcd_data_w)(*this, READ_REG(arg));
+ (*m_lcd_data_w)(*this, READ_REG(arg+1));
}
check_optional_jr(arg);
@@ -1498,10 +1456,10 @@ void hd61700_cpu_device::execute_run()
UINT8 arg = read_op();
UINT8 reg0, reg1;
- if (m_cpu_config.m_lcd_data_r)
+ if (m_lcd_data_r)
{
- reg0 = (*m_cpu_config.m_lcd_data_r)(*this);
- reg1 = (*m_cpu_config.m_lcd_data_r)(*this);
+ reg0 = (*m_lcd_data_r)(*this);
+ reg1 = (*m_lcd_data_r)(*this);
}
else
reg0 = reg1 = 0xff;
@@ -1666,10 +1624,10 @@ void hd61700_cpu_device::execute_run()
}
else
{
- if (m_cpu_config.m_port_r)
+ if (m_port_r)
{
- reg0 = (*m_cpu_config.m_port_r)(*this);
- reg1 = (*m_cpu_config.m_port_r)(*this);
+ reg0 = (*m_port_r)(*this);
+ reg1 = (*m_port_r)(*this);
}
else
reg0 = reg1 = 0xff;
@@ -1698,8 +1656,8 @@ void hd61700_cpu_device::execute_run()
{
UINT16 port = 0xff;
- if (m_cpu_config.m_kb_r)
- port = (*m_cpu_config.m_kb_r)(*this);
+ if (m_kb_r)
+ port = (*m_kb_r)(*this);
src = (REG_KY & 0x0f00) | (port & 0xf0ff);
}
@@ -2158,8 +2116,8 @@ void hd61700_cpu_device::execute_run()
for (int n=GET_IM3(arg1); n>0; n--)
{
- if (m_cpu_config.m_lcd_data_w)
- (*m_cpu_config.m_lcd_data_w)(*this, READ_REG(arg));
+ if (m_lcd_data_w)
+ (*m_lcd_data_w)(*this, READ_REG(arg));
arg++;
m_icount -= 8;
@@ -2177,8 +2135,8 @@ void hd61700_cpu_device::execute_run()
for (int n=GET_IM3(arg1); n>0; n--)
{
- if (m_cpu_config.m_lcd_data_r)
- src = (*m_cpu_config.m_lcd_data_r)(*this);
+ if (m_lcd_data_r)
+ src = (*m_lcd_data_r)(*this);
else
src = 0xff;
@@ -2674,11 +2632,11 @@ void hd61700_cpu_device::execute_run()
m_state |= CPU_SLP;
m_irq_status = 0;
- if (m_cpu_config.m_lcd_control)
- (*m_cpu_config.m_lcd_control)(*this, 0);
+ if (m_lcd_control)
+ (*m_lcd_control)(*this, 0);
- if (m_cpu_config.m_kb_w)
- (*m_cpu_config.m_kb_w)(*this, 0);
+ if (m_kb_w)
+ (*m_kb_w)(*this, 0);
m_icount -= 3;
}
break;
diff --git a/src/emu/cpu/hd61700/hd61700.h b/src/emu/cpu/hd61700/hd61700.h
index a14fe9a4b3f..3e69ba97378 100644
--- a/src/emu/cpu/hd61700/hd61700.h
+++ b/src/emu/cpu/hd61700/hd61700.h
@@ -14,13 +14,7 @@
//**************************************************************************
#define MCFG_HD61700_CONFIG(_config) \
- hd61700_cpu_device_config::static_set_config(device, _config); \
-
-//**************************************************************************
-// DEVICE TYPE DEFINITION
-//**************************************************************************
-
-extern const device_type HD61700;
+ hd61700_cpu_device::static_set_config(*device, _config); \
//**************************************************************************
// DEFINITIONS
@@ -28,7 +22,6 @@ extern const device_type HD61700;
// class definition
class hd61700_cpu_device;
-class hd61700_cpu_device_config;
// cpu port callbacks types
typedef void (*hd61700_lcd_control_func)(hd61700_cpu_device &device, UINT8 data);
@@ -72,57 +65,27 @@ enum
};
-// ======================> hd61700_cpu_device_config
+// ======================> hd61700_cpu_device
-class hd61700_cpu_device_config : public cpu_device_config,
- public hd61700_config
+class hd61700_cpu_device : public cpu_device,
+ public hd61700_config
{
- friend class hd61700_cpu_device;
-
-protected:
- // construction/destruction
- hd61700_cpu_device_config(const machine_config &mconfig, device_type _type, const char *_tag, const device_config *_owner, UINT32 _clock);
-
public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_config(device_config *device, const hd61700_config &config);
-protected:
- // device_config_execute_interface overrides
- virtual UINT32 execute_min_cycles() const { return 1; }
- virtual UINT32 execute_max_cycles() const { return 52; }
- virtual UINT32 execute_input_lines() const { return 6; }
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : NULL; }
-
- // device_config_disasm_interface overrides
- virtual UINT32 disasm_min_opcode_bytes() const { return 1; }
- virtual UINT32 disasm_max_opcode_bytes() const { return 16; }
-
- // internal state
- address_space_config m_program_config;
-};
-
-
-// ======================> hd61700_cpu_device
+ // construction/destruction
+ hd61700_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock);
-class hd61700_cpu_device : public cpu_device
-{
- friend class hd61700_cpu_device_config;
+ static void static_set_config(device_t &device, const hd61700_config &config);
protected:
- // construction/destruction
- hd61700_cpu_device(running_machine &machine, const hd61700_cpu_device_config &config);
-
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
// device_execute_interface overrides
+ virtual UINT32 execute_min_cycles() const { return 1; }
+ virtual UINT32 execute_max_cycles() const { return 52; }
+ virtual UINT32 execute_input_lines() const { return 6; }
virtual void execute_run();
virtual void execute_set_input(int inputnum, int state);
@@ -130,8 +93,12 @@ protected:
virtual void state_import(const device_state_entry &entry);
void state_string_export(const device_state_entry &entry, astring &string);
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : NULL; }
// device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const { return 1; }
+ virtual UINT32 disasm_max_opcode_bytes() const { return 16; }
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
// interrupts
@@ -159,7 +126,7 @@ protected:
protected:
// internal state
- const hd61700_cpu_device_config &m_cpu_config; // reference to the config
+ address_space_config m_program_config;
static const device_timer_id SEC_TIMER = 1;
emu_timer *m_sec_timer;
@@ -189,4 +156,7 @@ protected:
static const int FLAG_APO = 0x04;
};
+extern const device_type HD61700;
+
+
#endif /* __HD61700_H__ */
diff --git a/src/emu/cpu/i8085/i8085.c b/src/emu/cpu/i8085/i8085.c
index 3908166fdf5..9df34b216e0 100644
--- a/src/emu/cpu/i8085/i8085.c
+++ b/src/emu/cpu/i8085/i8085.c
@@ -1001,8 +1001,8 @@ static void init_808x_common(legacy_cpu_device *device, device_irq_callback irqc
state->state_add(I8085_INTE, "INTE", cpustate->ietemp).mask(0x1).callimport().callexport();
}
- if (device->baseconfig().static_config() != NULL)
- cpustate->config = *(i8085_config *)device->baseconfig().static_config();
+ if (device->static_config() != NULL)
+ cpustate->config = *(i8085_config *)device->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 23310b9107f..4fb3314e358 100644
--- a/src/emu/cpu/i86/i286.c
+++ b/src/emu/cpu/i86/i286.c
@@ -296,8 +296,8 @@ static CPU_INIT( i80286 )
cpustate->direct = &cpustate->program->direct();
/* If a reset parameter is given, take it as pointer to an address mask */
- if( device->baseconfig().static_config() )
- cpustate->amask = *(unsigned*)device->baseconfig().static_config();
+ if( device->static_config() )
+ cpustate->amask = *(unsigned*)device->static_config();
else
cpustate->amask = 0x00ffff;
diff --git a/src/emu/cpu/i86/i86.c b/src/emu/cpu/i86/i86.c
index 2dfd32ec5ce..39f28eaf0eb 100644
--- a/src/emu/cpu/i86/i86.c
+++ b/src/emu/cpu/i86/i86.c
@@ -220,7 +220,7 @@ static CPU_INIT( i80186 )
CPU_INIT_CALL(i8086);
/* resolve callbacks */
- i80186_interface *intf = (i80186_interface *) device->baseconfig().static_config();
+ i80186_interface *intf = (i80186_interface *) device->static_config();
if (intf != NULL)
{
diff --git a/src/emu/cpu/jaguar/jaguar.c b/src/emu/cpu/jaguar/jaguar.c
index f3b27bad764..42b59020b0f 100644
--- a/src/emu/cpu/jaguar/jaguar.c
+++ b/src/emu/cpu/jaguar/jaguar.c
@@ -411,7 +411,7 @@ static STATE_POSTLOAD( jaguar_postload )
static void init_common(int isdsp, legacy_cpu_device *device, device_irq_callback irqcallback)
{
- const jaguar_cpu_config *configdata = (const jaguar_cpu_config *)device->baseconfig().static_config();
+ const jaguar_cpu_config *configdata = (const jaguar_cpu_config *)device->static_config();
jaguar_state *jaguar = get_safe_token(device);
init_tables();
diff --git a/src/emu/cpu/lh5801/lh5801.c b/src/emu/cpu/lh5801/lh5801.c
index d2292449f7c..854e276f90a 100644
--- a/src/emu/cpu/lh5801/lh5801.c
+++ b/src/emu/cpu/lh5801/lh5801.c
@@ -116,7 +116,7 @@ static CPU_INIT( lh5801 )
lh5801_state *cpustate = get_safe_token(device);
memset(cpustate, 0, sizeof(*cpustate));
- cpustate->config = (const lh5801_cpu_core *) device->baseconfig().static_config();
+ cpustate->config = (const lh5801_cpu_core *) device->static_config();
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
cpustate->io = device->space(AS_IO);
diff --git a/src/emu/cpu/lr35902/lr35902.c b/src/emu/cpu/lr35902/lr35902.c
index 1b4174d17b9..13b40d46782 100644
--- a/src/emu/cpu/lr35902/lr35902.c
+++ b/src/emu/cpu/lr35902/lr35902.c
@@ -189,7 +189,7 @@ static CPU_INIT( lr35902 )
{
lr35902_state *cpustate = get_safe_token(device);
- cpustate->w.config = (const lr35902_cpu_core *) device->baseconfig().static_config();
+ cpustate->w.config = (const lr35902_cpu_core *) device->static_config();
cpustate->w.irq_callback = irqcallback;
cpustate->w.device = device;
cpustate->w.program = device->space(AS_PROGRAM);
diff --git a/src/emu/cpu/m6502/m4510.c b/src/emu/cpu/m6502/m4510.c
index 76aefb9f7a7..907ecfe3ad9 100644
--- a/src/emu/cpu/m6502/m4510.c
+++ b/src/emu/cpu/m6502/m4510.c
@@ -198,7 +198,7 @@ static void default_wrmem_id(address_space *space, offs_t address, UINT8 data)
static CPU_INIT( m4510 )
{
m4510_Regs *cpustate = get_safe_token(device);
- const m6502_interface *intf = (const m6502_interface *)device->baseconfig().static_config();
+ const m6502_interface *intf = (const m6502_interface *)device->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 f4a1e02e1f1..f52307c2c64 100644
--- a/src/emu/cpu/m6502/m6502.c
+++ b/src/emu/cpu/m6502/m6502.c
@@ -133,7 +133,7 @@ static void default_wdmem_id(address_space *space, offs_t offset, UINT8 data) {
static void m6502_common_init(legacy_cpu_device *device, device_irq_callback irqcallback, UINT8 subtype, void (*const *insn)(m6502_Regs *cpustate), const char *type)
{
m6502_Regs *cpustate = get_safe_token(device);
- const m6502_interface *intf = (const m6502_interface *)device->baseconfig().static_config();
+ const m6502_interface *intf = (const m6502_interface *)device->static_config();
cpustate->irq_callback = irqcallback;
cpustate->device = device;
diff --git a/src/emu/cpu/m6502/m6509.c b/src/emu/cpu/m6502/m6509.c
index 1d6c97a6d9c..995a935096f 100644
--- a/src/emu/cpu/m6502/m6509.c
+++ b/src/emu/cpu/m6502/m6509.c
@@ -141,7 +141,7 @@ static void default_wdmem_id(address_space *space, offs_t address, UINT8 data) {
static CPU_INIT( m6509 )
{
m6509_Regs *cpustate = get_safe_token(device);
- const m6502_interface *intf = (const m6502_interface *)device->baseconfig().static_config();
+ const m6502_interface *intf = (const m6502_interface *)device->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 899d9aa2788..a79fbc7fd9d 100644
--- a/src/emu/cpu/m6502/m65ce02.c
+++ b/src/emu/cpu/m6502/m65ce02.c
@@ -101,7 +101,7 @@ static void default_wdmem_id(address_space *space, offs_t address, UINT8 data) {
static CPU_INIT( m65ce02 )
{
m65ce02_Regs *cpustate = get_safe_token(device);
- const m6502_interface *intf = (const m6502_interface *)device->baseconfig().static_config();
+ const m6502_interface *intf = (const m6502_interface *)device->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 310795aad0f..8770fe73a0c 100644
--- a/src/emu/cpu/m6800/m6800.c
+++ b/src/emu/cpu/m6800/m6800.c
@@ -1208,9 +1208,9 @@ static CPU_INIT( m6801 )
state_register(cpustate, "m6801");
- if (device->baseconfig().static_config() != NULL)
+ if (device->static_config() != NULL)
{
- m6801_interface *intf = (m6801_interface *) device->baseconfig().static_config();
+ m6801_interface *intf = (m6801_interface *) device->static_config();
devcb_resolve_write_line(&cpustate->out_sc2_func, &intf->out_sc2_func, device);
}
@@ -1258,9 +1258,9 @@ static CPU_INIT( m6803 )
state_register(cpustate, "m6803");
- if (device->baseconfig().static_config() != NULL)
+ if (device->static_config() != NULL)
{
- m6801_interface *intf = (m6801_interface *) device->baseconfig().static_config();
+ m6801_interface *intf = (m6801_interface *) device->static_config();
devcb_resolve_write_line(&cpustate->out_sc2_func, &intf->out_sc2_func, device);
}
diff --git a/src/emu/cpu/m6809/6809dasm.c b/src/emu/cpu/m6809/6809dasm.c
index 430d2d9636d..cb77184a4e2 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->baseconfig().static_config() : NULL;
+ const m6809_config *configdata = device ? (const m6809_config *)device->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 75d4ed9183f..4fb5be8d8c4 100644
--- a/src/emu/cpu/m6809/m6809.c
+++ b/src/emu/cpu/m6809/m6809.c
@@ -371,7 +371,7 @@ static CPU_INIT( m6809 )
0
};
- const m6809_config *configdata = device->baseconfig().static_config() ? (const m6809_config *)device->baseconfig().static_config() : &default_config;
+ const m6809_config *configdata = device->static_config() ? (const m6809_config *)device->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 3150b447b48..d941d5e80b4 100644
--- a/src/emu/cpu/mb86233/mb86233.c
+++ b/src/emu/cpu/mb86233/mb86233.c
@@ -107,7 +107,7 @@ INLINE mb86233_state *get_safe_token(device_t *device)
static CPU_INIT( mb86233 )
{
mb86233_state *cpustate = get_safe_token(device);
- mb86233_cpu_core * _config = (mb86233_cpu_core *)device->baseconfig().static_config();
+ mb86233_cpu_core * _config = (mb86233_cpu_core *)device->static_config();
(void)irqcallback;
memset(cpustate, 0, sizeof( *cpustate ) );
diff --git a/src/emu/cpu/mb88xx/mb88xx.c b/src/emu/cpu/mb88xx/mb88xx.c
index 8c60ca444aa..0972d89901c 100644
--- a/src/emu/cpu/mb88xx/mb88xx.c
+++ b/src/emu/cpu/mb88xx/mb88xx.c
@@ -136,9 +136,9 @@ static CPU_INIT( mb88 )
{
mb88_state *cpustate = get_safe_token(device);
- if ( device->baseconfig().static_config() )
+ if ( device->static_config() )
{
- const mb88_cpu_core *_config = (const mb88_cpu_core*)device->baseconfig().static_config();
+ const mb88_cpu_core *_config = (const mb88_cpu_core*)device->static_config();
cpustate->PLA = _config->PLA_config;
}
diff --git a/src/emu/cpu/mc68hc11/mc68hc11.c b/src/emu/cpu/mc68hc11/mc68hc11.c
index dfa0054d495..ebcf5151f02 100644
--- a/src/emu/cpu/mc68hc11/mc68hc11.c
+++ b/src/emu/cpu/mc68hc11/mc68hc11.c
@@ -369,7 +369,7 @@ static CPU_INIT( hc11 )
hc11_state *cpustate = get_safe_token(device);
int i;
- const hc11_config *conf = (const hc11_config *)device->baseconfig().static_config();
+ const hc11_config *conf = (const hc11_config *)device->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 388cffa0d86..71864db4398 100644
--- a/src/emu/cpu/mcs48/mcs48.c
+++ b/src/emu/cpu/mcs48/mcs48.c
@@ -1418,7 +1418,7 @@ static CPU_GET_INFO( mcs48 )
CPU-SPECIFIC CONTEXT ACCESS
***************************************************************************/
-static void mcs48_generic_get_info(const device_config *devconfig, legacy_cpu_device *device, UINT32 state, cpuinfo *info, UINT8 features, int romsize, int ramsize, const char *name)
+static void mcs48_generic_get_info(legacy_cpu_device *device, UINT32 state, cpuinfo *info, UINT8 features, int romsize, int ramsize, const char *name)
{
switch (state)
{
@@ -1494,31 +1494,31 @@ static void mcs48_generic_get_info(const device_config *devconfig, legacy_cpu_de
/* Official Intel MCS-48 parts */
-CPU_GET_INFO( i8021 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 1024, 64, "I8021"); }
-CPU_GET_INFO( i8022 ) { mcs48_generic_get_info(devconfig, device, state, info, MCS48_FEATURE, 2048, 128, "I8022"); }
-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"); }
+CPU_GET_INFO( i8021 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 1024, 64, "I8021"); }
+CPU_GET_INFO( i8022 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 2048, 128, "I8022"); }
+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"); }
/* Official Intel UPI-41 parts */
-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"); }
+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"); }
/* Clones */
-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"); }
+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"); }
/* Official Intel MCS-48 parts */
DEFINE_LEGACY_CPU_DEVICE(I8021, i8021); /* 1k internal ROM, 64 bytes internal RAM */
diff --git a/src/emu/cpu/mcs51/mcs51.c b/src/emu/cpu/mcs51/mcs51.c
index 61bfde09727..b2db9af668e 100644
--- a/src/emu/cpu/mcs51/mcs51.c
+++ b/src/emu/cpu/mcs51/mcs51.c
@@ -2384,7 +2384,7 @@ static CPU_INIT( ds5002fp )
{
/* default configuration */
static const ds5002fp_config default_config = { 0x00, 0x00, 0x00 };
- const ds5002fp_config *sconfig = device->baseconfig().static_config() ? (const ds5002fp_config *)device->baseconfig().static_config() : &default_config;
+ const ds5002fp_config *sconfig = device->static_config() ? (const ds5002fp_config *)device->static_config() : &default_config;
mcs51_state_t *mcs51_state = get_safe_token(device);
CPU_INIT_CALL( mcs51 );
diff --git a/src/emu/cpu/minx/minx.c b/src/emu/cpu/minx/minx.c
index 5750b766613..fc4597957ef 100644
--- a/src/emu/cpu/minx/minx.c
+++ b/src/emu/cpu/minx/minx.c
@@ -120,7 +120,7 @@ static CPU_INIT( minx )
minx->irq_callback = irqcallback;
minx->device = device;
minx->program = device->space(AS_PROGRAM);
- if ( device->baseconfig().static_config() != NULL )
+ if ( device->static_config() != NULL )
{
}
else
diff --git a/src/emu/cpu/mips/mips3com.c b/src/emu/cpu/mips/mips3com.c
index 21e67659249..96541d39ca5 100644
--- a/src/emu/cpu/mips/mips3com.c
+++ b/src/emu/cpu/mips/mips3com.c
@@ -71,7 +71,7 @@ INLINE int tlb_entry_is_global(const mips3_tlb_entry *entry)
void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, legacy_cpu_device *device, device_irq_callback irqcallback)
{
- const mips3_config *config = (const mips3_config *)device->baseconfig().static_config();
+ const mips3_config *config = (const mips3_config *)device->static_config();
int tlbindex;
/* initialize based on the config */
diff --git a/src/emu/cpu/mips/psx.c b/src/emu/cpu/mips/psx.c
index 199dc2d3235..735ecf4a198 100644
--- a/src/emu/cpu/mips/psx.c
+++ b/src/emu/cpu/mips/psx.c
@@ -158,6 +158,10 @@ static const char *const delayn[] =
"pc", "!pc"
};
+// device type definition
+const device_type PSXCPU = &device_creator<psxcpu_device>;
+const device_type CXD8661R = &device_creator<cxd8661r_device>;
+
static const UINT32 mtc0_writemask[]=
{
0x00000000, /* !INDEX */
@@ -1557,70 +1561,28 @@ static ADDRESS_MAP_START( cxd8661r_internal_map, AS_PROGRAM, 32 )
ADDRESS_MAP_END
-const device_type PSXCPU = psxcpu_device_config::static_alloc_device_config;
-const device_type CXD8661R = cxd8661r_device_config::static_alloc_device_config;
-
//**************************************************************************
-// PSXCPU DEVICE CONFIG
+// DEVICE INTERFACE
//**************************************************************************
//-------------------------------------------------
-// psxcpu_device_config - constructor
+// psxcpu_device - constructor
//-------------------------------------------------
-psxcpu_device_config::psxcpu_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, address_map_constructor internal_map)
- : cpu_device_config(mconfig, type, name, tag, owner, clock),
+psxcpu_device::psxcpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map)
+ : cpu_device(mconfig, type, name, tag, owner, clock),
m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0, internal_map)
{
}
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *psxcpu_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
+psxcpu_device::psxcpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : cpu_device(mconfig, PSXCPU, "PSXCPU", tag, owner, clock),
+ m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0, ADDRESS_MAP_NAME(psxcpu_internal_map))
{
- return global_alloc(psxcpu_device_config(mconfig, PSXCPU, "PSXCPU", tag, owner, clock, ADDRESS_MAP_NAME(psxcpu_internal_map)));
}
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *cxd8661r_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(psxcpu_device_config(mconfig, CXD8661R, "CXD8661R", tag, owner, clock, ADDRESS_MAP_NAME(cxd8661r_internal_map)));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *psxcpu_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, psxcpu_device(machine, *this));
-}
-
-device_t *cxd8661r_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, psxcpu_device(machine, *this));
-}
-
-
-//**************************************************************************
-// DEVICE INTERFACE
-//**************************************************************************
-
-//-------------------------------------------------
-// psxcpu_device - constructor
-//-------------------------------------------------
-
-psxcpu_device::psxcpu_device(running_machine &machine, const psxcpu_device_config &config)
- : cpu_device(machine, config)
+cxd8661r_device::cxd8661r_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : psxcpu_device(mconfig, CXD8661R, "CXD8661R", tag, owner, clock, ADDRESS_MAP_NAME(cxd8661r_internal_map))
{
}
diff --git a/src/emu/cpu/mips/psx.h b/src/emu/cpu/mips/psx.h
index 2704552d179..f4e4eb1b9bf 100644
--- a/src/emu/cpu/mips/psx.h
+++ b/src/emu/cpu/mips/psx.h
@@ -96,25 +96,13 @@ enum
PSXCPU_CP2CR30, PSXCPU_CP2CR31
};
-extern const device_type PSXCPU;
-
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
//#define MCFG_PSXCPU_CONFIG(_config)
-// psxcpu_device_config::static_set_config(device, _config);
-
-
-
-//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// device type definition
-extern const device_type PSXCPU;
-extern const device_type CXD8661R;
+// psxcpu_device::static_set_config(*device, _config);
@@ -122,65 +110,21 @@ extern const device_type CXD8661R;
// TYPE DEFINITIONS
//**************************************************************************
-class psxcpu_device;
-
-
-// ======================> psxcpu_device_config
-
-class psxcpu_device_config : public cpu_device_config
-{
- friend class psxcpu_device;
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // construction/destruction
- psxcpu_device_config(const machine_config &mconfig, device_type _type, const char *name, const char *tag, const device_config *owner, UINT32 clock, address_map_constructor internal_map);
-protected:
- // device_config_execute_interface overrides
- virtual UINT32 execute_min_cycles() const { return 1; }
- virtual UINT32 execute_max_cycles() const { return 40; }
- virtual UINT32 execute_input_lines() const { return 6; }
- virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const { return ( clocks + 3 ) / 4; }
- virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const { return cycles * 4; }
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : NULL; }
-
- // device_config_disasm_interface overrides
- virtual UINT32 disasm_min_opcode_bytes() const { return 4; }
- virtual UINT32 disasm_max_opcode_bytes() const { return 4; }
-
- // address spaces
- const address_space_config m_program_config;
-};
-
-class cxd8661r_device_config : public psxcpu_device_config
-{
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
// ======================> psxcpu_device
class psxcpu_device : public cpu_device
{
- friend class psxcpu_device_config;
- friend class cxd8661r_device_config;
-
public:
+ // construction/destruction
+ psxcpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
// public interfaces
void set_berr();
void set_biu( UINT32 data, UINT32 mem_mask );
UINT32 get_biu();
protected:
- // construction/destruction
- psxcpu_device(running_machine &_machine, const psxcpu_device_config &config);
+ psxcpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal_map);
// device-level overrides
virtual void device_start();
@@ -188,14 +132,24 @@ protected:
virtual void device_post_load();
// device_execute_interface overrides
+ virtual UINT32 execute_min_cycles() const { return 1; }
+ virtual UINT32 execute_max_cycles() const { return 40; }
+ virtual UINT32 execute_input_lines() const { return 6; }
+ virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const { return ( clocks + 3 ) / 4; }
+ virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const { return cycles * 4; }
virtual void execute_run();
virtual void execute_set_input(int inputnum, int state);
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : NULL; }
+
// device_state_interface overrides
virtual void state_import(const device_state_entry &entry);
virtual void state_string_export(const device_state_entry &entry, astring &string);
// device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const { return 4; }
+ virtual UINT32 disasm_max_opcode_bytes() const { return 4; }
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
@@ -218,6 +172,7 @@ protected:
inline UINT32 opcode_read();
// address spaces
+ const address_space_config m_program_config;
address_space *m_program;
direct_read_data *m_direct;
@@ -311,6 +266,19 @@ protected:
void docop2( int gteop );
};
+class cxd8661r_device : public psxcpu_device
+{
+public:
+ // construction/destruction
+ cxd8661r_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+// device type definition
+extern const device_type PSXCPU;
+extern const device_type CXD8661R;
+
+
+
#define PSXCPU_DELAYR_PC ( 32 )
#define PSXCPU_DELAYR_NOTPC ( 33 )
diff --git a/src/emu/cpu/mips/r3000.c b/src/emu/cpu/mips/r3000.c
index dc8debb8fd6..e28bc8bee47 100644
--- a/src/emu/cpu/mips/r3000.c
+++ b/src/emu/cpu/mips/r3000.c
@@ -299,7 +299,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->baseconfig().static_config();
+ const r3000_cpu_core *configdata = (const r3000_cpu_core *)device->static_config();
r3000_state *r3000 = get_safe_token(device);
/* allocate memory */
diff --git a/src/emu/cpu/nec/v25.c b/src/emu/cpu/nec/v25.c
index 15c8ea5e666..1447575c5ad 100644
--- a/src/emu/cpu/nec/v25.c
+++ b/src/emu/cpu/nec/v25.c
@@ -398,7 +398,7 @@ static CPU_DISASSEMBLE( v25 )
static void v25_init(legacy_cpu_device *device, device_irq_callback irqcallback, int type)
{
- const nec_config *config = device->baseconfig().static_config() ? (const nec_config *)device->baseconfig().static_config() : &default_config;
+ const nec_config *config = device->static_config() ? (const nec_config *)device->static_config() : &default_config;
v25_state_t *nec_state = get_safe_token(device);
unsigned int i, j, c;
diff --git a/src/emu/cpu/pdp1/pdp1.c b/src/emu/cpu/pdp1/pdp1.c
index d356596b8e7..f77ebb0a06b 100644
--- a/src/emu/cpu/pdp1/pdp1.c
+++ b/src/emu/cpu/pdp1/pdp1.c
@@ -537,7 +537,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->baseconfig().static_config();
+ const pdp1_reset_param_t *param = (const pdp1_reset_param_t *)device->static_config();
pdp1_state *cpustate = get_safe_token(device);
int i;
diff --git a/src/emu/cpu/pdp1/tx0.c b/src/emu/cpu/pdp1/tx0.c
index 15b1aa0dcd6..e446a0ecde4 100644
--- a/src/emu/cpu/pdp1/tx0.c
+++ b/src/emu/cpu/pdp1/tx0.c
@@ -130,7 +130,7 @@ static void tx0_init_common(legacy_cpu_device *device, device_irq_callback irqca
tx0_state *cpustate = get_safe_token(device);
/* clean-up */
- cpustate->iface = (const tx0_reset_param_t *)device->baseconfig().static_config();
+ cpustate->iface = (const tx0_reset_param_t *)device->static_config();
cpustate->address_mask = is_64kw ? ADDRESS_MASK_64KW : ADDRESS_MASK_8KW;
cpustate->ir_mask = is_64kw ? 03 : 037;
diff --git a/src/emu/cpu/powerpc/ppc.c b/src/emu/cpu/powerpc/ppc.c
index a839bf2c51c..2b9935b3b10 100644
--- a/src/emu/cpu/powerpc/ppc.c
+++ b/src/emu/cpu/powerpc/ppc.c
@@ -929,7 +929,7 @@ static void ppc_init(void)
// !!! probably should move this stuff elsewhere !!!
static CPU_INIT( ppc403 )
{
- const ppc_config *configdata = device->baseconfig().static_config();
+ const ppc_config *configdata = device->static_config();
ppc_init();
@@ -975,7 +975,7 @@ static CPU_EXIT( ppc403 )
static CPU_INIT( ppc603 )
{
- const ppc_config *configdata = device->baseconfig().static_config();
+ const ppc_config *configdata = device->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->baseconfig().static_config();
+ const ppc_config *configdata = device->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->baseconfig().static_config();
+ const ppc_config *configdata = device->static_config();
int i ;
@@ -1393,7 +1393,7 @@ static CPU_EXIT( mpc8240 )
static CPU_INIT( ppc601 )
{
- const ppc_config *configdata = device->baseconfig().static_config();
+ const ppc_config *configdata = device->static_config();
float multiplier;
int i ;
@@ -1521,7 +1521,7 @@ static CPU_EXIT( ppc601 )
static CPU_INIT( ppc604 )
{
- const ppc_config *configdata = device->baseconfig().static_config();
+ const ppc_config *configdata = device->static_config();
float multiplier;
int i ;
diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c
index efdb560a523..4523ea5eb17 100644
--- a/src/emu/cpu/powerpc/ppccom.c
+++ b/src/emu/cpu/powerpc/ppccom.c
@@ -304,7 +304,7 @@ INLINE int sign_double(double x)
void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy_cpu_device *device, device_irq_callback irqcallback)
{
- const powerpc_config *config = (const powerpc_config *)device->baseconfig().static_config();
+ const powerpc_config *config = (const powerpc_config *)device->static_config();
/* initialize based on the config */
memset(ppc, 0, sizeof(*ppc));
diff --git a/src/emu/cpu/rsp/rsp.c b/src/emu/cpu/rsp/rsp.c
index 1a9bd158f6e..a6bedcf3fcd 100644
--- a/src/emu/cpu/rsp/rsp.c
+++ b/src/emu/cpu/rsp/rsp.c
@@ -274,7 +274,7 @@ static CPU_INIT( rsp )
rsp_state *rsp = get_safe_token(device);
int regIdx;
int accumIdx;
- rsp->config = (const rsp_config *)device->baseconfig().static_config();
+ rsp->config = (const rsp_config *)device->static_config();
if (LOG_INSTRUCTION_EXECUTION)
rsp->exec_output = fopen("rsp_execute.txt", "wt");
diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c
index f41d462b3a5..fff466a2e53 100644
--- a/src/emu/cpu/rsp/rspdrc.c
+++ b/src/emu/cpu/rsp/rspdrc.c
@@ -569,7 +569,7 @@ static void rspcom_init(rsp_state *rsp, legacy_cpu_device *device, device_irq_ca
memset(rsp, 0, sizeof(*rsp));
- rsp->config = (const rsp_config *)device->baseconfig().static_config();
+ rsp->config = (const rsp_config *)device->static_config();
rsp->irq_callback = irqcallback;
rsp->device = device;
rsp->program = device->space(AS_PROGRAM);
diff --git a/src/emu/cpu/saturn/saturn.c b/src/emu/cpu/saturn/saturn.c
index 7fa69b211e6..b03c4260923 100644
--- a/src/emu/cpu/saturn/saturn.c
+++ b/src/emu/cpu/saturn/saturn.c
@@ -112,7 +112,7 @@ static CPU_INIT( saturn )
{
saturn_state *cpustate = get_safe_token(device);
- cpustate->config = (saturn_cpu_core *) device->baseconfig().static_config();
+ cpustate->config = (saturn_cpu_core *) device->static_config();
cpustate->irq_callback = irqcallback;
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
diff --git a/src/emu/cpu/sc61860/sc61860.c b/src/emu/cpu/sc61860/sc61860.c
index 60cd6a8ce9a..b943bbef7d6 100644
--- a/src/emu/cpu/sc61860/sc61860.c
+++ b/src/emu/cpu/sc61860/sc61860.c
@@ -103,7 +103,7 @@ static CPU_RESET( sc61860 )
static CPU_INIT( sc61860 )
{
sc61860_state *cpustate = get_safe_token(device);
- cpustate->config = (sc61860_cpu_core *) device->baseconfig().static_config();
+ cpustate->config = (sc61860_cpu_core *) device->static_config();
device->machine().scheduler().timer_pulse(attotime::from_hz(500), FUNC(sc61860_2ms_tick), 0, cpustate);
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
diff --git a/src/emu/cpu/scmp/scmp.c b/src/emu/cpu/scmp/scmp.c
index c20ad19d53d..bf67f516a51 100644
--- a/src/emu/cpu/scmp/scmp.c
+++ b/src/emu/cpu/scmp/scmp.c
@@ -494,8 +494,8 @@ static CPU_INIT( scmp )
{
scmp_state *cpustate = get_safe_token(device);
- if (device->baseconfig().static_config() != NULL)
- cpustate->config = *(scmp_config *)device->baseconfig().static_config();
+ if (device->static_config() != NULL)
+ cpustate->config = *(scmp_config *)device->static_config();
/* set up the state table */
{
diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c
index 045af03d406..1ec595291bb 100644
--- a/src/emu/cpu/sh2/sh2comn.c
+++ b/src/emu/cpu/sh2/sh2comn.c
@@ -920,7 +920,7 @@ void sh2_exception(sh2_state *sh2, const char *message, int irqline)
void sh2_common_init(sh2_state *sh2, legacy_cpu_device *device, device_irq_callback irqcallback)
{
- const sh2_cpu_core *conf = (const sh2_cpu_core *)device->baseconfig().static_config();
+ const sh2_cpu_core *conf = (const sh2_cpu_core *)device->static_config();
int i;
sh2->timer = device->machine().scheduler().timer_alloc(FUNC(sh2_timer_callback), sh2);
diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c
index 1503db55665..58d69892872 100644
--- a/src/emu/cpu/sh4/sh4.c
+++ b/src/emu/cpu/sh4/sh4.c
@@ -3377,7 +3377,7 @@ static CPU_EXECUTE( sh4 )
static CPU_INIT( sh4 )
{
- const struct sh4_config *conf = (const struct sh4_config *)device->baseconfig().static_config();
+ const struct sh4_config *conf = (const struct sh4_config *)device->static_config();
sh4_state *sh4 = get_safe_token(device);
sh4_common_init(device);
diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c
index 63bd604603f..70fbdc3959e 100644
--- a/src/emu/cpu/sharc/sharc.c
+++ b/src/emu/cpu/sharc/sharc.c
@@ -418,7 +418,7 @@ void sharc_external_dma_write(device_t *device, UINT32 address, UINT64 data)
static CPU_INIT( sharc )
{
SHARC_REGS *cpustate = get_safe_token(device);
- const sharc_config *cfg = (const sharc_config *)device->baseconfig().static_config();
+ const sharc_config *cfg = (const sharc_config *)device->static_config();
int saveindex;
cpustate->boot_mode = cfg->boot_mode;
diff --git a/src/emu/cpu/sm8500/sm8500.c b/src/emu/cpu/sm8500/sm8500.c
index 862c665f4ac..6ebe381ae82 100644
--- a/src/emu/cpu/sm8500/sm8500.c
+++ b/src/emu/cpu/sm8500/sm8500.c
@@ -126,9 +126,9 @@ static CPU_INIT( sm8500 )
cpustate->irq_callback = irqcallback;
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
- if ( device->baseconfig().static_config() != NULL ) {
- cpustate->config.handle_dma = ((SM8500_CONFIG *)device->baseconfig().static_config())->handle_dma;
- cpustate->config.handle_timers = ((SM8500_CONFIG *)device->baseconfig().static_config())->handle_timers;
+ 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;
} else {
cpustate->config.handle_dma = NULL;
cpustate->config.handle_timers = NULL;
diff --git a/src/emu/cpu/superfx/superfx.c b/src/emu/cpu/superfx/superfx.c
index 1ffe408e0c2..fa7a4404d7e 100644
--- a/src/emu/cpu/superfx/superfx.c
+++ b/src/emu/cpu/superfx/superfx.c
@@ -754,9 +754,9 @@ static CPU_INIT( superfx )
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
- if (device->baseconfig().static_config() != NULL)
+ if (device->static_config() != NULL)
{
- cpustate->config = *(superfx_config *)device->baseconfig().static_config();
+ cpustate->config = *(superfx_config *)device->static_config();
}
devcb_resolve_write_line(&cpustate->out_irq_func, &cpustate->config.out_irq_func, device);
diff --git a/src/emu/cpu/t11/t11.c b/src/emu/cpu/t11/t11.c
index 5355bca86cf..47f688bfaf7 100644
--- a/src/emu/cpu/t11/t11.c
+++ b/src/emu/cpu/t11/t11.c
@@ -258,7 +258,7 @@ static CPU_INIT( t11 )
0xc000, 0x8000, 0x4000, 0x2000,
0x1000, 0x0000, 0xf600, 0xf400
};
- const struct t11_setup *setup = (const struct t11_setup *)device->baseconfig().static_config();
+ const struct t11_setup *setup = (const struct t11_setup *)device->static_config();
t11_state *cpustate = get_safe_token(device);
cpustate->initial_pc = initial_pc[setup->mode >> 13];
diff --git a/src/emu/cpu/tlcs900/tlcs900.c b/src/emu/cpu/tlcs900/tlcs900.c
index 21c8d6c987c..b505c74bb3b 100644
--- a/src/emu/cpu/tlcs900/tlcs900.c
+++ b/src/emu/cpu/tlcs900/tlcs900.c
@@ -217,7 +217,7 @@ static CPU_INIT( tlcs900 )
{
tlcs900_state *cpustate = get_safe_token(device);
- cpustate->intf = (const tlcs900_interface *)device->baseconfig().static_config();
+ cpustate->intf = (const tlcs900_interface *)device->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 e3a6440f4ba..5dd4d30e301 100644
--- a/src/emu/cpu/tms0980/tms0980.c
+++ b/src/emu/cpu/tms0980/tms0980.c
@@ -494,7 +494,7 @@ static void cpu_init_tms_common( legacy_cpu_device *device, const UINT32* decode
{
tms0980_state *cpustate = get_safe_token( device );
- cpustate->config = (const tms0980_config *) device->baseconfig().static_config();
+ cpustate->config = (const tms0980_config *) device->static_config();
assert( cpustate->config != NULL );
diff --git a/src/emu/cpu/tms32031/32031ops.c b/src/emu/cpu/tms32031/32031ops.c
index 31482d4a407..12f8a815f54 100644
--- a/src/emu/cpu/tms32031/32031ops.c
+++ b/src/emu/cpu/tms32031/32031ops.c
@@ -138,10 +138,10 @@ void tms3203x_device::update_special(int dreg)
}
else if (dreg == TMR_IOF)
{
- if (m_config.m_xf0_w != NULL && IREG(TMR_IOF) & 0x002)
- (*m_config.m_xf0_w)(*this, (IREG(TMR_IOF) >> 2) & 1);
- if (m_config.m_xf1_w != NULL && IREG(TMR_IOF) & 0x020)
- (*m_config.m_xf1_w)(*this, (IREG(TMR_IOF) >> 6) & 1);
+ if (m_xf0_w != NULL && IREG(TMR_IOF) & 0x002)
+ (*m_xf0_w)(*this, (IREG(TMR_IOF) >> 2) & 1);
+ if (m_xf1_w != NULL && IREG(TMR_IOF) & 0x020)
+ (*m_xf1_w)(*this, (IREG(TMR_IOF) >> 6) & 1);
}
else if (dreg == TMR_ST || dreg == TMR_IF || dreg == TMR_IE)
check_irqs();
@@ -3142,21 +3142,21 @@ void tms3203x_device::xor_imm(UINT32 op)
void tms3203x_device::iack_dir(UINT32 op)
{
offs_t addr = DIRECT(op);
- if (m_config.m_iack_w)
- (*m_config.m_iack_w)(*this, ASSERT_LINE, addr);
+ if (m_iack_w)
+ (*m_iack_w)(*this, ASSERT_LINE, addr);
RMEM(addr);
- if (m_config.m_iack_w)
- (*m_config.m_iack_w)(*this, CLEAR_LINE, addr);
+ if (m_iack_w)
+ (*m_iack_w)(*this, CLEAR_LINE, addr);
}
void tms3203x_device::iack_ind(UINT32 op)
{
offs_t addr = INDIRECT_D(op, op >> 8);
- if (m_config.m_iack_w)
- (*m_config.m_iack_w)(*this, ASSERT_LINE, addr);
+ if (m_iack_w)
+ (*m_iack_w)(*this, ASSERT_LINE, addr);
RMEM(addr);
- if (m_config.m_iack_w)
- (*m_config.m_iack_w)(*this, CLEAR_LINE, addr);
+ if (m_iack_w)
+ (*m_iack_w)(*this, CLEAR_LINE, addr);
}
/*-----------------------------------------------------*/
@@ -5671,7 +5671,7 @@ void tms3203x_device::trap(int trapnum)
{
WMEM(++IREG(TMR_SP), m_pc);
IREG(TMR_ST) &= ~GIEFLAG;
- if (m_config.m_chip_type == tms3203x_device_config::CHIP_TYPE_TMS32032)
+ if (m_chip_type == CHIP_TYPE_TMS32032)
m_pc = RMEM(((IREG(TMR_IF) >> 16) << 8) + trapnum);
else if (m_mcu_mode)
m_pc = 0x809fc0 + trapnum;
diff --git a/src/emu/cpu/tms32031/tms32031.c b/src/emu/cpu/tms32031/tms32031.c
index c56d0007022..227e52f5e77 100644
--- a/src/emu/cpu/tms32031/tms32031.c
+++ b/src/emu/cpu/tms32031/tms32031.c
@@ -115,9 +115,9 @@ const int GIEFLAG = 0x2000;
// GLOBAL VARIABLES
//**************************************************************************
-// device definitions
-const device_type TMS32031 = tms32031_device_config::static_alloc_device_config;
-const device_type TMS32032 = tms32032_device_config::static_alloc_device_config;
+// device type definition
+const device_type TMS32031 = &device_creator<tms32031_device>;
+const device_type TMS32032 = &device_creator<tms32032_device>;
// internal memory maps
static ADDRESS_MAP_START( internal_32031, AS_PROGRAM, 32 )
@@ -131,143 +131,6 @@ ADDRESS_MAP_END
//**************************************************************************
-// TMS3203X DEVICE CONFIG
-//**************************************************************************
-
-//-------------------------------------------------
-// tms3203x_device_config - constructor
-//-------------------------------------------------
-
-tms3203x_device_config::tms3203x_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 chiptype, address_map_constructor internal_map)
- : cpu_device_config(mconfig, type, name, tag, owner, clock),
- m_program_config("program", ENDIANNESS_LITTLE, 32, 24, -2, internal_map),
- m_chip_type(chiptype)
-{
- m_bootoffset = 0;
- m_xf0_w = NULL;
- m_xf1_w = NULL;
- m_iack_w = NULL;
-}
-
-tms32031_device_config::tms32031_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : tms3203x_device_config(mconfig, static_alloc_device_config, "TMS32031", tag, owner, clock, CHIP_TYPE_TMS32031, ADDRESS_MAP_NAME(internal_32031)) { }
-
-tms32032_device_config::tms32032_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : tms3203x_device_config(mconfig, static_alloc_device_config, "TMS32032", tag, owner, clock, CHIP_TYPE_TMS32032, ADDRESS_MAP_NAME(internal_32032)) { }
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *tms32031_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(tms32031_device_config(mconfig, tag, owner, clock));
-}
-
-device_config *tms32032_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(tms32032_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *tms32031_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, tms32031_device(machine, *this));
-}
-
-device_t *tms32032_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, tms32032_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// static_set_config - set the configuration
-// structure
-//-------------------------------------------------
-
-void tms3203x_device_config::static_set_config(device_config *device, const tms3203x_config &config)
-{
- tms3203x_device_config *tms = downcast<tms3203x_device_config *>(device);
- *static_cast<tms3203x_config *>(tms) = config;
-}
-
-
-//-------------------------------------------------
-// execute_min_cycles - return minimum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 tms3203x_device_config::execute_min_cycles() const
-{
- return 1;
-}
-
-
-//-------------------------------------------------
-// execute_max_cycles - return maximum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 tms3203x_device_config::execute_max_cycles() const
-{
- return 4;
-}
-
-
-//-------------------------------------------------
-// execute_input_lines - return the number of
-// input/interrupt lines
-//-------------------------------------------------
-
-UINT32 tms3203x_device_config::execute_input_lines() const
-{
- return 11;
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return the configuration
-// of the specified address space, or NULL if
-// the space doesn't exist
-//-------------------------------------------------
-
-const address_space_config *tms3203x_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_PROGRAM) ? &m_program_config : NULL;
-}
-
-
-//-------------------------------------------------
-// disasm_min_opcode_bytes - return the length
-// of the shortest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 tms3203x_device_config::disasm_min_opcode_bytes() const
-{
- return 4;
-}
-
-
-//-------------------------------------------------
-// disasm_max_opcode_bytes - return the length
-// of the longest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 tms3203x_device_config::disasm_max_opcode_bytes() const
-{
- return 4;
-}
-
-
-
-//**************************************************************************
// TMSREG REGISTER
//**************************************************************************
@@ -403,9 +266,10 @@ void tms3203x_device::tmsreg::from_double(double val)
// tms3203x_device - constructor
//-------------------------------------------------
-tms3203x_device::tms3203x_device(running_machine &_machine, const tms3203x_device_config &config)
- : cpu_device(_machine, config),
- m_config(config),
+tms3203x_device::tms3203x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype, address_map_constructor internal_map)
+ : cpu_device(mconfig, type, name, tag, owner, clock),
+ m_program_config("program", ENDIANNESS_LITTLE, 32, 24, -2, internal_map),
+ m_chip_type(chiptype),
m_pc(0),
m_bkmask(0),
m_irq_state(0),
@@ -418,6 +282,11 @@ tms3203x_device::tms3203x_device(running_machine &_machine, const tms3203x_devic
m_program(0),
m_direct(0)
{
+ m_bootoffset = 0;
+ m_xf0_w = NULL;
+ m_xf1_w = NULL;
+ m_iack_w = NULL;
+
// initialize remaining state
memset(&m_r, 0, sizeof(m_r));
@@ -429,11 +298,11 @@ tms3203x_device::tms3203x_device(running_machine &_machine, const tms3203x_devic
#endif
}
-tms32031_device::tms32031_device(running_machine &_machine, const tms32031_device_config &config)
- : tms3203x_device(_machine, config) { }
+tms32031_device::tms32031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms3203x_device(mconfig, TMS32031, "TMS32031", tag, owner, clock, CHIP_TYPE_TMS32031, ADDRESS_MAP_NAME(internal_32031)) { }
-tms32032_device::tms32032_device(running_machine &_machine, const tms32032_device_config &config)
- : tms3203x_device(_machine, config) { }
+tms32032_device::tms32032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms3203x_device(mconfig, TMS32032, "TMS32032", tag, owner, clock, CHIP_TYPE_TMS32032, ADDRESS_MAP_NAME(internal_32032)) { }
//-------------------------------------------------
@@ -451,6 +320,18 @@ tms3203x_device::~tms3203x_device()
//-------------------------------------------------
+// static_set_config - set the configuration
+// structure
+//-------------------------------------------------
+
+void tms3203x_device::static_set_config(device_t &device, const tms3203x_config &config)
+{
+ tms3203x_device &tms = downcast<tms3203x_device &>(device);
+ static_cast<tms3203x_config &>(tms) = config;
+}
+
+
+//-------------------------------------------------
// ROPCODE - fetch an opcode
//-------------------------------------------------
@@ -551,10 +432,10 @@ void tms3203x_device::device_start()
void tms3203x_device::device_reset()
{
// if we have a config struct, get the boot ROM address
- if (m_config.m_bootoffset != 0)
+ if (m_bootoffset != 0)
{
m_mcu_mode = true;
- m_pc = boot_loader(m_config.m_bootoffset);
+ m_pc = boot_loader(m_bootoffset);
}
else
{
@@ -574,6 +455,18 @@ void tms3203x_device::device_reset()
//-------------------------------------------------
+// memory_space_config - return the configuration
+// of the specified address space, or NULL if
+// the space doesn't exist
+//-------------------------------------------------
+
+const address_space_config *tms3203x_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_PROGRAM) ? &m_program_config : NULL;
+}
+
+
+//-------------------------------------------------
// state_import - import state into the device,
// after it has been set
//-------------------------------------------------
@@ -664,6 +557,28 @@ void tms3203x_device::state_string_export(const device_state_entry &entry, astri
//-------------------------------------------------
+// disasm_min_opcode_bytes - return the length
+// of the shortest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 tms3203x_device::disasm_min_opcode_bytes() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
+// disasm_max_opcode_bytes - return the length
+// of the longest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 tms3203x_device::disasm_max_opcode_bytes() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
// disasm_disassemble - call the disassembly
// helper function
//-------------------------------------------------
@@ -766,7 +681,7 @@ void tms3203x_device::check_irqs()
// after auto-clearing the interrupt bit, we need to re-trigger
// level-sensitive interrupts
- if (m_config.m_chip_type == tms3203x_device_config::CHIP_TYPE_TMS32031 || (IREG(TMR_ST) & 0x4000) == 0)
+ if (m_chip_type == CHIP_TYPE_TMS32031 || (IREG(TMR_ST) & 0x4000) == 0)
IREG(TMR_IF) |= m_irq_state & 0x0f;
}
else
@@ -775,6 +690,39 @@ void tms3203x_device::check_irqs()
//-------------------------------------------------
+// execute_min_cycles - return minimum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 tms3203x_device::execute_min_cycles() const
+{
+ return 1;
+}
+
+
+//-------------------------------------------------
+// execute_max_cycles - return maximum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 tms3203x_device::execute_max_cycles() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
+// execute_input_lines - return the number of
+// input/interrupt lines
+//-------------------------------------------------
+
+UINT32 tms3203x_device::execute_input_lines() const
+{
+ return 11;
+}
+
+
+//-------------------------------------------------
// execute_set_input - set input and IRQ lines
//-------------------------------------------------
@@ -797,7 +745,7 @@ void tms3203x_device::execute_set_input(int inputnum, int state)
// external interrupts are level-sensitive on the '31 and can be
// configured as such on the '32; in that case, if the external
// signal is high, we need to update the value in IF accordingly
- if (m_config.m_chip_type == tms3203x_device_config::CHIP_TYPE_TMS32031 || (IREG(TMR_ST) & 0x4000) == 0)
+ if (m_chip_type == CHIP_TYPE_TMS32031 || (IREG(TMR_ST) & 0x4000) == 0)
IREG(TMR_IF) |= m_irq_state & 0x0f;
}
diff --git a/src/emu/cpu/tms32031/tms32031.h b/src/emu/cpu/tms32031/tms32031.h
index 38c2ea277c0..d34a122b544 100644
--- a/src/emu/cpu/tms32031/tms32031.h
+++ b/src/emu/cpu/tms32031/tms32031.h
@@ -119,17 +119,7 @@ enum
//**************************************************************************
#define MCFG_TMS3203X_CONFIG(_config) \
- tms3203x_device_config::static_set_config(device, _config); \
-
-
-
-//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// device type definition
-extern const device_type TMS32031;
-extern const device_type TMS32032;
+ tms3203x_device::static_set_config(*device, _config); \
@@ -156,55 +146,11 @@ struct tms3203x_config
-// ======================> tms3203x_device_config
-
-class tms3203x_device_config : public cpu_device_config,
- public tms3203x_config
-{
- friend class tms3203x_device;
-
-protected:
- enum
- {
- CHIP_TYPE_TMS32031,
- CHIP_TYPE_TMS32032,
- };
-
- // construction/destruction
- tms3203x_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 chiptype, address_map_constructor internal_map);
-
-public:
- // inline configuration helpers
- static void static_set_config(device_config *device, const tms3203x_config &config);
-
-protected:
- // device_config_execute_interface overrides
- virtual UINT32 execute_min_cycles() const;
- virtual UINT32 execute_max_cycles() const;
- virtual UINT32 execute_input_lines() const;
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // device_config_disasm_interface overrides
- virtual UINT32 disasm_min_opcode_bytes() const;
- virtual UINT32 disasm_max_opcode_bytes() const;
-
- // address spaces
- const address_space_config m_program_config;
-
- // internal state
- UINT32 m_chip_type;
-};
-
-
-
// ======================> tms3203x_device
-class tms3203x_device : public cpu_device
+class tms3203x_device : public cpu_device,
+ public tms3203x_config
{
- friend class tms3203x_device_config;
-
struct tmsreg
{
// constructors
@@ -230,11 +176,20 @@ class tms3203x_device : public cpu_device
};
protected:
+ enum
+ {
+ CHIP_TYPE_TMS32031,
+ CHIP_TYPE_TMS32032,
+ };
+
// construction/destruction
- tms3203x_device(running_machine &_machine, const tms3203x_device_config &config);
+ tms3203x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 chiptype, address_map_constructor internal_map);
virtual ~tms3203x_device();
public:
+ // inline configuration helpers
+ static void static_set_config(device_t &device, const tms3203x_config &config);
+
// public interfaces
static float fp_to_float(UINT32 floatdata);
static double fp_to_double(UINT32 floatdata);
@@ -247,15 +202,23 @@ protected:
virtual void device_reset();
// device_execute_interface overrides
+ virtual UINT32 execute_min_cycles() const;
+ virtual UINT32 execute_max_cycles() const;
+ virtual UINT32 execute_input_lines() const;
virtual void execute_run();
virtual void execute_set_input(int inputnum, int state);
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
// device_state_interface overrides
virtual void state_import(const device_state_entry &entry);
virtual void state_export(const device_state_entry &entry);
virtual void state_string_export(const device_state_entry &entry, astring &string);
// device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const;
+ virtual UINT32 disasm_max_opcode_bytes() const;
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
// memory helpers
@@ -816,7 +779,8 @@ protected:
void xor3sti(UINT32 op);
// configuration
- const tms3203x_device_config &m_config;
+ const address_space_config m_program_config;
+ UINT32 m_chip_type;
union int_double
{
@@ -855,60 +819,30 @@ protected:
};
-// ======================> tms32031_device_config
-
-class tms32031_device_config : public tms3203x_device_config
-{
- friend class tms32031_device;
-
- // construction/destruction
- tms32031_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
-
// ======================> tms32031_device
class tms32031_device : public tms3203x_device
{
- friend class tms32031_device_config;
-
+public:
// construction/destruction
- tms32031_device(running_machine &_machine, const tms32031_device_config &config);
+ tms32031_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
-// ======================> tms32032_device_config
+// ======================> tms32032_device
-class tms32032_device_config : public tms3203x_device_config
+class tms32032_device : public tms3203x_device
{
- friend class tms32032_device;
-
-protected:
- // construction/destruction
- tms32032_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
+ // construction/destruction
+ tms32032_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
-// ======================> tms32032_device
-
-class tms32032_device : public tms3203x_device
-{
- friend class tms32032_device_config;
+// device type definition
+extern const device_type TMS32031;
+extern const device_type TMS32032;
-protected:
- // construction/destruction
- tms32032_device(running_machine &_machine, const tms32032_device_config &config);
-};
#endif /* __TMS32031_H__ */
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index e5e50b63ea1..024f8341eee 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -620,7 +620,7 @@ static void check_interrupt(tms34010_state *tms)
static CPU_INIT( tms34010 )
{
- const tms34010_config *configdata = device->baseconfig().static_config() ? (const tms34010_config *)device->baseconfig().static_config() : &default_config;
+ const tms34010_config *configdata = device->static_config() ? (const tms34010_config *)device->static_config() : &default_config;
tms34010_state *tms = get_safe_token(device);
tms->external_host_access = FALSE;
@@ -1087,7 +1087,7 @@ SCREEN_UPDATE( tms340x0 )
int x;
/* find the owning CPU */
- for (cpu = screen->machine().m_devicelist.first(); cpu != NULL; cpu = cpu->next())
+ for (cpu = screen->machine().devicelist().first(); cpu != NULL; cpu = cpu->next())
{
device_type type = cpu->type();
if (type == TMS34010 || type == TMS34020)
diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h
index ab919f70d8d..8702ed76684 100644
--- a/src/emu/cpu/tms9900/99xxcore.h
+++ b/src/emu/cpu/tms9900/99xxcore.h
@@ -1286,7 +1286,7 @@ static void register_for_save_state(device_t *device)
static CPU_INIT( tms99xx )
{
- const TMS99XX_RESET_PARAM *param = (const TMS99XX_RESET_PARAM *) device->baseconfig().static_config();
+ const TMS99XX_RESET_PARAM *param = (const TMS99XX_RESET_PARAM *) device->static_config();
tms99xx_state *cpustate = get_safe_token(device);
register_for_save_state(device);
@@ -4630,7 +4630,7 @@ static CPU_SET_INFO( tms99xx )
* Generic get_info
**************************************************************************/
-void TMS99XX_GET_INFO(const device_config *devconfig, legacy_cpu_device *device, UINT32 state, cpuinfo *info)
+void TMS99XX_GET_INFO(legacy_cpu_device *device, UINT32 state, cpuinfo *info)
{
tms99xx_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL;
switch (state)
diff --git a/src/emu/cpu/upd7725/upd7725.c b/src/emu/cpu/upd7725/upd7725.c
index 7d8f85ab4e2..205e89bf712 100755
--- a/src/emu/cpu/upd7725/upd7725.c
+++ b/src/emu/cpu/upd7725/upd7725.c
@@ -13,142 +13,35 @@
#include "debugger.h"
#include "upd7725.h"
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type UPD7725 = upd7725_device_config::static_alloc_device_config;
-const device_type UPD96050 = upd96050_device_config::static_alloc_device_config;
//**************************************************************************
-// UPD7725 DEVICE CONFIG
+// DEVICE INTERFACE
//**************************************************************************
-//-------------------------------------------------
-// necdsp_device_config - constructor
-//-------------------------------------------------
+// device type definition
+const device_type UPD7725 = &device_creator<upd7725_device>;
+const device_type UPD96050 = &device_creator<upd96050_device>;
-necdsp_device_config::necdsp_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock, UINT32 abits, UINT32 dbits, const char *name)
- : cpu_device_config(mconfig, static_alloc_device_config, name, tag, owner, clock),
+necdsp_device::necdsp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, UINT32 abits, UINT32 dbits, const char *name)
+ : cpu_device(mconfig, type, name, tag, owner, clock),
m_program_config("program", ENDIANNESS_BIG, 32, abits, -2), // data bus width, address bus width, -2 means DWORD-addressable
- m_data_config("data", ENDIANNESS_BIG, 16, dbits, -1) // -1 for WORD-addressable
-{
-}
-
-
-upd7725_device_config::upd7725_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : necdsp_device_config(mconfig, tag, owner, clock, 11, 11, "uPD7725")
-{
-}
-
-upd96050_device_config::upd96050_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : necdsp_device_config(mconfig, tag, owner, clock, 14, 12, "uPD96050")
-{
-}
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *necdsp_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(necdsp_device_config(mconfig, tag, owner, clock, 13, 11, "NECDSP"));
-}
-
-device_config *upd7725_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(upd7725_device_config(mconfig, tag, owner, clock));
-}
-
-device_config *upd96050_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(upd96050_device_config(mconfig, tag, owner, clock));
-}
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *necdsp_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, necdsp_device(machine, *this));
-}
-
-device_t *upd7725_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, upd7725_device(machine, *this));
-}
-
-device_t *upd96050_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, upd96050_device(machine, *this));
-}
-
-//-------------------------------------------------
-// execute_min_cycles - return minimum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 necdsp_device_config::execute_min_cycles() const
-{
- return 4;
-}
-
-
-//-------------------------------------------------
-// execute_max_cycles - return maximum number of
-// cycles it takes for one instruction to execute
-//-------------------------------------------------
-
-UINT32 necdsp_device_config::execute_max_cycles() const
-{
- return 4;
-}
-
-
-//-------------------------------------------------
-// execute_input_lines - return the number of
-// input/interrupt lines
-//-------------------------------------------------
-
-UINT32 necdsp_device_config::execute_input_lines() const
+ m_data_config("data", ENDIANNESS_BIG, 16, dbits, -1), // -1 for WORD-addressable
+ m_irq(0),
+ m_program(NULL),
+ m_data(NULL),
+ m_direct(NULL)
{
- return 3; // TODO: there should be 11: INT, SCK, /SIEN, /SOEN, SI, and /DACK, plus SO, /SORQ and DRQ; for now, just INT, P0, and P1 are enough.
}
-//-------------------------------------------------
-// memory_space_config - return the configuration
-// of the specified address space, or NULL if
-// the space doesn't exist
-//-------------------------------------------------
-
-const address_space_config *necdsp_device_config::memory_space_config(address_spacenum spacenum) const
+upd7725_device::upd7725_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : necdsp_device(mconfig, UPD7725, tag, owner, clock, 11, 11, "uPD7725")
{
- return (spacenum == AS_PROGRAM) ? &m_program_config : &m_data_config;
}
-
-//-------------------------------------------------
-// disasm_min_opcode_bytes - return the length
-// of the shortest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 necdsp_device_config::disasm_min_opcode_bytes() const
+upd96050_device::upd96050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : necdsp_device(mconfig, UPD96050, tag, owner, clock, 14, 12, "uPD96050")
{
- return 4;
-}
-
-
-//-------------------------------------------------
-// disasm_max_opcode_bytes - return the length
-// of the longest instruction, in bytes
-//-------------------------------------------------
-
-UINT32 necdsp_device_config::disasm_max_opcode_bytes() const
-{
- return 4;
}
//-------------------------------------------------
@@ -157,7 +50,7 @@ UINT32 necdsp_device_config::disasm_max_opcode_bytes() const
// complete
//-------------------------------------------------
-void necdsp_device_config::device_config_complete()
+void necdsp_device::device_config_complete()
{
// inherit a copy of the static data
const necdsp_interface *intf = reinterpret_cast<const necdsp_interface *>(static_config());
@@ -180,32 +73,6 @@ void necdsp_device_config::device_config_complete()
//memset(&m_out_drq_func, 0, sizeof(m_out_drq_func));
}
}
-
-//**************************************************************************
-// DEVICE INTERFACE
-//**************************************************************************
-
-necdsp_device::necdsp_device(running_machine &_machine, const necdsp_device_config &config)
- : cpu_device(_machine, config),
- m_irq(0),
- m_program(NULL),
- m_data(NULL),
- m_direct(NULL),
- m_config(config)
-{
-}
-
-
-upd7725_device::upd7725_device(running_machine &_machine, const upd7725_device_config &config)
- : necdsp_device(_machine, config)
-{
-}
-
-upd96050_device::upd96050_device(running_machine &_machine, const upd96050_device_config &config)
- : necdsp_device(_machine, config)
-{
-}
-
//-------------------------------------------------
// device_start - start up the device
//-------------------------------------------------
@@ -238,17 +105,17 @@ void necdsp_device::device_start()
state_add(UPD7725_IDB, "IDB", regs.idb);
// resolve callbacks
- devcb_resolve_read_line(&m_in_int_func, &m_config.m_in_int_func, this);
- //devcb_resolve_read8(&m_in_si_func, &m_config.m_in_si_func, this);
- //devcb_resolve_read_line(&m_in_sck_func, &m_config.m_in_sck_func, this);
- //devcb_resolve_read_line(&m_in_sien_func, &m_config.m_in_sien_func, this);
- //devcb_resolve_read_line(&m_in_soen_func, &m_config.m_in_soen_func, this);
- //devcb_resolve_read_line(&m_in_dack_func, &m_config.m_in_dack_func, this);
- devcb_resolve_write_line(&m_out_p0_func, &m_config.m_out_p0_func, this);
- devcb_resolve_write_line(&m_out_p1_func, &m_config.m_out_p1_func, this);
- //devcb_resolve_write8(&m_out_so_func, &m_config.m_out_so_func, this);
- //devcb_resolve_write_line(&m_out_sorq_func, &m_config.m_out_sorq_func, this);
- //devcb_resolve_write_line(&m_out_drq_func, &m_config.m_out_drq_func, this);
+ devcb_resolve_read_line(&m_in_int_func, &m_in_int_cb, this);
+ //devcb_resolve_read8(&m_in_si_func, &m_in_si_cb, this);
+ //devcb_resolve_read_line(&m_in_sck_func, &m_in_sck_cb, this);
+ //devcb_resolve_read_line(&m_in_sien_func, &m_in_sien_cb, this);
+ //devcb_resolve_read_line(&m_in_soen_func, &m_in_soen_cb, this);
+ //devcb_resolve_read_line(&m_in_dack_func, &m_in_dack_cb, this);
+ devcb_resolve_write_line(&m_out_p0_func, &m_out_p0_cb, this);
+ devcb_resolve_write_line(&m_out_p1_func, &m_out_p1_cb, this);
+ //devcb_resolve_write8(&m_out_so_func, &m_out_so_cb, this);
+ //devcb_resolve_write_line(&m_out_sorq_func, &m_out_sorq_cb, this);
+ //devcb_resolve_write_line(&m_out_drq_func, &m_out_drq_cb, this);
// save state registrations
save_item(NAME(regs.pc));
@@ -316,6 +183,18 @@ void necdsp_device::device_reset()
}
//-------------------------------------------------
+// memory_space_config - return the configuration
+// of the specified address space, or NULL if
+// the space doesn't exist
+//-------------------------------------------------
+
+const address_space_config *necdsp_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_PROGRAM) ? &m_program_config : &m_data_config;
+}
+
+
+//-------------------------------------------------
// state_import - import state into the device,
// after it has been set
//-------------------------------------------------
@@ -367,6 +246,39 @@ void necdsp_device::state_string_export(const device_state_entry &entry, astring
}
//-------------------------------------------------
+// execute_min_cycles - return minimum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 necdsp_device::execute_min_cycles() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
+// execute_max_cycles - return maximum number of
+// cycles it takes for one instruction to execute
+//-------------------------------------------------
+
+UINT32 necdsp_device::execute_max_cycles() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
+// execute_input_lines - return the number of
+// input/interrupt lines
+//-------------------------------------------------
+
+UINT32 necdsp_device::execute_input_lines() const
+{
+ return 3; // TODO: there should be 11: INT, SCK, /SIEN, /SOEN, SI, and /DACK, plus SO, /SORQ and DRQ; for now, just INT, P0, and P1 are enough.
+}
+
+
+//-------------------------------------------------
// execute_set_input -
//-------------------------------------------------
@@ -383,6 +295,27 @@ void necdsp_device::execute_set_input(int inputnum, int state)
}
//-------------------------------------------------
+// disasm_min_opcode_bytes - return the length
+// of the shortest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 necdsp_device::disasm_min_opcode_bytes() const
+{
+ return 4;
+}
+
+
+//-------------------------------------------------
+// disasm_max_opcode_bytes - return the length
+// of the longest instruction, in bytes
+//-------------------------------------------------
+
+UINT32 necdsp_device::disasm_max_opcode_bytes() const
+{
+ return 4;
+}
+
+//-------------------------------------------------
// disasm_disassemble - call the disassembly
// helper function
//-------------------------------------------------
diff --git a/src/emu/cpu/upd7725/upd7725.h b/src/emu/cpu/upd7725/upd7725.h
index bfefed13049..62c005d42e5 100755
--- a/src/emu/cpu/upd7725/upd7725.h
+++ b/src/emu/cpu/upd7725/upd7725.h
@@ -34,92 +34,29 @@ class upd96050_device;
struct necdsp_interface
{
- devcb_read_line m_in_int_func;
- //devcb_read8 m_in_si_func;
- //devcb_read_line m_in_sck_func;
- //devcb_read_line m_in_sien_func;
- //devcb_read_line m_in_soen_func;
- //devcb_read_line m_in_dack_func;
- devcb_write_line m_out_p0_func;
- devcb_write_line m_out_p1_func;
- //devcb_write8 m_out_so_func;
- //devcb_write_line m_out_sorq_func;
- //devcb_write_line m_out_drq_func;
+ devcb_read_line m_in_int_cb;
+ //devcb_read8 m_in_si_cb;
+ //devcb_read_line m_in_sck_cb;
+ //devcb_read_line m_in_sien_cb;
+ //devcb_read_line m_in_soen_cb;
+ //devcb_read_line m_in_dack_cb;
+ devcb_write_line m_out_p0_cb;
+ devcb_write_line m_out_p1_cb;
+ //devcb_write8 m_out_so_cb;
+ //devcb_write_line m_out_sorq_cb;
+ //devcb_write_line m_out_drq_cb;
};
#define NECDSP_INTERFACE(name) \
const necdsp_interface (name) =
-// ======================> necdsp_device_config
-
-class necdsp_device_config : public cpu_device_config, public necdsp_interface
-{
- friend class necdsp_device;
-
-protected:
- // construction/destruction
- necdsp_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock, UINT32 abits, UINT32 dbits, const char *name);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-
- // device_config_execute_interface overrides
- virtual UINT32 execute_min_cycles() const;
- virtual UINT32 execute_max_cycles() const;
- virtual UINT32 execute_input_lines() const;
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // device_config_disasm_interface overrides
- virtual UINT32 disasm_min_opcode_bytes() const;
- virtual UINT32 disasm_max_opcode_bytes() const;
-
- // inline data
- const address_space_config m_program_config, m_data_config;
-};
-
-class upd7725_device_config : public necdsp_device_config
-{
- friend class upd7725_device;
-
- // construction/destruction
- upd7725_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
-class upd96050_device_config : public necdsp_device_config
-{
- friend class upd96050_device;
-
- // construction/destruction
- upd96050_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
// ======================> necdsp_device
-class necdsp_device : public cpu_device
+class necdsp_device : public cpu_device, public necdsp_interface
{
- friend class necdsp_device_config;
-
protected:
// construction/destruction
- necdsp_device(running_machine &_machine, const necdsp_device_config &config);
+ necdsp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, UINT32 abits, UINT32 dbits, const char *name);
public:
UINT8 snesdsp_read(bool mode);
@@ -127,21 +64,33 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
// device_execute_interface overrides
+ virtual UINT32 execute_min_cycles() const;
+ virtual UINT32 execute_max_cycles() const;
+ virtual UINT32 execute_input_lines() const;
virtual void execute_run();
virtual void execute_set_input(int inputnum, int state);
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
// device_state_interface overrides
virtual void state_import(const device_state_entry &entry);
virtual void state_export(const device_state_entry &entry);
virtual void state_string_export(const device_state_entry &entry, astring &string);
// device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const;
+ virtual UINT32 disasm_max_opcode_bytes() const;
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
+ // inline data
+ const address_space_config m_program_config, m_data_config;
+
UINT16 dataRAM[2048];
private:
@@ -232,26 +181,21 @@ protected:
//devcb_resolved_write8 m_out_so_func;
//devcb_resolved_write_line m_out_sorq_func;
//devcb_resolved_write_line m_out_drq_func;
-
- const necdsp_device_config &m_config;
};
class upd7725_device : public necdsp_device
{
- friend class upd7725_device_config;
-
+public:
// construction/destruction
- upd7725_device(running_machine &_machine, const upd7725_device_config &config);
+ upd7725_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
class upd96050_device : public necdsp_device
{
- friend class upd96050_device_config;
-
+public:
// construction/destruction
- upd96050_device(running_machine &_machine, const upd96050_device_config &config);
+ upd96050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
UINT16 dataram_r(UINT16 addr) { return dataRAM[addr]; }
void dataram_w(UINT16 addr, UINT16 data) { dataRAM[addr] = data; }
};
diff --git a/src/emu/cpu/upd7810/upd7810.c b/src/emu/cpu/upd7810/upd7810.c
index 43a6533e3a7..c67992615c1 100644
--- a/src/emu/cpu/upd7810/upd7810.c
+++ b/src/emu/cpu/upd7810/upd7810.c
@@ -1700,7 +1700,7 @@ static CPU_INIT( upd7810 )
{
upd7810_state *cpustate = get_safe_token(device);
- cpustate->config = *(const UPD7810_CONFIG*) device->baseconfig().static_config();
+ cpustate->config = *(const UPD7810_CONFIG*) device->static_config();
cpustate->irq_callback = irqcallback;
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
diff --git a/src/emu/cpu/vtlb.c b/src/emu/cpu/vtlb.c
index 7cec6b3a90e..4e364f59011 100644
--- a/src/emu/cpu/vtlb.c
+++ b/src/emu/cpu/vtlb.c
@@ -66,7 +66,7 @@ vtlb_state *vtlb_alloc(device_t *cpu, address_spacenum space, int fixed_entries,
vtlb->space = space;
vtlb->dynamic = dynamic_entries;
vtlb->fixed = fixed_entries;
- const address_space_config *spaceconfig = devconfig_get_space_config(cpu->baseconfig(), space);
+ const address_space_config *spaceconfig = device_get_space_config(*cpu, space);
assert(spaceconfig != NULL);
vtlb->pageshift = spaceconfig->m_page_shift;
vtlb->addrwidth = spaceconfig->m_logaddr_width;
diff --git a/src/emu/cpu/z180/z180.c b/src/emu/cpu/z180/z180.c
index c1703fa69a0..ceef0e23568 100644
--- a/src/emu/cpu/z180/z180.c
+++ b/src/emu/cpu/z180/z180.c
@@ -1941,8 +1941,8 @@ static void z180_write_iolines(z180_state *cpustate, UINT32 data)
static CPU_INIT( z180 )
{
z180_state *cpustate = get_safe_token(device);
- if (device->baseconfig().static_config() != NULL)
- cpustate->daisy.init(device, (const z80_daisy_config *)device->baseconfig().static_config());
+ if (device->static_config() != NULL)
+ cpustate->daisy.init(device, (const z80_daisy_config *)device->static_config());
cpustate->irq_callback = irqcallback;
SZHVC_add = auto_alloc_array(device->machine(), UINT8, 2*256*256);
diff --git a/src/emu/cpu/z80/z80.c b/src/emu/cpu/z80/z80.c
index 19878d487b2..e6fb680c211 100644
--- a/src/emu/cpu/z80/z80.c
+++ b/src/emu/cpu/z80/z80.c
@@ -3477,8 +3477,8 @@ static CPU_INIT( z80 )
z80->after_ldair = 0;
z80->ea = 0;
- if (device->baseconfig().static_config() != NULL)
- z80->daisy.init(device, (const z80_daisy_config *)device->baseconfig().static_config());
+ if (device->static_config() != NULL)
+ z80->daisy.init(device, (const z80_daisy_config *)device->static_config());
z80->irq_callback = irqcallback;
z80->device = device;
z80->program = device->space(AS_PROGRAM);
diff --git a/src/emu/cpu/z80/z80daisy.c b/src/emu/cpu/z80/z80daisy.c
index 4b50bd12118..e7d5b20d2cf 100644
--- a/src/emu/cpu/z80/z80daisy.c
+++ b/src/emu/cpu/z80/z80daisy.c
@@ -11,30 +11,6 @@
//**************************************************************************
-// DEVICE CONFIG Z80 DAISY INTERFACE
-//**************************************************************************
-
-//-------------------------------------------------
-// device_config_z80daisy_interface - constructor
-//-------------------------------------------------
-
-device_config_z80daisy_interface::device_config_z80daisy_interface(const machine_config &mconfig, device_config &devconfig)
- : device_config_interface(mconfig, devconfig)
-{
-}
-
-
-//-------------------------------------------------
-// ~device_config_z80daisy_interface - destructor
-//-------------------------------------------------
-
-device_config_z80daisy_interface::~device_config_z80daisy_interface()
-{
-}
-
-
-
-//**************************************************************************
// DEVICE Z80 DAISY INTERFACE
//**************************************************************************
@@ -42,9 +18,8 @@ device_config_z80daisy_interface::~device_config_z80daisy_interface()
// device_z80daisy_interface - constructor
//-------------------------------------------------
-device_z80daisy_interface::device_z80daisy_interface(running_machine &machine, const device_config &config, device_t &device)
- : device_interface(machine, config, device),
- m_z80daisy_config(dynamic_cast<const device_config_z80daisy_interface &>(config))
+device_z80daisy_interface::device_z80daisy_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device)
{
}
diff --git a/src/emu/cpu/z80/z80daisy.h b/src/emu/cpu/z80/z80daisy.h
index f3e41b54b2d..5dbfd66294b 100644
--- a/src/emu/cpu/z80/z80daisy.h
+++ b/src/emu/cpu/z80/z80daisy.h
@@ -37,35 +37,19 @@ struct z80_daisy_config
-// ======================> device_config_z80daisy_interface
-
-// device_config_z80daisy_interface represents configuration information for a z80daisy device
-class device_config_z80daisy_interface : public device_config_interface
-{
-public:
- // construction/destruction
- device_config_z80daisy_interface(const machine_config &mconfig, device_config &devconfig);
- virtual ~device_config_z80daisy_interface();
-};
-
-
-
// ======================> device_z80daisy_interface
class device_z80daisy_interface : public device_interface
{
public:
// construction/destruction
- device_z80daisy_interface(running_machine &machine, const device_config &config, device_t &device);
+ device_z80daisy_interface(const machine_config &mconfig, device_t &device);
virtual ~device_z80daisy_interface();
// required operation overrides
virtual int z80daisy_irq_state() = 0;
virtual int z80daisy_irq_ack() = 0;
virtual void z80daisy_irq_reti() = 0;
-
-protected:
- const device_config_z80daisy_interface &m_z80daisy_config;
};
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index 2849b9ae14e..b09efc125ae 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -385,7 +385,7 @@ void debug_command_init(running_machine &machine)
static void debug_command_exit(running_machine &machine)
{
/* turn off all traces */
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
device->debug()->trace(NULL, 0, NULL);
if (cheat.length)
@@ -540,7 +540,7 @@ int debug_command_parameter_cpu(running_machine &machine, const char *param, dev
/* if we got a valid one, return */
device_execute_interface *exec = NULL;
- for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.devicelist().first(exec); gotone; gotone = exec->next(exec))
if (cpunum-- == 0)
{
*result = &exec->device();
@@ -977,7 +977,7 @@ static void execute_focus(running_machine &machine, int ref, int params, const c
/* then loop over CPUs and set the ignore flags on all other CPUs */
device_execute_interface *exec = NULL;
- for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.devicelist().first(exec); gotone; gotone = exec->next(exec))
if (&exec->device() != cpu)
exec->device().debug()->ignore(true);
debug_console_printf(machine, "Now focused on CPU '%s'\n", cpu->tag());
@@ -997,7 +997,7 @@ static void execute_ignore(running_machine &machine, int ref, int params, const
/* loop over all executable devices */
device_execute_interface *exec = NULL;
- for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.devicelist().first(exec); gotone; gotone = exec->next(exec))
/* build up a comma-separated list */
if (!exec->device().debug()->observing())
@@ -1030,7 +1030,7 @@ static void execute_ignore(running_machine &machine, int ref, int params, const
/* make sure this isn't the last live CPU */
device_execute_interface *exec = NULL;
bool gotone;
- for (gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (gotone = machine.devicelist().first(exec); gotone; gotone = exec->next(exec))
if (&exec->device() != devicelist[paramnum] && exec->device().debug()->observing())
break;
if (!gotone)
@@ -1059,7 +1059,7 @@ static void execute_observe(running_machine &machine, int ref, int params, const
/* loop over all executable devices */
device_execute_interface *exec = NULL;
- for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.devicelist().first(exec); gotone; gotone = exec->next(exec))
/* build up a comma-separated list */
if (exec->device().debug()->observing())
@@ -1208,7 +1208,7 @@ static void execute_bpclear(running_machine &machine, int ref, int params, const
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
device->debug()->breakpoint_clear_all();
debug_console_printf(machine, "Cleared all breakpoints\n");
}
@@ -1219,7 +1219,7 @@ static void execute_bpclear(running_machine &machine, int ref, int params, const
else
{
bool found = false;
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_clear(bpindex))
found = true;
if (found)
@@ -1242,7 +1242,7 @@ static void execute_bpdisenable(running_machine &machine, int ref, int params, c
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
device->debug()->breakpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all breakpoints\n");
@@ -1256,7 +1256,7 @@ static void execute_bpdisenable(running_machine &machine, int ref, int params, c
else
{
bool found = false;
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_enable(bpindex, ref))
found = true;
if (found)
@@ -1278,7 +1278,7 @@ static void execute_bplist(running_machine &machine, int ref, int params, const
astring buffer;
/* loop over all CPUs */
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_first() != NULL)
{
debug_console_printf(machine, "Device '%s' breakpoints:\n", device->tag());
@@ -1366,7 +1366,7 @@ static void execute_wpclear(running_machine &machine, int ref, int params, const
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
device->debug()->watchpoint_clear_all();
debug_console_printf(machine, "Cleared all watchpoints\n");
}
@@ -1377,7 +1377,7 @@ static void execute_wpclear(running_machine &machine, int ref, int params, const
else
{
bool found = false;
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
if (device->debug()->watchpoint_clear(wpindex))
found = true;
if (found)
@@ -1400,7 +1400,7 @@ static void execute_wpdisenable(running_machine &machine, int ref, int params, c
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
device->debug()->watchpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all watchpoints\n");
@@ -1414,7 +1414,7 @@ static void execute_wpdisenable(running_machine &machine, int ref, int params, c
else
{
bool found = false;
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
if (device->debug()->watchpoint_enable(wpindex, ref))
found = true;
if (found)
@@ -1436,7 +1436,7 @@ static void execute_wplist(running_machine &machine, int ref, int params, const
astring buffer;
/* loop over all CPUs */
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
if (device->debug()->watchpoint_first(spacenum) != NULL)
{
@@ -1478,7 +1478,7 @@ static void execute_hotspot(running_machine &machine, int ref, int params, const
bool cleared = false;
/* loop over CPUs and find live spots */
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
if (device->debug()->hotspot_tracking_enabled())
{
device->debug()->hotspot_track(0, 0);
@@ -2492,7 +2492,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;
- screen_device *screen = downcast<screen_device *>(machine.m_devicelist.find(SCREEN, scrnum));
+ screen_device *screen = downcast<screen_device *>(machine.devicelist().find(SCREEN, scrnum));
if ((screen == NULL) || !machine.render().is_live(*screen))
{
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index 3e594e87b51..37fc7327387 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -204,7 +204,7 @@ void debug_cpu_flush_traces(running_machine &machine)
{
/* this can be called on exit even when no debugging is enabled, so
make sure the devdebug is valid before proceeding */
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
if (device->debug() != NULL)
device->debug()->trace_flush();
}
@@ -341,7 +341,7 @@ bool debug_comment_save(running_machine &machine)
// for each device
bool found_comments = false;
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
if (device->debug()->comment_count() > 0)
{
// create a node for this device
@@ -1084,7 +1084,7 @@ static void on_vblank(screen_device &device, void *param, bool vblank_state)
static void reset_transient_flags(running_machine &machine)
{
/* loop over CPUs and reset the transient flags */
- for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.devicelist().first(); device != NULL; device = device->next())
device->debug()->reset_transient_flag();
machine.debugcpu_data->m_stop_when_not_device = NULL;
}
@@ -1149,7 +1149,7 @@ static device_t *expression_get_device(running_machine &machine, const char *tag
{
device_t *device;
- for (device = machine.m_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;
@@ -1635,7 +1635,7 @@ static UINT64 get_cpunum(symbol_table &table, void *ref)
device_execute_interface *exec = NULL;
int index = 0;
- for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.devicelist().first(exec); gotone; gotone = exec->next(exec))
{
if (&exec->device() == target)
return index;
diff --git a/src/emu/debug/dvdisasm.c b/src/emu/debug/dvdisasm.c
index f32e4fde4a4..ccd1616f1e2 100644
--- a/src/emu/debug/dvdisasm.c
+++ b/src/emu/debug/dvdisasm.c
@@ -134,7 +134,7 @@ void debug_view_disasm::enumerate_sources()
// iterate over devices with disassembly interfaces
device_disasm_interface *dasm = NULL;
astring name;
- for (bool gotone = machine().m_devicelist.first(dasm); gotone; gotone = dasm->next(dasm))
+ for (bool gotone = machine().devicelist().first(dasm); gotone; gotone = dasm->next(dasm))
{
name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
m_source_list.append(*auto_alloc(machine(), debug_view_disasm_source(name, dasm->device())));
diff --git a/src/emu/debug/dvmemory.c b/src/emu/debug/dvmemory.c
index 269d553b969..a1d4d88f9f8 100644
--- a/src/emu/debug/dvmemory.c
+++ b/src/emu/debug/dvmemory.c
@@ -153,7 +153,7 @@ void debug_view_memory::enumerate_sources()
// first add all the devices' address spaces
device_memory_interface *memintf = NULL;
- for (bool gotone = machine().m_devicelist.first(memintf); gotone; gotone = memintf->next(memintf))
+ for (bool gotone = machine().devicelist().first(memintf); gotone; gotone = memintf->next(memintf))
for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
{
address_space *space = memintf->space(spacenum);
diff --git a/src/emu/debug/dvstate.c b/src/emu/debug/dvstate.c
index 796ab379b0a..9d14f1c83d8 100644
--- a/src/emu/debug/dvstate.c
+++ b/src/emu/debug/dvstate.c
@@ -105,7 +105,7 @@ void debug_view_state::enumerate_sources()
// iterate over devices that have state interfaces
device_state_interface *state = NULL;
astring name;
- for (bool gotone = machine().m_devicelist.first(state); gotone; gotone = state->next(state))
+ for (bool gotone = machine().devicelist().first(state); gotone; gotone = state->next(state))
{
name.printf("%s '%s'", state->device().name(), state->device().tag());
m_source_list.append(*auto_alloc(machine(), debug_view_state_source(name, state->device())));
diff --git a/src/emu/deprecat.h b/src/emu/deprecat.h
index 0fdf979d971..924f1c98631 100644
--- a/src/emu/deprecat.h
+++ b/src/emu/deprecat.h
@@ -31,7 +31,7 @@
*************************************/
#define MCFG_CPU_VBLANK_INT_HACK(_func, _rate) \
- device_config_execute_interface::static_set_vblank_int(device, _func, NULL, _rate); \
+ device_execute_interface::static_set_vblank_int(*device, _func, NULL, _rate); \
diff --git a/src/emu/devcb.h b/src/emu/devcb.h
index 32eefe92d43..db591c4f873 100644
--- a/src/emu/devcb.h
+++ b/src/emu/devcb.h
@@ -176,10 +176,6 @@ void devcb_stub16(device_t *device, offs_t offset, UINT16 data)
TYPE DEFINITIONS
***************************************************************************/
-/* forward declarations */
-class device_config;
-
-
/* static structure used for device configuration when the desired callback type is a read_line_device_func */
typedef struct _devcb_read_line devcb_read_line;
struct _devcb_read_line
diff --git a/src/emu/devcpu.c b/src/emu/devcpu.c
index cddecf11f7a..53b3907c751 100644
--- a/src/emu/devcpu.c
+++ b/src/emu/devcpu.c
@@ -43,144 +43,6 @@
//**************************************************************************
-// CPU DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// cpu_device_config - constructor
-//-------------------------------------------------
-
-cpu_device_config::cpu_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, type, name, tag, owner, clock),
- device_config_execute_interface(mconfig, *this),
- device_config_memory_interface(mconfig, *this),
- device_config_state_interface(mconfig, *this),
- device_config_disasm_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// legacy_cpu_device_config - constructor
-//-------------------------------------------------
-
-legacy_cpu_device_config::legacy_cpu_device_config(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, cpu_get_info_func get_info)
- : cpu_device_config(mconfig, type, "CPU", tag, owner, clock),
- m_get_info(get_info)
-{
- // build up our address spaces; legacy devices don't have logical spaces
- memset(m_space_config, 0, sizeof(m_space_config));
- for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_space_config); spacenum++)
- {
- m_space_config[spacenum].m_name = (spacenum == 1) ? "data" : (spacenum == 2) ? "i/o" : "program";
- m_space_config[spacenum].m_endianness = static_cast<endianness_t>(get_legacy_config_int(DEVINFO_INT_ENDIANNESS));
- m_space_config[spacenum].m_databus_width = get_legacy_config_int(DEVINFO_INT_DATABUS_WIDTH + spacenum);
- m_space_config[spacenum].m_addrbus_width = get_legacy_config_int(DEVINFO_INT_ADDRBUS_WIDTH + spacenum);
- m_space_config[spacenum].m_addrbus_shift = get_legacy_config_int(DEVINFO_INT_ADDRBUS_SHIFT + spacenum);
- m_space_config[spacenum].m_logaddr_width = get_legacy_config_int(CPUINFO_INT_LOGADDR_WIDTH + spacenum);
- if (m_space_config[spacenum].m_logaddr_width == 0)
- m_space_config[spacenum].m_logaddr_width = m_space_config[spacenum].m_addrbus_width;
- m_space_config[spacenum].m_page_shift = get_legacy_config_int(CPUINFO_INT_PAGE_SHIFT + spacenum);
- m_space_config[spacenum].m_internal_map = reinterpret_cast<address_map_constructor>(get_legacy_config_fct(DEVINFO_PTR_INTERNAL_MEMORY_MAP + spacenum));
- m_space_config[spacenum].m_default_map = reinterpret_cast<address_map_constructor>(get_legacy_config_fct(DEVINFO_PTR_DEFAULT_MEMORY_MAP + spacenum));
- }
-
- // set the real name
- m_name = get_legacy_config_string(DEVINFO_STR_NAME);
- m_shortname = get_legacy_config_string(DEVINFO_STR_SHORTNAME);
- m_searchpath = m_shortname;
-}
-
-
-//-------------------------------------------------
-// execute_clocks_to_cycles - convert the raw
-// clock into cycles per second
-//-------------------------------------------------
-
-UINT64 legacy_cpu_device_config::execute_clocks_to_cycles(UINT64 clocks) const
-{
- UINT32 multiplier = get_legacy_config_int(CPUINFO_INT_CLOCK_MULTIPLIER);
- UINT32 divider = get_legacy_config_int(CPUINFO_INT_CLOCK_DIVIDER);
-
- if (multiplier == 0) multiplier = 1;
- if (divider == 0) divider = 1;
-
- return (clocks * multiplier + divider - 1) / divider;
-}
-
-
-//-------------------------------------------------
-// execute_cycles_to_clocks - convert a cycle
-// count back to raw clocks
-//-------------------------------------------------
-
-UINT64 legacy_cpu_device_config::execute_cycles_to_clocks(UINT64 cycles) const
-{
- UINT32 multiplier = get_legacy_config_int(CPUINFO_INT_CLOCK_MULTIPLIER);
- UINT32 divider = get_legacy_config_int(CPUINFO_INT_CLOCK_DIVIDER);
-
- if (multiplier == 0) multiplier = 1;
- if (divider == 0) divider = 1;
-
- return (cycles * divider + multiplier - 1) / multiplier;
-}
-
-
-//-------------------------------------------------
-// get_legacy_config_int - return a legacy
-// integer value
-//-------------------------------------------------
-
-INT64 legacy_cpu_device_config::get_legacy_config_int(UINT32 state) const
-{
- cpuinfo info = { 0 };
- (*m_get_info)(this, NULL, state, &info);
- return info.i;
-}
-
-
-//-------------------------------------------------
-// get_legacy_config_ptr - return a legacy
-// pointer value
-//-------------------------------------------------
-
-void *legacy_cpu_device_config::get_legacy_config_ptr(UINT32 state) const
-{
- cpuinfo info = { 0 };
- (*m_get_info)(this, NULL, state, &info);
- return info.p;
-}
-
-
-//-------------------------------------------------
-// get_legacy_config_fct - return a legacy
-// function value
-//-------------------------------------------------
-
-genf *legacy_cpu_device_config::get_legacy_config_fct(UINT32 state) const
-{
- cpuinfo info = { 0 };
- (*m_get_info)(this, NULL, state, &info);
- return info.f;
-}
-
-
-//-------------------------------------------------
-// get_legacy_config_string - return a legacy
-// string value
-//-------------------------------------------------
-
-const char *legacy_cpu_device_config::get_legacy_config_string(UINT32 state) const
-{
- cpuinfo info;
- info.s = get_temp_string_buffer();
- (*m_get_info)(this, NULL, state, &info);
- return info.s;
-}
-
-
-
-//**************************************************************************
// CPU RUNNING DEVICE
//**************************************************************************
@@ -188,12 +50,12 @@ const char *legacy_cpu_device_config::get_legacy_config_string(UINT32 state) con
// cpu_device - constructor
//-------------------------------------------------
-cpu_device::cpu_device(running_machine &machine, const cpu_device_config &config)
- : device_t(machine, config),
- device_execute_interface(machine, config, *this),
- device_memory_interface(machine, config, *this),
- device_state_interface(machine, config, *this),
- device_disasm_interface(machine, config, *this)
+cpu_device::cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_execute_interface(mconfig, *this),
+ device_memory_interface(mconfig, *this),
+ device_state_interface(mconfig, *this),
+ device_disasm_interface(mconfig, *this)
{
}
@@ -211,33 +73,55 @@ cpu_device::~cpu_device()
// legacy_cpu_device - constructor
//-------------------------------------------------
-legacy_cpu_device::legacy_cpu_device(running_machine &machine, const legacy_cpu_device_config &config)
- : cpu_device(machine, config),
- m_cpu_config(config),
+legacy_cpu_device::legacy_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, cpu_get_info_func get_info)
+ : cpu_device(mconfig, type, "CPU", tag, owner, clock),
+ m_get_info(get_info),
m_token(NULL),
- m_set_info(reinterpret_cast<cpu_set_info_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_SET_INFO))),
- m_execute(reinterpret_cast<cpu_execute_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_EXECUTE))),
- m_burn(reinterpret_cast<cpu_burn_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_BURN))),
- m_translate(reinterpret_cast<cpu_translate_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_TRANSLATE))),
- m_read(reinterpret_cast<cpu_read_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_READ))),
- m_write(reinterpret_cast<cpu_write_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_WRITE))),
- m_readop(reinterpret_cast<cpu_readop_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_READOP))),
- m_disassemble(reinterpret_cast<cpu_disassemble_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_DISASSEMBLE))),
- m_state_import(reinterpret_cast<cpu_state_io_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_IMPORT_STATE))),
- m_state_export(reinterpret_cast<cpu_state_io_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_EXPORT_STATE))),
- m_string_export(reinterpret_cast<cpu_string_io_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_EXPORT_STRING))),
- m_exit(reinterpret_cast<cpu_exit_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_EXIT))),
+ m_set_info(reinterpret_cast<cpu_set_info_func>(get_legacy_fct(CPUINFO_FCT_SET_INFO))),
+ m_execute(reinterpret_cast<cpu_execute_func>(get_legacy_fct(CPUINFO_FCT_EXECUTE))),
+ m_burn(reinterpret_cast<cpu_burn_func>(get_legacy_fct(CPUINFO_FCT_BURN))),
+ m_translate(reinterpret_cast<cpu_translate_func>(get_legacy_fct(CPUINFO_FCT_TRANSLATE))),
+ m_read(reinterpret_cast<cpu_read_func>(get_legacy_fct(CPUINFO_FCT_READ))),
+ m_write(reinterpret_cast<cpu_write_func>(get_legacy_fct(CPUINFO_FCT_WRITE))),
+ m_readop(reinterpret_cast<cpu_readop_func>(get_legacy_fct(CPUINFO_FCT_READOP))),
+ m_disassemble(reinterpret_cast<cpu_disassemble_func>(get_legacy_fct(CPUINFO_FCT_DISASSEMBLE))),
+ m_state_import(reinterpret_cast<cpu_state_io_func>(get_legacy_fct(CPUINFO_FCT_IMPORT_STATE))),
+ m_state_export(reinterpret_cast<cpu_state_io_func>(get_legacy_fct(CPUINFO_FCT_EXPORT_STATE))),
+ m_string_export(reinterpret_cast<cpu_string_io_func>(get_legacy_fct(CPUINFO_FCT_EXPORT_STRING))),
+ m_exit(reinterpret_cast<cpu_exit_func>(get_legacy_fct(CPUINFO_FCT_EXIT))),
m_using_legacy_state(false),
m_inited(false)
{
+ // build up our address spaces; legacy devices don't have logical spaces
+ memset(m_space_config, 0, sizeof(m_space_config));
+ for (address_spacenum spacenum = AS_0; spacenum < ARRAY_LENGTH(m_space_config); spacenum++)
+ {
+ m_space_config[spacenum].m_name = (spacenum == 1) ? "data" : (spacenum == 2) ? "i/o" : "program";
+ m_space_config[spacenum].m_endianness = static_cast<endianness_t>(get_legacy_int(DEVINFO_INT_ENDIANNESS));
+ m_space_config[spacenum].m_databus_width = get_legacy_int(DEVINFO_INT_DATABUS_WIDTH + spacenum);
+ m_space_config[spacenum].m_addrbus_width = get_legacy_int(DEVINFO_INT_ADDRBUS_WIDTH + spacenum);
+ m_space_config[spacenum].m_addrbus_shift = get_legacy_int(DEVINFO_INT_ADDRBUS_SHIFT + spacenum);
+ m_space_config[spacenum].m_logaddr_width = get_legacy_int(CPUINFO_INT_LOGADDR_WIDTH + spacenum);
+ if (m_space_config[spacenum].m_logaddr_width == 0)
+ m_space_config[spacenum].m_logaddr_width = m_space_config[spacenum].m_addrbus_width;
+ m_space_config[spacenum].m_page_shift = get_legacy_int(CPUINFO_INT_PAGE_SHIFT + spacenum);
+ m_space_config[spacenum].m_internal_map = reinterpret_cast<address_map_constructor>(get_legacy_fct(DEVINFO_PTR_INTERNAL_MEMORY_MAP + spacenum));
+ m_space_config[spacenum].m_default_map = reinterpret_cast<address_map_constructor>(get_legacy_fct(DEVINFO_PTR_DEFAULT_MEMORY_MAP + spacenum));
+ }
+
+ // set the real name
+ m_name = get_legacy_string(DEVINFO_STR_NAME);
+ m_shortname = get_legacy_string(DEVINFO_STR_SHORTNAME);
+ m_searchpath = m_shortname;
+
memset(&m_partial_frame_period, 0, sizeof(m_partial_frame_period));
- int tokenbytes = m_cpu_config.get_legacy_config_int(CPUINFO_INT_CONTEXT_SIZE);
+ int tokenbytes = get_legacy_int(CPUINFO_INT_CONTEXT_SIZE);
if (tokenbytes == 0)
- throw emu_fatalerror("Device %s specifies a 0 context size!\n", tag());
+ throw emu_fatalerror("Device %s specifies a 0 context size!\n", tag);
// allocate memory for the token
- m_token = auto_alloc_array_clear(machine, UINT8, tokenbytes);
+ m_token = global_alloc_array_clear(UINT8, tokenbytes);
}
@@ -247,9 +131,7 @@ legacy_cpu_device::legacy_cpu_device(running_machine &machine, const legacy_cpu_
legacy_cpu_device::~legacy_cpu_device()
{
- // call the CPU's exit function if present
- if (m_inited && m_exit != NULL)
- (*m_exit)(this);
+ global_free(m_token);
}
@@ -260,7 +142,7 @@ legacy_cpu_device::~legacy_cpu_device()
void legacy_cpu_device::device_start()
{
// standard init
- cpu_init_func init = reinterpret_cast<cpu_init_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_INIT));
+ cpu_init_func init = reinterpret_cast<cpu_init_func>(get_legacy_fct(CPUINFO_FCT_INIT));
(*init)(this, static_standard_irq_callback);
m_inited = true;
@@ -270,7 +152,7 @@ void legacy_cpu_device::device_start()
m_using_legacy_state = true;
for (int index = 0; index < MAX_REGS; index++)
{
- const char *string = get_legacy_runtime_string(CPUINFO_STR_REGISTER + index);
+ const char *string = get_legacy_string(CPUINFO_STR_REGISTER + index);
if (strchr(string, ':') != NULL)
{
astring tempstr(string);
@@ -293,7 +175,7 @@ void legacy_cpu_device::device_start()
state_add(STATE_GENPC, "curpc", m_state_io).callimport().callexport().formatstr("%8s").noshow();
state_add(STATE_GENPCBASE, "curpcbase", m_state_io).callimport().callexport().formatstr("%8s").noshow();
- const char *string = get_legacy_runtime_string(CPUINFO_STR_FLAGS);
+ const char *string = get_legacy_string(CPUINFO_STR_FLAGS);
if (string != NULL && string[0] != 0)
{
astring flagstr;
@@ -303,7 +185,7 @@ void legacy_cpu_device::device_start()
}
// get our icount pointer
- m_icountptr = reinterpret_cast<int *>(get_legacy_runtime_ptr(CPUINFO_PTR_INSTRUCTION_COUNTER));
+ m_icountptr = reinterpret_cast<int *>(get_legacy_ptr(CPUINFO_PTR_INSTRUCTION_COUNTER));
assert(m_icountptr != 0);
*m_icountptr = 0;
}
@@ -315,15 +197,62 @@ void legacy_cpu_device::device_start()
void legacy_cpu_device::device_reset()
{
- cpu_reset_func reset = reinterpret_cast<cpu_reset_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_RESET));
+ cpu_reset_func reset = reinterpret_cast<cpu_reset_func>(get_legacy_fct(CPUINFO_FCT_RESET));
if (reset != NULL)
(*reset)(this);
}
//-------------------------------------------------
-// execute - execute for the provided number of
-// cycles
+// device_stop - clean up before the machine goes
+// away
+//-------------------------------------------------
+
+void legacy_cpu_device::device_stop()
+{
+ // call the CPU's exit function if present
+ if (m_inited && m_exit != NULL)
+ (*m_exit)(this);
+}
+
+
+//-------------------------------------------------
+// execute_clocks_to_cycles - convert the raw
+// clock into cycles per second
+//-------------------------------------------------
+
+UINT64 legacy_cpu_device::execute_clocks_to_cycles(UINT64 clocks) const
+{
+ UINT32 multiplier = get_legacy_int(CPUINFO_INT_CLOCK_MULTIPLIER);
+ UINT32 divider = get_legacy_int(CPUINFO_INT_CLOCK_DIVIDER);
+
+ if (multiplier == 0) multiplier = 1;
+ if (divider == 0) divider = 1;
+
+ return (clocks * multiplier + divider - 1) / divider;
+}
+
+
+//-------------------------------------------------
+// execute_cycles_to_clocks - convert a cycle
+// count back to raw clocks
+//-------------------------------------------------
+
+UINT64 legacy_cpu_device::execute_cycles_to_clocks(UINT64 cycles) const
+{
+ UINT32 multiplier = get_legacy_int(CPUINFO_INT_CLOCK_MULTIPLIER);
+ UINT32 divider = get_legacy_int(CPUINFO_INT_CLOCK_DIVIDER);
+
+ if (multiplier == 0) multiplier = 1;
+ if (divider == 0) divider = 1;
+
+ return (cycles * divider + multiplier - 1) / multiplier;
+}
+
+
+//-------------------------------------------------
+// execute_run - execute for the provided number
+// of cycles
//-------------------------------------------------
void legacy_cpu_device::execute_run()
@@ -402,7 +331,7 @@ bool legacy_cpu_device::memory_readop(offs_t offset, int size, UINT64 &value)
void legacy_cpu_device::device_debug_setup()
{
- cpu_debug_init_func init = reinterpret_cast<cpu_debug_init_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_DEBUG_INIT));
+ cpu_debug_init_func init = reinterpret_cast<cpu_debug_init_func>(get_legacy_fct(CPUINFO_FCT_DEBUG_INIT));
if (init != NULL)
(*init)(this);
}
@@ -445,51 +374,61 @@ offs_t legacy_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT
//-------------------------------------------------
-// get_legacy_runtime_int - call the get info
-// function to retrieve an integer value
+// get_legacy_int - return a legacy integer value
//-------------------------------------------------
-INT64 legacy_cpu_device::get_legacy_runtime_int(UINT32 state)
+INT64 legacy_cpu_device::get_legacy_int(UINT32 state) const
{
cpuinfo info = { 0 };
- (*m_cpu_config.m_get_info)(&m_cpu_config, this, state, &info);
+ (*m_get_info)(const_cast<legacy_cpu_device *>(this), state, &info);
return info.i;
}
//-------------------------------------------------
-// get_legacy_runtime_ptr - call the get info
-// function to retrieve a pointer value
+// get_legacy_ptr - return a legacy pointer value
//-------------------------------------------------
-void *legacy_cpu_device::get_legacy_runtime_ptr(UINT32 state)
+void *legacy_cpu_device::get_legacy_ptr(UINT32 state) const
{
cpuinfo info = { 0 };
- (*m_cpu_config.m_get_info)(&m_cpu_config, this, state, &info);
+ (*m_get_info)(const_cast<legacy_cpu_device *>(this), state, &info);
return info.p;
}
//-------------------------------------------------
-// get_legacy_runtime_string - call the get info
-// function to retrieve a string value
+// get_legacy_fct - return a legacy function value
+//-------------------------------------------------
+
+genf *legacy_cpu_device::get_legacy_fct(UINT32 state) const
+{
+ cpuinfo info = { 0 };
+ (*m_get_info)(const_cast<legacy_cpu_device *>(this), state, &info);
+ return info.f;
+}
+
+
+//-------------------------------------------------
+// get_legacy_string - return a legacy
+// string value
//-------------------------------------------------
-const char *legacy_cpu_device::get_legacy_runtime_string(UINT32 state)
+const char *legacy_cpu_device::get_legacy_string(UINT32 state) const
{
cpuinfo info;
info.s = get_temp_string_buffer();
- (*m_cpu_config.m_get_info)(&m_cpu_config, this, state, &info);
+ (*m_get_info)(const_cast<legacy_cpu_device *>(this), state, &info);
return info.s;
}
//-------------------------------------------------
-// set_legacy_runtime_int - call the get info
-// function to set an integer value
+// set_legacy_int - call the get info function
+// to set an integer value
//-------------------------------------------------
-void legacy_cpu_device::set_legacy_runtime_int(UINT32 state, INT64 value)
+void legacy_cpu_device::set_legacy_int(UINT32 state, INT64 value)
{
cpuinfo info = { 0 };
info.i = value;
@@ -505,7 +444,7 @@ void legacy_cpu_device::state_import(const device_state_entry &entry)
if (entry.index() == STATE_GENFLAGS)
; // do nothing
else
- set_legacy_runtime_int(CPUINFO_INT_REGISTER + entry.index(), m_state_io);
+ set_legacy_int(CPUINFO_INT_REGISTER + entry.index(), m_state_io);
}
else if (m_state_import != NULL)
(*m_state_import)(this, entry);
@@ -518,13 +457,13 @@ void legacy_cpu_device::state_export(const device_state_entry &entry)
{
if (entry.index() == STATE_GENFLAGS)
{
- const char *temp = get_legacy_runtime_string(CPUINFO_STR_FLAGS);
+ const char *temp = get_legacy_string(CPUINFO_STR_FLAGS);
m_state_io = 0;
while (*temp != 0)
m_state_io = ((m_state_io << 5) | (m_state_io >> (64-5))) ^ *temp++;
}
else
- m_state_io = get_legacy_runtime_int(CPUINFO_INT_REGISTER + entry.index());
+ m_state_io = get_legacy_int(CPUINFO_INT_REGISTER + entry.index());
}
else if (m_state_export != NULL)
(*m_state_export)(this, entry);
@@ -536,9 +475,9 @@ void legacy_cpu_device::state_string_export(const device_state_entry &entry, ast
if (m_using_legacy_state)
{
if (entry.index() == STATE_GENFLAGS)
- string.cpy(get_legacy_runtime_string(CPUINFO_STR_FLAGS));
+ string.cpy(get_legacy_string(CPUINFO_STR_FLAGS));
else
- string.cpy(strchr(get_legacy_runtime_string(CPUINFO_STR_REGISTER + entry.index()), ':') + 1);
+ string.cpy(strchr(get_legacy_string(CPUINFO_STR_REGISTER + entry.index()), ':') + 1);
}
else if (m_string_export != NULL)
(*m_string_export)(this, entry, string);
diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h
index db4aafc885b..e2bcfa75ac0 100644
--- a/src/emu/devcpu.h
+++ b/src/emu/devcpu.h
@@ -166,54 +166,30 @@ enum
\
CPU_GET_INFO( basename ); \
\
-class basename##_device_config; \
- \
class basename##_device : public legacy_cpu_device \
{ \
- friend class basename##_device_config; \
- basename##_device(running_machine &_machine, const basename##_device_config &config); \
-}; \
- \
-class basename##_device_config : public legacy_cpu_device_config \
-{ \
- basename##_device_config(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock); \
- \
public: \
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); \
- virtual device_t *alloc_device(running_machine &machine) const; \
+ basename##_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock); \
}; \
\
-extern const device_type name
+extern const device_type name;
// macro for defining the implementation needed for configuration and device classes
#define DEFINE_LEGACY_CPU_DEVICE(name, basename) \
\
-basename##_device::basename##_device(running_machine &_machine, const basename##_device_config &config) \
- : legacy_cpu_device(_machine, config) \
-{ \
-} \
- \
-basename##_device_config::basename##_device_config(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock) \
- : legacy_cpu_device_config(mconfig, type, tag, owner, clock, CPU_GET_INFO_NAME(basename)) \
-{ \
-} \
- \
-device_config *basename##_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) \
+basename##_device::basename##_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock) \
+ : legacy_cpu_device(mconfig, type, tag, owner, clock, CPU_GET_INFO_NAME(basename)) \
{ \
- return global_alloc(basename##_device_config(mconfig, static_alloc_device_config, tag, owner, clock)); \
} \
\
-device_t *basename##_device_config::alloc_device(running_machine &machine) const \
-{ \
- return pool_alloc(machine_get_pool(machine), basename##_device(machine, *this)); \
-} \
-const device_type name = basename##_device_config::static_alloc_device_config
+const device_type name = &legacy_device_creator<basename##_device>
+
// CPU interface functions
#define CPU_GET_INFO_NAME(name) cpu_get_info_##name
-#define CPU_GET_INFO(name) void CPU_GET_INFO_NAME(name)(const device_config *devconfig, legacy_cpu_device *device, UINT32 state, cpuinfo *info)
-#define CPU_GET_INFO_CALL(name) CPU_GET_INFO_NAME(name)(devconfig, device, state, info)
+#define CPU_GET_INFO(name) void CPU_GET_INFO_NAME(name)(legacy_cpu_device *device, UINT32 state, cpuinfo *info)
+#define CPU_GET_INFO_CALL(name) CPU_GET_INFO_NAME(name)(device, state, info)
#define CPU_SET_INFO_NAME(name) cpu_set_info_##name
#define CPU_SET_INFO(name) void CPU_SET_INFO_NAME(name)(legacy_cpu_device *device, UINT32 state, cpuinfo *info)
@@ -302,7 +278,7 @@ class legacy_cpu_device;
// CPU interface functions
-typedef void (*cpu_get_info_func)(const device_config *devconfig, legacy_cpu_device *device, UINT32 state, cpuinfo *info);
+typedef void (*cpu_get_info_func)(legacy_cpu_device *device, UINT32 state, cpuinfo *info);
typedef void (*cpu_set_info_func)(legacy_cpu_device *device, UINT32 state, cpuinfo *info);
typedef void (*cpu_init_func)(legacy_cpu_device *device, device_irq_callback irqcallback);
typedef void (*cpu_reset_func)(legacy_cpu_device *device);
@@ -356,66 +332,6 @@ union cpuinfo
-// ======================> cpu_device_config
-
-class cpu_device_config : public device_config,
- public device_config_execute_interface,
- public device_config_memory_interface,
- public device_config_state_interface,
- public device_config_disasm_interface
-{
- friend class cpu_device;
-
-protected:
- // construction/destruction
- cpu_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock);
-};
-
-
-
-// ======================> legacy_cpu_device_config
-
-class legacy_cpu_device_config : public cpu_device_config
-{
- friend class legacy_cpu_device;
-
-protected:
- // construction/destruction
- legacy_cpu_device_config(const machine_config &mconfig, device_type _type, const char *_tag, const device_config *_owner, UINT32 _clock, cpu_get_info_func get_info);
-
- // basic information getters
- virtual const rom_entry *device_rom_region() const { return reinterpret_cast<const rom_entry *>(get_legacy_config_ptr(DEVINFO_PTR_ROM_REGION)); }
- virtual machine_config_constructor device_mconfig_additions() const { return reinterpret_cast<machine_config_constructor>(get_legacy_config_ptr(DEVINFO_PTR_MACHINE_CONFIG)); }
- virtual const input_port_token *device_input_ports() const { return reinterpret_cast<const input_port_token *>(get_legacy_config_ptr(DEVINFO_PTR_INPUT_PORTS)); }
-
- // device_config_execute_interface overrides
- virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const;
- virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const;
- virtual UINT32 execute_min_cycles() const { return get_legacy_config_int(CPUINFO_INT_MIN_CYCLES); }
- virtual UINT32 execute_max_cycles() const { return get_legacy_config_int(CPUINFO_INT_MAX_CYCLES); }
- virtual UINT32 execute_input_lines() const { return get_legacy_config_int(CPUINFO_INT_INPUT_LINES); }
- virtual UINT32 execute_default_irq_vector() const { return get_legacy_config_int(CPUINFO_INT_DEFAULT_IRQ_VECTOR); }
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum < ARRAY_LENGTH(m_space_config) && m_space_config[spacenum].m_addrbus_width != 0) ? &m_space_config[spacenum] : NULL; }
-
- // device_config_disasm_interface overrides
- virtual UINT32 disasm_min_opcode_bytes() const { return get_legacy_config_int(CPUINFO_INT_MIN_INSTRUCTION_BYTES); }
- virtual UINT32 disasm_max_opcode_bytes() const { return get_legacy_config_int(CPUINFO_INT_MAX_INSTRUCTION_BYTES); }
-
- // legacy interface helpers
- INT64 get_legacy_config_int(UINT32 state) const;
- void *get_legacy_config_ptr(UINT32 state) const;
- genf *get_legacy_config_fct(UINT32 state) const;
- const char *get_legacy_config_string(UINT32 state) const;
-
- // internal state
- cpu_get_info_func m_get_info;
- address_space_config m_space_config[3]; // array of address space configs
-};
-
-
-
// ======================> cpu_device
class cpu_device : public device_t,
@@ -424,12 +340,11 @@ class cpu_device : public device_t,
public device_state_interface,
public device_disasm_interface
{
- friend class cpu_device_config;
friend resource_pool_object<cpu_device>::~resource_pool_object();
protected:
// construction/destruction
- cpu_device(running_machine &machine, const cpu_device_config &config);
+ cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
virtual ~cpu_device();
};
@@ -439,12 +354,11 @@ protected:
class legacy_cpu_device : public cpu_device
{
- friend class legacy_cpu_device_config;
friend resource_pool_object<legacy_cpu_device>::~resource_pool_object();
protected:
// construction/destruction
- legacy_cpu_device(running_machine &machine, const legacy_cpu_device_config &config);
+ legacy_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, cpu_get_info_func info);
virtual ~legacy_cpu_device();
public:
@@ -452,16 +366,27 @@ public:
protected:
// device-level overrides
+ virtual const rom_entry *device_rom_region() const { return reinterpret_cast<const rom_entry *>(get_legacy_ptr(DEVINFO_PTR_ROM_REGION)); }
+ virtual machine_config_constructor device_mconfig_additions() const { return reinterpret_cast<machine_config_constructor>(get_legacy_ptr(DEVINFO_PTR_MACHINE_CONFIG)); }
+ virtual const input_port_token *device_input_ports() const { return reinterpret_cast<const input_port_token *>(get_legacy_ptr(DEVINFO_PTR_INPUT_PORTS)); }
virtual void device_start();
virtual void device_reset();
+ virtual void device_stop();
virtual void device_debug_setup();
// device_execute_interface overrides
+ virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const;
+ virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const;
+ virtual UINT32 execute_min_cycles() const { return get_legacy_int(CPUINFO_INT_MIN_CYCLES); }
+ virtual UINT32 execute_max_cycles() const { return get_legacy_int(CPUINFO_INT_MAX_CYCLES); }
+ virtual UINT32 execute_input_lines() const { return get_legacy_int(CPUINFO_INT_INPUT_LINES); }
+ virtual UINT32 execute_default_irq_vector() const { return get_legacy_int(CPUINFO_INT_DEFAULT_IRQ_VECTOR); }
virtual void execute_run();
virtual void execute_burn(INT32 cycles);
- virtual void execute_set_input(int inputnum, int state) { set_legacy_runtime_int(CPUINFO_INT_INPUT_STATE + inputnum, state); }
+ virtual void execute_set_input(int inputnum, int state) { set_legacy_int(CPUINFO_INT_INPUT_STATE + inputnum, state); }
// device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum < ARRAY_LENGTH(m_space_config) && m_space_config[spacenum].m_addrbus_width != 0) ? &m_space_config[spacenum] : NULL; }
virtual bool memory_translate(address_spacenum spacenum, int intention, offs_t &address);
virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value);
virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value);
@@ -473,17 +398,21 @@ protected:
virtual void state_string_export(const device_state_entry &entry, astring &string);
// device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const { return get_legacy_int(CPUINFO_INT_MIN_INSTRUCTION_BYTES); }
+ virtual UINT32 disasm_max_opcode_bytes() const { return get_legacy_int(CPUINFO_INT_MAX_INSTRUCTION_BYTES); }
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
// helpers to access data via the legacy get_info functions
- INT64 get_legacy_runtime_int(UINT32 state);
- void *get_legacy_runtime_ptr(UINT32 state);
- const char *get_legacy_runtime_string(UINT32 state);
- void set_legacy_runtime_int(UINT32 state, INT64 value);
+ INT64 get_legacy_int(UINT32 state) const;
+ void *get_legacy_ptr(UINT32 state) const;
+ genf *get_legacy_fct(UINT32 state) const;
+ const char *get_legacy_string(UINT32 state) const;
+ void set_legacy_int(UINT32 state, INT64 value);
protected:
// internal state
- const legacy_cpu_device_config &m_cpu_config; // reference to the config
+ cpu_get_info_func m_get_info;
+ address_space_config m_space_config[3]; // array of address space configs
void * m_token; // pointer to our state
cpu_set_info_func m_set_info; // extracted legacy function pointers
diff --git a/src/emu/devimage.c b/src/emu/devimage.c
index d4c53c11e3a..0a44e1bfb8f 100644
--- a/src/emu/devimage.c
+++ b/src/emu/devimage.c
@@ -49,25 +49,53 @@
//**************************************************************************
//-------------------------------------------------
-// legacy_image_device_config_base - constructor
+// legacy_device_base - destructor
//-------------------------------------------------
-legacy_image_device_config_base::legacy_image_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config)
- : legacy_device_config_base(mconfig, type, tag, owner, clock, get_config),
- device_config_image_interface(mconfig, *this),
+legacy_image_device_base::~legacy_image_device_base()
+{
+ image_device_format **formatptr = &m_formatlist;
+
+ /* free all entries */
+ while (*formatptr != NULL)
+ {
+ image_device_format *entry = *formatptr;
+ *formatptr = entry->m_next;
+ global_free(entry);
+ }
+}
+
+device_image_partialhash_func legacy_image_device_base::get_partial_hash() const
+{
+ return reinterpret_cast<device_image_partialhash_func>(get_legacy_fct(DEVINFO_FCT_IMAGE_PARTIAL_HASH));
+}
+
+//**************************************************************************
+// LIVE LEGACY IMAGE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// legacy_image_device_base - constructor
+//-------------------------------------------------
+
+legacy_image_device_base::legacy_image_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config)
+ : legacy_device_base(mconfig, type, tag, owner, clock, get_config),
+ device_image_interface(mconfig, *this),
m_create_option_guide(NULL),
- m_formatlist(NULL)
+ m_formatlist(NULL),
+ m_is_loading(FALSE)
{
}
+
//-------------------------------------------------
// device_config_complete - update configuration
// based on completed device setup
//-------------------------------------------------
-void legacy_image_device_config_base::device_config_complete()
+void legacy_image_device_base::device_config_complete()
{
- const device_config_image_interface *image = NULL;
+ const device_image_interface *image = NULL;
int count = 0;
int index = -1;
image_device_format **formatptr;
@@ -75,35 +103,35 @@ void legacy_image_device_config_base::device_config_complete()
formatptr = &m_formatlist;
int cnt = 0;
- m_type = static_cast<iodevice_t>(get_legacy_config_int(DEVINFO_INT_IMAGE_TYPE));
- m_readable = get_legacy_config_int(DEVINFO_INT_IMAGE_READABLE)!=0;
- m_writeable = get_legacy_config_int(DEVINFO_INT_IMAGE_WRITEABLE)!=0;
- m_creatable = get_legacy_config_int(DEVINFO_INT_IMAGE_CREATABLE)!=0;
- m_must_be_loaded = get_legacy_config_int(DEVINFO_INT_IMAGE_MUST_BE_LOADED)!=0;
- m_reset_on_load = get_legacy_config_int(DEVINFO_INT_IMAGE_RESET_ON_LOAD)!=0;
- m_has_partial_hash = get_legacy_config_int(DEVINFO_FCT_IMAGE_PARTIAL_HASH)!=0;
+ m_type = static_cast<iodevice_t>(get_legacy_int(DEVINFO_INT_IMAGE_TYPE));
+ m_readable = get_legacy_int(DEVINFO_INT_IMAGE_READABLE)!=0;
+ m_writeable = get_legacy_int(DEVINFO_INT_IMAGE_WRITEABLE)!=0;
+ m_creatable = get_legacy_int(DEVINFO_INT_IMAGE_CREATABLE)!=0;
+ m_must_be_loaded = get_legacy_int(DEVINFO_INT_IMAGE_MUST_BE_LOADED)!=0;
+ m_reset_on_load = get_legacy_int(DEVINFO_INT_IMAGE_RESET_ON_LOAD)!=0;
+ m_has_partial_hash = get_legacy_int(DEVINFO_FCT_IMAGE_PARTIAL_HASH)!=0;
- m_interface_name = get_legacy_config_string(DEVINFO_STR_IMAGE_INTERFACE);
+ m_interface_name = get_legacy_string(DEVINFO_STR_IMAGE_INTERFACE);
- m_file_extensions = get_legacy_config_string(DEVINFO_STR_IMAGE_FILE_EXTENSIONS);
+ m_file_extensions = get_legacy_string(DEVINFO_STR_IMAGE_FILE_EXTENSIONS);
- m_create_option_guide = reinterpret_cast<const option_guide *>(get_legacy_config_ptr(DEVINFO_PTR_IMAGE_CREATE_OPTGUIDE));
+ m_create_option_guide = reinterpret_cast<const option_guide *>(get_legacy_ptr(DEVINFO_PTR_IMAGE_CREATE_OPTGUIDE));
- int format_count = get_legacy_config_int(DEVINFO_INT_IMAGE_CREATE_OPTCOUNT);
+ int format_count = get_legacy_int(DEVINFO_INT_IMAGE_CREATE_OPTCOUNT);
for (int i = 0; i < format_count; i++)
{
// only add if creatable
- if (get_legacy_config_string(DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i)) {
+ if (get_legacy_string(DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i)) {
// allocate a new format
format = global_alloc_clear(image_device_format);
// populate it
format->m_index = cnt;
- format->m_name = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTNAME + i);
- format->m_description = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTDESC + i);
- format->m_extensions = get_legacy_config_string(DEVINFO_STR_IMAGE_CREATE_OPTEXTS + i);
- format->m_optspec = get_legacy_config_string(DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i);
+ format->m_name = get_legacy_string(DEVINFO_STR_IMAGE_CREATE_OPTNAME + i);
+ format->m_description = get_legacy_string(DEVINFO_STR_IMAGE_CREATE_OPTDESC + i);
+ format->m_extensions = get_legacy_string(DEVINFO_STR_IMAGE_CREATE_OPTEXTS + i);
+ format->m_optspec = get_legacy_string(DEVINFO_PTR_IMAGE_CREATE_OPTSPEC + i);
// and append it to the list
*formatptr = format;
@@ -112,7 +140,7 @@ void legacy_image_device_config_base::device_config_complete()
}
}
- for (bool gotone = device_config::m_machine_config.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = device_t::m_machine_config.devicelist().first(image); gotone; gotone = image->next(image))
{
if (this == image)
index = count;
@@ -129,11 +157,11 @@ void legacy_image_device_config_base::device_config_complete()
m_brief_instance_name = device_brieftypename(m_type);
}
// Override in case of hardcoded values
- if (strlen(get_legacy_config_string(DEVINFO_STR_IMAGE_INSTANCE_NAME))>0) {
- m_instance_name = get_legacy_config_string(DEVINFO_STR_IMAGE_INSTANCE_NAME);
+ if (strlen(get_legacy_string(DEVINFO_STR_IMAGE_INSTANCE_NAME))>0) {
+ m_instance_name = get_legacy_string(DEVINFO_STR_IMAGE_INSTANCE_NAME);
}
- if (strlen(get_legacy_config_string(DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME))>0) {
- m_brief_instance_name = get_legacy_config_string(DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME);
+ if (strlen(get_legacy_string(DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME))>0) {
+ m_brief_instance_name = get_legacy_string(DEVINFO_STR_IMAGE_BRIEF_INSTANCE_NAME);
}
}
@@ -142,7 +170,7 @@ void legacy_image_device_config_base::device_config_complete()
// based on completed device setup
//-------------------------------------------------
-bool legacy_image_device_config_base::uses_file_extension(const char *file_extension) const
+bool legacy_image_device_base::uses_file_extension(const char *file_extension) const
{
bool result = FALSE;
@@ -164,44 +192,6 @@ bool legacy_image_device_config_base::uses_file_extension(const char *file_exten
return result;
}
-//-------------------------------------------------
-// ~legacy_device_config_base - destructor
-//-------------------------------------------------
-
-legacy_image_device_config_base::~legacy_image_device_config_base()
-{
- image_device_format **formatptr = &m_formatlist;
-
- /* free all entries */
- while (*formatptr != NULL)
- {
- image_device_format *entry = *formatptr;
- *formatptr = entry->m_next;
- global_free(entry);
- }
-}
-
-device_image_partialhash_func legacy_image_device_config_base::get_partial_hash() const
-{
- return reinterpret_cast<device_image_partialhash_func>(get_legacy_config_fct(DEVINFO_FCT_IMAGE_PARTIAL_HASH));
-}
-
-//**************************************************************************
-// LIVE LEGACY IMAGE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// legacy_image_device_base - constructor
-//-------------------------------------------------
-
-legacy_image_device_base::legacy_image_device_base(running_machine &machine, const device_config &config)
- : legacy_device_base(machine, config),
- device_image_interface(machine, config, *this),
- m_is_loading(FALSE)
-{
-}
-
-
/****************************************************************************
IMAGE LOADING
****************************************************************************/
@@ -282,13 +272,13 @@ void legacy_image_device_base::determine_open_plan(int is_create, UINT32 *open_p
int i = 0;
/* emit flags */
- if (!is_create && m_image_config.is_readable() && m_image_config.is_writeable())
+ if (!is_create && is_readable() && is_writeable())
open_plan[i++] = OPEN_FLAG_READ | OPEN_FLAG_WRITE;
- if (!is_create && !m_image_config.is_readable() && m_image_config.is_writeable())
+ if (!is_create && !is_readable() && is_writeable())
open_plan[i++] = OPEN_FLAG_WRITE;
- if (!is_create && m_image_config.is_readable())
+ if (!is_create && is_readable())
open_plan[i++] = OPEN_FLAG_READ;
- if (m_image_config.is_writeable() && m_image_config.is_creatable())
+ if (is_writeable() && is_creatable())
open_plan[i++] = OPEN_FLAG_READ | OPEN_FLAG_WRITE | OPEN_FLAG_CREATE;
open_plan[i] = 0;
}
@@ -498,7 +488,7 @@ done:
}
else {
/* do we need to reset the CPU? only schedule it if load/create is successful */
- if (device().machine().time() > attotime::zero && m_image_config.is_reset_on_load())
+ if (device().machine().time() > attotime::zero && is_reset_on_load())
device().machine().schedule_hard_reset();
else
{
@@ -542,7 +532,7 @@ bool legacy_image_device_base::finish_load()
if (m_from_swlist)
call_display_info();
- if (has_been_created() && m_config.get_legacy_config_fct(DEVINFO_FCT_IMAGE_CREATE) != NULL)
+ if (has_been_created() && get_legacy_fct(DEVINFO_FCT_IMAGE_CREATE) != NULL)
{
err = call_create(m_create_format, m_create_args);
if (err)
@@ -631,7 +621,7 @@ void legacy_image_device_base::unload()
int legacy_image_device_base::call_load()
{
- device_image_load_func func = reinterpret_cast<device_image_load_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_IMAGE_LOAD));
+ device_image_load_func func = reinterpret_cast<device_image_load_func>(get_legacy_fct(DEVINFO_FCT_IMAGE_LOAD));
if (func) {
return (*func)(*this);
} else {
@@ -641,7 +631,7 @@ int legacy_image_device_base::call_load()
bool legacy_image_device_base::call_softlist_load(char *swlist, char *swname, rom_entry *start_entry)
{
- device_image_softlist_load_func func = reinterpret_cast<device_image_softlist_load_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_IMAGE_SOFTLIST_LOAD));
+ device_image_softlist_load_func func = reinterpret_cast<device_image_softlist_load_func>(get_legacy_fct(DEVINFO_FCT_IMAGE_SOFTLIST_LOAD));
if (func) {
return (*func)(*this,swlist,swname,start_entry);
} else {
@@ -651,7 +641,7 @@ bool legacy_image_device_base::call_softlist_load(char *swlist, char *swname, ro
int legacy_image_device_base::call_create(int format_type, option_resolution *format_options)
{
- device_image_create_func func = reinterpret_cast<device_image_create_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_IMAGE_CREATE));
+ device_image_create_func func = reinterpret_cast<device_image_create_func>(get_legacy_fct(DEVINFO_FCT_IMAGE_CREATE));
if (func) {
return (*func)(*this,format_type,format_options);
} else {
@@ -661,34 +651,34 @@ int legacy_image_device_base::call_create(int format_type, option_resolution *fo
void legacy_image_device_base::call_unload()
{
- device_image_unload_func func = reinterpret_cast<device_image_unload_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_IMAGE_UNLOAD));
+ device_image_unload_func func = reinterpret_cast<device_image_unload_func>(get_legacy_fct(DEVINFO_FCT_IMAGE_UNLOAD));
if (func) (*func)(*this);
}
void legacy_image_device_base::call_display()
{
- device_image_display_func func = reinterpret_cast<device_image_display_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_IMAGE_DISPLAY));
+ device_image_display_func func = reinterpret_cast<device_image_display_func>(get_legacy_fct(DEVINFO_FCT_IMAGE_DISPLAY));
if (func) (*func)(*this);
}
void legacy_image_device_base::call_display_info()
{
- device_image_display_info_func func = reinterpret_cast<device_image_display_info_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_IMAGE_DISPLAY_INFO));
+ device_image_display_info_func func = reinterpret_cast<device_image_display_info_func>(get_legacy_fct(DEVINFO_FCT_IMAGE_DISPLAY_INFO));
if (func) (*func)(*this);
}
device_image_partialhash_func legacy_image_device_base::get_partial_hash()
{
- return reinterpret_cast<device_image_partialhash_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_IMAGE_PARTIAL_HASH));
+ return reinterpret_cast<device_image_partialhash_func>(get_legacy_fct(DEVINFO_FCT_IMAGE_PARTIAL_HASH));
}
void legacy_image_device_base::call_get_devices()
{
- device_image_get_devices_func func = reinterpret_cast<device_image_get_devices_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_IMAGE_GET_DEVICES));
+ device_image_get_devices_func func = reinterpret_cast<device_image_get_devices_func>(get_legacy_fct(DEVINFO_FCT_IMAGE_GET_DEVICES));
if (func) (*func)(*this);
}
void *legacy_image_device_base::get_device_specific_call()
{
- return (void*) m_config.get_legacy_config_fct(DEVINFO_FCT_DEVICE_SPECIFIC);
+ return (void*) get_legacy_fct(DEVINFO_FCT_DEVICE_SPECIFIC);
}
diff --git a/src/emu/devintrf.c b/src/emu/devintrf.c
index 1503ff5a189..ede4a6b5167 100644
--- a/src/emu/devintrf.c
+++ b/src/emu/devintrf.c
@@ -95,29 +95,24 @@ resource_pool &machine_get_pool(running_machine &machine)
//-------------------------------------------------
device_list::device_list(resource_pool &pool)
- : tagged_device_list<device_t>(pool),
- m_machine(NULL)
+ : tagged_list<device_t>(pool)
{
}
//-------------------------------------------------
-// import_config_list - import a list of device
-// configs and allocate new devices
+// set_machine_all - once the machine is created,
+// tell every device about it
//-------------------------------------------------
-void device_list::import_config_list(const device_config_list &list, running_machine &machine)
+void device_list::set_machine_all(running_machine &machine)
{
- // remember the machine for later use
+ // add exit and reset callbacks
m_machine = &machine;
-
- // append each device from the configuration list
- for (const device_config *devconfig = list.first(); devconfig != NULL; devconfig = devconfig->next())
- {
- device_t *newdevice = devconfig->alloc_device(machine);
- append(devconfig->tag(), *newdevice);
- newdevice->find_interfaces();
- }
+
+ // iterate over devices and set their machines as well
+ for (device_t *device = first(); device != NULL; device = device->next())
+ device->set_machine(machine);
}
@@ -129,7 +124,6 @@ void device_list::import_config_list(const device_config_list &list, running_mac
void device_list::start_all()
{
// add exit and reset callbacks
- assert(m_machine != NULL);
machine().add_notifier(MACHINE_NOTIFY_RESET, static_reset);
machine().add_notifier(MACHINE_NOTIFY_EXIT, static_exit);
@@ -137,27 +131,44 @@ void device_list::start_all()
machine().save().register_presave(static_pre_save, this);
machine().save().register_postload(static_post_load, this);
- // iterate over devices to start them
+ // start_new_devices does all the necessary work
+ start_new_devices();
+}
+
+
+//-------------------------------------------------
+// start_new_devices - start any unstarted devices
+//-------------------------------------------------
+
+void device_list::start_new_devices()
+{
+ assert(m_machine != NULL);
+
+ // iterate through the devices
device_t *nextdevice;
for (device_t *device = first(); device != NULL; device = nextdevice)
{
- // attempt to start the device, catching any expected exceptions
+ // see if this device is what we want
nextdevice = device->next();
- try
- {
- mame_printf_verbose("Starting %s '%s'\n", device->name(), device->tag());
- device->start();
- }
-
- // handle missing dependencies by moving the device to the end
- catch (device_missing_dependencies &)
+ if (!device->started())
{
- // if we're the end, fail
- mame_printf_verbose(" (missing dependencies; rescheduling)\n");
- if (nextdevice == NULL)
- throw emu_fatalerror("Circular dependency in device startup; unable to start %s '%s'\n", device->name(), device->tag());
- detach(*device);
- append(device->tag(), *device);
+ // attempt to start the device, catching any expected exceptions
+ try
+ {
+ mame_printf_verbose("Starting %s '%s'\n", device->name(), device->tag());
+ device->start();
+ }
+
+ // handle missing dependencies by moving the device to the end
+ catch (device_missing_dependencies &)
+ {
+ // if we're the end, fail
+ mame_printf_verbose(" (missing dependencies; rescheduling)\n");
+ if (nextdevice == NULL)
+ throw emu_fatalerror("Circular dependency in device startup; unable to start %s '%s'\n", device->name(), device->tag());
+ detach(*device);
+ append(device->tag(), *device);
+ }
}
}
}
@@ -167,393 +178,146 @@ void device_list::start_all()
// reset_all - reset all devices in the list
//-------------------------------------------------
-void device_list::reset_all()
+void device_list::reset_all() const
{
- // iterate over devices and stop them
+ // iterate over devices and reset them
for (device_t *device = first(); device != NULL; device = device->next())
device->reset();
}
-void device_list::static_reset(running_machine &machine)
-{
- machine.m_devicelist.reset_all();
-}
-
-
-//-------------------------------------------------
-// static_exit - tear down all the devices
-//-------------------------------------------------
-
-void device_list::static_exit(running_machine &machine)
-{
- // first let the debugger save comments
- if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
- debug_comment_save(machine);
-
- // then nuke the devices
- machine.m_devicelist.reset();
-}
-
-
-//-------------------------------------------------
-// static_pre_save - tell all the devices we are
-// about to save
-//-------------------------------------------------
-
-void device_list::static_pre_save(running_machine &machine, void *param)
-{
- device_list *list = reinterpret_cast<device_list *>(param);
- for (device_t *device = list->first(); device != NULL; device = device->next())
- device->pre_save();
-}
-
-
-//-------------------------------------------------
-// static_post_load - tell all the devices we just
-// completed a load
-//-------------------------------------------------
-
-void device_list::static_post_load(running_machine &machine, void *param)
-{
- device_list *list = reinterpret_cast<device_list *>(param);
- for (device_t *device = list->first(); device != NULL; device = device->next())
- device->post_load();
-}
-
-
-
-//**************************************************************************
-// DEVICE INTERFACE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// device_config_interface - constructor
-//-------------------------------------------------
-
-device_config_interface::device_config_interface(const machine_config &mconfig, device_config &devconfig)
- : m_device_config(devconfig),
- m_machine_config(mconfig),
- m_interface_next(NULL)
-{
- device_config_interface **tailptr;
- for (tailptr = &devconfig.m_interface_list; *tailptr != NULL; tailptr = &(*tailptr)->m_interface_next) ;
- *tailptr = this;
-}
-
-
-//-------------------------------------------------
-// ~device_config_interface - destructor
-//-------------------------------------------------
-
-device_config_interface::~device_config_interface()
-{
-}
-
-
-//-------------------------------------------------
-// interface_config_complete - perform any
-// operations now that the configuration is
-// complete
//-------------------------------------------------
-
-void device_config_interface::interface_config_complete()
-{
- // do nothing by default
-}
-
-
-//-------------------------------------------------
-// interface_validity_check - default validation
-// for a device after the configuration has been
-// constructed
-//-------------------------------------------------
-
-bool device_config_interface::interface_validity_check(emu_options &options, const game_driver &driver) const
-{
- return false;
-}
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// device_config - constructor for a new
-// device configuration
-//-------------------------------------------------
-
-device_config::device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 param)
- : m_next(NULL),
- m_owner(const_cast<device_config *>(owner)),
- m_interface_list(NULL),
- m_type(type),
- m_clock(clock),
- m_machine_config(mconfig),
- m_static_config(NULL),
- m_input_defaults(NULL),
- m_name(name),
- m_tag(tag),
- m_config_complete(false)
-{
- // derive the clock from our owner if requested
- if ((m_clock & 0xff000000) == 0xff000000)
- {
- assert(m_owner != NULL);
- m_clock = m_owner->m_clock * ((m_clock >> 12) & 0xfff) / ((m_clock >> 0) & 0xfff);
- }
-}
-
-
-device_config::device_config(const machine_config &mconfig, device_type type, const char *name, const char *shortname, const char *tag, const device_config *owner, UINT32 clock, UINT32 param)
- : m_next(NULL),
- m_owner(const_cast<device_config *>(owner)),
- m_interface_list(NULL),
- m_type(type),
- m_clock(clock),
- m_machine_config(mconfig),
- m_static_config(NULL),
- m_input_defaults(NULL),
- m_name(name),
- m_shortname(shortname),
- m_searchpath(shortname),
- m_tag(tag),
- m_config_complete(false)
-{
- // derive the clock from our owner if requested
- if ((m_clock & 0xff000000) == 0xff000000)
- {
- assert(m_owner != NULL);
- m_clock = m_owner->m_clock * ((m_clock >> 12) & 0xfff) / ((m_clock >> 0) & 0xfff);
- }
-}
-
-
-//-------------------------------------------------
-// ~device_config - destructor
-//-------------------------------------------------
-
-device_config::~device_config()
-{
-}
-
-
-//-------------------------------------------------
-// config_complete - called when the
-// configuration of a device is complete
-//-------------------------------------------------
-
-void device_config::config_complete()
-{
- // first notify the interfaces
- for (device_config_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
- intf->interface_config_complete();
-
- // then notify the device itself
- device_config_complete();
-}
-
-
-//-------------------------------------------------
-// validity_check - validate a device after the
-// configuration has been constructed
+// stop_all - stop all the devices in the
+// list
//-------------------------------------------------
-bool device_config::validity_check(emu_options &options, const game_driver &driver) const
+void device_list::stop_all()
{
- bool error = false;
-
- // validate via the interfaces
- for (device_config_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
- if (intf->interface_validity_check(options, driver))
- error = true;
-
- // let the device itself validate
- if (device_validity_check(options, driver))
- error = true;
+ // iterate over devices and stop them
+ for (device_t *device = first(); device != NULL; device = device->next())
+ device->stop();
- return error;
+ // leave with no machine
+ m_machine = NULL;
}
//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
+// first - return the first device of the given
+// type
//-------------------------------------------------
-void device_config::device_config_complete()
+device_t *device_list::first(device_type type) const
{
- // do nothing by default
+ device_t *cur;
+ for (cur = super::first(); cur != NULL && cur->type() != type; cur = cur->next()) ;
+ return cur;
}
//-------------------------------------------------
-// device_validity_check - validate a device after
-// the configuration has been constructed
+// count - count the number of devices of the
+// given type
//-------------------------------------------------
-bool device_config::device_validity_check(emu_options &options, const game_driver &driver) const
+int device_list::count(device_type type) const
{
- // indicate no error by default
- return false;
+ int num = 0;
+ for (const device_t *curdev = first(type); curdev != NULL; curdev = curdev->typenext()) num++;
+ return num;
}
//-------------------------------------------------
-// rom_region - return a pointer to the implicit
-// rom region description for this device
+// indexof - return the index of the given device
+// among its kind
//-------------------------------------------------
-const rom_entry *device_config::device_rom_region() const
+int device_list::indexof(device_type type, device_t &object) const
{
- return NULL;
+ int num = 0;
+ for (device_t *cur = first(type); cur != NULL; cur = cur->typenext(), num++)
+ if (cur == &object) return num;
+ return -1;
}
//-------------------------------------------------
-// machine_config - return a pointer to a machine
-// config constructor describing sub-devices for
-// this device
+// indexof - return the index of the given device
+// among its kind
//-------------------------------------------------
-machine_config_constructor device_config::device_mconfig_additions() const
+int device_list::indexof(device_type type, const char *tag) const
{
- return NULL;
+ device_t *object = find(tag);
+ return (object != NULL && object->type() == type) ? indexof(type, *object) : -1;
}
-
//-------------------------------------------------
-// input_ports - return a pointer to the implicit
-// input ports description for this device
+// find - find a device by type + index
//-------------------------------------------------
-const input_port_token *device_config::device_input_ports() const
+device_t *device_list::find(device_type type, int index) const
{
+ for (device_t *cur = first(type); cur != NULL; cur = cur->typenext())
+ if (index-- == 0) return cur;
return NULL;
}
-//**************************************************************************
-// LIVE DEVICE INTERFACES
-//**************************************************************************
-
-//-------------------------------------------------
-// device_interface - constructor
-//-------------------------------------------------
-
-device_interface::device_interface(running_machine &machine, const device_config &config, device_t &device)
- : m_interface_next(NULL),
- m_device(device)
-{
- device_interface **tailptr;
- for (tailptr = &device.m_interface_list; *tailptr != NULL; tailptr = &(*tailptr)->m_interface_next) ;
- *tailptr = this;
-}
-
-
-//-------------------------------------------------
-// ~device_interface - destructor
-//-------------------------------------------------
-
-device_interface::~device_interface()
-{
-}
-
-
-//-------------------------------------------------
-// interface_pre_start - called before the
-// device's own start function
-//-------------------------------------------------
-
-void device_interface::interface_pre_start()
-{
- // do nothing by default
-}
-
-
-//-------------------------------------------------
-// interface_post_start - called after the
-// device's own start function
-//-------------------------------------------------
-
-void device_interface::interface_post_start()
-{
- // do nothing by default
-}
-
-
-//-------------------------------------------------
-// interface_pre_reset - called before the
-// device's own reset function
-//-------------------------------------------------
-
-void device_interface::interface_pre_reset()
-{
- // do nothing by default
-}
-
-
//-------------------------------------------------
-// interface_post_reset - called after the
-// device's own reset function
+// static_reset - internal callback for resetting
+// all devices
//-------------------------------------------------
-void device_interface::interface_post_reset()
+void device_list::static_reset(running_machine &machine)
{
- // do nothing by default
+ machine.devicelist().reset_all();
}
//-------------------------------------------------
-// interface_pre_save - called prior to saving the
-// state, so that registered variables can be
-// properly normalized
+// static_exit - tear down all the devices
//-------------------------------------------------
-void device_interface::interface_pre_save()
+void device_list::static_exit(running_machine &machine)
{
- // do nothing by default
-}
+ // first let the debugger save comments
+ if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ debug_comment_save(machine);
+ // stop all the devices before we go away
+ const_cast<device_list &>(machine.devicelist()).stop_all();
-//-------------------------------------------------
-// interface_post_load - called after the loading a
-// saved state, so that registered variables can
-// be expaneded as necessary
-//-------------------------------------------------
-
-void device_interface::interface_post_load()
-{
- // do nothing by default
+ // then nuke the devices
+ const_cast<device_list &>(machine.devicelist()).reset();
}
//-------------------------------------------------
-// interface_clock_changed - called when the
-// device clock is altered in any way; designed
-// to be overridden by the actual device
-// implementation
+// static_pre_save - tell all the devices we are
+// about to save
//-------------------------------------------------
-void device_interface::interface_clock_changed()
+void device_list::static_pre_save(running_machine &machine, void *param)
{
- // do nothing by default
+ device_list *list = reinterpret_cast<device_list *>(param);
+ for (device_t *device = list->first(); device != NULL; device = device->next())
+ device->pre_save();
}
//-------------------------------------------------
-// interface_debug_setup - called to allow
-// interfaces to set up any debugging for this
-// device
+// static_post_load - tell all the devices we just
+// completed a load
//-------------------------------------------------
-void device_interface::interface_debug_setup()
+void device_list::static_post_load(running_machine &machine, void *param)
{
- // do nothing by default
+ device_list *list = reinterpret_cast<device_list *>(param);
+ for (device_t *device = list->first(); device != NULL; device = device->next())
+ device->post_load();
}
@@ -568,25 +332,75 @@ void device_interface::interface_debug_setup()
// from the provided config
//-------------------------------------------------
-device_t::device_t(running_machine &_machine, const device_config &config)
- : m_save_manager(_machine.save()),
- m_debug(NULL),
+device_t::device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : m_debug(NULL),
m_execute(NULL),
m_memory(NULL),
m_state(NULL),
m_next(NULL),
- m_owner((config.m_owner != NULL) ? _machine.m_devicelist.find(config.m_owner->tag()) : NULL),
+ m_owner(owner),
m_interface_list(NULL),
+ m_type(type),
+ m_configured_clock(clock),
+ m_machine_config(mconfig),
+ m_static_config(NULL),
+ m_input_defaults(NULL),
+ m_name(name),
m_started(false),
- m_clock(config.m_clock),
+ m_clock(clock),
m_region(NULL),
- m_baseconfig(config),
- m_unscaled_clock(config.m_clock),
+ m_unscaled_clock(clock),
m_clock_scale(1.0),
- m_attoseconds_per_clock((config.m_clock == 0) ? 0 : HZ_TO_ATTOSECONDS(config.m_clock)),
+ m_attoseconds_per_clock((clock == 0) ? 0 : HZ_TO_ATTOSECONDS(clock)),
m_auto_finder_list(NULL),
- m_machine(_machine)
+ m_machine(NULL),
+ m_save(NULL),
+ m_tag(tag),
+ m_config_complete(false)
{
+ // derive the clock from our owner if requested
+ if ((m_configured_clock & 0xff000000) == 0xff000000)
+ {
+ assert(m_owner != NULL);
+ m_clock = m_unscaled_clock = m_configured_clock = m_owner->m_configured_clock * ((m_configured_clock >> 12) & 0xfff) / ((m_configured_clock >> 0) & 0xfff);
+ }
+}
+
+
+device_t::device_t(const machine_config &mconfig, device_type type, const char *name, const char *shortname, const char *tag, device_t *owner, UINT32 clock)
+ : m_debug(NULL),
+ m_execute(NULL),
+ m_memory(NULL),
+ m_state(NULL),
+ m_next(NULL),
+ m_owner(owner),
+ m_interface_list(NULL),
+ m_type(type),
+ m_configured_clock(clock),
+ m_machine_config(mconfig),
+ m_static_config(NULL),
+ m_input_defaults(NULL),
+ m_name(name),
+ m_shortname(shortname),
+ m_searchpath(shortname),
+ m_started(false),
+ m_clock(clock),
+ m_region(NULL),
+ m_unscaled_clock(clock),
+ m_clock_scale(1.0),
+ m_attoseconds_per_clock((clock == 0) ? 0 : HZ_TO_ATTOSECONDS(clock)),
+ m_auto_finder_list(NULL),
+ m_machine(NULL),
+ m_save(NULL),
+ m_tag(tag),
+ m_config_complete(false)
+{
+ // derive the clock from our owner if requested
+ if ((m_configured_clock & 0xff000000) == 0xff000000)
+ {
+ assert(m_owner != NULL);
+ m_clock = m_unscaled_clock = m_configured_clock = m_owner->m_configured_clock * ((m_configured_clock >> 12) & 0xfff) / ((m_configured_clock >> 0) & 0xfff);
+ }
}
@@ -596,7 +410,6 @@ device_t::device_t(running_machine &_machine, const device_config &config)
device_t::~device_t()
{
- auto_free(machine(), m_debug);
}
@@ -652,7 +465,68 @@ device_t *device_t::siblingdevice(const char *_tag) const
//-------------------------------------------------
-// set_clock - sets the given device's raw clock
+// config_complete - called when the
+// configuration of a device is complete
+//-------------------------------------------------
+
+void device_t::config_complete()
+{
+ // first notify the interfaces
+ for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
+ intf->interface_config_complete();
+
+ // then notify the device itself
+ device_config_complete();
+
+ // then mark ourselves complete
+ m_config_complete = true;
+}
+
+
+//-------------------------------------------------
+// validity_check - validate a device after the
+// configuration has been constructed
+//-------------------------------------------------
+
+bool device_t::validity_check(emu_options &options, const game_driver &driver) const
+{
+ bool error = false;
+
+ // validate via the interfaces
+ for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
+ if (intf->interface_validity_check(options, driver))
+ error = true;
+
+ // let the device itself validate
+ if (device_validity_check(options, driver))
+ error = true;
+
+ return error;
+}
+
+
+//-------------------------------------------------
+// reset - reset a device
+//-------------------------------------------------
+
+void device_t::reset()
+{
+ // let the interfaces do their pre-work
+ for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
+ intf->interface_pre_reset();
+
+ // reset the device
+ device_reset();
+
+ // let the interfaces do their post-work
+ for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
+ intf->interface_post_reset();
+}
+
+
+//-------------------------------------------------
+// set_unscaled_clock - sets the given device's
+// unscaled clock
//-------------------------------------------------
void device_t::set_unscaled_clock(UINT32 clock)
@@ -665,7 +539,7 @@ void device_t::set_unscaled_clock(UINT32 clock)
//-------------------------------------------------
-// set_clockscale - sets a scale factor for the
+// set_clock_scale - sets a scale factor for the
// device's clock
//-------------------------------------------------
@@ -730,15 +604,14 @@ void device_t::timer_set(attotime duration, device_timer_id id, int param, void
//-------------------------------------------------
-// find_interfaces - locate fast interfaces
+// set_machine - notify that the machine now
+// exists
//-------------------------------------------------
-void device_t::find_interfaces()
+void device_t::set_machine(running_machine &machine)
{
- // look up the common interfaces
- m_execute = dynamic_cast<device_execute_interface *>(this);
- m_memory = dynamic_cast<device_memory_interface *>(this);
- m_state = dynamic_cast<device_state_interface *>(this);
+ m_machine = &machine;
+ m_save = &machine.save();
}
@@ -748,7 +621,7 @@ void device_t::find_interfaces()
void device_t::start()
{
- // populate the region field
+ // populate the machine and the region field
m_region = machine().region(tag());
// find all the registered devices
@@ -801,36 +674,43 @@ void device_t::start()
//-------------------------------------------------
-// debug_setup - set up for debugging
+// stop - stop a device
//-------------------------------------------------
-void device_t::debug_setup()
+void device_t::stop()
{
- // notify the interface
+ // let the interfaces do their pre-work
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
- intf->interface_debug_setup();
+ intf->interface_pre_stop();
- // notify the device
- device_debug_setup();
+ // stop the device
+ device_stop();
+
+ // let the interfaces do their post-work
+ for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
+ intf->interface_post_stop();
+
+ // free any debugging info
+ auto_free(machine(), m_debug);
+
+ // we're now officially stopped, and the machine is off-limits
+ m_started = false;
+ m_machine = NULL;
}
//-------------------------------------------------
-// reset - reset a device
+// debug_setup - set up for debugging
//-------------------------------------------------
-void device_t::reset()
+void device_t::debug_setup()
{
- // let the interfaces do their pre-work
+ // notify the interface
for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
- intf->interface_pre_reset();
-
- // reset the device
- device_reset();
+ intf->interface_debug_setup();
- // let the interfaces do their post-work
- for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
- intf->interface_post_reset();
+ // notify the device
+ device_debug_setup();
}
@@ -867,6 +747,84 @@ void device_t::post_load()
//-------------------------------------------------
+// notify_clock_changed - notify all interfaces
+// that the clock has changed
+//-------------------------------------------------
+
+void device_t::notify_clock_changed()
+{
+ // first notify interfaces
+ for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
+ intf->interface_clock_changed();
+
+ // then notify the device
+ device_clock_changed();
+}
+
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void device_t::device_config_complete()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
+// device_validity_check - validate a device after
+// the configuration has been constructed
+//-------------------------------------------------
+
+bool device_t::device_validity_check(emu_options &options, const game_driver &driver) const
+{
+ // indicate no error by default
+ return false;
+}
+
+
+//-------------------------------------------------
+// rom_region - return a pointer to the implicit
+// rom region description for this device
+//-------------------------------------------------
+
+const rom_entry *device_t::device_rom_region() const
+{
+ // none by default
+ return NULL;
+}
+
+
+//-------------------------------------------------
+// machine_config - return a pointer to a machine
+// config constructor describing sub-devices for
+// this device
+//-------------------------------------------------
+
+machine_config_constructor device_t::device_mconfig_additions() const
+{
+ // none by default
+ return NULL;
+}
+
+
+
+//-------------------------------------------------
+// input_ports - return a pointer to the implicit
+// input ports description for this device
+//-------------------------------------------------
+
+const input_port_token *device_t::device_input_ports() const
+{
+ // none by default
+ return NULL;
+}
+
+
+//-------------------------------------------------
// device_reset - actually handle resetting of
// a device; designed to be overriden by the
// actual device implementation
@@ -879,6 +837,17 @@ void device_t::device_reset()
//-------------------------------------------------
+// device_stop - clean up anything that needs to
+// happen before the running_machine goes away
+//-------------------------------------------------
+
+void device_t::device_stop()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
// device_pre_save - called prior to saving the
// state, so that registered variables can be
// properly normalized
@@ -938,22 +907,6 @@ void device_t::device_timer(emu_timer &timer, device_timer_id id, int param, voi
//-------------------------------------------------
-// notify_clock_changed - notify all interfaces
-// that the clock has changed
-//-------------------------------------------------
-
-void device_t::notify_clock_changed()
-{
- // first notify interfaces
- for (device_interface *intf = m_interface_list; intf != NULL; intf = intf->interface_next())
- intf->interface_clock_changed();
-
- // then notify the device
- device_clock_changed();
-}
-
-
-//-------------------------------------------------
// register_auto_finder - add a new item to the
// list of stuff to find after we go live
//-------------------------------------------------
@@ -1020,3 +973,170 @@ size_t device_t::auto_finder_base::find_shared_size(device_t &base, const char *
memory_get_shared(base.machine(), tag, result);
return result;
}
+
+
+
+//**************************************************************************
+// LIVE DEVICE INTERFACES
+//**************************************************************************
+
+//-------------------------------------------------
+// device_interface - constructor
+//-------------------------------------------------
+
+device_interface::device_interface(device_t &device)
+ : m_interface_next(NULL),
+ m_device(device)
+{
+ device_interface **tailptr;
+ for (tailptr = &device.m_interface_list; *tailptr != NULL; tailptr = &(*tailptr)->m_interface_next) ;
+ *tailptr = this;
+}
+
+
+//-------------------------------------------------
+// ~device_interface - destructor
+//-------------------------------------------------
+
+device_interface::~device_interface()
+{
+}
+
+
+//-------------------------------------------------
+// interface_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void device_interface::interface_config_complete()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
+// interface_validity_check - default validation
+// for a device after the configuration has been
+// constructed
+//-------------------------------------------------
+
+bool device_interface::interface_validity_check(emu_options &options, const game_driver &driver) const
+{
+ return false;
+}
+
+
+//-------------------------------------------------
+// interface_pre_start - called before the
+// device's own start function
+//-------------------------------------------------
+
+void device_interface::interface_pre_start()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
+// interface_post_start - called after the
+// device's own start function
+//-------------------------------------------------
+
+void device_interface::interface_post_start()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
+// interface_pre_reset - called before the
+// device's own reset function
+//-------------------------------------------------
+
+void device_interface::interface_pre_reset()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
+// interface_post_reset - called after the
+// device's own reset function
+//-------------------------------------------------
+
+void device_interface::interface_post_reset()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
+// interface_pre_stop - called before the
+// device's own stop function
+//-------------------------------------------------
+
+void device_interface::interface_pre_stop()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
+// interface_post_stop - called after the
+// device's own stop function
+//-------------------------------------------------
+
+void device_interface::interface_post_stop()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
+// interface_pre_save - called prior to saving the
+// state, so that registered variables can be
+// properly normalized
+//-------------------------------------------------
+
+void device_interface::interface_pre_save()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
+// interface_post_load - called after the loading a
+// saved state, so that registered variables can
+// be expaneded as necessary
+//-------------------------------------------------
+
+void device_interface::interface_post_load()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
+// interface_clock_changed - called when the
+// device clock is altered in any way; designed
+// to be overridden by the actual device
+// implementation
+//-------------------------------------------------
+
+void device_interface::interface_clock_changed()
+{
+ // do nothing by default
+}
+
+
+//-------------------------------------------------
+// interface_debug_setup - called to allow
+// interfaces to set up any debugging for this
+// device
+//-------------------------------------------------
+
+void device_interface::interface_debug_setup()
+{
+ // do nothing by default
+}
diff --git a/src/emu/devintrf.h b/src/emu/devintrf.h
index 367be9d2096..6481778606d 100644
--- a/src/emu/devintrf.h
+++ b/src/emu/devintrf.h
@@ -58,40 +58,6 @@
// shorthand for accessing devices by machine/type/tag
#define devtag_reset(mach,tag) (mach).device(tag)->reset()
-// often derived devices need only a different name and a simple parameter to differentiate them
-// these are provided as macros because you can't pass string literals to templates, annoyingly enough
-// use this to declare the existence of a derived device in the header file
-#define DECLARE_TRIVIAL_DERIVED_DEVICE(_ConfigClass, _ConfigBase, _DeviceClass, _DeviceBase) \
-typedef _DeviceBase _DeviceClass; \
-class _ConfigClass; \
- \
-class _ConfigClass : public _ConfigBase \
-{ \
-protected: \
- _ConfigClass(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock, UINT32 param = 0); \
- \
-public: \
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); \
- virtual device_t *alloc_device(running_machine &machine) const; \
-}; \
-
-// use this macro to define the actual implementation in the source file
-#define DEFINE_TRIVIAL_DERIVED_DEVICE(_ConfigClass, _ConfigBase, _DeviceClass, _DeviceBase, _Name, _Param) \
-_ConfigClass::_ConfigClass(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock, UINT32 param) \
- : _ConfigBase(mconfig, static_alloc_device_config, _Name, tag, owner, clock, param) \
-{ \
-} \
- \
-device_config *_ConfigClass::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) \
-{ \
- return global_alloc(_ConfigClass(mconfig, tag, owner, clock, _Param)); \
-} \
- \
-device_t *_ConfigClass::alloc_device(running_machine &machine) const \
-{ \
- return auto_alloc(machine, _DeviceClass(machine, *this)); \
-} \
-
//**************************************************************************
@@ -100,16 +66,16 @@ device_t *_ConfigClass::alloc_device(running_machine &machine) const \
// configure devices
#define MCFG_DEVICE_CONFIG(_config) \
- device_config::static_set_static_config(device, &(_config)); \
+ device_t::static_set_static_config(*device, &(_config)); \
#define MCFG_DEVICE_CONFIG_CLEAR() \
- device_config::static_set_static_config(device, NULL); \
+ device_t::static_set_static_config(*device, NULL); \
#define MCFG_DEVICE_CLOCK(_clock) \
- device_config::static_set_clock(device, _clock); \
+ device_t::static_set_clock(*device, _clock); \
#define MCFG_DEVICE_INPUT_DEFAULTS(_config) \
- device_config::static_set_input_default(device, DEVICE_INPUT_DEFAULTS_NAME(_config)); \
+ device_t::static_set_input_default(*device, DEVICE_INPUT_DEFAULTS_NAME(_config)); \
//**************************************************************************
@@ -119,8 +85,6 @@ device_t *_ConfigClass::alloc_device(running_machine &machine) const \
// forward references
class memory_region;
class device_debug;
-class device_config;
-class device_config_interface;
class device_t;
class device_interface;
class device_execute_interface;
@@ -138,7 +102,15 @@ class device_missing_dependencies : public emu_exception { };
// a device_type is simply a pointer to its alloc function
-typedef device_config *(*device_type)(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
+typedef device_t *(*device_type)(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+
+// this template function creates a stub which constructs a device
+template<class T>
+device_t *device_creator(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+{
+ return global_alloc(T(mconfig, tag, owner, clock));
+}
// timer IDs for devices
@@ -154,14 +126,23 @@ typedef void (*write_line_device_func)(device_t *device, int state);
// ======================> tagged_device_list
// tagged_device_list is a tagged_list with additional searching based on type
-template<class T>
-class tagged_device_list : public tagged_list<T>
+class device_list : public tagged_list<device_t>
{
- typedef tagged_list<T> super;
+ typedef tagged_list<device_t> super;
public:
- tagged_device_list(resource_pool &pool = global_resource_pool)
- : tagged_list<T>(pool) { }
+ // construction/destruction
+ device_list(resource_pool &pool = global_resource_pool);
+
+ // getters
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ // bulk operations
+ void set_machine_all(running_machine &machine);
+ void start_all();
+ void start_new_devices();
+ void reset_all() const;
+ void stop_all();
// pull the generic forms forward
using super::first;
@@ -170,126 +151,54 @@ public:
using super::find;
// provide type-specific overrides
- 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 indexof(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 indexof(device_type type, const char *tag) const
- {
- T *object = find(tag);
- return (object != NULL && object->type() == type) ? indexof(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;
- }
+ device_t *first(device_type type) const;
+ int count(device_type type) const;
+ int indexof(device_type type, device_t &object) const;
+ int indexof(device_type type, const char *tag) const;
+ device_t *find(device_type type, int index) const;
// provide interface-specific overrides
template<class I>
- bool first(I *&intf) const
- {
- for (T *cur = super::first(); cur != NULL; cur = cur->next())
- if (cur->interface(intf))
- return true;
- return false;
- }
-};
-
-
-
-// ======================> device_config_list
-
-// device_config_list manages a list of device_configs
-typedef tagged_device_list<device_config> device_config_list;
-
-
-
-// ======================> device_list
-
-// device_list manages a list of device_ts
-class device_list : public tagged_device_list<device_t>
-{
- running_machine *m_machine;
-
+ bool first(I *&intf) const;
+
+private:
+ // internal helpers
static void static_reset(running_machine &machine);
static void static_exit(running_machine &machine);
static void static_pre_save(running_machine &machine, void *param);
static void static_post_load(running_machine &machine, void *param);
-public:
- device_list(resource_pool &pool = global_resource_pool);
- void import_config_list(const device_config_list &list, running_machine &machine);
-
- running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
-
- void start_all();
- void reset_all();
+ // internal state
+ running_machine *m_machine;
};
-// ======================> device_config
+// ======================> device_t
-// device_config represents a device configuration that is attached to a machine_config
-class device_config
+// device_t represents a device
+class device_t : public bindable_object
{
- DISABLE_COPYING(device_config);
+ DISABLE_COPYING(device_t);
- friend class machine_config;
- friend class device_t;
- friend class device_config_interface;
- friend class simple_list<device_config>;
+ friend class device_interface;
+ friend class device_memory_interface;
+ friend class device_state_interface;
+ friend class device_execute_interface;
+ friend class simple_list<device_t>;
+ friend class device_list;
protected:
// construction/destruction
- device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 param = 0);
- device_config(const machine_config &mconfig, device_type type, const char *name, const char *shortname, const char *tag, const device_config *owner, UINT32 clock, UINT32 param = 0);
- virtual ~device_config();
+ device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
+ device_t(const machine_config &mconfig, device_type type, const char *name, const char *shortname, const char *tag, device_t *owner, UINT32 clock);
+ virtual ~device_t();
public:
- // iteration helpers
- device_config *next() const { return m_next; }
- device_config *typenext() const;
- device_config *owner() const { return m_owner; }
-
- // interface helpers
- template<class T> bool interface(const T *&intf) const { intf = dynamic_cast<const T *>(this); return (intf != NULL); }
- template<class T> bool next(T *&intf) const
- {
- for (device_config *cur = m_next; cur != NULL; cur = cur->m_next)
- if (cur->interface(intf))
- return true;
- return false;
- }
-
- // owned object helpers
- astring &subtag(astring &dest, const char *tag) const;
- astring &siblingtag(astring &dest, const char *tag) const;
-
- // basic information getters
+ // getters
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
device_type type() const { return m_type; }
- UINT32 clock() const { return m_clock; }
+ UINT32 configured_clock() const { return m_configured_clock; }
const char *name() const { return m_name; }
const char *shortname() const { return m_shortname; }
const char *searchpath() const { return m_searchpath; }
@@ -301,109 +210,6 @@ public:
machine_config_constructor machine_config_additions() const { return device_mconfig_additions(); }
const input_port_token *input_ports() const { return device_input_ports(); }
- // methods that wrap both interface-level and device-level behavior
- void config_complete();
- bool validity_check(emu_options &options, const game_driver &driver) const;
-
- // configuration helpers
- static void static_set_clock(device_config *device, UINT32 clock) { device->m_clock = clock; }
- static void static_set_static_config(device_config *device, const void *config) { device->m_static_config = config; }
- static void static_set_input_default(device_config *device, const input_device_default *config) { device->m_input_defaults = config; }
-
- //------------------- begin derived class overrides
-
- // required operation overrides
- virtual device_t *alloc_device(running_machine &machine) const = 0;
-
- // optional operation overrides
-protected:
- virtual void device_config_complete();
- virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
-
- // optional information overrides
- virtual const rom_entry *device_rom_region() const;
- virtual machine_config_constructor device_mconfig_additions() const;
- virtual const input_port_token *device_input_ports() const;
-
- //------------------- end derived class overrides
-
- // device relationships
- device_config * m_next; // next device (of any type/class)
- device_config * m_owner; // device that owns us, or NULL if nobody
- device_config_interface *m_interface_list; // head of interface list
-
- const device_type m_type; // device type
- UINT32 m_clock; // device clock
-
- const machine_config & m_machine_config; // reference to the machine's configuration
- const void * m_static_config; // static device configuration
- const input_device_default *m_input_defaults; // devices input ports default overrides
-
- astring m_name; // name of the device
- astring m_shortname; // short name of the device
- astring m_searchpath; // search path, used for media loading
-
-private:
- astring m_tag; // tag for this instance
- bool m_config_complete; // have we completed our configuration?
-};
-
-
-
-// ======================> device_config_interface
-
-// device_config_interface represents configuration information for a particular device interface
-class device_config_interface
-{
- DISABLE_COPYING(device_config_interface);
-
-protected:
- // construction/destruction
- device_config_interface(const machine_config &mconfig, device_config &devconfig);
- virtual ~device_config_interface();
-
-public:
- // casting helpers
- const device_config &devconfig() const { return m_device_config; }
- operator const device_config &() const { return m_device_config; }
- operator const device_config *() const { return &m_device_config; }
-
- // iteration helpers
- device_config_interface *interface_next() const { return m_interface_next; }
- template<class T> bool next(T *&intf) const { return m_device_config.next(intf); }
-
- // optional operation overrides
- virtual void interface_config_complete();
- virtual bool interface_validity_check(emu_options &options, const game_driver &driver) const;
-
-protected:
- const device_config & m_device_config;
- const machine_config & m_machine_config;
- device_config_interface * m_interface_next;
-};
-
-
-
-// ======================> device_t
-
-// device_t represents a device that is live and attached to a running_machine
-class device_t : public bindable_object
-{
- DISABLE_COPYING(device_t);
-
- friend class device_interface;
- friend class simple_list<device_t>;
- friend class device_list;
-
-protected:
- // construction/destruction
- device_t(running_machine &machine, const device_config &config);
- virtual ~device_t();
-
-public:
- // getters
- running_machine &machine() const { return m_machine; }
-
// iteration helpers
device_t *next() const { return m_next; }
device_t *typenext() const;
@@ -427,22 +233,28 @@ public:
bool interface(device_memory_interface *&intf) const { intf = m_memory; return (intf != NULL); }
bool interface(device_state_interface *&intf) { intf = m_state; return (intf != NULL); }
bool interface(device_state_interface *&intf) const { intf = m_state; return (intf != NULL); }
+ device_execute_interface &execute() const { assert(m_execute != NULL); return *m_execute; }
device_memory_interface &memory() const { assert(m_memory != NULL); return *m_memory; }
// owned object helpers
- astring &subtag(astring &dest, const char *tag) const { return m_baseconfig.subtag(dest, tag); }
- astring &siblingtag(astring &dest, const char *tag) const { return m_baseconfig.siblingtag(dest, tag); }
+ astring &subtag(astring &dest, const char *tag) const;
+ astring &siblingtag(astring &dest, const char *tag) const;
const memory_region *subregion(const char *tag) const;
device_t *subdevice(const char *tag) const;
device_t *siblingdevice(const char *tag) const;
template<class T> inline T *subdevice(const char *tag) { return downcast<T *>(subdevice(tag)); }
template<class T> inline T *siblingdevice(const char *tag) { return downcast<T *>(siblingdevice(tag)); }
+ const memory_region *region() const { return m_region; }
// configuration helpers
- const device_config &baseconfig() const { return m_baseconfig; }
- const memory_region *region() const { return m_region; }
+ static void static_set_clock(device_t &device, UINT32 clock) { device.m_clock = clock; }
+ static void static_set_static_config(device_t &device, const void *config) { device.m_static_config = config; }
+ static void static_set_input_default(device_t &device, const input_device_default *config) { device.m_input_defaults = config; }
// state helpers
+ void config_complete();
+ bool configured() const { return m_config_complete; }
+ bool validity_check(emu_options &options, const game_driver &driver) const;
bool started() const { return m_started; }
void reset();
@@ -463,27 +275,18 @@ public:
// state saving interfaces
template<typename T>
- void save_item(T &value, const char *valname, int index = 0) { m_save_manager.save_item(name(), tag(), index, value, valname); }
+ void save_item(T &value, const char *valname, int index = 0) { assert(m_save != NULL); m_save->save_item(name(), tag(), index, value, valname); }
template<typename T>
- void save_pointer(T *value, const char *valname, UINT32 count, int index = 0) { m_save_manager.save_pointer(name(), tag(), index, value, valname, count); }
+ void save_pointer(T *value, const char *valname, UINT32 count, int index = 0) { assert(m_save != NULL); m_save->save_pointer(name(), tag(), index, value, valname, count); }
// debugging
device_debug *debug() const { return m_debug; }
- // basic information getters ... pass through to underlying config
- device_type type() const { return m_baseconfig.type(); }
- const char *name() const { return m_baseconfig.name(); }
- const char *tag() const { return m_baseconfig.tag(); }
-
- // machine and ROM configuration getters ... pass through to underlying config
- const rom_entry *rom_region() const { return m_baseconfig.rom_region(); }
- machine_config_constructor machine_config_additions() const { return m_baseconfig.machine_config_additions(); }
- const input_port_token *input_ports() const { return m_baseconfig.input_ports(); }
-
protected:
// miscellaneous helpers
- void find_interfaces();
+ void set_machine(running_machine &machine);
void start();
+ void stop();
void debug_setup();
void pre_save();
void post_load();
@@ -492,17 +295,22 @@ protected:
//------------------- begin derived class overrides
// device-level overrides
+ virtual const rom_entry *device_rom_region() const;
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const input_port_token *device_input_ports() const;
+ virtual void device_config_complete();
+ virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
virtual void device_start() = 0;
+ virtual void device_stop();
virtual void device_reset();
virtual void device_pre_save();
virtual void device_post_load();
virtual void device_clock_changed();
virtual void device_debug_setup();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
-
+
//------------------- end derived class overrides
- save_manager & m_save_manager;
device_debug * m_debug;
// core device interfaces for speed
@@ -515,11 +323,21 @@ protected:
device_t * m_owner; // device that owns us, or NULL if nobody
device_interface * m_interface_list; // head of interface list
+ const device_type m_type; // device type
+ UINT32 m_configured_clock; // originally configured device clock
+
+ const machine_config & m_machine_config; // reference to the machine's configuration
+ const void * m_static_config; // static device configuration
+ const input_device_default *m_input_defaults; // devices input ports default overrides
+
+ astring m_name; // name of the device
+ astring m_shortname; // short name of the device
+ astring m_searchpath; // search path, used for media loading
+
bool m_started; // true if the start function has succeeded
UINT32 m_clock; // device clock
const memory_region * m_region; // our device-local region
- const device_config & m_baseconfig; // reference to our device_config
UINT32 m_unscaled_clock; // unscaled clock
double m_clock_scale; // clock scale factor
attoseconds_t m_attoseconds_per_clock;// period in attoseconds
@@ -630,7 +448,11 @@ protected:
auto_finder_base * m_auto_finder_list;
private:
- running_machine & m_machine;
+ // private state; accessor use required
+ running_machine * m_machine;
+ save_manager * m_save;
+ astring m_tag; // tag for this instance
+ bool m_config_complete; // have we completed our configuration?
};
@@ -644,7 +466,7 @@ class device_interface
protected:
// construction/destruction
- device_interface(running_machine &machine, const device_config &config, device_t &device);
+ device_interface(device_t &device);
virtual ~device_interface();
public:
@@ -659,16 +481,21 @@ public:
template<class T> bool next(T *&intf) const { return m_device.next(intf); }
// optional operation overrides
+ virtual void interface_config_complete();
+ virtual bool interface_validity_check(emu_options &options, const game_driver &driver) const;
virtual void interface_pre_start();
virtual void interface_post_start();
virtual void interface_pre_reset();
virtual void interface_post_reset();
+ virtual void interface_pre_stop();
+ virtual void interface_post_stop();
virtual void interface_pre_save();
virtual void interface_post_load();
virtual void interface_clock_changed();
virtual void interface_debug_setup();
protected:
+ // internal state
device_interface * m_interface_next;
device_t & m_device;
};
@@ -682,38 +509,35 @@ protected:
// ======================> device config helpers
-// find the next device_config of the same type
-inline device_config *device_config::typenext() const
+// find the next device_t of the same type
+inline device_t *device_t::typenext() const
{
- device_config *cur;
+ device_t *cur;
for (cur = m_next; cur != NULL && cur->m_type != m_type; cur = cur->m_next) ;
return cur;
}
// create a tag for an object that is owned by this device
-inline astring &device_config::subtag(astring &dest, const char *_tag) const
+inline astring &device_t::subtag(astring &dest, const char *_tag) const
{
// temp. for now: don't include the root tag in the full tag name
return (this != NULL && m_owner != NULL) ? dest.cpy(m_tag).cat(":").cat(_tag) : dest.cpy(_tag);
}
// create a tag for an object that a sibling to this device
-inline astring &device_config::siblingtag(astring &dest, const char *_tag) const
+inline astring &device_t::siblingtag(astring &dest, const char *_tag) const
{
return (this != NULL && m_owner != NULL) ? m_owner->subtag(dest, _tag) : dest.cpy(_tag);
}
-
-// ======================> running device helpers
-
-// find the next device_t of the same type
-inline device_t *device_t::typenext() const
+template<class I>
+bool device_list::first(I *&intf) const
{
- device_t *cur;
- for (cur = m_next; cur != NULL && cur->type() != type(); cur = cur->m_next) ;
- return cur;
+ for (device_t *cur = super::first(); cur != NULL; cur = cur->next())
+ if (cur->interface(intf))
+ return true;
+ return false;
}
-
#endif /* __DEVINTRF_H__ */
diff --git a/src/emu/devlegcy.c b/src/emu/devlegcy.c
index b15fdcd6b65..19e130d84dc 100644
--- a/src/emu/devlegcy.c
+++ b/src/emu/devlegcy.c
@@ -46,42 +46,54 @@
//**************************************************************************
//-------------------------------------------------
-// legacy_device_config_base - constructor
+// legacy_device_base - constructor
//-------------------------------------------------
-legacy_device_config_base::legacy_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config)
- : device_config(mconfig, type, "Legacy Device", tag, owner, clock),
+legacy_device_base::legacy_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config)
+ : device_t(mconfig, type, "Legacy Device", tag, owner, clock),
m_get_config_func(get_config),
m_inline_config(NULL)
{
// allocate a buffer for the inline configuration
- UINT32 configlen = (UINT32)get_legacy_config_int(DEVINFO_INT_INLINE_CONFIG_BYTES);
+ UINT32 configlen = (UINT32)get_legacy_int(DEVINFO_INT_INLINE_CONFIG_BYTES);
if (configlen != 0)
m_inline_config = global_alloc_array_clear(UINT8, configlen);
// set the proper name
- m_name = get_legacy_config_string(DEVINFO_STR_NAME);
- m_shortname = get_legacy_config_string(DEVINFO_STR_SHORTNAME);
+ m_name = get_legacy_string(DEVINFO_STR_NAME);
+ m_shortname = get_legacy_string(DEVINFO_STR_SHORTNAME);
m_searchpath = m_shortname;
+
+ // create the token
+ int tokenbytes = get_legacy_int(DEVINFO_INT_TOKEN_BYTES);
+ if (tokenbytes != 0)
+ m_token = global_alloc_array_clear(UINT8, tokenbytes);
}
//-------------------------------------------------
-// ~legacy_device_config_base - destructor
+// ~legacy_device_base - destructor
//-------------------------------------------------
-legacy_device_config_base::~legacy_device_config_base()
+legacy_device_base::~legacy_device_base()
{
+ if (m_started)
+ {
+ device_stop_func stop_func = reinterpret_cast<device_stop_func>(get_legacy_fct(DEVINFO_FCT_STOP));
+ if (stop_func != NULL)
+ (*stop_func)(this);
+ }
+ global_free(m_token);
global_free(m_inline_config);
}
//-------------------------------------------------
-// get_legacy_config_int - return a legacy
+// get_legacy_int - return a legacy
// configuration parameter as an integer
//-------------------------------------------------
-INT64 legacy_device_config_base::get_legacy_config_int(UINT32 state) const
+INT64 legacy_device_base::get_legacy_int(UINT32 state) const
{
deviceinfo info = { 0 };
(*m_get_config_func)(this, state, &info);
@@ -90,11 +102,11 @@ INT64 legacy_device_config_base::get_legacy_config_int(UINT32 state) const
//-------------------------------------------------
-// get_legacy_config_ptr - return a legacy
+// get_legacy_ptr - return a legacy
// configuration parameter as a pointer
//-------------------------------------------------
-void *legacy_device_config_base::get_legacy_config_ptr(UINT32 state) const
+void *legacy_device_base::get_legacy_ptr(UINT32 state) const
{
deviceinfo info = { 0 };
(*m_get_config_func)(this, state, &info);
@@ -103,11 +115,11 @@ void *legacy_device_config_base::get_legacy_config_ptr(UINT32 state) const
//-------------------------------------------------
-// get_legacy_config_fct - return a legacy
+// get_legacy_fct - return a legacy
// configuration parameter as a function pointer
//-------------------------------------------------
-genf *legacy_device_config_base::get_legacy_config_fct(UINT32 state) const
+genf *legacy_device_base::get_legacy_fct(UINT32 state) const
{
deviceinfo info = { 0 };
(*m_get_config_func)(this, state, &info);
@@ -116,11 +128,11 @@ genf *legacy_device_config_base::get_legacy_config_fct(UINT32 state) const
//-------------------------------------------------
-// get_legacy_config_string - return a legacy
+// get_legacy_string - return a legacy
// configuration parameter as a string pointer
//-------------------------------------------------
-const char *legacy_device_config_base::get_legacy_config_string(UINT32 state) const
+const char *legacy_device_base::get_legacy_string(UINT32 state) const
{
deviceinfo info;
info.s = get_temp_string_buffer();
@@ -134,10 +146,10 @@ const char *legacy_device_config_base::get_legacy_config_string(UINT32 state) co
// set a 32-bit value in the inline configuration
//-------------------------------------------------
-void legacy_device_config_base::static_set_inline32(device_config *device, UINT32 offset, UINT32 size, UINT32 value)
+void legacy_device_base::static_set_inline32(device_t &device, UINT32 offset, UINT32 size, UINT32 value)
{
- legacy_device_config_base *legacy = downcast<legacy_device_config_base *>(device);
- void *dest = reinterpret_cast<UINT8 *>(legacy->m_inline_config) + offset;
+ legacy_device_base &legacy = downcast<legacy_device_base &>(device);
+ void *dest = reinterpret_cast<UINT8 *>(legacy.m_inline_config) + offset;
if (size == 1)
*reinterpret_cast<UINT8 *>(dest) = value;
else if (size == 2)
@@ -145,7 +157,7 @@ void legacy_device_config_base::static_set_inline32(device_config *device, UINT3
else if (size == 4)
*reinterpret_cast<UINT32 *>(dest) = value;
else
- throw emu_fatalerror("Unexpected size %d in legacy_device_config_base::static_set_inline32", size);
+ throw emu_fatalerror("Unexpected size %d in legacy_device_base::static_set_inline32", size);
}
@@ -154,10 +166,10 @@ void legacy_device_config_base::static_set_inline32(device_config *device, UINT3
// set a 64-bit value in the inline configuration
//-------------------------------------------------
-void legacy_device_config_base::static_set_inline64(device_config *device, UINT32 offset, UINT32 size, UINT64 value)
+void legacy_device_base::static_set_inline64(device_t &device, UINT32 offset, UINT32 size, UINT64 value)
{
- legacy_device_config_base *legacy = downcast<legacy_device_config_base *>(device);
- void *dest = reinterpret_cast<UINT8 *>(legacy->m_inline_config) + offset;
+ legacy_device_base &legacy = downcast<legacy_device_base &>(device);
+ void *dest = reinterpret_cast<UINT8 *>(legacy.m_inline_config) + offset;
if (size == 1)
*reinterpret_cast<UINT8 *>(dest) = value;
else if (size == 2)
@@ -167,7 +179,7 @@ void legacy_device_config_base::static_set_inline64(device_config *device, UINT3
else if (size == 8)
*reinterpret_cast<UINT64 *>(dest) = value;
else
- throw emu_fatalerror("Unexpected size %d in legacy_device_config_base::static_set_inline64", size);
+ throw emu_fatalerror("Unexpected size %d in legacy_device_base::static_set_inline64", size);
}
@@ -177,14 +189,14 @@ void legacy_device_config_base::static_set_inline64(device_config *device, UINT3
// configuration
//-------------------------------------------------
-void legacy_device_config_base::static_set_inline_float(device_config *device, UINT32 offset, UINT32 size, float value)
+void legacy_device_base::static_set_inline_float(device_t &device, UINT32 offset, UINT32 size, float value)
{
- legacy_device_config_base *legacy = downcast<legacy_device_config_base *>(device);
- void *dest = reinterpret_cast<UINT8 *>(legacy->m_inline_config) + offset;
+ legacy_device_base &legacy = downcast<legacy_device_base &>(device);
+ void *dest = reinterpret_cast<UINT8 *>(legacy.m_inline_config) + offset;
if (size == 4)
*reinterpret_cast<float *>(dest) = value;
else
- throw emu_fatalerror("Unexpected size %d in legacy_device_config_base::static_set_inline_float", size);
+ throw emu_fatalerror("Unexpected size %d in legacy_device_base::static_set_inline_float", size);
}
@@ -193,57 +205,22 @@ void legacy_device_config_base::static_set_inline_float(device_config *device, U
// checks on a device configuration
//-------------------------------------------------
-bool legacy_device_config_base::device_validity_check(emu_options &options, const game_driver &driver) const
+bool legacy_device_base::device_validity_check(emu_options &options, const game_driver &driver) const
{
- device_validity_check_func validity_func = reinterpret_cast<device_validity_check_func>(get_legacy_config_fct(DEVINFO_FCT_VALIDITY_CHECK));
+ device_validity_check_func validity_func = reinterpret_cast<device_validity_check_func>(get_legacy_fct(DEVINFO_FCT_VALIDITY_CHECK));
if (validity_func != NULL)
return (*validity_func)(&driver, this, options);
return false;
}
-
-//**************************************************************************
-// LIVE LEGACY DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// legacy_device_base - constructor
-//-------------------------------------------------
-
-legacy_device_base::legacy_device_base(running_machine &_machine, const device_config &config)
- : device_t(_machine, config),
- m_config(downcast<const legacy_device_config_base &>(config)),
- m_token(NULL)
-{
- int tokenbytes = m_config.get_legacy_config_int(DEVINFO_INT_TOKEN_BYTES);
- if (tokenbytes != 0)
- m_token = auto_alloc_array_clear(machine(), UINT8, tokenbytes);
-}
-
-
-//-------------------------------------------------
-// ~legacy_device_base - destructor
-//-------------------------------------------------
-
-legacy_device_base::~legacy_device_base()
-{
- if (m_started)
- {
- device_stop_func stop_func = reinterpret_cast<device_stop_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_STOP));
- if (stop_func != NULL)
- (*stop_func)(this);
- }
-}
-
-
//-------------------------------------------------
// device_start - called to start up a device
//-------------------------------------------------
void legacy_device_base::device_start()
{
- device_start_func start_func = reinterpret_cast<device_start_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_START));
+ device_start_func start_func = reinterpret_cast<device_start_func>(get_legacy_fct(DEVINFO_FCT_START));
assert(start_func != NULL);
(*start_func)(this);
}
@@ -255,7 +232,7 @@ void legacy_device_base::device_start()
void legacy_device_base::device_reset()
{
- device_reset_func reset_func = reinterpret_cast<device_reset_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_RESET));
+ device_reset_func reset_func = reinterpret_cast<device_reset_func>(get_legacy_fct(DEVINFO_FCT_RESET));
if (reset_func != NULL)
(*reset_func)(this);
}
@@ -263,32 +240,16 @@ void legacy_device_base::device_reset()
//**************************************************************************
-// LEGACY SOUND DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// legacy_sound_device_config_base - constructor
-//-------------------------------------------------
-
-legacy_sound_device_config_base::legacy_sound_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config)
- : legacy_device_config_base(mconfig, type, tag, owner, clock, get_config),
- device_config_sound_interface(mconfig, *this)
-{
-}
-
-
-
-//**************************************************************************
-// LIVE LEGACY SOUND DEVICE
+// LEGACY SOUND DEVICE
//**************************************************************************
//-------------------------------------------------
// legacy_sound_device_base - constructor
//-------------------------------------------------
-legacy_sound_device_base::legacy_sound_device_base(running_machine &machine, const device_config &config)
- : legacy_device_base(machine, config),
- device_sound_interface(machine, config, *this)
+legacy_sound_device_base::legacy_sound_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config)
+ : legacy_device_base(mconfig, type, tag, owner, clock, get_config),
+ device_sound_interface(mconfig, *this)
{
}
@@ -306,16 +267,16 @@ void legacy_sound_device_base::sound_stream_update(sound_stream &stream, stream_
//**************************************************************************
-// LEGACY MEMORY DEVICE CONFIGURATION
+// LEGACY MEMORY DEVICE
//**************************************************************************
//-------------------------------------------------
-// legacy_memory_device_config_base - constructor
+// legacy_memory_device_base - constructor
//-------------------------------------------------
-legacy_memory_device_config_base::legacy_memory_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config)
- : legacy_device_config_base(mconfig, type, tag, owner, clock, get_config),
- device_config_memory_interface(mconfig, *this)
+legacy_memory_device_base::legacy_memory_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config)
+ : legacy_device_base(mconfig, type, tag, owner, clock, get_config),
+ device_memory_interface(mconfig, *this)
{
memset(&m_space_config, 0, sizeof(m_space_config));
}
@@ -326,64 +287,32 @@ legacy_memory_device_config_base::legacy_memory_device_config_base(const machine
// based on completed device setup
//-------------------------------------------------
-void legacy_memory_device_config_base::device_config_complete()
+void legacy_memory_device_base::device_config_complete()
{
m_space_config.m_name = "memory";
- m_space_config.m_endianness = static_cast<endianness_t>(get_legacy_config_int(DEVINFO_INT_ENDIANNESS));
- m_space_config.m_databus_width = get_legacy_config_int(DEVINFO_INT_DATABUS_WIDTH);
- m_space_config.m_addrbus_width = get_legacy_config_int(DEVINFO_INT_ADDRBUS_WIDTH);
- m_space_config.m_addrbus_shift = get_legacy_config_int(DEVINFO_INT_ADDRBUS_SHIFT);
+ m_space_config.m_endianness = static_cast<endianness_t>(get_legacy_int(DEVINFO_INT_ENDIANNESS));
+ m_space_config.m_databus_width = get_legacy_int(DEVINFO_INT_DATABUS_WIDTH);
+ m_space_config.m_addrbus_width = get_legacy_int(DEVINFO_INT_ADDRBUS_WIDTH);
+ m_space_config.m_addrbus_shift = get_legacy_int(DEVINFO_INT_ADDRBUS_SHIFT);
m_space_config.m_logaddr_width = m_space_config.m_addrbus_width;
m_space_config.m_page_shift = 0;
- m_space_config.m_internal_map = reinterpret_cast<address_map_constructor>(get_legacy_config_fct(DEVINFO_PTR_INTERNAL_MEMORY_MAP));
- m_space_config.m_default_map = reinterpret_cast<address_map_constructor>(get_legacy_config_fct(DEVINFO_PTR_DEFAULT_MEMORY_MAP));
-}
-
-
-
-//**************************************************************************
-// LIVE LEGACY MEMORY DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// legacy_memory_device_base - constructor
-//-------------------------------------------------
-
-legacy_memory_device_base::legacy_memory_device_base(running_machine &machine, const device_config &config)
- : legacy_device_base(machine, config),
- device_memory_interface(machine, config, *this)
-{
-}
-
-
-
-//**************************************************************************
-// LEGACY NVRAM DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// legacy_nvram_device_config_base - constructor
-//-------------------------------------------------
-
-legacy_nvram_device_config_base::legacy_nvram_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config)
- : legacy_device_config_base(mconfig, type, tag, owner, clock, get_config),
- device_config_nvram_interface(mconfig, *this)
-{
+ m_space_config.m_internal_map = reinterpret_cast<address_map_constructor>(get_legacy_fct(DEVINFO_PTR_INTERNAL_MEMORY_MAP));
+ m_space_config.m_default_map = reinterpret_cast<address_map_constructor>(get_legacy_fct(DEVINFO_PTR_DEFAULT_MEMORY_MAP));
}
//**************************************************************************
-// LIVE LEGACY NVRAM DEVICE
+// LEGACY NVRAM DEVICE
//**************************************************************************
//-------------------------------------------------
// legacy_nvram_device_base - constructor
//-------------------------------------------------
-legacy_nvram_device_base::legacy_nvram_device_base(running_machine &machine, const device_config &config)
- : legacy_device_base(machine, config),
- device_nvram_interface(machine, config, *this)
+legacy_nvram_device_base::legacy_nvram_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config)
+ : legacy_device_base(mconfig, type, tag, owner, clock, get_config),
+ device_nvram_interface(mconfig, *this)
{
}
@@ -394,7 +323,7 @@ legacy_nvram_device_base::legacy_nvram_device_base(running_machine &machine, con
void legacy_nvram_device_base::nvram_default()
{
- device_nvram_func nvram_func = reinterpret_cast<device_nvram_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_NVRAM));
+ device_nvram_func nvram_func = reinterpret_cast<device_nvram_func>(get_legacy_fct(DEVINFO_FCT_NVRAM));
(*nvram_func)(this, NULL, FALSE);
}
@@ -405,7 +334,7 @@ void legacy_nvram_device_base::nvram_default()
void legacy_nvram_device_base::nvram_read(emu_file &file)
{
- device_nvram_func nvram_func = reinterpret_cast<device_nvram_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_NVRAM));
+ device_nvram_func nvram_func = reinterpret_cast<device_nvram_func>(get_legacy_fct(DEVINFO_FCT_NVRAM));
(*nvram_func)(this, &file, FALSE);
}
@@ -416,6 +345,6 @@ void legacy_nvram_device_base::nvram_read(emu_file &file)
void legacy_nvram_device_base::nvram_write(emu_file &file)
{
- device_nvram_func nvram_func = reinterpret_cast<device_nvram_func>(m_config.get_legacy_config_fct(DEVINFO_FCT_NVRAM));
+ device_nvram_func nvram_func = reinterpret_cast<device_nvram_func>(get_legacy_fct(DEVINFO_FCT_NVRAM));
(*nvram_func)(this, &file, TRUE);
}
diff --git a/src/emu/devlegcy.h b/src/emu/devlegcy.h
index fc7e2ddd0fb..cdbf809734c 100644
--- a/src/emu/devlegcy.h
+++ b/src/emu/devlegcy.h
@@ -182,74 +182,57 @@ enum
//**************************************************************************
// macro for declaring the configuration and device classes of a legacy device
-#define _DECLARE_LEGACY_DEVICE(name, basename, configclass, deviceclass, baseconfigclass, basedeviceclass) \
+#define _DECLARE_LEGACY_DEVICE(name, basename, deviceclass, basedeviceclass) \
\
DEVICE_GET_INFO( basename ); \
\
-class configclass; \
- \
class deviceclass : public basedeviceclass \
{ \
- friend class configclass; \
- deviceclass(running_machine &_machine, const configclass &config); \
-}; \
- \
-class configclass : public baseconfigclass \
-{ \
- configclass(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock); \
- \
public: \
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); \
- virtual device_t *alloc_device(running_machine &machine) const; \
+ deviceclass(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock); \
}; \
\
extern const device_type name
// macro for defining the implementation needed for configuration and device classes
-#define _DEFINE_LEGACY_DEVICE(name, basename, configclass, deviceclass, baseconfigclass, basedeviceclass) \
- \
-deviceclass::deviceclass(running_machine &_machine, const configclass &config) \
- : basedeviceclass(_machine, config) \
-{ \
-} \
+#define _DEFINE_LEGACY_DEVICE(name, basename, deviceclass, basedeviceclass) \
\
-configclass::configclass(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock) \
- : baseconfigclass(mconfig, type, tag, owner, clock, DEVICE_GET_INFO_NAME(basename)) \
+deviceclass::deviceclass(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock) \
+ : basedeviceclass(mconfig, type, tag, owner, clock, DEVICE_GET_INFO_NAME(basename)) \
{ \
} \
\
-device_config *configclass::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) \
-{ \
- return global_alloc(configclass(mconfig, static_alloc_device_config, tag, owner, clock)); \
-} \
- \
-device_t *configclass::alloc_device(running_machine &machine) const \
-{ \
- return pool_alloc(machine_get_pool(machine), deviceclass(machine, *this)); \
-} \
-const device_type name = configclass::static_alloc_device_config
+const device_type name = &legacy_device_creator<deviceclass>
+
+// this template function creates a stub which constructs a device
+template<class T>
+device_t *legacy_device_creator(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+{
+ return global_alloc(T(mconfig, &legacy_device_creator<T>, tag, owner, clock));
+}
+
// reduced macros that are easier to use, and map to the above two macros
-#define DECLARE_LEGACY_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_device_config_base, legacy_device_base)
-#define DECLARE_LEGACY_SOUND_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_sound_device_config_base, legacy_sound_device_base)
-#define DECLARE_LEGACY_MEMORY_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_memory_device_config_base, legacy_memory_device_base)
-#define DECLARE_LEGACY_NVRAM_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_nvram_device_config_base, legacy_nvram_device_base)
-#define DECLARE_LEGACY_IMAGE_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_image_device_config_base, legacy_image_device_base)
+#define DECLARE_LEGACY_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device, legacy_device_base)
+#define DECLARE_LEGACY_SOUND_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device, legacy_sound_device_base)
+#define DECLARE_LEGACY_MEMORY_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device, legacy_memory_device_base)
+#define DECLARE_LEGACY_NVRAM_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device, legacy_nvram_device_base)
+#define DECLARE_LEGACY_IMAGE_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device, legacy_image_device_base)
-#define DEFINE_LEGACY_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_device_config_base, legacy_device_base)
-#define DEFINE_LEGACY_SOUND_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_sound_device_config_base, legacy_sound_device_base)
-#define DEFINE_LEGACY_MEMORY_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_memory_device_config_base, legacy_memory_device_base)
-#define DEFINE_LEGACY_NVRAM_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_nvram_device_config_base, legacy_nvram_device_base)
-#define DEFINE_LEGACY_IMAGE_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_image_device_config_base, legacy_image_device_base)
+#define DEFINE_LEGACY_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device, legacy_device_base)
+#define DEFINE_LEGACY_SOUND_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device, legacy_sound_device_base)
+#define DEFINE_LEGACY_MEMORY_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device, legacy_memory_device_base)
+#define DEFINE_LEGACY_NVRAM_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device, legacy_nvram_device_base)
+#define DEFINE_LEGACY_IMAGE_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device, legacy_image_device_base)
// macros to wrap legacy device functions
#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(name) void DEVICE_GET_INFO_NAME(name)(const device_t *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, emu_options &options)
+#define DEVICE_VALIDITY_CHECK(name) int DEVICE_VALIDITY_CHECK_NAME(name)(const game_driver *driver, const device_t *device, emu_options &options)
#define DEVICE_VALIDITY_CHECK_CALL(name) DEVICE_VALIDITY_CHECK_NAME(name)(driver, device)
#define DEVICE_START_NAME(name) device_start_##name
@@ -282,7 +265,7 @@ const device_type name = configclass::static_alloc_device_config
// inline device configurations that require 32 bits of storage in the token
#define MCFG_DEVICE_CONFIG_DATA32_EXPLICIT(_size, _offset, _val) \
- legacy_device_config_base::static_set_inline32(device, _offset, _size, (UINT32)(_val));
+ legacy_device_base::static_set_inline32(*device, _offset, _size, (UINT32)(_val));
#define MCFG_DEVICE_CONFIG_DATA32(_struct, _field, _val) \
MCFG_DEVICE_CONFIG_DATA32_EXPLICIT(structsizeof(_struct, _field), offsetof(_struct, _field), _val)
@@ -305,7 +288,7 @@ const device_type name = configclass::static_alloc_device_config
// inline device configurations that require 32 bits of fixed-point storage in the token
#define MCFG_DEVICE_CONFIG_DATAFP32_EXPLICIT(_size, _offset, _val, _fixbits) \
- legacy_device_config_base::static_set_inline_float(device, _offset, _size, (float)(_val));
+ legacy_device_base::static_set_inline_float(*device, _offset, _size, (float)(_val));
#define MCFG_DEVICE_CONFIG_DATAFP32(_struct, _field, _val, _fixbits) \
MCFG_DEVICE_CONFIG_DATAFP32_EXPLICIT(structsizeof(_struct, _field), offsetof(_struct, _field), _val, _fixbits)
@@ -328,7 +311,7 @@ const device_type name = configclass::static_alloc_device_config
// inline device configurations that require 64 bits of storage in the token
#define MCFG_DEVICE_CONFIG_DATA64_EXPLICIT(_size, _offset, _val) \
- legacy_device_config_base::static_set_inline64(device, _offset, _size, (UINT64)(_val));
+ legacy_device_base::static_set_inline64(*device, _offset, _size, (UINT64)(_val));
#define MCFG_DEVICE_CONFIG_DATA64(_struct, _field, _val) \
MCFG_DEVICE_CONFIG_DATA64_EXPLICIT(structsizeof(_struct, _field), offsetof(_struct, _field), _val)
@@ -376,15 +359,15 @@ const device_type name = configclass::static_alloc_device_config
union deviceinfo;
class machine_config;
-class device_config;
+class device_t;
char *get_temp_string_buffer(void);
resource_pool &machine_get_pool(running_machine &machine);
// device interface function types
-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, emu_options &options);
+typedef void (*device_get_config_func)(const device_t *device, UINT32 state, deviceinfo *info);
+typedef int (*device_validity_check_func)(const game_driver *driver, const device_t *device, emu_options &options);
typedef void (*device_start_func)(device_t *device);
typedef void (*device_stop_func)(device_t *device);
@@ -419,87 +402,49 @@ union deviceinfo
};
-// ======================> legacy_device_config_base
+// ======================> legacy_device_base
-// legacy_device_config_base describes a base configuration class for legacy devices
-class legacy_device_config_base : public device_config
+// legacy_device_base serves as a common base class for legacy devices
+class legacy_device_base : public device_t
{
- friend class legacy_device_base;
- friend class legacy_nvram_device_base;
- friend class legacy_image_device_base;
-
protected:
// construction/destruction
- legacy_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config);
- virtual ~legacy_device_config_base();
-
- // allocators - defined in derived classes
+ legacy_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config);
+ virtual ~legacy_device_base();
- // basic information getters
public:
// access to legacy inline configuartion
void *inline_config() const { return m_inline_config; }
// inline configuration helpers
- static void static_set_inline32(device_config *device, UINT32 offset, UINT32 size, UINT32 value);
- static void static_set_inline64(device_config *device, UINT32 offset, UINT32 size, UINT64 value);
- static void static_set_inline_float(device_config *device, UINT32 offset, UINT32 size, float value);
-
-protected:
- // overrides
- virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
- virtual const rom_entry *device_rom_region() const { return reinterpret_cast<const rom_entry *>(get_legacy_config_ptr(DEVINFO_PTR_ROM_REGION)); }
- virtual machine_config_constructor device_mconfig_additions() const { return reinterpret_cast<machine_config_constructor>(get_legacy_config_ptr(DEVINFO_PTR_MACHINE_CONFIG)); }
- virtual const input_port_token *device_input_ports() const { return reinterpret_cast<const input_port_token *>(get_legacy_config_ptr(DEVINFO_PTR_INPUT_PORTS)); }
-
- // access to legacy configuration info
- INT64 get_legacy_config_int(UINT32 state) const;
- void *get_legacy_config_ptr(UINT32 state) const;
- genf *get_legacy_config_fct(UINT32 state) const;
- const char *get_legacy_config_string(UINT32 state) const;
-
- // internal state
- device_get_config_func m_get_config_func;
- void * m_inline_config;
-};
-
-
+ static void static_set_inline32(device_t &device, UINT32 offset, UINT32 size, UINT32 value);
+ static void static_set_inline64(device_t &device, UINT32 offset, UINT32 size, UINT64 value);
+ static void static_set_inline_float(device_t &device, UINT32 offset, UINT32 size, float value);
-// ======================> legacy_device_base
-
-// legacy_device_base serves as a common base class for legacy devices
-class legacy_device_base : public device_t
-{
-protected:
- // construction/destruction
- legacy_device_base(running_machine &_machine, const device_config &config);
- virtual ~legacy_device_base();
-
-public:
// access to legacy token
- void *token() const { return m_token; }
+ void *token() const { assert(m_token != NULL); return m_token; }
protected:
// device-level overrides
+ virtual const rom_entry *device_rom_region() const { return reinterpret_cast<const rom_entry *>(get_legacy_ptr(DEVINFO_PTR_ROM_REGION)); }
+ virtual machine_config_constructor device_mconfig_additions() const { return reinterpret_cast<machine_config_constructor>(get_legacy_ptr(DEVINFO_PTR_MACHINE_CONFIG)); }
+ virtual const input_port_token *device_input_ports() const { return reinterpret_cast<const input_port_token *>(get_legacy_ptr(DEVINFO_PTR_INPUT_PORTS)); }
+ virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
virtual void device_start();
virtual void device_reset();
- // internal state
- const legacy_device_config_base & m_config;
- void * m_token;
-};
-
-
+ // access to legacy configuration info
+ INT64 get_legacy_int(UINT32 state) const;
+ void *get_legacy_ptr(UINT32 state) const;
+ genf *get_legacy_fct(UINT32 state) const;
+ const char *get_legacy_string(UINT32 state) const;
-// ======================> legacy_sound_device_config_base
+ // configuration state
+ device_get_config_func m_get_config_func;
+ void * m_inline_config;
-// legacy_sound_device_config is a device_config with a sound interface
-class legacy_sound_device_config_base : public legacy_device_config_base,
- public device_config_sound_interface
-{
-protected:
- // construction/destruction
- legacy_sound_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config);
+ // internal state
+ void * m_token;
};
@@ -512,7 +457,7 @@ class legacy_sound_device_base : public legacy_device_base,
{
protected:
// construction/destruction
- legacy_sound_device_base(running_machine &machine, const device_config &config);
+ legacy_sound_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
@@ -520,28 +465,6 @@ protected:
-// ======================> legacy_memory_device_config_base
-
-// legacy_memory_device_config is a device_config with a memory interface
-class legacy_memory_device_config_base : public legacy_device_config_base,
- public device_config_memory_interface
-{
-protected:
- // construction/destruction
- legacy_memory_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config);
-
- // device_config overrides
- virtual void device_config_complete();
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == 0) ? &m_space_config : NULL; }
-
- // internal state
- address_space_config m_space_config;
-};
-
-
-
// ======================> legacy_memory_device_base
// legacy_memory_device is a legacy_device_base with a memory interface
@@ -550,20 +473,16 @@ class legacy_memory_device_base : public legacy_device_base,
{
protected:
// construction/destruction
- legacy_memory_device_base(running_machine &machine, const device_config &config);
-};
-
+ legacy_memory_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config);
+ // device overrides
+ virtual void device_config_complete();
-// ======================> legacy_nvram_device_config
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == 0) ? &m_space_config : NULL; }
-// legacy_nvram_device_config is a device_config with a nvram interface
-class legacy_nvram_device_config_base : public legacy_device_config_base,
- public device_config_nvram_interface
-{
-protected:
- // construction/destruction
- legacy_nvram_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config);
+ // internal state
+ address_space_config m_space_config;
};
@@ -576,7 +495,7 @@ class legacy_nvram_device_base : public legacy_device_base,
{
protected:
// construction/destruction
- legacy_nvram_device_base(running_machine &machine, const device_config &config);
+ legacy_nvram_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config);
// device_nvram_interface overrides
virtual void nvram_default();
@@ -584,16 +503,18 @@ protected:
virtual void nvram_write(emu_file &file);
};
-// ======================> legacy_image_device_config
-// legacy_image_device_config is a device_config with a image interface
-class legacy_image_device_config_base : public legacy_device_config_base,
- public device_config_image_interface
+
+// ======================> legacy_image_device
+
+// legacy_image_device is a legacy_device_base with a image interface
+class legacy_image_device_base : public legacy_device_base,
+ public device_image_interface
{
public:
virtual iodevice_t image_type() const { return m_type; }
virtual const char *image_type_name() const { return device_typename(m_type); }
- virtual iodevice_t image_type_direct() const { return static_cast<iodevice_t>(get_legacy_config_int(DEVINFO_INT_IMAGE_TYPE)); }
+ virtual iodevice_t image_type_direct() const { return static_cast<iodevice_t>(get_legacy_int(DEVINFO_INT_IMAGE_TYPE)); }
virtual bool is_readable() const { return m_readable; }
virtual bool is_writeable() const { return m_writeable; }
virtual bool is_creatable() const { return m_creatable; }
@@ -608,12 +529,24 @@ public:
virtual const option_guide *create_option_guide() const { return m_create_option_guide; }
virtual image_device_format *formatlist() const { return m_formatlist; }
virtual device_image_partialhash_func get_partial_hash() const;
-protected:
- // construction/destruction
- legacy_image_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config);
- virtual ~legacy_image_device_config_base();
- // device_config overrides
+ virtual bool load(const char *path);
+ virtual bool finish_load();
+ virtual void unload();
+ virtual bool create(const char *path, const image_device_format *create_format, option_resolution *create_args);
+ virtual bool load_software(char *swlist, char *swname, rom_entry *entry);
+
+ virtual int call_load();
+ virtual bool call_softlist_load(char *swlist, char *swname, rom_entry *start_entry);
+ virtual int call_create(int format_type, option_resolution *format_options);
+ virtual void call_unload();
+ virtual void call_display();
+ virtual void call_display_info();
+ virtual device_image_partialhash_func get_partial_hash();
+ virtual void call_get_devices();
+ virtual void *get_device_specific_call();
+protected:
+ // device overrides
virtual void device_config_complete();
iodevice_t m_type;
@@ -631,34 +564,10 @@ protected:
/* creation info */
const option_guide *m_create_option_guide;
image_device_format *m_formatlist;
-};
-
-
-// ======================> legacy_image_device
-// legacy_image_device is a legacy_device_base with a image interface
-class legacy_image_device_base : public legacy_device_base,
- public device_image_interface
-{
-public:
- virtual bool load(const char *path);
- virtual bool finish_load();
- virtual void unload();
- virtual bool create(const char *path, const image_device_format *create_format, option_resolution *create_args);
- virtual bool load_software(char *swlist, char *swname, rom_entry *entry);
-
- virtual int call_load();
- virtual bool call_softlist_load(char *swlist, char *swname, rom_entry *start_entry);
- virtual int call_create(int format_type, option_resolution *format_options);
- virtual void call_unload();
- virtual void call_display();
- virtual void call_display_info();
- virtual device_image_partialhash_func get_partial_hash();
- virtual void call_get_devices();
- virtual void *get_device_specific_call();
-protected:
// construction/destruction
- legacy_image_device_base(running_machine &machine, const device_config &config);
+ legacy_image_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config);
+ ~legacy_image_device_base();
// device_image_interface overrides
bool load_internal(const char *path, bool is_create, int create_format, option_resolution *create_args);
void determine_open_plan(int is_create, UINT32 *open_plan);
@@ -670,6 +579,4 @@ protected:
};
-
-
#endif /* __DEVLEGCY_H__ */
diff --git a/src/emu/didisasm.c b/src/emu/didisasm.c
index 0d312a6f4aa..0ea48b8b3d0 100644
--- a/src/emu/didisasm.c
+++ b/src/emu/didisasm.c
@@ -41,30 +41,6 @@
//**************************************************************************
-// DEVICE CONFIG DISASM INTERFACE
-//**************************************************************************
-
-//-------------------------------------------------
-// device_config_disasm_interface - constructor
-//-------------------------------------------------
-
-device_config_disasm_interface::device_config_disasm_interface(const machine_config &mconfig, device_config &devconfig)
- : device_config_interface(mconfig, devconfig)
-{
-}
-
-
-//-------------------------------------------------
-// ~device_config_disasm_interface - destructor
-//-------------------------------------------------
-
-device_config_disasm_interface::~device_config_disasm_interface()
-{
-}
-
-
-
-//**************************************************************************
// DEVICE DISASM INTERFACE
//**************************************************************************
@@ -72,9 +48,8 @@ device_config_disasm_interface::~device_config_disasm_interface()
// device_disasm_interface - constructor
//-------------------------------------------------
-device_disasm_interface::device_disasm_interface(running_machine &machine, const device_config &config, device_t &device)
- : device_interface(machine, config, device),
- m_disasm_config(dynamic_cast<const device_config_disasm_interface &>(config))
+device_disasm_interface::device_disasm_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device)
{
}
diff --git a/src/emu/didisasm.h b/src/emu/didisasm.h
index 30ca1e389ad..f6debcb4cdf 100644
--- a/src/emu/didisasm.h
+++ b/src/emu/didisasm.h
@@ -74,28 +74,6 @@ const UINT32 DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain the ac
//**************************************************************************
-// ======================> device_config_disasm_interface
-
-// class representing interface-specific configuration disasm
-class device_config_disasm_interface : public device_config_interface
-{
-public:
- // construction/destruction
- device_config_disasm_interface(const machine_config &mconfig, device_config &device);
- virtual ~device_config_disasm_interface();
-
- // required configuration overrides
- UINT32 min_opcode_bytes() const { return disasm_min_opcode_bytes(); }
- UINT32 max_opcode_bytes() const { return disasm_max_opcode_bytes(); }
-
-protected:
- // required configuration overrides
- virtual UINT32 disasm_min_opcode_bytes() const = 0;
- virtual UINT32 disasm_max_opcode_bytes() const = 0;
-};
-
-
-
// ======================> device_disasm_interface
// class representing interface-specific live disasm
@@ -103,22 +81,21 @@ class device_disasm_interface : public device_interface
{
public:
// construction/destruction
- device_disasm_interface(running_machine &machine, const device_config &config, device_t &device);
+ device_disasm_interface(const machine_config &mconfig, device_t &device);
virtual ~device_disasm_interface();
// configuration access
- const device_config_disasm_interface &disasm_config() const { return m_disasm_config; }
- UINT32 min_opcode_bytes() const { return m_disasm_config.min_opcode_bytes(); }
- UINT32 max_opcode_bytes() const { return m_disasm_config.max_opcode_bytes(); }
+ UINT32 min_opcode_bytes() const { return disasm_min_opcode_bytes(); }
+ UINT32 max_opcode_bytes() const { return disasm_max_opcode_bytes(); }
// interface for disassembly
offs_t disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options = 0) { return disasm_disassemble(buffer, pc, oprom, opram, options); }
protected:
// required operation overrides
+ virtual UINT32 disasm_min_opcode_bytes() const = 0;
+ virtual UINT32 disasm_max_opcode_bytes() const = 0;
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) = 0;
-
- const device_config_disasm_interface & m_disasm_config; // reference to configuration data
};
diff --git a/src/emu/diexec.c b/src/emu/diexec.c
index d5c7b295d5c..4d1dc501058 100644
--- a/src/emu/diexec.c
+++ b/src/emu/diexec.c
@@ -68,26 +68,50 @@ const int TRIGGER_SUSPENDTIME = -4000;
//**************************************************************************
//-------------------------------------------------
-// device_config_execute_interface - constructor
+// device_execute_interface - constructor
//-------------------------------------------------
-device_config_execute_interface::device_config_execute_interface(const machine_config &mconfig, device_config &devconfig)
- : device_config_interface(mconfig, devconfig),
+device_execute_interface::device_execute_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device),
m_disabled(false),
m_vblank_interrupt(NULL),
m_vblank_interrupts_per_frame(0),
m_vblank_interrupt_screen(NULL),
m_timed_interrupt(NULL),
- m_timed_interrupt_period(attotime::zero)
+ m_timed_interrupt_period(attotime::zero),
+ m_nextexec(NULL),
+ m_driver_irq(0),
+ m_timedint_timer(NULL),
+ m_iloops(0),
+ m_partial_frame_timer(NULL),
+ m_profiler(PROFILER_IDLE),
+ m_icountptr(NULL),
+ m_cycles_running(0),
+ m_cycles_stolen(0),
+ m_suspend(0),
+ m_nextsuspend(0),
+ m_eatcycles(0),
+ m_nexteatcycles(0),
+ m_trigger(0),
+ m_inttrigger(0),
+ m_totalcycles(0),
+ m_divisor(0),
+ m_divshift(0),
+ m_cycles_per_second(0),
+ m_attoseconds_per_cycle(0)
{
+ memset(&m_localtime, 0, sizeof(m_localtime));
+
+ // configure the fast accessor
+ device.m_execute = this;
}
//-------------------------------------------------
-// device_config_execute_interface - destructor
+// device_execute_interface - destructor
//-------------------------------------------------
-device_config_execute_interface::~device_config_execute_interface()
+device_execute_interface::~device_execute_interface()
{
}
@@ -97,11 +121,11 @@ device_config_execute_interface::~device_config_execute_interface()
// set the disabled state of a device
//-------------------------------------------------
-void device_config_execute_interface::static_set_disable(device_config *device)
+void device_execute_interface::static_set_disable(device_t &device)
{
- device_config_execute_interface *exec = dynamic_cast<device_config_execute_interface *>(device);
- if (exec == NULL)
- throw emu_fatalerror("MCFG_DEVICE_DISABLE called on device '%s' with no execute interface", device->tag());
+ device_execute_interface *exec;
+ if (!device.interface(exec))
+ throw emu_fatalerror("MCFG_DEVICE_DISABLE called on device '%s' with no execute interface", device.tag());
exec->m_disabled = true;
}
@@ -111,11 +135,11 @@ void device_config_execute_interface::static_set_disable(device_config *device)
// to set up VBLANK interrupts on the device
//-------------------------------------------------
-void device_config_execute_interface::static_set_vblank_int(device_config *device, device_interrupt_func function, const char *tag, int rate)
+void device_execute_interface::static_set_vblank_int(device_t &device, device_interrupt_func function, const char *tag, int rate)
{
- device_config_execute_interface *exec = dynamic_cast<device_config_execute_interface *>(device);
- if (exec == NULL)
- throw emu_fatalerror("MCFG_DEVICE_VBLANK_INT called on device '%s' with no execute interface", device->tag());
+ device_execute_interface *exec;
+ if (!device.interface(exec))
+ throw emu_fatalerror("MCFG_DEVICE_VBLANK_INT called on device '%s' with no execute interface", device.tag());
exec->m_vblank_interrupt = function;
exec->m_vblank_interrupts_per_frame = rate;
exec->m_vblank_interrupt_screen = tag;
@@ -127,187 +151,17 @@ void device_config_execute_interface::static_set_vblank_int(device_config *devic
// to set up periodic interrupts on the device
//-------------------------------------------------
-void device_config_execute_interface::static_set_periodic_int(device_config *device, device_interrupt_func function, attotime rate)
+void device_execute_interface::static_set_periodic_int(device_t &device, device_interrupt_func function, attotime rate)
{
- device_config_execute_interface *exec = dynamic_cast<device_config_execute_interface *>(device);
- if (exec == NULL)
- throw emu_fatalerror("MCFG_DEVICE_PERIODIC_INT called on device '%s' with no execute interface", device->tag());
+ device_execute_interface *exec;
+ if (!device.interface(exec))
+ throw emu_fatalerror("MCFG_DEVICE_PERIODIC_INT called on device '%s' with no execute interface", device.tag());
exec->m_timed_interrupt = function;
exec->m_timed_interrupt_period = rate;
}
//-------------------------------------------------
-// execute_clocks_to_cycles - convert the number
-// of clocks to cycles, rounding down if necessary
-//-------------------------------------------------
-
-UINT64 device_config_execute_interface::execute_clocks_to_cycles(UINT64 clocks) const
-{
- return clocks;
-}
-
-
-//-------------------------------------------------
-// execute_cycles_to_clocks - convert the number
-// of cycles to clocks, rounding down if necessary
-//-------------------------------------------------
-
-UINT64 device_config_execute_interface::execute_cycles_to_clocks(UINT64 cycles) const
-{
- return cycles;
-}
-
-
-//-------------------------------------------------
-// execute_min_cycles - return the smallest number
-// of cycles that a single instruction or
-// operation can take
-//-------------------------------------------------
-
-UINT32 device_config_execute_interface::execute_min_cycles() const
-{
- return 1;
-}
-
-
-//-------------------------------------------------
-// execute_max_cycles - return the maximum number
-// of cycles that a single instruction or
-// operation can take
-//-------------------------------------------------
-
-UINT32 device_config_execute_interface::execute_max_cycles() const
-{
- return 1;
-}
-
-
-//-------------------------------------------------
-// execute_input_lines - return the total number
-// of input lines for the device
-//-------------------------------------------------
-
-UINT32 device_config_execute_interface::execute_input_lines() const
-{
- return 0;
-}
-
-
-//-------------------------------------------------
-// execute_default_irq_vector - return the default
-// IRQ vector when an acknowledge is processed
-//-------------------------------------------------
-
-UINT32 device_config_execute_interface::execute_default_irq_vector() const
-{
- return 0;
-}
-
-
-//-------------------------------------------------
-// interface_validity_check - validation for a
-// device after the configuration has been
-// constructed
-//-------------------------------------------------
-
-bool device_config_execute_interface::interface_validity_check(emu_options &options, const game_driver &driver) const
-{
- const device_config *devconfig = crosscast<const device_config *>(this);
- bool error = false;
-
- /* validate the interrupts */
- if (m_vblank_interrupt != NULL)
- {
- if (m_machine_config.m_devicelist.count(SCREEN) == 0)
- {
- mame_printf_error("%s: %s device '%s' has a VBLANK interrupt, but the driver is screenless!\n", driver.source_file, driver.name, devconfig->tag());
- error = true;
- }
- else if (m_vblank_interrupt_screen != NULL && m_vblank_interrupts_per_frame != 0)
- {
- mame_printf_error("%s: %s device '%s' has a new VBLANK interrupt handler with >1 interrupts!\n", driver.source_file, driver.name, devconfig->tag());
- error = true;
- }
- else if (m_vblank_interrupt_screen != NULL && m_machine_config.m_devicelist.find(m_vblank_interrupt_screen) == NULL)
- {
- mame_printf_error("%s: %s device '%s' VBLANK interrupt with a non-existant screen tag (%s)!\n", driver.source_file, driver.name, devconfig->tag(), m_vblank_interrupt_screen);
- error = true;
- }
- else if (m_vblank_interrupt_screen == NULL && m_vblank_interrupts_per_frame == 0)
- {
- mame_printf_error("%s: %s device '%s' has a VBLANK interrupt handler with 0 interrupts!\n", driver.source_file, driver.name, devconfig->tag());
- error = true;
- }
- }
- else if (m_vblank_interrupts_per_frame != 0)
- {
- mame_printf_error("%s: %s device '%s' has no VBLANK interrupt handler but a non-0 interrupt count is given!\n", driver.source_file, driver.name, devconfig->tag());
- error = true;
- }
-
- if (m_timed_interrupt != NULL && m_timed_interrupt_period == attotime::zero)
- {
- mame_printf_error("%s: %s device '%s' has a timer interrupt handler with 0 period!\n", driver.source_file, driver.name, devconfig->tag());
- error = true;
- }
- else if (m_timed_interrupt == NULL && m_timed_interrupt_period != attotime::zero)
- {
- mame_printf_error("%s: %s device '%s' has a no timer interrupt handler but has a non-0 period given!\n", driver.source_file, driver.name, devconfig->tag());
- error = true;
- }
-
- return error;
-}
-
-
-
-//**************************************************************************
-// EXECUTING DEVICE MANAGEMENT
-//**************************************************************************
-
-//-------------------------------------------------
-// device_execute_interface - constructor
-//-------------------------------------------------
-
-device_execute_interface::device_execute_interface(running_machine &machine, const device_config &config, device_t &device)
- : device_interface(machine, config, device),
- m_execute_config(dynamic_cast<const device_config_execute_interface &>(config)),
- m_nextexec(NULL),
- m_driver_irq(0),
- m_timedint_timer(NULL),
- m_iloops(0),
- m_partial_frame_timer(NULL),
- m_profiler(PROFILER_IDLE),
- m_icountptr(NULL),
- m_cycles_running(0),
- m_cycles_stolen(0),
- m_suspend(0),
- m_nextsuspend(0),
- m_eatcycles(0),
- m_nexteatcycles(0),
- m_trigger(0),
- m_inttrigger(0),
- m_totalcycles(0),
- m_divisor(0),
- m_divshift(0),
- m_cycles_per_second(0),
- m_attoseconds_per_cycle(0)
-{
- memset(&m_localtime, 0, sizeof(m_localtime));
-}
-
-
-//-------------------------------------------------
-// ~device_execute_interface - destructor
-//-------------------------------------------------
-
-device_execute_interface::~device_execute_interface()
-{
-}
-
-
-//-------------------------------------------------
// executing - return true if this device is
// within its execute function
//-------------------------------------------------
@@ -430,7 +284,7 @@ if (TEMPLOG) printf("resume %s (%X)\n", device().tag(), reason);
//-------------------------------------------------
-// spinuntil_time - burn cycles for a specific
+// spin_until_time - burn cycles for a specific
// period of time
//-------------------------------------------------
@@ -517,6 +371,74 @@ UINT64 device_execute_interface::total_cycles() const
//-------------------------------------------------
+// execute_clocks_to_cycles - convert the number
+// of clocks to cycles, rounding down if necessary
+//-------------------------------------------------
+
+UINT64 device_execute_interface::execute_clocks_to_cycles(UINT64 clocks) const
+{
+ return clocks;
+}
+
+
+//-------------------------------------------------
+// execute_cycles_to_clocks - convert the number
+// of cycles to clocks, rounding down if necessary
+//-------------------------------------------------
+
+UINT64 device_execute_interface::execute_cycles_to_clocks(UINT64 cycles) const
+{
+ return cycles;
+}
+
+
+//-------------------------------------------------
+// execute_min_cycles - return the smallest number
+// of cycles that a single instruction or
+// operation can take
+//-------------------------------------------------
+
+UINT32 device_execute_interface::execute_min_cycles() const
+{
+ return 1;
+}
+
+
+//-------------------------------------------------
+// execute_max_cycles - return the maximum number
+// of cycles that a single instruction or
+// operation can take
+//-------------------------------------------------
+
+UINT32 device_execute_interface::execute_max_cycles() const
+{
+ return 1;
+}
+
+
+//-------------------------------------------------
+// execute_input_lines - return the total number
+// of input lines for the device
+//-------------------------------------------------
+
+UINT32 device_execute_interface::execute_input_lines() const
+{
+ return 0;
+}
+
+
+//-------------------------------------------------
+// execute_default_irq_vector - return the default
+// IRQ vector when an acknowledge is processed
+//-------------------------------------------------
+
+UINT32 device_execute_interface::execute_default_irq_vector() const
+{
+ return 0;
+}
+
+
+//-------------------------------------------------
// execute_burn - called after we consume a bunch
// of cycles for artifical reasons (such as
// spinning devices for performance optimization)
@@ -540,6 +462,61 @@ void device_execute_interface::execute_set_input(int linenum, int state)
//-------------------------------------------------
+// interface_validity_check - validation for a
+// device after the configuration has been
+// constructed
+//-------------------------------------------------
+
+bool device_execute_interface::interface_validity_check(emu_options &options, const game_driver &driver) const
+{
+ bool error = false;
+
+ /* validate the interrupts */
+ if (m_vblank_interrupt != NULL)
+ {
+ if (device().mconfig().devicelist().count(SCREEN) == 0)
+ {
+ mame_printf_error("%s: %s device '%s' has a VBLANK interrupt, but the driver is screenless!\n", driver.source_file, driver.name, device().tag());
+ error = true;
+ }
+ else if (m_vblank_interrupt_screen != NULL && m_vblank_interrupts_per_frame != 0)
+ {
+ mame_printf_error("%s: %s device '%s' has a new VBLANK interrupt handler with >1 interrupts!\n", driver.source_file, driver.name, device().tag());
+ error = true;
+ }
+ else if (m_vblank_interrupt_screen != NULL && device().mconfig().devicelist().find(m_vblank_interrupt_screen) == NULL)
+ {
+ mame_printf_error("%s: %s device '%s' VBLANK interrupt with a non-existant screen tag (%s)!\n", driver.source_file, driver.name, device().tag(), m_vblank_interrupt_screen);
+ error = true;
+ }
+ else if (m_vblank_interrupt_screen == NULL && m_vblank_interrupts_per_frame == 0)
+ {
+ mame_printf_error("%s: %s device '%s' has a VBLANK interrupt handler with 0 interrupts!\n", driver.source_file, driver.name, device().tag());
+ error = true;
+ }
+ }
+ else if (m_vblank_interrupts_per_frame != 0)
+ {
+ mame_printf_error("%s: %s device '%s' has no VBLANK interrupt handler but a non-0 interrupt count is given!\n", driver.source_file, driver.name, device().tag());
+ error = true;
+ }
+
+ if (m_timed_interrupt != NULL && m_timed_interrupt_period == attotime::zero)
+ {
+ mame_printf_error("%s: %s device '%s' has a timer interrupt handler with 0 period!\n", driver.source_file, driver.name, device().tag());
+ error = true;
+ }
+ else if (m_timed_interrupt == NULL && m_timed_interrupt_period != attotime::zero)
+ {
+ mame_printf_error("%s: %s device '%s' has a no timer interrupt handler but has a non-0 period given!\n", driver.source_file, driver.name, device().tag());
+ error = true;
+ }
+
+ return error;
+}
+
+
+//-------------------------------------------------
// interface_pre_start - work to be done prior to
// actually starting a device
//-------------------------------------------------
@@ -547,7 +524,7 @@ void device_execute_interface::execute_set_input(int linenum, int state)
void device_execute_interface::interface_pre_start()
{
// fill in the initial states
- int index = device().machine().m_devicelist.indexof(m_device);
+ int index = device().machine().devicelist().indexof(m_device);
m_suspend = SUSPEND_REASON_RESET;
m_profiler = profile_type(index + PROFILER_DEVICE_FIRST);
m_inttrigger = index + TRIGGER_INT;
@@ -557,9 +534,9 @@ void device_execute_interface::interface_pre_start()
m_input[line].start(this, line);
// allocate timers if we need them
- if (m_execute_config.m_vblank_interrupts_per_frame > 1)
+ if (m_vblank_interrupts_per_frame > 1)
m_partial_frame_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_partial_frame_interrupt), (void *)this);
- if (m_execute_config.m_timed_interrupt_period != attotime::zero)
+ if (m_timed_interrupt_period != attotime::zero)
m_timedint_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this);
// register for save states
@@ -597,7 +574,7 @@ void device_execute_interface::interface_pre_reset()
m_totalcycles = 0;
// enable all devices (except for disabled devices)
- if (!m_execute_config.disabled())
+ if (!disabled())
resume(SUSPEND_ANY_REASON);
else
suspend(SUSPEND_REASON_DISABLE, true);
@@ -616,14 +593,14 @@ void device_execute_interface::interface_post_reset()
m_input[line].reset();
// reconfingure VBLANK interrupts
- if (m_execute_config.m_vblank_interrupts_per_frame > 0 || m_execute_config.m_vblank_interrupt_screen != NULL)
+ if (m_vblank_interrupts_per_frame > 0 || m_vblank_interrupt_screen != NULL)
{
// get the screen that will trigger the VBLANK
// new style - use screen tag directly
screen_device *screen;
- if (m_execute_config.m_vblank_interrupt_screen != NULL)
- screen = downcast<screen_device *>(device().machine().device(m_execute_config.m_vblank_interrupt_screen));
+ if (m_vblank_interrupt_screen != NULL)
+ screen = downcast<screen_device *>(device().machine().device(m_vblank_interrupt_screen));
// old style 'hack' setup - use screen #0
else
@@ -634,9 +611,9 @@ void device_execute_interface::interface_post_reset()
}
// reconfigure periodic interrupts
- if (m_execute_config.m_timed_interrupt_period != attotime::zero)
+ if (m_timed_interrupt_period != attotime::zero)
{
- attotime timedint_period = m_execute_config.m_timed_interrupt_period;
+ attotime timedint_period = m_timed_interrupt_period;
assert(m_timedint_timer != NULL);
m_timedint_timer->adjust(timedint_period, 0, timedint_period);
}
@@ -670,8 +647,35 @@ void device_execute_interface::interface_clock_changed()
//-------------------------------------------------
-// get_minimum_quantum - return the minimum
-// quantum required for this device
+// static_standard_irq_callback - IRQ acknowledge
+// callback; handles HOLD_LINE case and signals
+// to the debugger
+//-------------------------------------------------
+
+IRQ_CALLBACK( device_execute_interface::static_standard_irq_callback )
+{
+ return device_execute(device)->standard_irq_callback(irqline);
+}
+
+int device_execute_interface::standard_irq_callback(int irqline)
+{
+ // get the default vector and acknowledge the interrupt if needed
+ int vector = m_input[irqline].default_irq_callback();
+ LOG(("static_standard_irq_callback('%s', %d) $%04x\n", m_device.tag(), irqline, vector));
+
+ // if there's a driver callback, run it to get the vector
+ if (m_driver_irq != NULL)
+ vector = (*m_driver_irq)(&m_device, irqline);
+
+ // notify the debugger
+ debugger_interrupt_hook(&m_device, irqline);
+ return vector;
+}
+
+
+//-------------------------------------------------
+// minimum_quantum - return the minimum quantum
+// required for this device
//-------------------------------------------------
attoseconds_t device_execute_interface::minimum_quantum() const
@@ -709,7 +713,7 @@ void device_execute_interface::static_on_vblank(screen_device &screen, void *par
if (vblank_state)
{
device_execute_interface *exec = NULL;
- for (bool gotone = screen.machine().m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = screen.machine().devicelist().first(exec); gotone; gotone = exec->next(exec))
exec->on_vblank_start(screen);
}
}
@@ -724,23 +728,23 @@ void device_execute_interface::on_vblank_start(screen_device &screen)
// the hack style VBLANK decleration always uses the first screen
bool interested = false;
- if (m_execute_config.m_vblank_interrupts_per_frame > 1)
+ if (m_vblank_interrupts_per_frame > 1)
interested = true;
// for new style declaration, we need to compare the tags
- else if (m_execute_config.m_vblank_interrupt_screen != NULL)
- interested = (strcmp(screen.tag(), m_execute_config.m_vblank_interrupt_screen) == 0);
+ else if (m_vblank_interrupt_screen != NULL)
+ interested = (strcmp(screen.tag(), m_vblank_interrupt_screen) == 0);
// if interested, call the interrupt handler
if (interested)
{
if (!suspended(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
- (*m_execute_config.m_vblank_interrupt)(&m_device);
+ (*m_vblank_interrupt)(&m_device);
// if we have more than one interrupt per frame, start the timer now to trigger the rest of them
- if (m_execute_config.m_vblank_interrupts_per_frame > 1 && !suspended(SUSPEND_REASON_DISABLE))
+ if (m_vblank_interrupts_per_frame > 1 && !suspended(SUSPEND_REASON_DISABLE))
{
- m_partial_frame_period = device().machine().primary_screen->frame_period() / m_execute_config.m_vblank_interrupts_per_frame;
+ m_partial_frame_period = device().machine().primary_screen->frame_period() / m_vblank_interrupts_per_frame;
m_partial_frame_timer->adjust(m_partial_frame_period);
}
}
@@ -761,14 +765,14 @@ void device_execute_interface::trigger_partial_frame_interrupt()
{
// when we hit 0, reset to the total count
if (m_iloops == 0)
- m_iloops = m_execute_config.m_vblank_interrupts_per_frame;
+ m_iloops = m_vblank_interrupts_per_frame;
// count one more "iloop"
m_iloops--;
// call the interrupt handler if we're not suspended
if (!suspended(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
- (*m_execute_config.m_vblank_interrupt)(&m_device);
+ (*m_vblank_interrupt)(&m_device);
// set up to retrigger if there's more interrupts to generate
if (m_iloops > 1)
@@ -789,35 +793,8 @@ TIMER_CALLBACK( device_execute_interface::static_trigger_periodic_interrupt )
void device_execute_interface::trigger_periodic_interrupt()
{
// bail if there is no routine
- if (m_execute_config.m_timed_interrupt != NULL && !suspended(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
- (*m_execute_config.m_timed_interrupt)(&m_device);
-}
-
-
-//-------------------------------------------------
-// static_standard_irq_callback - IRQ acknowledge
-// callback; handles HOLD_LINE case and signals
-// to the debugger
-//-------------------------------------------------
-
-IRQ_CALLBACK( device_execute_interface::static_standard_irq_callback )
-{
- return device_execute(device)->standard_irq_callback(irqline);
-}
-
-int device_execute_interface::standard_irq_callback(int irqline)
-{
- // get the default vector and acknowledge the interrupt if needed
- int vector = m_input[irqline].default_irq_callback();
- LOG(("static_standard_irq_callback('%s', %d) $%04x\n", m_device.tag(), irqline, vector));
-
- // if there's a driver callback, run it to get the vector
- if (m_driver_irq != NULL)
- vector = (*m_driver_irq)(&m_device, irqline);
-
- // notify the debugger
- debugger_interrupt_hook(&m_device, irqline);
- return vector;
+ if (m_timed_interrupt != NULL && !suspended(SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
+ (*m_timed_interrupt)(&m_device);
}
diff --git a/src/emu/diexec.h b/src/emu/diexec.h
index db1fc83643f..57e172bfed8 100644
--- a/src/emu/diexec.h
+++ b/src/emu/diexec.h
@@ -109,13 +109,13 @@ enum
//**************************************************************************
#define MCFG_DEVICE_DISABLE() \
- device_config_execute_interface::static_set_disable(device); \
+ device_execute_interface::static_set_disable(*device); \
#define MCFG_DEVICE_VBLANK_INT(_tag, _func) \
- device_config_execute_interface::static_set_vblank_int(device, _func, _tag); \
+ device_execute_interface::static_set_vblank_int(*device, _func, _tag); \
#define MCFG_DEVICE_PERIODIC_INT(_func, _rate) \
- device_config_execute_interface::static_set_periodic_int(device, _func, attotime::from_hz(_rate)); \
+ device_execute_interface::static_set_periodic_int(*device, _func, attotime::from_hz(_rate)); \
@@ -135,76 +135,32 @@ typedef int (*device_irq_callback)(device_t *device, int irqnum);
-// ======================> device_config_execute_interface
+// ======================> device_execute_interface
-// class representing interface-specific configuration state
-class device_config_execute_interface : public device_config_interface
+class device_execute_interface : public device_interface
{
- friend class device_execute_interface;
+ friend class device_scheduler;
public:
// construction/destruction
- device_config_execute_interface(const machine_config &mconfig, device_config &devconfig);
- virtual ~device_config_execute_interface();
+ device_execute_interface(const machine_config &mconfig, device_t &device);
+ virtual ~device_execute_interface();
- // basic information getters
+ // configuration access
bool disabled() const { return m_disabled; }
-
- // clock and cycle information getters
UINT64 clocks_to_cycles(UINT64 clocks) const { return execute_clocks_to_cycles(clocks); }
UINT64 cycles_to_clocks(UINT64 cycles) const { return execute_cycles_to_clocks(cycles); }
UINT32 min_cycles() const { return execute_min_cycles(); }
UINT32 max_cycles() const { return execute_max_cycles(); }
-
- // input line information getters
+ attotime cycles_to_attotime(UINT64 cycles) const { return device().clocks_to_attotime(cycles_to_clocks(cycles)); }
+ UINT64 attotime_to_cycles(attotime duration) const { return clocks_to_cycles(device().attotime_to_clocks(duration)); }
UINT32 input_lines() const { return execute_input_lines(); }
UINT32 default_irq_vector() const { return execute_default_irq_vector(); }
- // static inline helpers
- static void static_set_disable(device_config *device);
- static void static_set_vblank_int(device_config *device, device_interrupt_func function, const char *tag, int rate = 0);
- static void static_set_periodic_int(device_config *device, device_interrupt_func function, attotime rate);
-
-protected:
- // clock and cycle information getters
- virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const;
- virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const;
- virtual UINT32 execute_min_cycles() const;
- virtual UINT32 execute_max_cycles() const;
-
- // input line information getters
- virtual UINT32 execute_input_lines() const;
- virtual UINT32 execute_default_irq_vector() const;
-
- // optional operation overrides
- virtual bool interface_validity_check(emu_options &options, const game_driver &driver) const;
-
- bool m_disabled;
- device_interrupt_func m_vblank_interrupt; // for interrupts tied to VBLANK
- int m_vblank_interrupts_per_frame; // usually 1
- const char * m_vblank_interrupt_screen; // the screen that causes the VBLANK interrupt
- device_interrupt_func m_timed_interrupt; // for interrupts not tied to VBLANK
- attotime m_timed_interrupt_period; // period for periodic interrupts
-};
-
-
-
-// ======================> device_execute_interface
-
-class device_execute_interface : public device_interface
-{
- friend class device_scheduler;
-
-public:
- // construction/destruction
- device_execute_interface(running_machine &machine, const device_config &config, device_t &device);
- virtual ~device_execute_interface();
-
- // configuration access
- const device_config_execute_interface &execute_config() const { return m_execute_config; }
-
- // basic information getters
- bool disabled() const { return m_execute_config.disabled(); }
+ // static inline configuration helpers
+ static void static_set_disable(device_t &device);
+ static void static_set_vblank_int(device_t &device, device_interrupt_func function, const char *tag, int rate = 0);
+ static void static_set_periodic_int(device_t &device, device_interrupt_func function, attotime rate);
// execution management
bool executing() const;
@@ -242,28 +198,27 @@ public:
attotime local_time() const;
UINT64 total_cycles() const;
- // clock and cycle information getters ... pass through to underlying config
- UINT64 clocks_to_cycles(UINT64 clocks) const { return m_execute_config.clocks_to_cycles(clocks); }
- UINT64 cycles_to_clocks(UINT64 cycles) const { return m_execute_config.cycles_to_clocks(cycles); }
- UINT32 min_cycles() const { return m_execute_config.min_cycles(); }
- UINT32 max_cycles() const { return m_execute_config.max_cycles(); }
- attotime cycles_to_attotime(UINT64 cycles) const { return device().clocks_to_attotime(cycles_to_clocks(cycles)); }
- UINT64 attotime_to_cycles(attotime duration) const { return clocks_to_cycles(device().attotime_to_clocks(duration)); }
-
- // input line information getters
- UINT32 input_lines() const { return m_execute_config.input_lines(); }
- UINT32 default_irq_vector() const { return m_execute_config.default_irq_vector(); }
-
// required operation overrides
void run() { execute_run(); }
protected:
+ // clock and cycle information getters
+ virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const;
+ virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const;
+ virtual UINT32 execute_min_cycles() const;
+ virtual UINT32 execute_max_cycles() const;
+
+ // input line information getters
+ virtual UINT32 execute_input_lines() const;
+ virtual UINT32 execute_default_irq_vector() const;
+
// optional operation overrides
virtual void execute_run() = 0;
virtual void execute_burn(INT32 cycles);
virtual void execute_set_input(int linenum, int state);
// interface-level overrides
+ virtual bool interface_validity_check(emu_options &options, const game_driver &driver) const;
virtual void interface_pre_start();
virtual void interface_post_start();
virtual void interface_pre_reset();
@@ -305,7 +260,12 @@ protected:
};
// configuration
- const device_config_execute_interface &m_execute_config; // reference to our device_config_execute_interface
+ bool m_disabled; // disabled from executing?
+ device_interrupt_func m_vblank_interrupt; // for interrupts tied to VBLANK
+ int m_vblank_interrupts_per_frame; // usually 1
+ const char * m_vblank_interrupt_screen; // the screen that causes the VBLANK interrupt
+ device_interrupt_func m_timed_interrupt; // for interrupts not tied to VBLANK
+ attotime m_timed_interrupt_period; // period for periodic interrupts
// execution lists
device_execute_interface *m_nextexec; // pointer to the next device to execute, in order
diff --git a/src/emu/diimage.c b/src/emu/diimage.c
index d3c31bb503f..1c5d7553a51 100644
--- a/src/emu/diimage.c
+++ b/src/emu/diimage.c
@@ -46,7 +46,7 @@
//**************************************************************************
// DEVICE CONFIG IMAGE INTERFACE
//**************************************************************************
-const image_device_type_info device_config_image_interface::m_device_info_array[] =
+const image_device_type_info device_image_interface::m_device_info_array[] =
{
{ IO_CARTSLOT, "cartridge", "cart" }, /* 0 */
{ IO_FLOPPY, "floppydisk", "flop" }, /* 1 */
@@ -65,34 +65,55 @@ const image_device_type_info device_config_image_interface::m_device_info_array[
{ IO_MAGTAPE, "magtape", "magt" }, /* 14 */
};
+
+//**************************************************************************
+// DEVICE IMAGE INTERFACE
+//**************************************************************************
+
+/*-------------------------------------------------
+ memory_error - report a memory error
+-------------------------------------------------*/
+
+static void memory_error(const char *message)
+{
+ fatalerror("%s", message);
+}
+
+
//-------------------------------------------------
-// device_config_image_interface - constructor
+// device_image_interface - constructor
//-------------------------------------------------
-device_config_image_interface::device_config_image_interface(const machine_config &mconfig, device_config &devconfig)
- : device_config_interface(mconfig, devconfig)
+device_image_interface::device_image_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device),
+ m_file(NULL),
+ m_mame_file(NULL),
+ m_full_software_name(NULL),
+ m_software_info_ptr(NULL),
+ m_software_part_ptr(NULL)
{
+ m_mempool = pool_alloc_lib(memory_error);
}
//-------------------------------------------------
-// ~device_config_image_interface - destructor
+// ~device_image_interface - destructor
//-------------------------------------------------
-device_config_image_interface::~device_config_image_interface()
+device_image_interface::~device_image_interface()
{
+ pool_free_lib(m_mempool);
}
-
//-------------------------------------------------
// find_device_type - search trough list of
// device types to extact data
//-------------------------------------------------
-const image_device_type_info *device_config_image_interface::find_device_type(iodevice_t type)
+const image_device_type_info *device_image_interface::find_device_type(iodevice_t type)
{
int i;
- for (i = 0; i < ARRAY_LENGTH(device_config_image_interface::m_device_info_array); i++)
+ for (i = 0; i < ARRAY_LENGTH(device_image_interface::m_device_info_array); i++)
{
if (m_device_info_array[i].m_type == type)
return &m_device_info_array[i];
@@ -104,7 +125,7 @@ const image_device_type_info *device_config_image_interface::find_device_type(io
// device_typename - retrieves device type name
//-------------------------------------------------
-const char *device_config_image_interface::device_typename(iodevice_t type)
+const char *device_image_interface::device_typename(iodevice_t type)
{
const image_device_type_info *info = find_device_type(type);
return (info != NULL) ? info->m_name : NULL;
@@ -115,7 +136,7 @@ const char *device_config_image_interface::device_typename(iodevice_t type)
// brief type name
//-------------------------------------------------
-const char *device_config_image_interface::device_brieftypename(iodevice_t type)
+const char *device_image_interface::device_brieftypename(iodevice_t type)
{
const image_device_type_info *info = find_device_type(type);
return (info != NULL) ? info->m_shortname : NULL;
@@ -125,10 +146,10 @@ const char *device_config_image_interface::device_brieftypename(iodevice_t type)
// device_typeid - retrieves device type id
//-------------------------------------------------
-iodevice_t device_config_image_interface::device_typeid(const char *name)
+iodevice_t device_image_interface::device_typeid(const char *name)
{
int i;
- for (i = 0; i < ARRAY_LENGTH(device_config_image_interface::m_device_info_array); i++)
+ for (i = 0; i < ARRAY_LENGTH(device_image_interface::m_device_info_array); i++)
{
if (!mame_stricmp(name, m_device_info_array[i].m_name) || !mame_stricmp(name, m_device_info_array[i].m_shortname))
return m_device_info_array[i].m_type;
@@ -141,7 +162,7 @@ iodevice_t device_config_image_interface::device_typeid(const char *name)
using this device's partial hash if appropriate
-------------------------------------------------*/
-void device_config_image_interface::device_compute_hash(hash_collection &hashes, const void *data, size_t length, const char *types) const
+void device_image_interface::device_compute_hash(hash_collection &hashes, const void *data, size_t length, const char *types) const
{
/* retrieve the partial hash func */
device_image_partialhash_func partialhash = get_partial_hash();
@@ -153,47 +174,6 @@ void device_config_image_interface::device_compute_hash(hash_collection &hashes,
hashes.compute(reinterpret_cast<const UINT8 *>(data), length, types);
}
-
-//**************************************************************************
-// DEVICE IMAGE INTERFACE
-//**************************************************************************
-
-/*-------------------------------------------------
- memory_error - report a memory error
--------------------------------------------------*/
-
-static void memory_error(const char *message)
-{
- fatalerror("%s", message);
-}
-
-
-//-------------------------------------------------
-// device_image_interface - constructor
-//-------------------------------------------------
-
-device_image_interface::device_image_interface(running_machine &machine, const device_config &config, device_t &device)
- : device_interface(machine, config, device),
- m_image_config(dynamic_cast<const device_config_image_interface &>(config)),
- m_file(NULL),
- m_mame_file(NULL),
- m_full_software_name(NULL),
- m_software_info_ptr(NULL),
- m_software_part_ptr(NULL)
-{
- m_mempool = pool_alloc_lib(memory_error);
-}
-
-
-//-------------------------------------------------
-// ~device_image_interface - destructor
-//-------------------------------------------------
-
-device_image_interface::~device_image_interface()
-{
- pool_free_lib(m_mempool);
-}
-
/*-------------------------------------------------
set_image_filename - specifies the filename of
an image
@@ -201,13 +181,13 @@ device_image_interface::~device_image_interface()
image_error_t device_image_interface::set_image_filename(const char *filename)
{
- m_name = filename;
+ m_image_name = filename;
zippath_parent(&m_working_directory, filename);
- m_basename = m_name.cpy(m_name);
+ m_basename.cpy(m_image_name);
- int loc1 = m_name.rchr(0,'\\');
- int loc2 = m_name.rchr(0,'/');
- int loc3 = m_name.rchr(0,':');
+ int loc1 = m_image_name.rchr(0,'\\');
+ int loc2 = m_image_name.rchr(0,'/');
+ int loc3 = m_image_name.rchr(0,':');
int loc = MAX(loc1,MAX(loc2,loc3));
if (loc!=-1) {
m_basename = m_basename.substr(loc + 1,m_basename.len()-loc);
@@ -540,7 +520,7 @@ void device_image_interface::image_checkhash()
{
/* do not cause a linear read of 600 megs please */
/* TODO: use SHA/MD5 in the CHD header as the hash */
- if (m_image_config.image_type() == IO_CDROM)
+ if (image_type() == IO_CDROM)
return;
/* Skip calculating the hash when we have an image mounted through a software list */
diff --git a/src/emu/diimage.h b/src/emu/diimage.h
index afbd2ccef9f..caa4084d6d3 100644
--- a/src/emu/diimage.h
+++ b/src/emu/diimage.h
@@ -148,18 +148,18 @@ typedef void (*device_image_display_info_func)(device_image_interface &image);
#define DEVICE_IMAGE_SOFTLIST_LOAD_NAME(name) device_softlist_load_##name
#define DEVICE_IMAGE_SOFTLIST_LOAD(name) bool DEVICE_IMAGE_SOFTLIST_LOAD_NAME(name)(device_image_interface &image, char *swlist, char *swname, rom_entry *start_entry)
-// ======================> device_config_image_interface
-// class representing interface-specific configuration image
-class device_config_image_interface : public device_config_interface
+
+// ======================> device_image_interface
+
+// class representing interface-specific live image
+class device_image_interface : public device_interface
{
- friend class device_image_interface;
public:
// construction/destruction
- device_config_image_interface(const machine_config &mconfig, device_config &device);
- virtual ~device_config_image_interface();
+ device_image_interface(const machine_config &mconfig, device_t &device);
+ virtual ~device_image_interface();
- // public accessors... for now
virtual iodevice_t image_type() const = 0;
virtual const char *image_type_name() const = 0;
virtual iodevice_t image_type_direct() const = 0;
@@ -183,23 +183,6 @@ public:
virtual device_image_partialhash_func get_partial_hash() const = 0;
virtual void device_compute_hash(hash_collection &hashes, const void *data, size_t length, const char *types) const;
-protected:
- static const image_device_type_info *find_device_type(iodevice_t type);
- static const image_device_type_info m_device_info_array[];
-};
-
-
-
-// ======================> device_image_interface
-
-// class representing interface-specific live image
-class device_image_interface : public device_interface
-{
- friend class device_config_image_interface;
-public:
- // construction/destruction
- device_image_interface(running_machine &machine, const device_config &config, device_t &device);
- virtual ~device_image_interface();
virtual bool load(const char *path) = 0;
virtual bool finish_load() = 0;
@@ -212,14 +195,13 @@ public:
virtual void call_unload() = 0;
virtual void call_display() = 0;
virtual void call_display_info() = 0;
- virtual device_image_partialhash_func get_partial_hash() = 0;
virtual void call_get_devices() = 0;
virtual void *get_device_specific_call() = 0;
virtual const image_device_format *device_get_indexed_creatable_format(int index);
virtual const image_device_format *device_get_named_creatable_format(const char *format_name);
- const option_guide *device_get_creation_option_guide() { return m_image_config.create_option_guide(); }
- const image_device_format *device_get_creatable_formats() { return m_image_config.formatlist(); }
+ const option_guide *device_get_creation_option_guide() { return create_option_guide(); }
+ const image_device_format *device_get_creatable_formats() { return formatlist(); }
virtual bool create(const char *path, const image_device_format *create_format, option_resolution *create_args) = 0;
@@ -227,8 +209,8 @@ public:
void seterror(image_error_t err, const char *message);
void message(const char *format, ...);
- bool exists() { return m_name; }
- const char *filename() { if (!m_name) return NULL; else return m_name; }
+ bool exists() { return m_image_name; }
+ const char *filename() { if (!m_image_name) return NULL; else return m_image_name; }
const char *basename() { if (!m_basename) return NULL; else return m_basename; }
const char *basename_noext() { if (!m_basename_noext) return NULL; else return m_basename_noext; }
const char *filetype() { if (!m_filetype) return NULL; else return m_filetype; }
@@ -246,8 +228,6 @@ public:
int image_feof() { check_for_file(); return core_feof(m_file); }
void *ptr() {check_for_file(); return (void *) core_fbuffer(m_file); }
// configuration access
- const device_config_image_interface &image_config() const { return m_image_config; }
-
void set_init_phase() { m_init_phase = TRUE; }
const char* longname() { return m_longname; }
@@ -291,7 +271,8 @@ protected:
// derived class overrides
// configuration
- const device_config_image_interface &m_image_config; // reference to our device_config_execute_interface
+ static const image_device_type_info *find_device_type(iodevice_t type);
+ static const image_device_type_info m_device_info_array[];
/* error related info */
image_error_t m_err;
@@ -300,7 +281,7 @@ protected:
/* variables that are only non-zero when an image is mounted */
core_file *m_file;
emu_file *m_mame_file;
- astring m_name;
+ astring m_image_name;
astring m_basename;
astring m_basename_noext;
astring m_filetype;
diff --git a/src/emu/dimemory.c b/src/emu/dimemory.c
index 7b9ccea2ae5..95774786bc4 100644
--- a/src/emu/dimemory.c
+++ b/src/emu/dimemory.c
@@ -107,55 +107,118 @@ address_space_config::address_space_config(const char *name, endianness_t endian
//**************************************************************************
-// MEMORY DEVICE CONFIG
+// MEMORY DEVICE MANAGEMENT
//**************************************************************************
//-------------------------------------------------
-// device_config_memory_interface - constructor
+// device_memory_interface - constructor
//-------------------------------------------------
-device_config_memory_interface::device_config_memory_interface(const machine_config &mconfig, device_config &devconfig)
- : device_config_interface(mconfig, devconfig)
+device_memory_interface::device_memory_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device)
{
- // initialize remaining members
memset(m_address_map, 0, sizeof(m_address_map));
+ memset(m_addrspace, 0, sizeof(m_addrspace));
+
+ // configure the fast accessor
+ device.m_memory = this;
}
//-------------------------------------------------
-// device_config_memory_interface - destructor
+// ~device_memory_interface - destructor
//-------------------------------------------------
-device_config_memory_interface::~device_config_memory_interface()
+device_memory_interface::~device_memory_interface()
{
}
//-------------------------------------------------
-// memory_space_config - return configuration for
-// the given space by index, or NULL if the space
-// does not exist
+// static_set_vblank_int - configuration helper
+// to set up VBLANK interrupts on the device
//-------------------------------------------------
-const address_space_config *device_config_memory_interface::memory_space_config(address_spacenum spacenum) const
+void device_memory_interface::static_set_addrmap(device_t &device, address_spacenum spacenum, address_map_constructor map)
{
- return NULL;
+ device_memory_interface *memory;
+ if (!device.interface(memory))
+ throw emu_fatalerror("MCFG_DEVICE_ADDRESS_MAP called on device '%s' with no memory interface", device.tag());
+ if (spacenum >= ARRAY_LENGTH(memory->m_address_map))
+ throw emu_fatalerror("MCFG_DEVICE_ADDRESS_MAP called with out-of-range space number %d", device.tag(), spacenum);
+ memory->m_address_map[spacenum] = map;
}
//-------------------------------------------------
-// static_set_vblank_int - configuration helper
-// to set up VBLANK interrupts on the device
+// set_address_space - connect an address space
+// to a device
//-------------------------------------------------
-void device_config_memory_interface::static_set_addrmap(device_config *device, address_spacenum spacenum, address_map_constructor map)
+void device_memory_interface::set_address_space(address_spacenum spacenum, address_space &space)
{
- device_config_memory_interface *memory = dynamic_cast<device_config_memory_interface *>(device);
- if (memory == NULL)
- throw emu_fatalerror("MCFG_DEVICE_ADDRESS_MAP called on device '%s' with no memory interface", device->tag());
- if (spacenum >= ARRAY_LENGTH(memory->m_address_map))
- throw emu_fatalerror("MCFG_DEVICE_ADDRESS_MAP called with out-of-range space number %d", device->tag(), spacenum);
- memory->m_address_map[spacenum] = map;
+ assert(spacenum < ARRAY_LENGTH(m_addrspace));
+ m_addrspace[spacenum] = &space;
+}
+
+
+//-------------------------------------------------
+// memory_translate - translate from logical to
+// phyiscal addresses; designed to be overridden
+// by the actual device implementation if address
+// translation is supported
+//-------------------------------------------------
+
+bool device_memory_interface::memory_translate(address_spacenum spacenum, int intention, offs_t &address)
+{
+ // by default it maps directly
+ return true;
+}
+
+
+//-------------------------------------------------
+// memory_read - perform internal memory
+// operations that bypass the memory system;
+// designed to be overridden by the actual device
+// implementation if internal read operations are
+// handled by bypassing the memory system
+//-------------------------------------------------
+
+bool device_memory_interface::memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value)
+{
+ // by default, we don't do anything
+ return false;
+}
+
+
+//-------------------------------------------------
+// memory_write - perform internal memory
+// operations that bypass the memory system;
+// designed to be overridden by the actual device
+// implementation if internal write operations are
+// handled by bypassing the memory system
+//-------------------------------------------------
+
+bool device_memory_interface::memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value)
+{
+ // by default, we don't do anything
+ return false;
+}
+
+
+//-------------------------------------------------
+// memory_readop - perform internal memory
+// operations that bypass the memory system;
+// designed to be overridden by the actual device
+// implementation if internal opcode fetching
+// operations are handled by bypassing the memory
+// system
+//-------------------------------------------------
+
+bool device_memory_interface::memory_readop(offs_t offset, int size, UINT64 &value)
+{
+ // by default, we don't do anything
+ return false;
}
@@ -164,9 +227,8 @@ void device_config_memory_interface::static_set_addrmap(device_config *device, a
// checks on the memory configuration
//-------------------------------------------------
-bool device_config_memory_interface::interface_validity_check(emu_options &options, const game_driver &driver) const
+bool device_memory_interface::interface_validity_check(emu_options &options, const game_driver &driver) const
{
- const device_config *devconfig = &m_device_config;
bool detected_overlap = DETECT_OVERLAPPING_MEMORY ? false : true;
bool error = false;
@@ -180,7 +242,7 @@ bool device_config_memory_interface::interface_validity_check(emu_options &optio
int alignunit = datawidth / 8;
// construct the maps
- ::address_map *map = global_alloc(::address_map(*devconfig, spacenum));
+ ::address_map *map = global_alloc(::address_map(device(), spacenum));
// if this is an empty map, just skip it
if (map->m_entrylist.first() == NULL)
@@ -192,12 +254,12 @@ bool device_config_memory_interface::interface_validity_check(emu_options &optio
// validate the global map parameters
if (map->m_spacenum != spacenum)
{
- mame_printf_error("%s: %s device '%s' space %d has address space %d handlers!\n", driver.source_file, driver.name, devconfig->tag(), spacenum, map->m_spacenum);
+ mame_printf_error("%s: %s device '%s' space %d has address space %d handlers!\n", driver.source_file, driver.name, device().tag(), spacenum, map->m_spacenum);
error = true;
}
if (map->m_databits != datawidth)
{
- 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(), spaceconfig->m_name, datawidth, map->m_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, device().tag(), spaceconfig->m_name, datawidth, map->m_databits);
error = true;
}
@@ -216,7 +278,7 @@ bool device_config_memory_interface::interface_validity_check(emu_options &optio
((entry->m_read.m_type != AMH_NONE && scan->m_read.m_type != AMH_NONE) ||
(entry->m_write.m_type != AMH_NONE && scan->m_write.m_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, devconfig->tag(), spaceconfig->m_name, entry->m_addrstart, entry->m_addrend, entry->m_read.m_type, entry->m_write.m_type, scan->m_addrstart, scan->m_addrend, scan->m_read.m_type, scan->m_write.m_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, device().tag(), spaceconfig->m_name, entry->m_addrstart, entry->m_addrend, entry->m_read.m_type, entry->m_write.m_type, scan->m_addrstart, scan->m_addrend, scan->m_read.m_type, scan->m_write.m_type);
detected_overlap = true;
break;
}
@@ -239,7 +301,7 @@ bool device_config_memory_interface::interface_validity_check(emu_options &optio
// if this is a program space, auto-assign implicit ROM entries
if (entry->m_read.m_type == AMH_ROM && entry->m_region == NULL)
{
- entry->m_region = devconfig->tag();
+ entry->m_region = device().tag();
entry->m_rgnoffs = entry->m_addrstart;
}
@@ -248,7 +310,7 @@ bool device_config_memory_interface::interface_validity_check(emu_options &optio
{
// look for the region
bool found = false;
- for (const rom_source *source = rom_first_source(m_machine_config); source != NULL && !found; source = rom_next_source(*source))
+ for (const rom_source *source = rom_first_source(device().mconfig()); source != NULL && !found; source = rom_next_source(*source))
for (const rom_entry *romp = rom_first_region(*source); !ROMENTRY_ISEND(romp) && !found; romp++)
{
const char *regiontag = ROMREGION_GETTAG(romp);
@@ -262,7 +324,7 @@ bool device_config_memory_interface::interface_validity_check(emu_options &optio
offs_t length = ROMREGION_GETLENGTH(romp);
if (entry->m_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, devconfig->tag(), spaceconfig->m_name, entry->m_addrstart, entry->m_addrend, entry->m_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, device().tag(), spaceconfig->m_name, entry->m_addrstart, entry->m_addrend, entry->m_region, length);
error = true;
}
found = true;
@@ -273,16 +335,16 @@ bool device_config_memory_interface::interface_validity_check(emu_options &optio
// error if not found
if (!found)
{
- 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(), spaceconfig->m_name, entry->m_addrstart, entry->m_addrend, entry->m_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, device().tag(), spaceconfig->m_name, entry->m_addrstart, entry->m_addrend, entry->m_region);
error = true;
}
}
// make sure all devices exist
- if ((entry->m_read.m_type == AMH_LEGACY_DEVICE_HANDLER && entry->m_read.m_tag != NULL && m_machine_config.m_devicelist.find(entry->m_read.m_tag) == NULL) ||
- (entry->m_write.m_type == AMH_LEGACY_DEVICE_HANDLER && entry->m_write.m_tag != NULL && m_machine_config.m_devicelist.find(entry->m_write.m_tag) == NULL))
+ if ((entry->m_read.m_type == AMH_LEGACY_DEVICE_HANDLER && entry->m_read.m_tag != NULL && device().mconfig().devicelist().find(entry->m_read.m_tag) == NULL) ||
+ (entry->m_write.m_type == AMH_LEGACY_DEVICE_HANDLER && entry->m_write.m_tag != NULL && device().mconfig().devicelist().find(entry->m_write.m_tag) == NULL))
{
- mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant device '%s'\n", driver.source_file, driver.name, devconfig->tag(), spaceconfig->m_name, entry->m_write.m_tag);
+ mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant device '%s'\n", driver.source_file, driver.name, device().tag(), spaceconfig->m_name, entry->m_write.m_tag);
error = true;
}
@@ -290,7 +352,7 @@ bool device_config_memory_interface::interface_validity_check(emu_options &optio
// if ((entry->m_read.m_type == AMH_PORT && entry->m_read.m_tag != NULL && portlist.find(entry->m_read.m_tag) == NULL) ||
// (entry->m_write.m_type == AMH_PORT && entry->m_write.m_tag != NULL && portlist.find(entry->m_write.m_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, devconfig->tag(), spaceconfig->m_name, entry->m_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, device().tag(), spaceconfig->m_name, entry->m_read.tag);
// error = true;
// }
@@ -309,101 +371,3 @@ bool device_config_memory_interface::interface_validity_check(emu_options &optio
}
return error;
}
-
-
-
-//**************************************************************************
-// MEMORY DEVICE MANAGEMENT
-//**************************************************************************
-
-//-------------------------------------------------
-// device_memory_interface - constructor
-//-------------------------------------------------
-
-device_memory_interface::device_memory_interface(running_machine &machine, const device_config &config, device_t &device)
- : device_interface(machine, config, device),
- m_memory_config(dynamic_cast<const device_config_memory_interface &>(config))
-{
- memset(m_addrspace, 0, sizeof(m_addrspace));
-}
-
-
-//-------------------------------------------------
-// ~device_memory_interface - destructor
-//-------------------------------------------------
-
-device_memory_interface::~device_memory_interface()
-{
-}
-
-
-//-------------------------------------------------
-// set_address_space - connect an address space
-// to a device
-//-------------------------------------------------
-
-void device_memory_interface::set_address_space(address_spacenum spacenum, address_space &space)
-{
- assert(spacenum < ARRAY_LENGTH(m_addrspace));
- m_addrspace[spacenum] = &space;
-}
-
-
-//-------------------------------------------------
-// memory_translate - translate from logical to
-// phyiscal addresses; designed to be overridden
-// by the actual device implementation if address
-// translation is supported
-//-------------------------------------------------
-
-bool device_memory_interface::memory_translate(address_spacenum spacenum, int intention, offs_t &address)
-{
- // by default it maps directly
- return true;
-}
-
-
-//-------------------------------------------------
-// memory_read - perform internal memory
-// operations that bypass the memory system;
-// designed to be overridden by the actual device
-// implementation if internal read operations are
-// handled by bypassing the memory system
-//-------------------------------------------------
-
-bool device_memory_interface::memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value)
-{
- // by default, we don't do anything
- return false;
-}
-
-
-//-------------------------------------------------
-// memory_write - perform internal memory
-// operations that bypass the memory system;
-// designed to be overridden by the actual device
-// implementation if internal write operations are
-// handled by bypassing the memory system
-//-------------------------------------------------
-
-bool device_memory_interface::memory_write(address_spacenum spacenum, offs_t offset, int size, UINT64 value)
-{
- // by default, we don't do anything
- return false;
-}
-
-
-//-------------------------------------------------
-// memory_readop - perform internal memory
-// operations that bypass the memory system;
-// designed to be overridden by the actual device
-// implementation if internal opcode fetching
-// operations are handled by bypassing the memory
-// system
-//-------------------------------------------------
-
-bool device_memory_interface::memory_readop(offs_t offset, int size, UINT64 &value)
-{
- // by default, we don't do anything
- return false;
-}
diff --git a/src/emu/dimemory.h b/src/emu/dimemory.h
index d1a9cc42d82..b0e2da346bb 100644
--- a/src/emu/dimemory.h
+++ b/src/emu/dimemory.h
@@ -73,7 +73,7 @@ const int TRANSLATE_FETCH_DEBUG = (TRANSLATE_FETCH | TRANSLATE_DEBUG_MASK);
//**************************************************************************
#define MCFG_DEVICE_ADDRESS_MAP(_space, _map) \
- device_config_memory_interface::static_set_addrmap(device, _space, ADDRESS_MAP_NAME(_map));
+ device_memory_interface::static_set_addrmap(*device, _space, ADDRESS_MAP_NAME(_map));
#define MCFG_DEVICE_PROGRAM_MAP(_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_PROGRAM, _map)
@@ -90,37 +90,6 @@ const int TRANSLATE_FETCH_DEBUG = (TRANSLATE_FETCH | TRANSLATE_DEBUG_MASK);
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> device_config_memory_interface
-
-// class representing interface-specific configuration state
-class device_config_memory_interface : public device_config_interface
-{
- friend class device_memory_interface;
-
-public:
- // construction/destruction
- device_config_memory_interface(const machine_config &mconfig, device_config &devconfig);
- virtual ~device_config_memory_interface();
-
- // basic information getters
- address_map_constructor address_map(address_spacenum spacenum = AS_0) const { return (spacenum < ARRAY_LENGTH(m_address_map)) ? m_address_map[spacenum] : NULL; }
- const address_space_config *space_config(address_spacenum spacenum = AS_0) const { return memory_space_config(spacenum); }
-
- // static inline helpers
- static void static_set_addrmap(device_config *device, address_spacenum spacenum, address_map_constructor map);
-
-protected:
- // required overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum) const = 0;
-
- // optional operation overrides
- virtual bool interface_validity_check(emu_options &options, const game_driver &driver) const;
-
- address_map_constructor m_address_map[ADDRESS_SPACES]; // address maps for each address space
-};
-
-
-
// ======================> device_memory_interface
class device_memory_interface : public device_interface
@@ -129,14 +98,17 @@ class device_memory_interface : public device_interface
public:
// construction/destruction
- device_memory_interface(running_machine &machine, const device_config &config, device_t &device);
+ device_memory_interface(const machine_config &mconfig, device_t &device);
virtual ~device_memory_interface();
// configuration access
- const device_config_memory_interface &memory_config() const { return m_memory_config; }
+ address_map_constructor address_map(address_spacenum spacenum = AS_0) const { return (spacenum < ARRAY_LENGTH(m_address_map)) ? m_address_map[spacenum] : NULL; }
+ const address_space_config *space_config(address_spacenum spacenum = AS_0) const { return memory_space_config(spacenum); }
+
+ // static inline configuration helpers
+ static void static_set_addrmap(device_t &device, address_spacenum spacenum, address_map_constructor map);
// basic information getters
- const address_space_config *space_config(address_spacenum spacenum = AS_0) const { return m_memory_config.space_config(spacenum); }
address_space *space(int index = 0) const { return m_addrspace[index]; }
address_space *space(address_spacenum index) const { return m_addrspace[static_cast<int>(index)]; }
@@ -152,6 +124,9 @@ public:
bool readop(offs_t offset, int size, UINT64 &value) { return memory_readop(offset, size, value); }
protected:
+ // required overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum) const = 0;
+
// optional operation overrides
virtual bool memory_translate(address_spacenum spacenum, int intention, offs_t &address);
virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, UINT64 &value);
@@ -159,9 +134,10 @@ protected:
virtual bool memory_readop(offs_t offset, int size, UINT64 &value);
// interface-level overrides
+ virtual bool interface_validity_check(emu_options &options, const game_driver &driver) const;
// configuration
- const device_config_memory_interface &m_memory_config; // reference to our device_config_execute_interface
+ address_map_constructor m_address_map[ADDRESS_SPACES]; // address maps for each address space
address_space * m_addrspace[ADDRESS_SPACES]; // reported address spaces
};
@@ -172,15 +148,15 @@ protected:
//**************************************************************************
//-------------------------------------------------
-// devconfig_get_space_config - return a pointer
+// device_get_space_config - return a pointer
// to sthe given address space's configuration
//-------------------------------------------------
-inline const address_space_config *devconfig_get_space_config(const device_config &devconfig, address_spacenum spacenum = AS_0)
+inline const address_space_config *device_get_space_config(const device_t &device, address_spacenum spacenum = AS_0)
{
- const device_config_memory_interface *intf;
- if (!devconfig.interface(intf))
- throw emu_fatalerror("Device '%s' does not have memory interface", devconfig.tag());
+ const device_memory_interface *intf;
+ if (!device.interface(intf))
+ throw emu_fatalerror("Device '%s' does not have memory interface", device.tag());
return intf->space_config(spacenum);
}
diff --git a/src/emu/dinvram.c b/src/emu/dinvram.c
index 9321f922f03..60594c1e6de 100644
--- a/src/emu/dinvram.c
+++ b/src/emu/dinvram.c
@@ -42,30 +42,6 @@
//**************************************************************************
-// DEVICE CONFIG NVRAM INTERFACE
-//**************************************************************************
-
-//-------------------------------------------------
-// device_config_nvram_interface - constructor
-//-------------------------------------------------
-
-device_config_nvram_interface::device_config_nvram_interface(const machine_config &mconfig, device_config &devconfig)
- : device_config_interface(mconfig, devconfig)
-{
-}
-
-
-//-------------------------------------------------
-// ~device_config_nvram_interface - destructor
-//-------------------------------------------------
-
-device_config_nvram_interface::~device_config_nvram_interface()
-{
-}
-
-
-
-//**************************************************************************
// DEVICE NVRAM INTERFACE
//**************************************************************************
@@ -73,9 +49,8 @@ device_config_nvram_interface::~device_config_nvram_interface()
// device_nvram_interface - constructor
//-------------------------------------------------
-device_nvram_interface::device_nvram_interface(running_machine &machine, const device_config &config, device_t &device)
- : device_interface(machine, config, device),
- m_nvram_config(dynamic_cast<const device_config_nvram_interface &>(config))
+device_nvram_interface::device_nvram_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device)
{
}
diff --git a/src/emu/dinvram.h b/src/emu/dinvram.h
index f1051dce25d..30b490c60a1 100644
--- a/src/emu/dinvram.h
+++ b/src/emu/dinvram.h
@@ -52,19 +52,6 @@
//**************************************************************************
-// ======================> device_config_nvram_interface
-
-// class representing interface-specific configuration nvram
-class device_config_nvram_interface : public device_config_interface
-{
-public:
- // construction/destruction
- device_config_nvram_interface(const machine_config &mconfig, device_config &device);
- virtual ~device_config_nvram_interface();
-};
-
-
-
// ======================> device_nvram_interface
// class representing interface-specific live nvram
@@ -72,12 +59,9 @@ class device_nvram_interface : public device_interface
{
public:
// construction/destruction
- device_nvram_interface(running_machine &machine, const device_config &config, device_t &device);
+ device_nvram_interface(const machine_config &mconfig, device_t &device);
virtual ~device_nvram_interface();
- // configuration access
- const device_config_nvram_interface &nvram_config() const { return m_nvram_config; }
-
// public accessors... for now
void nvram_reset() { nvram_default(); }
void nvram_load(emu_file &file) { nvram_read(file); }
@@ -88,9 +72,6 @@ protected:
virtual void nvram_default() = 0;
virtual void nvram_read(emu_file &file) = 0;
virtual void nvram_write(emu_file &file) = 0;
-
- // configuration
- const device_config_nvram_interface &m_nvram_config; // reference to our device_config_execute_interface
};
diff --git a/src/emu/dirtc.c b/src/emu/dirtc.c
index fa90a979d5e..0483be355ac 100644
--- a/src/emu/dirtc.c
+++ b/src/emu/dirtc.c
@@ -11,30 +11,6 @@
//**************************************************************************
-// DEVICE CONFIG RTC INTERFACE
-//**************************************************************************
-
-//-------------------------------------------------
-// device_config_rtc_interface - constructor
-//-------------------------------------------------
-
-device_config_rtc_interface::device_config_rtc_interface(const machine_config &mconfig, device_config &devconfig)
- : device_config_interface(mconfig, devconfig)
-{
-}
-
-
-//-------------------------------------------------
-// ~device_config_rtc_interface - destructor
-//-------------------------------------------------
-
-device_config_rtc_interface::~device_config_rtc_interface()
-{
-}
-
-
-
-//**************************************************************************
// DEVICE RTC INTERFACE
//**************************************************************************
@@ -42,9 +18,8 @@ device_config_rtc_interface::~device_config_rtc_interface()
// device_rtc_interface - constructor
//-------------------------------------------------
-device_rtc_interface::device_rtc_interface(running_machine &machine, const device_config &config, device_t &device)
- : device_interface(machine, config, device),
- m_rtc_config(dynamic_cast<const device_config_rtc_interface &>(config))
+device_rtc_interface::device_rtc_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device)
{
}
diff --git a/src/emu/dirtc.h b/src/emu/dirtc.h
index a791e3a8230..ba1b238eecf 100644
--- a/src/emu/dirtc.h
+++ b/src/emu/dirtc.h
@@ -21,19 +21,6 @@
//**************************************************************************
-// ======================> device_config_rtc_interface
-
-// class representing interface-specific configuration rtc
-class device_config_rtc_interface : public device_config_interface
-{
-public:
- // construction/destruction
- device_config_rtc_interface(const machine_config &mconfig, device_config &device);
- virtual ~device_config_rtc_interface();
-};
-
-
-
// ======================> device_rtc_interface
// class representing interface-specific live rtc
@@ -41,19 +28,13 @@ class device_rtc_interface : public device_interface
{
public:
// construction/destruction
- device_rtc_interface(running_machine &machine, const device_config &config, device_t &device);
+ device_rtc_interface(const machine_config &mconfig, device_t &device);
virtual ~device_rtc_interface();
- // configuration access
- const device_config_rtc_interface &rtc_config() const { return m_rtc_config; }
-
protected:
// derived class overrides
virtual void rtc_set_time(int year, int month, int day, int day_of_week, int hour, int minute, int second) = 0;
virtual bool rtc_is_year_2000_compliant() = 0;
-
- // configuration
- const device_config_rtc_interface &m_rtc_config; // reference to our device_config_execute_interface
};
diff --git a/src/emu/disound.c b/src/emu/disound.c
index 89fbd33ecb8..1b7a7da4797 100644
--- a/src/emu/disound.c
+++ b/src/emu/disound.c
@@ -46,20 +46,22 @@
//**************************************************************************
//-------------------------------------------------
-// device_config_sound_interface - constructor
+// device_sound_interface - constructor
//-------------------------------------------------
-device_config_sound_interface::device_config_sound_interface(const machine_config &mconfig, device_config &devconfig)
- : device_config_interface(mconfig, devconfig)
+device_sound_interface::device_sound_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device),
+ m_outputs(0),
+ m_auto_allocated_inputs(0)
{
}
//-------------------------------------------------
-// ~device_config_sound_interface - destructor
+// ~device_sound_interface - destructor
//-------------------------------------------------
-device_config_sound_interface::~device_config_sound_interface()
+device_sound_interface::~device_sound_interface()
{
}
@@ -69,12 +71,12 @@ device_config_sound_interface::~device_config_sound_interface()
// a new route to the device
//-------------------------------------------------
-void device_config_sound_interface::static_add_route(device_config *device, UINT32 output, const char *target, double gain, UINT32 input)
+void device_sound_interface::static_add_route(device_t &device, UINT32 output, const char *target, double gain, UINT32 input)
{
// find our sound interface
- device_config_sound_interface *sound = dynamic_cast<device_config_sound_interface *>(device);
- if (sound == NULL)
- throw emu_fatalerror("MCFG_SOUND_ROUTE called on device '%s' with no sound interface", device->tag());
+ device_sound_interface *sound;
+ if (!device.interface(sound))
+ throw emu_fatalerror("MCFG_SOUND_ROUTE called on device '%s' with no sound interface", device.tag());
// append a new route to the list
sound->m_route_list.append(*global_alloc(sound_route(output, input, gain, target)));
@@ -86,12 +88,12 @@ void device_config_sound_interface::static_add_route(device_config *device, UINT
// reset all existing routes to the device
//-------------------------------------------------
-void device_config_sound_interface::static_reset_routes(device_config *device)
+void device_sound_interface::static_reset_routes(device_t &device)
{
// find our sound interface
- device_config_sound_interface *sound = dynamic_cast<device_config_sound_interface *>(device);
- if (sound == NULL)
- throw emu_fatalerror("MCFG_SOUND_ROUTES_RESET called on device '%s' with no sound interface", device->tag());
+ device_sound_interface *sound;
+ if (!device.interface(sound))
+ throw emu_fatalerror("MCFG_SOUND_ROUTES_RESET called on device '%s' with no sound interface", device.tag());
// reset the routine list
sound->m_route_list.reset();
@@ -99,80 +101,6 @@ void device_config_sound_interface::static_reset_routes(device_config *device)
//-------------------------------------------------
-// interface_validity_check - validation for a
-// device after the configuration has been
-// constructed
-//-------------------------------------------------
-
-bool device_config_sound_interface::interface_validity_check(emu_options &options, const game_driver &driver) const
-{
- bool error = false;
-
- // loop over all the routes
- for (const sound_route *route = first_route(); route != NULL; route = route->next())
- {
- // find a device with the requested tag
- const device_config *target = m_machine_config.m_devicelist.find(route->m_target);
- if (target == NULL)
- {
- mame_printf_error("%s: %s attempting to route sound to non-existant device '%s'\n", driver.source_file, driver.name, route->m_target);
- error = true;
- }
-
- // if it's not a speaker or a sound device, error
- const device_config_sound_interface *sound;
- if (target != NULL && target->type() != SPEAKER && !target->interface(sound))
- {
- mame_printf_error("%s: %s attempting to route sound to a non-sound device '%s' (%s)\n", driver.source_file, driver.name, route->m_target, target->name());
- error = true;
- }
- }
- return error;
-}
-
-
-//-------------------------------------------------
-// sound_route - constructor
-//-------------------------------------------------
-
-device_config_sound_interface::sound_route::sound_route(int output, int input, float gain, const char *target)
- : m_next(NULL),
- m_output(output),
- m_input(input),
- m_gain(gain),
- m_target(target)
-{
-}
-
-
-
-//**************************************************************************
-// DEVICE CONFIG SOUND INTERFACE
-//**************************************************************************
-
-//-------------------------------------------------
-// device_sound_interface - constructor
-//-------------------------------------------------
-
-device_sound_interface::device_sound_interface(running_machine &machine, const device_config &config, device_t &device)
- : device_interface(machine, config, device),
- m_sound_config(dynamic_cast<const device_config_sound_interface &>(config)),
- m_outputs(0),
- m_auto_allocated_inputs(0)
-{
-}
-
-
-//-------------------------------------------------
-// ~device_sound_interface - destructor
-//-------------------------------------------------
-
-device_sound_interface::~device_sound_interface()
-{
-}
-
-
-//-------------------------------------------------
// inputs - return the total number of inputs
// for the given device
//-------------------------------------------------
@@ -286,6 +214,39 @@ void device_sound_interface::set_output_gain(int outputnum, float gain)
//-------------------------------------------------
+// interface_validity_check - validation for a
+// device after the configuration has been
+// constructed
+//-------------------------------------------------
+
+bool device_sound_interface::interface_validity_check(emu_options &options, const game_driver &driver) const
+{
+ bool error = false;
+
+ // loop over all the routes
+ for (const sound_route *route = first_route(); route != NULL; route = route->next())
+ {
+ // find a device with the requested tag
+ const device_t *target = device().mconfig().devicelist().find(route->m_target);
+ if (target == NULL)
+ {
+ mame_printf_error("%s: %s attempting to route sound to non-existant device '%s'\n", driver.source_file, driver.name, route->m_target);
+ error = true;
+ }
+
+ // if it's not a speaker or a sound device, error
+ const device_sound_interface *sound;
+ if (target != NULL && target->type() != SPEAKER && !target->interface(sound))
+ {
+ mame_printf_error("%s: %s attempting to route sound to a non-sound device '%s' (%s)\n", driver.source_file, driver.name, route->m_target, target->name());
+ error = true;
+ }
+ }
+ return error;
+}
+
+
+//-------------------------------------------------
// interface_pre_start - make sure all our input
// devices are started
//-------------------------------------------------
@@ -294,10 +255,10 @@ void device_sound_interface::interface_pre_start()
{
// scan all the sound devices
device_sound_interface *sound = NULL;
- for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = m_device.machine().devicelist().first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
- for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
+ for (const sound_route *route = sound->first_route(); route != NULL; route = route->next())
{
// see if we are the target of this route; if we are, make sure the source device is started
device_t *target_device = m_device.machine().device(route->m_target);
@@ -308,16 +269,16 @@ void device_sound_interface::interface_pre_start()
// now iterate through devices again and assign any auto-allocated inputs
m_auto_allocated_inputs = 0;
- for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = m_device.machine().devicelist().first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
- for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
+ for (const sound_route *route = sound->first_route(); route != NULL; route = route->next())
{
// see if we are the target of this route
device_t *target_device = m_device.machine().device(route->m_target);
if (target_device == &m_device && route->m_input == AUTO_ALLOC_INPUT)
{
- const_cast<device_config_sound_interface::sound_route *>(route)->m_input = m_auto_allocated_inputs;
+ const_cast<sound_route *>(route)->m_input = m_auto_allocated_inputs;
m_auto_allocated_inputs += (route->m_output == ALL_OUTPUTS) ? sound->outputs() : 1;
}
}
@@ -334,10 +295,10 @@ void device_sound_interface::interface_post_start()
{
// iterate over all the sound devices
device_sound_interface *sound = NULL;
- for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = m_device.machine().devicelist().first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
- for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
+ for (const sound_route *route = sound->first_route(); route != NULL; route = route->next())
{
// if we are the target of this route, hook it up
device_t *target_device = m_device.machine().device(route->m_target);
@@ -382,3 +343,22 @@ void device_sound_interface::interface_pre_reset()
if (&stream->device() == &device())
stream->update();
}
+
+
+
+//**************************************************************************
+// SOUND ROUTE
+//**************************************************************************
+
+//-------------------------------------------------
+// sound_route - constructor
+//-------------------------------------------------
+
+device_sound_interface::sound_route::sound_route(int output, int input, float gain, const char *target)
+ : m_next(NULL),
+ m_output(output),
+ m_input(input),
+ m_gain(gain),
+ m_target(target)
+{
+}
diff --git a/src/emu/disound.h b/src/emu/disound.h
index cb8a96af365..b5e8e4ad2eb 100644
--- a/src/emu/disound.h
+++ b/src/emu/disound.h
@@ -76,13 +76,13 @@ const int AUTO_ALLOC_INPUT = 65535;
MCFG_DEVICE_CONFIG(_config)
#define MCFG_SOUND_ROUTE_EX(_output, _target, _gain, _input) \
- device_config_sound_interface::static_add_route(device, _output, _target, _gain, _input); \
+ device_sound_interface::static_add_route(*device, _output, _target, _gain, _input); \
#define MCFG_SOUND_ROUTE(_output, _target, _gain) \
MCFG_SOUND_ROUTE_EX(_output, _target, _gain, AUTO_ALLOC_INPUT)
#define MCFG_SOUND_ROUTES_RESET() \
- device_config_sound_interface::static_reset_routes(device); \
+ device_sound_interface::static_reset_routes(*device); \
@@ -93,13 +93,11 @@ const int AUTO_ALLOC_INPUT = 65535;
class sound_stream;
-// ======================> device_config_sound_interface
+// ======================> device_sound_interface
-// device_config_sound_interface represents configuration information for a sound device
-class device_config_sound_interface : public device_config_interface
+class device_sound_interface : public device_interface
{
public:
- // sound route
class sound_route
{
public:
@@ -115,36 +113,15 @@ public:
};
// construction/destruction
- device_config_sound_interface(const machine_config &mconfig, device_config &devconfig);
- virtual ~device_config_sound_interface();
-
- // getters
- const sound_route *first_route() const { return m_route_list.first(); }
-
- // static inline helpers
- static void static_add_route(device_config *device, UINT32 output, const char *target, double gain, UINT32 input = AUTO_ALLOC_INPUT);
- static void static_reset_routes(device_config *device);
-
-protected:
- // optional operation overrides
- virtual bool interface_validity_check(emu_options &options, const game_driver &driver) const;
-
- // internal state
- simple_list<sound_route> m_route_list; // list of sound routes
-};
-
-
-// ======================> device_sound_interface
-
-class device_sound_interface : public device_interface
-{
-public:
- // construction/destruction
- device_sound_interface(running_machine &machine, const device_config &config, device_t &device);
+ device_sound_interface(const machine_config &mconfig, device_t &device);
virtual ~device_sound_interface();
// configuration access
- const device_config_sound_interface &sound_config() const { return m_sound_config; }
+ const sound_route *first_route() const { return m_route_list.first(); }
+
+ // static inline configuration helpers
+ static void static_add_route(device_t &device, UINT32 output, const char *target, double gain, UINT32 input = AUTO_ALLOC_INPUT);
+ static void static_reset_routes(device_t &device);
// sound stream update overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) = 0;
@@ -158,13 +135,13 @@ public:
protected:
// optional operation overrides
+ virtual bool interface_validity_check(emu_options &options, const game_driver &driver) const;
virtual void interface_pre_start();
virtual void interface_post_start();
virtual void interface_pre_reset();
// internal state
- const device_config_sound_interface &m_sound_config;
-
+ simple_list<sound_route> m_route_list; // list of sound routes
int m_outputs; // number of outputs from this instance
int m_auto_allocated_inputs; // number of auto-allocated inputs targeting us
};
diff --git a/src/emu/distate.c b/src/emu/distate.c
index 4a095bc5457..903306f27ea 100644
--- a/src/emu/distate.c
+++ b/src/emu/distate.c
@@ -137,6 +137,25 @@ device_state_entry &device_state_entry::formatstr(const char *_format)
//-------------------------------------------------
+// format_from_mask - make a format based on
+// the data mask
+//-------------------------------------------------
+
+void device_state_entry::format_from_mask()
+{
+ // skip if we have a user-provided format
+ if (!m_default_format)
+ return;
+
+ // make up a format based on the mask
+ int width = 0;
+ for (UINT64 tempmask = m_datamask; tempmask != 0; tempmask >>= 4)
+ width++;
+ m_format.printf("%%0%dX", width);
+}
+
+
+//-------------------------------------------------
// value - return the current value as a UINT64
//-------------------------------------------------
@@ -355,49 +374,6 @@ void device_state_entry::set_value(const char *string) const
}
-//-------------------------------------------------
-// format_from_mask - make a format based on
-// the data mask
-//-------------------------------------------------
-
-void device_state_entry::format_from_mask()
-{
- // skip if we have a user-provided format
- if (!m_default_format)
- return;
-
- // make up a format based on the mask
- int width = 0;
- for (UINT64 tempmask = m_datamask; tempmask != 0; tempmask >>= 4)
- width++;
- m_format.printf("%%0%dX", width);
-}
-
-
-
-//**************************************************************************
-// DEVICE CONFIG STATE INTERFACE
-//**************************************************************************
-
-//-------------------------------------------------
-// device_config_state_interface - constructor
-//-------------------------------------------------
-
-device_config_state_interface::device_config_state_interface(const machine_config &mconfig, device_config &devconfig)
- : device_config_interface(mconfig, devconfig)
-{
-}
-
-
-//-------------------------------------------------
-// ~device_config_state_interface - destructor
-//-------------------------------------------------
-
-device_config_state_interface::~device_config_state_interface()
-{
-}
-
-
//**************************************************************************
// DEVICE STATE INTERFACE
@@ -407,11 +383,13 @@ device_config_state_interface::~device_config_state_interface()
// device_state_interface - constructor
//-------------------------------------------------
-device_state_interface::device_state_interface(running_machine &machine, const device_config &config, device_t &device)
- : device_interface(machine, config, device),
- m_state_config(dynamic_cast<const device_config_state_interface &>(config))
+device_state_interface::device_state_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device)
{
memset(m_fast_state, 0, sizeof(m_fast_state));
+
+ // configure the fast accessor
+ device.m_state = this;
}
@@ -528,12 +506,38 @@ void device_state_interface::set_state(int index, const char *string)
//-------------------------------------------------
+// state_add - return the value of the given
+// pieces of indexed state as a UINT64
+//-------------------------------------------------
+
+device_state_entry &device_state_interface::state_add(int index, const char *symbol, void *data, UINT8 size)
+{
+ // assert validity of incoming parameters
+ assert(size == 1 || size == 2 || size == 4 || size == 8);
+ assert(symbol != NULL);
+
+ // allocate new entry
+ device_state_entry *entry = auto_alloc(device().machine(), device_state_entry(index, symbol, data, size));
+
+ // append to the end of the list
+ m_state_list.append(*entry);
+
+ // set the fast entry if applicable
+ if (index >= k_fast_state_min && index <= k_fast_state_max)
+ m_fast_state[index - k_fast_state_min] = entry;
+
+ return *entry;
+}
+
+
+//-------------------------------------------------
// state_import - called after new state is
// written to perform any post-processing
//-------------------------------------------------
void device_state_interface::state_import(const device_state_entry &entry)
{
+ // do nothing by default
}
@@ -544,6 +548,7 @@ void device_state_interface::state_import(const device_state_entry &entry)
void device_state_interface::state_export(const device_state_entry &entry)
{
+ // do nothing by default
}
@@ -554,6 +559,7 @@ void device_state_interface::state_export(const device_state_entry &entry)
void device_state_interface::state_string_import(const device_state_entry &entry, astring &string)
{
+ // do nothing by default
}
@@ -564,31 +570,20 @@ void device_state_interface::state_string_import(const device_state_entry &entry
void device_state_interface::state_string_export(const device_state_entry &entry, astring &string)
{
+ // do nothing by default
}
//-------------------------------------------------
-// state_add - return the value of the given
-// pieces of indexed state as a UINT64
+// interface_post_start - verify that state was
+// properly set up
//-------------------------------------------------
-device_state_entry &device_state_interface::state_add(int index, const char *symbol, void *data, UINT8 size)
+void device_state_interface::interface_post_start()
{
- // assert validity of incoming parameters
- assert(size == 1 || size == 2 || size == 4 || size == 8);
- assert(symbol != NULL);
-
- // allocate new entry
- device_state_entry *entry = auto_alloc(device().machine(), device_state_entry(index, symbol, data, size));
-
- // append to the end of the list
- m_state_list.append(*entry);
-
- // set the fast entry if applicable
- if (index >= k_fast_state_min && index <= k_fast_state_max)
- m_fast_state[index - k_fast_state_min] = entry;
-
- return *entry;
+ // make sure we got something during startup
+ if (m_state_list.count() == 0)
+ throw emu_fatalerror("No state registered for device '%s' that supports it!", m_device.tag());
}
@@ -611,16 +606,3 @@ const device_state_entry *device_state_interface::state_find_entry(int index)
// handle failure by returning NULL
return NULL;
}
-
-
-//-------------------------------------------------
-// interface_post_start - verify that state was
-// properly set up
-//-------------------------------------------------
-
-void device_state_interface::interface_post_start()
-{
- // make sure we got something during startup
- if (m_state_list.count() == 0)
- throw emu_fatalerror("No state registered for device '%s' that supports it!", m_device.tag());
-}
diff --git a/src/emu/distate.h b/src/emu/distate.h
index 2184678cef0..41b188e17d2 100644
--- a/src/emu/distate.h
+++ b/src/emu/distate.h
@@ -137,19 +137,6 @@ protected:
-// ======================> device_config_state_interface
-
-// class representing interface-specific configuration state
-class device_config_state_interface : public device_config_interface
-{
-public:
- // construction/destruction
- device_config_state_interface(const machine_config &mconfig, device_config &device);
- virtual ~device_config_state_interface();
-};
-
-
-
// ======================> device_state_interface
// class representing interface-specific live state
@@ -157,11 +144,10 @@ class device_state_interface : public device_interface
{
public:
// construction/destruction
- device_state_interface(running_machine &machine, const device_config &config, device_t &device);
+ device_state_interface(const machine_config &mconfig, device_t &device);
virtual ~device_state_interface();
// configuration access
- const device_config_state_interface &state_config() const { return m_state_config; }
const device_state_entry *state_first() const { return m_state_list.first(); }
// state getters
@@ -204,7 +190,6 @@ protected:
static const int k_fast_state_max = 256; // lookups
// state
- const device_config_state_interface & m_state_config; // reference to configuration data
simple_list<device_state_entry> m_state_list; // head of state list
device_state_entry * m_fast_state[k_fast_state_max + 1 - k_fast_state_min];
// fast access to common entries
diff --git a/src/emu/driver.c b/src/emu/driver.c
index 3515865bf44..eb0f7d785fc 100644
--- a/src/emu/driver.c
+++ b/src/emu/driver.c
@@ -212,8 +212,22 @@ driver_enumerator::~driver_enumerator()
machine_config &driver_enumerator::config(int index) const
{
assert(index >= 0 && index < s_driver_count);
+
+ // if we don't have it cached, add it
if (m_config[index] == NULL)
- m_config[index] = global_alloc(machine_config(*s_drivers_sorted[index], m_options));
+ {
+ // if our cache is full, release the head entry
+ if (m_config_cache.count() == CONFIG_CACHE_COUNT)
+ {
+ config_entry *first = m_config_cache.first();
+ m_config[first->index()] = NULL;
+ m_config_cache.remove(*first);
+ }
+
+ // allocate the config and add it to the end of the list
+ machine_config *config = m_config[index] = global_alloc(machine_config(*s_drivers_sorted[index], m_options));
+ m_config_cache.append(*global_alloc(config_entry(*config, index)));
+ }
return *m_config[index];
}
@@ -400,3 +414,17 @@ void driver_enumerator::find_approximate_matches(const char *string, int count,
// free our temp memory
global_free(penalty);
}
+
+
+driver_enumerator::config_entry::config_entry(machine_config &config, int index)
+ : m_next(NULL),
+ m_config(&config),
+ m_index(index)
+{
+}
+
+
+driver_enumerator::config_entry::~config_entry()
+{
+ global_free(m_config);
+}
diff --git a/src/emu/driver.h b/src/emu/driver.h
index f927ac1dc25..641833100cc 100644
--- a/src/emu/driver.h
+++ b/src/emu/driver.h
@@ -202,12 +202,37 @@ public:
void find_approximate_matches(const char *string, int count, int *results);
private:
+ // entry in the config cache
+ struct config_entry
+ {
+ friend class simple_list<config_entry>;
+
+ public:
+ // construction/destruction
+ config_entry(machine_config &config, int index);
+ ~config_entry();
+
+ // getters
+ config_entry *next() const { return m_next; }
+ int index() const { return m_index; }
+ machine_config *config() const { return m_config; }
+
+ private:
+ // internal state
+ config_entry * m_next;
+ machine_config * m_config;
+ int m_index;
+ };
+
+ static const int CONFIG_CACHE_COUNT = 100;
+
// internal state
int m_current;
int m_filtered_count;
emu_options & m_options;
UINT8 * m_included;
machine_config ** m_config;
+ mutable simple_list<config_entry> m_config_cache;
};
diff --git a/src/emu/emu.h b/src/emu/emu.h
index 50d7756ef45..f35be9f8463 100644
--- a/src/emu/emu.h
+++ b/src/emu/emu.h
@@ -78,8 +78,7 @@
// define machine_config_constructor here due to circular dependency
// between devices and the machine config
class machine_config;
-class device_config;
-typedef device_config * (*machine_config_constructor)(machine_config &config, device_config *owner);
+typedef device_t * (*machine_config_constructor)(machine_config &config, device_t *owner);
// devices and callbacks
#include "devintrf.h"
diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c
index 7753b8e83ac..f2e63718f07 100644
--- a/src/emu/emuopts.c
+++ b/src/emu/emuopts.c
@@ -224,10 +224,10 @@ void emu_options::add_device_options()
machine_config config(*cursystem, *this);
// iterate through all image devices
- const device_config_image_interface *image = NULL;
+ const device_image_interface *image = NULL;
bool first = true;
options_entry entry[2] = { { 0 }, { 0 } };
- for (bool gotone = config.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = config.devicelist().first(image); gotone; gotone = image->next(image))
{
// first device? add the header as to be pretty
if (first)
@@ -331,8 +331,8 @@ void emu_options::parse_standard_inis(astring &error_string)
// parse "vector.ini" for vector games
{
machine_config config(*cursystem, *this);
- for (const screen_device_config *devconfig = config.first_screen(); devconfig != NULL; devconfig = devconfig->next_screen())
- if (devconfig->screen_type() == SCREEN_TYPE_VECTOR)
+ for (const screen_device *device = config.first_screen(); device != NULL; device = device->next_screen())
+ if (device->screen_type() == SCREEN_TYPE_VECTOR)
{
parse_one_ini("vector", OPTION_PRIORITY_VECTOR_INI, &error_string);
break;
@@ -402,7 +402,7 @@ void emu_options::set_system_name(const char *name)
const char *emu_options::device_option(device_image_interface &image)
{
- return image.device().machine().options().value(image.image_config().instance_name());
+ return value(image.instance_name());
}
diff --git a/src/emu/image.c b/src/emu/image.c
index 13e90b0a1c0..0ca80b9fa83 100644
--- a/src/emu/image.c
+++ b/src/emu/image.c
@@ -77,9 +77,9 @@ static void image_dirs_load(running_machine &machine, int config_type, xml_data_
if ((dev_instance != NULL) && (dev_instance[0] != '\0'))
{
- for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
{
- if (!strcmp(dev_instance, image->image_config().instance_name())) {
+ if (!strcmp(dev_instance, image->instance_name())) {
working_directory = xml_get_attribute_string(node, "directory", NULL);
if (working_directory != NULL)
image->set_working_directory(working_directory);
@@ -106,9 +106,9 @@ static void image_dirs_save(running_machine &machine, int config_type, xml_data_
/* only care about game-specific data */
if (config_type == CONFIG_TYPE_GAME)
{
- for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
{
- dev_instance = image->image_config().instance_name();
+ dev_instance = image->instance_name();
node = xml_add_child(parentnode, "device", NULL);
if (node != NULL)
@@ -161,13 +161,13 @@ static void image_options_extract(running_machine &machine)
int index = 0;
device_image_interface *image = NULL;
- for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
{
const char *filename = image->filename();
/* and set the option */
astring error;
- machine.options().set_value(image->image_config().instance_name(), filename ? filename : "", OPTION_PRIORITY_CMDLINE, error);
+ machine.options().set_value(image->instance_name(), filename ? filename : "", OPTION_PRIORITY_CMDLINE, error);
index++;
}
@@ -190,7 +190,7 @@ void image_unload_all(running_machine &machine)
// extract the options
image_options_extract(machine);
- for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
{
// unload this image
image->unload();
@@ -207,7 +207,7 @@ void image_device_init(running_machine &machine)
device_image_interface *image = NULL;
/* make sure that any required devices have been allocated */
- for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
{
/* is an image specified for this image */
image_name = machine.options().device_option(*image);
@@ -231,7 +231,7 @@ void image_device_init(running_machine &machine)
image_unload_all(machine);
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
- image->image_config().devconfig().name(),
+ image->device().name(),
image_basename.cstr(),
image_err.cstr());
}
@@ -239,9 +239,9 @@ void image_device_init(running_machine &machine)
else
{
/* no image... must this device be loaded? */
- if (image->image_config().must_be_loaded())
+ if (image->must_be_loaded())
{
- fatalerror_exitcode(machine, MAMERR_DEVICE, "Driver requires that device \"%s\" must have an image to load", image->image_config().instance_name());
+ fatalerror_exitcode(machine, MAMERR_DEVICE, "Driver requires that device \"%s\" must have an image to load", image->instance_name());
}
}
@@ -259,7 +259,7 @@ void image_postdevice_init(running_machine &machine)
device_image_interface *image = NULL;
/* make sure that any required devices have been allocated */
- for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
{
int result = image->finish_load();
/* did the image load fail? */
@@ -272,7 +272,7 @@ void image_postdevice_init(running_machine &machine)
image_unload_all(machine);
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load failed: %s",
- image->image_config().devconfig().name(),
+ image->device().name(),
image_err.cstr());
}
}
@@ -377,7 +377,7 @@ astring *image_info_astring(running_machine &machine, astring *string)
}
#endif
- for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
{
const char *name = image->filename();
if (name != NULL)
@@ -390,7 +390,7 @@ astring *image_info_astring(running_machine &machine, astring *string)
base_filename_noextension = strip_extension(base_filename);
/* display device type and filename */
- astring_catprintf(string, "%s: %s\n", image->image_config().devconfig().name(), base_filename);
+ astring_catprintf(string, "%s: %s\n", image->device().name(), base_filename);
/* display long filename, if present and doesn't correspond to name */
info = image->longname();
@@ -420,7 +420,7 @@ astring *image_info_astring(running_machine &machine, astring *string)
}
else
{
- astring_catprintf(string, "%s: ---\n", image->image_config().devconfig().name());
+ astring_catprintf(string, "%s: ---\n", image->device().name());
}
}
return string;
@@ -475,7 +475,7 @@ device_image_interface *image_from_absolute_index(running_machine &machine, int
device_image_interface *image = NULL;
int cnt = 0;
/* make sure that any required devices have been allocated */
- for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
{
if (cnt==absolute_index) return image;
cnt++;
@@ -490,24 +490,5 @@ device_image_interface *image_from_absolute_index(running_machine &machine, int
-------------------------------------------------*/
void image_add_device_with_subdevices(device_t *owner, device_type type, const char *tag, UINT32 clock)
{
- astring tempstring;
- device_list *device_list = &owner->machine().m_devicelist;
- machine_config &config = const_cast<machine_config &>(owner->machine().config());
-
- device_config *devconfig = type(config, owner->subtag(tempstring,tag), &owner->baseconfig(), clock);
- device_t &device = device_list->append(devconfig->tag(), *devconfig->alloc_device(owner->machine()));
-
- machine_config_constructor machconfig = device.machine_config_additions();
- if (machconfig != NULL)
- {
- (*machconfig)(config, devconfig);
- for (const device_config *config_dev = config.m_devicelist.first(); config_dev != NULL; config_dev = config_dev->next())
- {
- if (config_dev->owner()==devconfig) {
- device_list->append(config_dev->tag(), *config_dev->alloc_device(owner->machine()));
- }
- }
- }
- config.m_devicelist.append(devconfig->tag(), *devconfig);
+ owner->machine().add_dynamic_device(*owner, type, tag, clock);
}
-
diff --git a/src/emu/imagedev/bitbngr.c b/src/emu/imagedev/bitbngr.c
index cb2dadac3ea..9bbef4ecc83 100644
--- a/src/emu/imagedev/bitbngr.c
+++ b/src/emu/imagedev/bitbngr.c
@@ -69,7 +69,7 @@ INLINE const bitbanger_config *get_config(device_t *device)
{
assert(device != NULL);
assert(device->type() == BITBANGER);
- return (const bitbanger_config *) device->baseconfig().static_config();
+ return (const bitbanger_config *) device->static_config();
}
diff --git a/src/emu/imagedev/cartslot.c b/src/emu/imagedev/cartslot.c
index 534fdf84990..1790ca5aa89 100644
--- a/src/emu/imagedev/cartslot.c
+++ b/src/emu/imagedev/cartslot.c
@@ -35,19 +35,13 @@ INLINE cartslot_t *get_token(device_t *device)
}
-INLINE const cartslot_config *get_config(device_t *device)
+INLINE const cartslot_config *get_config(const device_t *device)
{
assert(device != NULL);
assert(device->type() == CARTSLOT);
- return (const cartslot_config *) downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ return (const cartslot_config *) downcast<const legacy_device_base *>(device)->inline_config();
}
-INLINE const cartslot_config *get_config_dev(const device_config *device)
-{
- assert(device != NULL);
- assert(device->type() == CARTSLOT);
- return (const cartslot_config *)downcast<const legacy_device_config_base *>(device)->inline_config();
-}
/***************************************************************************
IMPLEMENTATION
@@ -436,8 +430,8 @@ DEVICE_GET_INFO( cartslot )
case DEVINFO_INT_IMAGE_CREATABLE: info->i = 0; break;
case DEVINFO_INT_IMAGE_RESET_ON_LOAD: info->i = 1; break;
case DEVINFO_INT_IMAGE_MUST_BE_LOADED:
- if ( device && downcast<const legacy_image_device_config_base *>(device)->inline_config()) {
- info->i = get_config_dev(device)->must_be_loaded;
+ if ( device && downcast<const legacy_image_device_base *>(device)->inline_config()) {
+ info->i = get_config(device)->must_be_loaded;
} else {
info->i = 0;
}
@@ -450,15 +444,15 @@ DEVICE_GET_INFO( cartslot )
case DEVINFO_FCT_IMAGE_GET_DEVICES: info->f = (genf *) DEVICE_IMAGE_GET_DEVICES_NAME(cartslot); break;
case DEVINFO_FCT_IMAGE_SOFTLIST_LOAD: info->f = (genf *) DEVICE_IMAGE_SOFTLIST_LOAD_NAME(cartslot); break;
case DEVINFO_FCT_IMAGE_PARTIAL_HASH:
- if ( device && downcast<const legacy_image_device_config_base *>(device)->inline_config() && get_config_dev(device)->device_partialhash) {
- info->f = (genf *) get_config_dev(device)->device_partialhash;
+ if ( device && downcast<const legacy_image_device_base *>(device)->inline_config() && get_config(device)->device_partialhash) {
+ info->f = (genf *) get_config(device)->device_partialhash;
} else {
info->f = NULL;
}
break;
case DEVINFO_FCT_IMAGE_DISPLAY_INFO:
- if ( device && downcast<const legacy_image_device_config_base *>(device)->inline_config() && get_config_dev(device)->device_displayinfo) {
- info->f = (genf *) get_config_dev(device)->device_displayinfo;
+ if ( device && downcast<const legacy_image_device_base *>(device)->inline_config() && get_config(device)->device_displayinfo) {
+ info->f = (genf *) get_config(device)->device_displayinfo;
} else {
info->f = NULL;
}
@@ -469,9 +463,9 @@ DEVICE_GET_INFO( cartslot )
case DEVINFO_STR_FAMILY: strcpy(info->s, "Cartslot"); break;
case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
case DEVINFO_STR_IMAGE_FILE_EXTENSIONS:
- if ( device && downcast<const legacy_image_device_config_base *>(device)->inline_config() && get_config_dev(device)->extensions )
+ if ( device && downcast<const legacy_image_device_base *>(device)->inline_config() && get_config(device)->extensions )
{
- strcpy(info->s, get_config_dev(device)->extensions);
+ strcpy(info->s, get_config(device)->extensions);
}
else
{
@@ -479,9 +473,9 @@ DEVICE_GET_INFO( cartslot )
}
break;
case DEVINFO_STR_IMAGE_INTERFACE:
- if ( device && downcast<const legacy_image_device_config_base *>(device)->inline_config() && get_config_dev(device)->interface )
+ if ( device && downcast<const legacy_image_device_base *>(device)->inline_config() && get_config(device)->interface )
{
- strcpy(info->s, get_config_dev(device)->interface );
+ strcpy(info->s, get_config(device)->interface );
}
break;
}
@@ -491,30 +485,6 @@ DEFINE_LEGACY_IMAGE_DEVICE(CARTSLOT, cartslot);
//**************************************************************************
-// DEVICE CONFIG CARTSLOT INTERFACE
-//**************************************************************************
-
-//-------------------------------------------------
-// device_config_cart_slot_interface - constructor
-//-------------------------------------------------
-
-device_config_cart_slot_interface::device_config_cart_slot_interface(const machine_config &mconfig, device_config &devconfig)
- : device_config_interface(mconfig, devconfig)
-{
-}
-
-
-//-------------------------------------------------
-// ~device_config_cart_slot_interface - destructor
-//-------------------------------------------------
-
-device_config_cart_slot_interface::~device_config_cart_slot_interface()
-{
-}
-
-
-
-//**************************************************************************
// DEVICE CARTSLOT INTERFACE
//**************************************************************************
@@ -522,9 +492,8 @@ device_config_cart_slot_interface::~device_config_cart_slot_interface()
// device_cart_slot_interface - constructor
//-------------------------------------------------
-device_cart_slot_interface::device_cart_slot_interface(running_machine &machine, const device_config &config, device_t &device)
- : device_interface(machine, config, device),
- m_cart_slot_config(dynamic_cast<const device_config_cart_slot_interface &>(config))
+device_cart_slot_interface::device_cart_slot_interface(const machine_config &mconfig, device_t &device)
+ : device_interface(device)
{
}
@@ -538,21 +507,6 @@ device_cart_slot_interface::~device_cart_slot_interface()
}
//**************************************************************************
-// LEGACY cart_slot DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// legacy_cart_slot_device_config_base - constructor
-//-------------------------------------------------
-
-legacy_cart_slot_device_config_base::legacy_cart_slot_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config)
- : legacy_device_config_base(mconfig, type, tag, owner, clock, get_config),
- device_config_cart_slot_interface(mconfig, *this)
-{
-}
-
-
-//**************************************************************************
// LIVE LEGACY cart_slot DEVICE
//**************************************************************************
@@ -560,8 +514,8 @@ legacy_cart_slot_device_config_base::legacy_cart_slot_device_config_base(const m
// legacy_cart_slot_device_base - constructor
//-------------------------------------------------
-legacy_cart_slot_device_base::legacy_cart_slot_device_base(running_machine &machine, const device_config &config)
- : legacy_device_base(machine, config),
- device_cart_slot_interface(machine, config, *this)
+legacy_cart_slot_device_base::legacy_cart_slot_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config)
+ : legacy_device_base(mconfig, type, tag, owner, clock, get_config),
+ device_cart_slot_interface(mconfig, *this)
{
}
diff --git a/src/emu/imagedev/cartslot.h b/src/emu/imagedev/cartslot.h
index 4fda8c830af..b7ef371f47b 100644
--- a/src/emu/imagedev/cartslot.h
+++ b/src/emu/imagedev/cartslot.h
@@ -119,20 +119,8 @@ int cartslot_get_resource_length(device_t *device, const char *socket_name);
#define MCFG_CARTSLOT_INTERFACE(_interface) \
MCFG_DEVICE_CONFIG_DATAPTR(cartslot_config, interface, _interface )
-#define DECLARE_LEGACY_CART_SLOT_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_cart_slot_device_config_base, legacy_cart_slot_device_base)
-#define DEFINE_LEGACY_CART_SLOT_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device_config, basename##_device, legacy_cart_slot_device_config_base, legacy_cart_slot_device_base)
-
-// ======================> device_config_cart_slot_interface
-
-// class representing interface-specific configuration cart_slot
-class device_config_cart_slot_interface : public device_config_interface
-{
-public:
- // construction/destruction
- device_config_cart_slot_interface(const machine_config &mconfig, device_config &device);
- virtual ~device_config_cart_slot_interface();
-};
-
+#define DECLARE_LEGACY_CART_SLOT_DEVICE(name, basename) _DECLARE_LEGACY_DEVICE(name, basename, basename##_device, legacy_cart_slot_device_base)
+#define DEFINE_LEGACY_CART_SLOT_DEVICE(name, basename) _DEFINE_LEGACY_DEVICE(name, basename, basename##_device, legacy_cart_slot_device_base)
// ======================> device_cart_slot_interface
@@ -142,42 +130,25 @@ class device_cart_slot_interface : public device_interface
{
public:
// construction/destruction
- device_cart_slot_interface(running_machine &machine, const device_config &config, device_t &device);
+ device_cart_slot_interface(const machine_config &mconfig, device_t &device);
virtual ~device_cart_slot_interface();
-
- // configuration access
- const device_config_cart_slot_interface &cart_slot_config() const { return m_cart_slot_config; }
-protected:
-
- // configuration
- const device_config_cart_slot_interface &m_cart_slot_config; // reference to our device_config_execute_interface
};
-// ======================> legacy_cart_slot_device_config
-
-// legacy_cart_slot_device_config is a device_config with a cart_slot interface
-class legacy_cart_slot_device_config_base : public legacy_device_config_base,
- public device_config_cart_slot_interface
-{
-protected:
- // construction/destruction
- legacy_cart_slot_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner, UINT32 clock, device_get_config_func get_config);
-public:
- INT64 get_config_int(UINT32 state) const { return get_legacy_config_int(state); }
- genf *get_config_fct(UINT32 state) const { return get_legacy_config_fct(state); }
- void *get_config_ptr(UINT32 state) const { return get_legacy_config_ptr(state); }
-};
-
// ======================> legacy_cart_slot_device
// legacy_cart_slot_device is a legacy_device_base with a cart_slot interface
class legacy_cart_slot_device_base : public legacy_device_base,
- public device_cart_slot_interface
+ public device_cart_slot_interface
{
protected:
// construction/destruction
- legacy_cart_slot_device_base(running_machine &machine, const device_config &config);
+ legacy_cart_slot_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, device_get_config_func get_config);
+
+public:
+ using legacy_device_base::get_legacy_int;
+ using legacy_device_base::get_legacy_fct;
+ using legacy_device_base::get_legacy_ptr;
// device_cart_slot_interface overrides
};
diff --git a/src/emu/imagedev/cassette.c b/src/emu/imagedev/cassette.c
index 741c0601346..0951e2dd839 100644
--- a/src/emu/imagedev/cassette.c
+++ b/src/emu/imagedev/cassette.c
@@ -50,11 +50,11 @@ INLINE dev_cassette_t *get_safe_token(device_t *device)
return (dev_cassette_t *) downcast<legacy_device_base *>(device)->token();
}
-INLINE const inline_cassette_config *get_config_dev(const device_config *device)
+INLINE const inline_cassette_config *get_config_dev(const device_t *device)
{
assert(device != NULL);
assert(device->type() == CASSETTE);
- return (const inline_cassette_config *)downcast<const legacy_device_config_base *>(device)->inline_config();
+ return (const inline_cassette_config *)downcast<const legacy_device_base *>(device)->inline_config();
}
/*********************************************************************
@@ -254,7 +254,7 @@ static DEVICE_START( cassette )
dev_cassette_t *cassette = get_safe_token( device );
/* set to default state */
- cassette->config = (const cassette_config*)device->baseconfig().static_config();
+ cassette->config = (const cassette_config*)device->static_config();
cassette->cassette = NULL;
cassette->state = cassette->config->default_state;
}
@@ -366,7 +366,7 @@ static DEVICE_IMAGE_DISPLAY(cassette)
x = 0.2f;
y = 0.5f;
- dev = device->machine().m_devicelist.first(CASSETTE );
+ dev = device->machine().devicelist().first(CASSETTE );
while ( dev && strcmp( dev->tag(), device->tag() ) )
{
@@ -429,7 +429,7 @@ DEVICE_GET_INFO(cassette)
case DEVINFO_FCT_IMAGE_DISPLAY: info->f = (genf *) DEVICE_IMAGE_DISPLAY_NAME(cassette); break;
case DEVINFO_FCT_IMAGE_SOFTLIST_LOAD: info->f = (genf *) DEVICE_IMAGE_SOFTLIST_LOAD_NAME(cassette); break;
case DEVINFO_FCT_IMAGE_DISPLAY_INFO:
- if ( device && downcast<const legacy_image_device_config_base *>(device)->inline_config() && get_config_dev(device)->device_displayinfo) {
+ if ( device && downcast<const legacy_image_device_base *>(device)->inline_config() && get_config_dev(device)->device_displayinfo) {
info->f = (genf *) get_config_dev(device)->device_displayinfo;
} else {
info->f = NULL;
diff --git a/src/emu/imagedev/chd_cd.c b/src/emu/imagedev/chd_cd.c
index 475e1010104..cfdaf9e47d3 100644
--- a/src/emu/imagedev/chd_cd.c
+++ b/src/emu/imagedev/chd_cd.c
@@ -37,11 +37,11 @@ static const char *const error_strings[] =
"unsupported CHD version"
};
-INLINE const cdrom_config *get_config_dev(const device_config *device)
+INLINE const cdrom_config *get_config_dev(const device_t *device)
{
assert(device != NULL);
assert(device->type() == CDROM);
- return (const cdrom_config *)downcast<const legacy_device_config_base *>(device)->inline_config();
+ return (const cdrom_config *)downcast<const legacy_device_base *>(device)->inline_config();
}
static const char *chd_get_error_string(int chderr)
@@ -174,7 +174,7 @@ DEVICE_GET_INFO(cdrom)
case DEVINFO_FCT_IMAGE_UNLOAD: info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(cdrom); break;
case DEVINFO_FCT_IMAGE_SOFTLIST_LOAD: info->f = (genf *) DEVICE_IMAGE_SOFTLIST_LOAD_NAME(cdrom); break;
case DEVINFO_FCT_IMAGE_DISPLAY_INFO:
- if ( device && downcast<const legacy_image_device_config_base *>(device)->inline_config() && get_config_dev(device)->device_displayinfo) {
+ if ( device && downcast<const legacy_image_device_base *>(device)->inline_config() && get_config_dev(device)->device_displayinfo) {
info->f = (genf *) get_config_dev(device)->device_displayinfo;
} else {
info->f = NULL;
@@ -193,7 +193,7 @@ DEVICE_GET_INFO(cdrom)
case DEVINFO_STR_IMAGE_CREATE_OPTEXTS+0: strcpy(info->s, "chd"); break;
case DEVINFO_STR_IMAGE_INTERFACE:
- if ( device && downcast<const legacy_image_device_config_base *>(device)->inline_config() && get_config_dev(device)->interface )
+ if ( device && downcast<const legacy_image_device_base *>(device)->inline_config() && get_config_dev(device)->interface )
{
strcpy(info->s, get_config_dev(device)->interface );
}
diff --git a/src/emu/imagedev/flopdrv.c b/src/emu/imagedev/flopdrv.c
index 43e7cb83221..264255bddc6 100644
--- a/src/emu/imagedev/flopdrv.c
+++ b/src/emu/imagedev/flopdrv.c
@@ -127,11 +127,11 @@ INLINE floppy_drive *get_safe_token(device_t *device)
return (floppy_drive *) downcast<legacy_device_base *>(device)->token();
}
-INLINE const inline_floppy_config *get_config_dev(const device_config *device)
+INLINE const inline_floppy_config *get_config_dev(const device_t *device)
{
assert(device != NULL);
assert( device->type() == FLOPPY || device->type() == FLOPPY_APPLE || device->type() == FLOPPY_SONY);
- return (const inline_floppy_config *)downcast<const legacy_device_config_base *>(device)->inline_config();
+ return (const inline_floppy_config *)downcast<const legacy_device_base *>(device)->inline_config();
}
floppy_image *flopimg_get_image(device_t *image)
@@ -224,7 +224,7 @@ static void floppy_drive_init(device_t *img)
pDrive->index_timer = img->machine().scheduler().timer_alloc(FUNC(floppy_drive_index_callback), (void *) img);
pDrive->idx = 0;
- floppy_drive_set_geometry(img, ((floppy_config*)img->baseconfig().static_config())->floppy_type);
+ floppy_drive_set_geometry(img, ((floppy_config*)img->static_config())->floppy_type);
/* initialise id index - not so important */
pDrive->id_index = 0;
@@ -572,7 +572,7 @@ void floppy_drive_set_controller(device_t *img, device_t *controller)
DEVICE_START( floppy )
{
floppy_drive *floppy = get_safe_token( device );
- floppy->config = (const floppy_config*)device->baseconfig().static_config();
+ floppy->config = (const floppy_config*)device->static_config();
floppy_drive_init(device);
floppy->drive_id = floppy_get_drive(device);
@@ -614,7 +614,7 @@ static int internal_floppy_device_load(device_image_interface *image, int create
flopimg = get_safe_token( &image->device() );
/* figure out the floppy options */
- floppy_options = ((floppy_config*)image->device().baseconfig().static_config())->formats;
+ floppy_options = ((floppy_config*)image->device().static_config())->formats;
if (image->has_been_created())
{
@@ -995,7 +995,7 @@ DEVICE_GET_INFO(floppy)
case DEVINFO_FCT_IMAGE_UNLOAD: info->f = (genf *) DEVICE_IMAGE_UNLOAD_NAME(floppy); break;
case DEVINFO_FCT_IMAGE_SOFTLIST_LOAD: info->f = (genf *) DEVICE_IMAGE_SOFTLIST_LOAD_NAME(floppy); break;
case DEVINFO_FCT_IMAGE_DISPLAY_INFO:
- if ( device && downcast<const legacy_image_device_config_base *>(device)->inline_config() && get_config_dev(device)->device_displayinfo) {
+ if ( device && downcast<const legacy_image_device_base *>(device)->inline_config() && get_config_dev(device)->device_displayinfo) {
info->f = (genf *) get_config_dev(device)->device_displayinfo;
} else {
info->f = NULL;
diff --git a/src/emu/imagedev/harddriv.c b/src/emu/imagedev/harddriv.c
index e7238fc51ab..16b142fa9df 100644
--- a/src/emu/imagedev/harddriv.c
+++ b/src/emu/imagedev/harddriv.c
@@ -269,7 +269,7 @@ static DEVICE_START(hd)
{
dev_harddisk_t *harddisk = get_safe_token( device );
- harddisk->config = (const harddisk_callback_config*)device->baseconfig().static_config();
+ harddisk->config = (const harddisk_callback_config*)device->static_config();
harddisk->chd = NULL;
harddisk->hard_disk_handle = NULL;
}
diff --git a/src/emu/imagedev/printer.c b/src/emu/imagedev/printer.c
index e88a3f5a102..ab256b00c92 100644
--- a/src/emu/imagedev/printer.c
+++ b/src/emu/imagedev/printer.c
@@ -49,7 +49,7 @@ void printer_output(device_t *printer, UINT8 data)
static DEVICE_IMAGE_LOAD( printer )
{
- const printer_config *conf = (const printer_config *)downcast<const legacy_image_device_config_base &>(image.device().baseconfig()).inline_config();
+ const printer_config *conf = (const printer_config *)downcast<const legacy_image_device_base &>(image.device()).inline_config();
/* send notify that the printer is now online */
if (conf != NULL && conf->online != NULL)
@@ -66,7 +66,7 @@ static DEVICE_IMAGE_LOAD( printer )
static DEVICE_IMAGE_UNLOAD( printer )
{
- const printer_config *conf = (const printer_config *)downcast<const legacy_image_device_config_base &>(image.device().baseconfig()).inline_config();
+ const printer_config *conf = (const printer_config *)downcast<const legacy_image_device_base &>(image.device()).inline_config();
/* send notify that the printer is now offline */
if (conf != NULL && conf->online != NULL)
diff --git a/src/emu/imagedev/snapquik.c b/src/emu/imagedev/snapquik.c
index ba9ccaeaad3..c15f82d597e 100644
--- a/src/emu/imagedev/snapquik.c
+++ b/src/emu/imagedev/snapquik.c
@@ -34,7 +34,7 @@ struct _snapquick_token
INLINE void assert_is_snapshot_or_quickload(device_t *device)
{
assert(device != NULL);
- assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
+ assert(downcast<const legacy_device_base *>(device)->inline_config() != NULL);
assert((device->type() == SNAPSHOT) || (device->type() == QUICKLOAD)
|| (device->type() == Z80BIN));
}
@@ -60,15 +60,15 @@ INLINE snapquick_token *get_token(device_t *device)
INLINE const snapquick_config *get_config(device_t *device)
{
assert_is_snapshot_or_quickload(device);
- return (const snapquick_config *) downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ return (const snapquick_config *) downcast<const legacy_device_base *>(device)->inline_config();
}
-INLINE const snapquick_config *get_config_dev(const device_config *device)
+INLINE const snapquick_config *get_config_dev(const device_t *device)
{
assert(device != NULL);
assert((device->type() == SNAPSHOT) || (device->type() == QUICKLOAD)
|| (device->type() == Z80BIN));
- return (const snapquick_config *) downcast<const legacy_device_config_base *>(device)->inline_config();
+ return (const snapquick_config *) downcast<const legacy_device_base *>(device)->inline_config();
}
/*-------------------------------------------------
@@ -323,7 +323,7 @@ static QUICKLOAD_LOAD( z80bin )
/* is this file executable? */
if (exec_addr != 0xffff)
{
- config = (const z80bin_config *)downcast<const legacy_device_config_base &>(image.device().baseconfig()).inline_config();
+ config = (const z80bin_config *)downcast<const legacy_device_base &>(image.device()).inline_config();
/* check to see if autorun is on (I hate how this works) */
autorun = input_port_read_safe(image.device().machine(), "CONFIG", 0xFF) & 1;
diff --git a/src/emu/info.c b/src/emu/info.c
index 7cf85649b2d..5ef5f542476 100644
--- a/src/emu/info.c
+++ b/src/emu/info.c
@@ -249,9 +249,9 @@ void info_xml_creator::output_one()
machine_config &config = m_drivlist.config();
ioport_list portlist;
input_port_list_init(portlist, driver.ipt, NULL, 0, FALSE, NULL);
- for (device_config *cfg = config.m_devicelist.first(); cfg != NULL; cfg = cfg->next())
- if (cfg->input_ports() != NULL)
- input_port_list_init(portlist, cfg->input_ports(), NULL, 0, FALSE, cfg);
+ for (device_t *device = config.devicelist().first(); device != NULL; device = device->next())
+ if (device->input_ports() != NULL)
+ input_port_list_init(portlist, device->input_ports(), NULL, 0, FALSE, device);
// print the header and the game name
fprintf(m_output, "\t<" XML_TOP);
@@ -326,9 +326,9 @@ void info_xml_creator::output_one()
void info_xml_creator::output_sampleof()
{
// iterate over sample devices
- for (const device_config *devconfig = m_drivlist.config().m_devicelist.first(SAMPLES); devconfig != NULL; devconfig = devconfig->typenext())
+ for (const device_t *device = m_drivlist.config().devicelist().first(SAMPLES); device != NULL; device = device->typenext())
{
- const char *const *samplenames = ((const samples_interface *)devconfig->static_config())->samplenames;
+ const char *const *samplenames = ((const samples_interface *)device->static_config())->samplenames;
if (samplenames != NULL)
// iterate over sample names
@@ -484,9 +484,9 @@ void info_xml_creator::output_rom()
void info_xml_creator::output_sample()
{
// iterate over sample devices
- for (const device_config *devconfig = m_drivlist.config().m_devicelist.first(SAMPLES); devconfig != NULL; devconfig = devconfig->typenext())
+ for (const device_t *device = m_drivlist.config().devicelist().first(SAMPLES); device != NULL; device = device->typenext())
{
- const char *const *samplenames = ((const samples_interface *)devconfig->static_config())->samplenames;
+ const char *const *samplenames = ((const samples_interface *)device->static_config())->samplenames;
if (samplenames != NULL)
// iterate over sample names
@@ -520,27 +520,27 @@ void info_xml_creator::output_sample()
void info_xml_creator::output_chips()
{
// iterate over executable devices
- const device_config_execute_interface *exec = NULL;
- for (bool gotone = m_drivlist.config().m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ device_execute_interface *exec = NULL;
+ for (bool gotone = m_drivlist.config().devicelist().first(exec); gotone; gotone = exec->next(exec))
{
fprintf(m_output, "\t\t<chip");
fprintf(m_output, " type=\"cpu\"");
- fprintf(m_output, " tag=\"%s\"", xml_normalize_string(exec->devconfig().tag()));
- fprintf(m_output, " name=\"%s\"", xml_normalize_string(exec->devconfig().name()));
- fprintf(m_output, " clock=\"%d\"", exec->devconfig().clock());
+ fprintf(m_output, " tag=\"%s\"", xml_normalize_string(exec->device().tag()));
+ fprintf(m_output, " name=\"%s\"", xml_normalize_string(exec->device().name()));
+ fprintf(m_output, " clock=\"%d\"", exec->device().clock());
fprintf(m_output, "/>\n");
}
// iterate over sound devices
- const device_config_sound_interface *sound = NULL;
- for (bool gotone = m_drivlist.config().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ device_sound_interface *sound = NULL;
+ for (bool gotone = m_drivlist.config().devicelist().first(sound); gotone; gotone = sound->next(sound))
{
fprintf(m_output, "\t\t<chip");
fprintf(m_output, " type=\"audio\"");
- fprintf(m_output, " tag=\"%s\"", xml_normalize_string(sound->devconfig().tag()));
- fprintf(m_output, " name=\"%s\"", xml_normalize_string(sound->devconfig().name()));
- if (sound->devconfig().clock() != 0)
- fprintf(m_output, " clock=\"%d\"", sound->devconfig().clock());
+ fprintf(m_output, " tag=\"%s\"", xml_normalize_string(sound->device().tag()));
+ fprintf(m_output, " name=\"%s\"", xml_normalize_string(sound->device().name()));
+ if (sound->device().clock() != 0)
+ fprintf(m_output, " clock=\"%d\"", sound->device().clock());
fprintf(m_output, "/>\n");
}
}
@@ -554,11 +554,11 @@ void info_xml_creator::output_chips()
void info_xml_creator::output_display()
{
// iterate over screens
- for (const screen_device_config *devconfig = m_drivlist.config().first_screen(); devconfig != NULL; devconfig = devconfig->next_screen())
+ for (const screen_device *device = m_drivlist.config().first_screen(); device != NULL; device = device->next_screen())
{
fprintf(m_output, "\t\t<display");
- switch (devconfig->screen_type())
+ switch (device->screen_type())
{
case SCREEN_TYPE_RASTER: fprintf(m_output, " type=\"raster\""); break;
case SCREEN_TYPE_VECTOR: fprintf(m_output, " type=\"vector\""); break;
@@ -596,29 +596,29 @@ void info_xml_creator::output_display()
}
// output width and height only for games that are not vector
- if (devconfig->screen_type() != SCREEN_TYPE_VECTOR)
+ if (device->screen_type() != SCREEN_TYPE_VECTOR)
{
- const rectangle &visarea = devconfig->visible_area();
+ const rectangle &visarea = device->visible_area();
fprintf(m_output, " width=\"%d\"", visarea.max_x - visarea.min_x + 1);
fprintf(m_output, " height=\"%d\"", visarea.max_y - visarea.min_y + 1);
}
// output refresh rate
- fprintf(m_output, " refresh=\"%f\"", ATTOSECONDS_TO_HZ(devconfig->refresh()));
+ fprintf(m_output, " refresh=\"%f\"", ATTOSECONDS_TO_HZ(device->refresh_attoseconds()));
// output raw video parameters only for games that are not vector
// and had raw parameters specified
- if (devconfig->screen_type() != SCREEN_TYPE_VECTOR && !devconfig->oldstyle_vblank_supplied())
+ if (device->screen_type() != SCREEN_TYPE_VECTOR && !device->oldstyle_vblank_supplied())
{
- int pixclock = devconfig->width() * devconfig->height() * ATTOSECONDS_TO_HZ(devconfig->refresh());
+ int pixclock = device->width() * device->height() * ATTOSECONDS_TO_HZ(device->refresh_attoseconds());
fprintf(m_output, " pixclock=\"%d\"", pixclock);
- fprintf(m_output, " htotal=\"%d\"", devconfig->width());
- fprintf(m_output, " hbend=\"%d\"", devconfig->visible_area().min_x);
- fprintf(m_output, " hbstart=\"%d\"", devconfig->visible_area().max_x+1);
- fprintf(m_output, " vtotal=\"%d\"", devconfig->height());
- fprintf(m_output, " vbend=\"%d\"", devconfig->visible_area().min_y);
- fprintf(m_output, " vbstart=\"%d\"", devconfig->visible_area().max_y+1);
+ fprintf(m_output, " htotal=\"%d\"", device->width());
+ fprintf(m_output, " hbend=\"%d\"", device->visible_area().min_x);
+ fprintf(m_output, " hbstart=\"%d\"", device->visible_area().max_x+1);
+ fprintf(m_output, " vtotal=\"%d\"", device->height());
+ fprintf(m_output, " vbend=\"%d\"", device->visible_area().min_y);
+ fprintf(m_output, " vbstart=\"%d\"", device->visible_area().max_y+1);
}
fprintf(m_output, " />\n");
}
@@ -632,11 +632,11 @@ void info_xml_creator::output_display()
void info_xml_creator::output_sound()
{
- int speakers = m_drivlist.config().m_devicelist.count(SPEAKER);
+ int speakers = m_drivlist.config().devicelist().count(SPEAKER);
// if we have no sound, zero m_output the speaker count
- const device_config_sound_interface *sound = NULL;
- if (!m_drivlist.config().m_devicelist.first(sound))
+ const device_sound_interface *sound = NULL;
+ if (!m_drivlist.config().devicelist().first(sound))
speakers = 0;
fprintf(m_output, "\t\t<sound channels=\"%d\"/>\n", speakers);
@@ -1032,15 +1032,15 @@ void info_xml_creator::output_categories(const ioport_list &portlist)
void info_xml_creator::output_images()
{
- const device_config_image_interface *dev = NULL;
- for (bool gotone = m_drivlist.config().m_devicelist.first(dev); gotone; gotone = dev->next(dev))
+ const device_image_interface *dev = NULL;
+ for (bool gotone = m_drivlist.config().devicelist().first(dev); gotone; gotone = dev->next(dev))
{
// print m_output device type
fprintf(m_output, "\t\t<device type=\"%s\"", xml_normalize_string(dev->image_type_name()));
// does this device have a tag?
- if (dev->devconfig().tag())
- fprintf(m_output, " tag=\"%s\"", xml_normalize_string(dev->devconfig().tag()));
+ if (dev->device().tag())
+ fprintf(m_output, " tag=\"%s\"", xml_normalize_string(dev->device().tag()));
// is this device mandatory?
if (dev->must_be_loaded())
@@ -1083,9 +1083,9 @@ void info_xml_creator::output_images()
void info_xml_creator::output_software_list()
{
- for (const device_config *dev = m_drivlist.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
+ for (const device_t *dev = m_drivlist.config().devicelist().first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
- software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
+ software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config();
for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
if (swlist->list_name[i])
@@ -1105,9 +1105,9 @@ void info_xml_creator::output_software_list()
void info_xml_creator::output_ramoptions()
{
- for (const device_config *device = m_drivlist.config().m_devicelist.first(RAM); device != NULL; device = device->typenext())
+ for (const device_t *device = m_drivlist.config().devicelist().first(RAM); device != NULL; device = device->typenext())
{
- ram_config *ram = (ram_config *)downcast<const legacy_device_config_base *>(device)->inline_config();
+ ram_config *ram = (ram_config *)downcast<const legacy_device_base *>(device)->inline_config();
fprintf(m_output, "\t\t<ramoption default=\"1\">%u</ramoption>\n", ram_parse_string(ram->default_size));
if (ram->extra_options != NULL)
diff --git a/src/emu/inptport.c b/src/emu/inptport.c
index 0c73d1e3f98..2cf3a58c919 100644
--- a/src/emu/inptport.c
+++ b/src/emu/inptport.c
@@ -788,7 +788,7 @@ static void frame_update_analog_field(running_machine &machine, analog_field_sta
static int frame_get_digital_field_state(const input_field_config *field, int mouse_down);
/* port configuration helpers */
-static void port_config_detokenize(ioport_list &portlist, const input_port_token *ipt, char *errorbuf, int errorbuflen, device_config *owner);
+static void port_config_detokenize(ioport_list &portlist, const input_port_token *ipt, char *errorbuf, int errorbuflen, device_t *owner);
static input_field_config *field_config_alloc(input_port_config *port, int type, input_port_value defvalue, input_port_value maskbits);
static void field_config_insert(input_field_config *field, input_port_value *disallowedbits, char *errorbuf, int errorbuflen);
static void field_config_free(input_field_config **fieldptr);
@@ -973,7 +973,7 @@ static WRITE_LINE_DEVICE_HANDLER( changed_write_line_device )
system
-------------------------------------------------*/
-time_t input_port_init(running_machine &machine, const input_port_token *tokens, const device_config_list &devicelist)
+time_t input_port_init(running_machine &machine, const input_port_token *tokens, const device_list &devicelist)
{
//input_port_private *portdata;
char errorbuf[1024];
@@ -998,11 +998,11 @@ time_t input_port_init(running_machine &machine, const input_port_token *tokens,
mame_printf_error("Input port errors:\n%s", errorbuf);
}
- for (device_config *config = devicelist.first(); config != NULL; config = config->next())
+ for (device_t *device = devicelist.first(); device != NULL; device = device->next())
{
- if (config->input_ports() != NULL)
+ if (device->input_ports() != NULL)
{
- input_port_list_init(machine.m_portlist, config->input_ports(), errorbuf, sizeof(errorbuf), TRUE, config);
+ input_port_list_init(machine.m_portlist, device->input_ports(), errorbuf, sizeof(errorbuf), TRUE, device);
if (errorbuf[0] != 0)
mame_printf_error("Input port errors:\n%s", errorbuf);
}
@@ -1044,7 +1044,7 @@ static void input_port_exit(running_machine &machine)
according to the given tokens
-------------------------------------------------*/
-void input_port_list_init(ioport_list &portlist, const input_port_token *tokens, char *errorbuf, int errorbuflen, int allocmap, device_config *owner)
+void input_port_list_init(ioport_list &portlist, const input_port_token *tokens, char *errorbuf, int errorbuflen, int allocmap, device_t *owner)
{
/* no tokens, no list */
if (tokens == NULL)
@@ -1637,7 +1637,7 @@ input_port_value input_port_read(running_machine &machine, const char *tag)
input_port_value input_port_read(device_t *device, const char *tag)
{
astring tempstring;
- const input_port_config *port = device->machine().port(device->baseconfig().subtag(tempstring, tag));
+ const input_port_config *port = device->machine().port(device->subtag(tempstring, tag));
if (port == NULL)
fatalerror("Unable to locate input port '%s'", tag);
return input_port_read_direct(port);
@@ -2937,7 +2937,7 @@ static int frame_get_digital_field_state(const input_field_config *field, int mo
of port settings according to device settings
-------------------------------------------------*/
-static UINT32 port_default_value(const char *fulltag, UINT32 mask, UINT32 defval, device_config *owner)
+static UINT32 port_default_value(const char *fulltag, UINT32 mask, UINT32 defval, device_t *owner)
{
astring tempstring;
const input_device_default *def = NULL;
@@ -2960,7 +2960,7 @@ static UINT32 port_default_value(const char *fulltag, UINT32 mask, UINT32 defval
detokenize a series of input port tokens
-------------------------------------------------*/
-static void port_config_detokenize(ioport_list &portlist, const input_port_token *ipt, char *errorbuf, int errorbuflen, device_config *owner)
+static void port_config_detokenize(ioport_list &portlist, const input_port_token *ipt, char *errorbuf, int errorbuflen, device_t *owner)
{
UINT32 entrytype = INPUT_TOKEN_INVALID;
input_setting_config *cursetting = NULL;
diff --git a/src/emu/inptport.h b/src/emu/inptport.h
index 5ee632fcccd..d7baddb1895 100644
--- a/src/emu/inptport.h
+++ b/src/emu/inptport.h
@@ -750,7 +750,7 @@ public:
/* these fields are only valid if the port is live */
input_port_state * state; /* live state of port (NULL if not live) */
- device_config * owner; /* associated device, when appropriate */
+ device_t * owner; /* associated device, when appropriate */
input_port_value active; /* mask of active bits in the port */
private:
@@ -1085,14 +1085,14 @@ struct _inp_header
/* ----- core system management ----- */
/* initialize the input ports, processing the given token list */
-time_t input_port_init(running_machine &machine, const input_port_token *tokens, const device_config_list &devicelist);
+time_t input_port_init(running_machine &machine, const input_port_token *tokens, const device_list &devicelist);
/* ----- port configurations ----- */
/* initialize an input port list structure and allocate ports according to the given tokens */
-void input_port_list_init(ioport_list &portlist, const input_port_token *tokens, char *errorbuf, int errorbuflen, int allocmap, device_config *owner);
+void input_port_list_init(ioport_list &portlist, const input_port_token *tokens, char *errorbuf, int errorbuflen, int allocmap, device_t *owner);
/* return the field that matches the given tag and mask */
const input_field_config *input_field_by_tag_and_mask(const ioport_list &portlist, const char *tag, input_port_value mask);
diff --git a/src/emu/machine.c b/src/emu/machine.c
index 7a53ea68877..646e4d9fff4 100644
--- a/src/emu/machine.c
+++ b/src/emu/machine.c
@@ -139,8 +139,7 @@ static char giant_string_buffer[65536] = { 0 };
//-------------------------------------------------
running_machine::running_machine(const machine_config &_config, osd_interface &osd, bool exit_to_game_select)
- : m_devicelist(m_respool),
- firstcpu(NULL),
+ : firstcpu(NULL),
primary_screen(NULL),
palette(NULL),
pens(NULL),
@@ -192,20 +191,18 @@ running_machine::running_machine(const machine_config &_config, osd_interface &o
memset(gfx, 0, sizeof(gfx));
memset(&generic, 0, sizeof(generic));
memset(&m_base_time, 0, sizeof(m_base_time));
+
+ // set the machine on all devices
+ const_cast<device_list &>(devicelist()).set_machine_all(*this);
// find the driver device config and tell it which game
- device_config *config = m_config.m_devicelist.find("root");
- if (config == NULL)
- throw emu_fatalerror("Machine configuration missing driver_device");
-
- // attach this machine to all the devices in the configuration
- m_devicelist.import_config_list(m_config.m_devicelist, *this);
m_driver_device = device<driver_device>("root");
- assert(m_driver_device != NULL);
+ if (m_driver_device == NULL)
+ throw emu_fatalerror("Machine configuration missing driver_device");
// find devices
- primary_screen = downcast<screen_device *>(m_devicelist.first(SCREEN));
- for (device_t *device = m_devicelist.first(); device != NULL; device = device->next())
+ primary_screen = downcast<screen_device *>(devicelist().first(SCREEN));
+ for (device_t *device = devicelist().first(); device != NULL; device = device->next())
if (dynamic_cast<cpu_device *>(device) != NULL)
{
firstcpu = downcast<cpu_device *>(device);
@@ -282,7 +279,7 @@ void running_machine::start()
// initialize the input system and input ports for the game
// this must be done before memory_init in order to allow specifying
// callbacks based on input port tags
- time_t newbase = input_port_init(*this, m_system.ipt, m_config.m_devicelist);
+ time_t newbase = input_port_init(*this, m_system.ipt, devicelist());
if (newbase != 0)
m_base_time = newbase;
@@ -322,7 +319,7 @@ void running_machine::start()
ui_set_startup_text(*this, "Initializing...", true);
// start up the devices
- m_devicelist.start_all();
+ const_cast<device_list &>(devicelist()).start_all();
// if we're coming in with a savegame request, process it now
const char *savegame = options().state();
@@ -342,6 +339,36 @@ void running_machine::start()
//-------------------------------------------------
+// add_dynamic_device - dynamically add a device
+//-------------------------------------------------
+
+device_t &running_machine::add_dynamic_device(device_t &owner, device_type type, const char *tag, UINT32 clock)
+{
+ // allocate and append this device
+ astring tempstring;
+ device_t &device = const_cast<device_list &>(devicelist()).append(tag, *type(m_config, owner.subtag(tempstring, tag), &owner, clock));
+
+ // append any machine config additions from new devices
+ for (device_t *curdevice = devicelist().first(); curdevice != NULL; curdevice = curdevice->next())
+ if (!curdevice->configured())
+ {
+ machine_config_constructor machconfig = curdevice->machine_config_additions();
+ if (machconfig != NULL)
+ (*machconfig)(const_cast<machine_config &>(m_config), curdevice);
+ }
+
+ // notify any new devices that their configurations are complete
+ for (device_t *curdevice = devicelist().first(); curdevice != NULL; curdevice = curdevice->next())
+ if (!curdevice->configured())
+ curdevice->config_complete();
+
+ // start all the new devices
+ const_cast<device_list &>(devicelist()).start_new_devices();
+ return device;
+}
+
+
+//-------------------------------------------------
// run - execute the machine
//-------------------------------------------------
@@ -924,11 +951,11 @@ running_machine::logerror_callback_item::logerror_callback_item(logerror_callbac
//**************************************************************************
//-------------------------------------------------
-// driver_device_config_base - constructor
+// driver_device - constructor
//-------------------------------------------------
-driver_device_config_base::driver_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner)
- : device_config(mconfig, type, "Driver Device", tag, owner, 0),
+driver_device::driver_device(const machine_config &mconfig, device_type type, const char *tag)
+ : device_t(mconfig, type, "Driver Device", tag, NULL, 0),
m_system(NULL),
m_palette_init(NULL)
{
@@ -937,23 +964,33 @@ driver_device_config_base::driver_device_config_base(const machine_config &mconf
//-------------------------------------------------
+// driver_device - destructor
+//-------------------------------------------------
+
+driver_device::~driver_device()
+{
+}
+
+
+//-------------------------------------------------
// static_set_game - set the game in the device
// configuration
//-------------------------------------------------
-void driver_device_config_base::static_set_game(device_config *device, const game_driver *game)
+void driver_device::static_set_game(device_t &device, const game_driver &game)
{
- driver_device_config_base *base = downcast<driver_device_config_base *>(device);
+ driver_device &driver = downcast<driver_device &>(device);
- base->m_system = game;
+ // set the system
+ driver.m_system = &game;
// set the short name to the game's name
- base->m_shortname = game->name;
+ driver.m_shortname = game.name;
// and set the search path to include all parents
- base->m_searchpath = game->name;
- for (int parent = driver_list::clone(*game); parent != -1; parent = driver_list::clone(parent))
- base->m_searchpath.cat(";").cat(driver_list::driver(parent).name);
+ driver.m_searchpath = game.name;
+ for (int parent = driver_list::clone(game); parent != -1; parent = driver_list::clone(parent))
+ driver.m_searchpath.cat(";").cat(driver_list::driver(parent).name);
}
@@ -963,9 +1000,9 @@ void driver_device_config_base::static_set_game(device_config *device, const gam
// configuration
//-------------------------------------------------
-void driver_device_config_base::static_set_callback(device_config *device, callback_type type, legacy_callback_func callback)
+void driver_device::static_set_callback(device_t &device, callback_type type, legacy_callback_func callback)
{
- downcast<driver_device_config_base *>(device)->m_callbacks[type] = callback;
+ downcast<driver_device &>(device).m_callbacks[type] = callback;
}
@@ -975,45 +1012,9 @@ void driver_device_config_base::static_set_callback(device_config *device, callb
// configuration
//-------------------------------------------------
-void driver_device_config_base::static_set_palette_init(device_config *device, palette_init_func callback)
-{
- downcast<driver_device_config_base *>(device)->m_palette_init = callback;
-}
-
-
-//-------------------------------------------------
-// rom_region - return a pointer to the ROM
-// regions specified for the current game
-//-------------------------------------------------
-
-const rom_entry *driver_device_config_base::device_rom_region() const
-{
- return m_system->rom;
-}
-
-
-
-//**************************************************************************
-// DRIVER DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// driver_device - constructor
-//-------------------------------------------------
-
-driver_device::driver_device(running_machine &machine, const driver_device_config_base &config)
- : device_t(machine, config),
- m_config(config)
-{
-}
-
-
-//-------------------------------------------------
-// driver_device - destructor
-//-------------------------------------------------
-
-driver_device::~driver_device()
+void driver_device::static_set_palette_init(device_t &device, palette_init_func callback)
{
+ downcast<driver_device &>(device).m_palette_init = callback;
}
@@ -1034,8 +1035,8 @@ void driver_device::driver_start()
void driver_device::machine_start()
{
- if (m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START])(machine());
+ if (m_callbacks[CB_MACHINE_START] != NULL)
+ (*m_callbacks[CB_MACHINE_START])(machine());
}
@@ -1046,8 +1047,8 @@ void driver_device::machine_start()
void driver_device::sound_start()
{
- if (m_config.m_callbacks[driver_device_config_base::CB_SOUND_START] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_START])(machine());
+ if (m_callbacks[CB_SOUND_START] != NULL)
+ (*m_callbacks[CB_SOUND_START])(machine());
}
@@ -1058,8 +1059,8 @@ void driver_device::sound_start()
void driver_device::video_start()
{
- if (m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START])(machine());
+ if (m_callbacks[CB_VIDEO_START] != NULL)
+ (*m_callbacks[CB_VIDEO_START])(machine());
}
@@ -1080,8 +1081,8 @@ void driver_device::driver_reset()
void driver_device::machine_reset()
{
- if (m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET])(machine());
+ if (m_callbacks[CB_MACHINE_RESET] != NULL)
+ (*m_callbacks[CB_MACHINE_RESET])(machine());
}
@@ -1092,8 +1093,8 @@ void driver_device::machine_reset()
void driver_device::sound_reset()
{
- if (m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET])(machine());
+ if (m_callbacks[CB_SOUND_RESET] != NULL)
+ (*m_callbacks[CB_SOUND_RESET])(machine());
}
@@ -1104,8 +1105,8 @@ void driver_device::sound_reset()
void driver_device::video_reset()
{
- if (m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET])(machine());
+ if (m_callbacks[CB_VIDEO_RESET] != NULL)
+ (*m_callbacks[CB_VIDEO_RESET])(machine());
}
@@ -1131,6 +1132,17 @@ void driver_device::screen_eof()
//-------------------------------------------------
+// device_rom_region - return a pointer to the
+// game's ROMs
+//-------------------------------------------------
+
+const rom_entry *driver_device::device_rom_region() const
+{
+ return m_system->rom;
+}
+
+
+//-------------------------------------------------
// device_start - device override which calls
// the various helpers
//-------------------------------------------------
@@ -1142,15 +1154,15 @@ void driver_device::device_start()
throw device_missing_dependencies();
// call the game-specific init
- if (m_config.m_system->driver_init != NULL)
- (*m_config.m_system->driver_init)(machine());
+ if (m_system->driver_init != NULL)
+ (*m_system->driver_init)(machine());
// finish image devices init process
image_postdevice_init(machine());
// call palette_init if present
- if (m_config.m_palette_init != NULL)
- (*m_config.m_palette_init)(machine(), machine().region("proms")->base());
+ if (m_palette_init != NULL)
+ (*m_palette_init)(machine(), machine().region("proms")->base());
// start the various pieces
driver_start();
diff --git a/src/emu/machine.h b/src/emu/machine.h
index 3b12245a5d4..c52ff0d661e 100644
--- a/src/emu/machine.h
+++ b/src/emu/machine.h
@@ -327,6 +327,7 @@ public:
// getters
const machine_config &config() const { return m_config; }
+ const device_list &devicelist() const { return m_config.devicelist(); }
const game_driver &system() const { return m_system; }
osd_interface &osd() const { return m_osd; }
resource_pool &respool() { return m_respool; }
@@ -363,6 +364,7 @@ public:
inline const memory_region *region(const char *tag);
// configuration helpers
+ device_t &add_dynamic_device(device_t &owner, device_type type, const char *tag, UINT32 clock);
UINT32 total_colors() const { return m_config.m_total_colors; }
// immediate operations
@@ -397,7 +399,6 @@ public:
const char *describe_context();
// internals
- device_list m_devicelist; // list of running devices
ioport_list m_portlist; // points to a list of input port configurations
// CPU information
@@ -528,18 +529,16 @@ private:
-// ======================> driver_device_config_base
+// ======================> driver_device
-// a base class with common functionality for the (mostly stub) driver_device_configs
-class driver_device_config_base : public device_config
+// base class for machine driver-specific devices
+class driver_device : public device_t
{
- friend class driver_device;
-
-protected:
+public:
// construction/destruction
- driver_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner);
+ driver_device(const machine_config &mconfig, device_type type, const char *tag);
+ virtual ~driver_device();
-public:
// indexes into our generic callbacks
enum callback_type
{
@@ -553,60 +552,9 @@ public:
};
// inline configuration helpers
- static void static_set_game(device_config *device, const game_driver *game);
- static void static_set_callback(device_config *device, callback_type type, legacy_callback_func callback);
- static void static_set_palette_init(device_config *device, palette_init_func callback);
-
-protected:
- // optional information overrides
- virtual const rom_entry *device_rom_region() const;
-
- // internal state
- const game_driver * m_system; // pointer to the game driver
-
- legacy_callback_func m_callbacks[CB_COUNT]; // generic legacy callbacks
- palette_init_func m_palette_init; // one-time palette init callback
-};
-
-
-
-// ======================> driver_device_config
-
-// this provides a minimal config class for driver devices, which don't
-// explicitly declare their own
-template<class _DeviceClass>
-class driver_device_config : public driver_device_config_base
-{
- // construction/destruction
- driver_device_config(const machine_config &mconfig, const char *tag, const device_config *owner)
- : driver_device_config_base(mconfig, static_alloc_device_config, tag, owner) { }
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- {
- return global_alloc(driver_device_config(mconfig, tag, owner));
- }
-
- virtual device_t *alloc_device(running_machine &machine) const
- {
- // we clear here for historical reasons, as many existing driver states
- // assume everything is NULL before starting
- return auto_alloc_clear(machine, _DeviceClass(machine, *this));
- }
-};
-
-
-
-// ======================> driver_device
-
-// base class for machine driver-specific devices
-class driver_device : public device_t
-{
-public:
- // construction/destruction
- driver_device(running_machine &machine, const driver_device_config_base &config);
- virtual ~driver_device();
+ static void static_set_game(device_t &device, const game_driver &game);
+ static void static_set_callback(device_t &device, callback_type type, legacy_callback_func callback);
+ static void static_set_palette_init(device_t &device, palette_init_func callback);
// additional video helpers
virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
@@ -626,14 +574,28 @@ protected:
virtual void video_reset();
// device-level overrides
+ virtual const rom_entry *device_rom_region() const;
virtual void device_start();
virtual void device_reset();
// internal state
- const driver_device_config_base &m_config;
+ const game_driver * m_system; // pointer to the game driver
+
+ legacy_callback_func m_callbacks[CB_COUNT]; // generic legacy callbacks
+ palette_init_func m_palette_init; // one-time palette init callback
};
+// this template function creates a stub which constructs a device
+template<class T>
+device_t *driver_device_creator(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+{
+ assert(owner == NULL);
+ assert(clock == 0);
+ return global_alloc_clear(T(mconfig, &driver_device_creator<T>, tag));
+}
+
+
//**************************************************************************
// INLINE FUNCTIONS
@@ -641,7 +603,7 @@ protected:
inline device_t *running_machine::device(const char *tag)
{
- return m_devicelist.find(tag);
+ return devicelist().find(tag);
}
inline const input_port_config *running_machine::port(const char *tag)
diff --git a/src/emu/machine/6522via.c b/src/emu/machine/6522via.c
index fd40ae03caf..c753fb1e551 100644
--- a/src/emu/machine/6522via.c
+++ b/src/emu/machine/6522via.c
@@ -105,44 +105,6 @@
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(via6522, "6522 VIA")
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void via6522_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const via6522_interface *intf = reinterpret_cast<const via6522_interface *>(static_config());
- if (intf != NULL)
- *static_cast<via6522_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_in_a_func, 0, sizeof(m_in_a_func));
- memset(&m_in_b_func, 0, sizeof(m_in_b_func));
- memset(&m_in_ca1_func, 0, sizeof(m_in_ca1_func));
- memset(&m_in_cb1_func, 0, sizeof(m_in_cb1_func));
- memset(&m_in_ca2_func, 0, sizeof(m_in_ca2_func));
- memset(&m_in_cb2_func, 0, sizeof(m_in_cb2_func));
- memset(&m_out_a_func, 0, sizeof(m_out_a_func));
- memset(&m_out_b_func, 0, sizeof(m_out_b_func));
- memset(&m_out_ca2_func, 0, sizeof(m_out_ca2_func));
- memset(&m_out_cb2_func, 0, sizeof(m_out_cb2_func));
- memset(&m_irq_func, 0, sizeof(m_irq_func));
- }
-}
-
-
-
/***************************************************************************
INLINE FUNCTIONS
***************************************************************************/
@@ -180,38 +142,70 @@ UINT16 via6522_device::get_counter1_value()
// LIVE DEVICE
//**************************************************************************
-const device_type VIA6522 = via6522_device_config::static_alloc_device_config;
+// device type definition
+const device_type VIA6522 = &device_creator<via6522_device>;
//-------------------------------------------------
// via6522_device - constructor
//-------------------------------------------------
-via6522_device::via6522_device(running_machine &_machine, const via6522_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+via6522_device::via6522_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, VIA6522, "6522 VIA", tag, owner, clock)
+{
+
+}
+
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void via6522_device::device_config_complete()
{
+ // inherit a copy of the static data
+ const via6522_interface *intf = reinterpret_cast<const via6522_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<via6522_interface *>(this) = *intf;
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_in_a_cb, 0, sizeof(m_in_a_cb));
+ memset(&m_in_b_cb, 0, sizeof(m_in_b_cb));
+ memset(&m_in_ca1_cb, 0, sizeof(m_in_ca1_cb));
+ memset(&m_in_cb1_cb, 0, sizeof(m_in_cb1_cb));
+ memset(&m_in_ca2_cb, 0, sizeof(m_in_ca2_cb));
+ memset(&m_in_cb2_cb, 0, sizeof(m_in_cb2_cb));
+ memset(&m_out_a_cb, 0, sizeof(m_out_a_cb));
+ memset(&m_out_b_cb, 0, sizeof(m_out_b_cb));
+ memset(&m_out_ca2_cb, 0, sizeof(m_out_ca2_cb));
+ memset(&m_out_cb2_cb, 0, sizeof(m_out_cb2_cb));
+ memset(&m_irq_cb, 0, sizeof(m_irq_cb));
+ }
}
+
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void via6522_device::device_start()
{
- devcb_resolve_read8(&m_in_a_func, &m_config.m_in_a_func, this);
- devcb_resolve_read8(&m_in_b_func, &m_config.m_in_b_func, this);
- devcb_resolve_read_line(&m_in_ca1_func, &m_config.m_in_ca1_func, this);
- devcb_resolve_read_line(&m_in_cb1_func, &m_config.m_in_cb1_func, this);
- devcb_resolve_read_line(&m_in_ca2_func, &m_config.m_in_ca2_func, this);
- devcb_resolve_read_line(&m_in_cb2_func, &m_config.m_in_cb2_func, this);
- devcb_resolve_write8(&m_out_a_func, &m_config.m_out_a_func, this);
- devcb_resolve_write8(&m_out_b_func, &m_config.m_out_b_func, this);
- devcb_resolve_write_line(&m_out_ca1_func, &m_config.m_out_ca1_func, this);
- devcb_resolve_write_line(&m_out_cb1_func, &m_config.m_out_cb1_func, this);
- devcb_resolve_write_line(&m_out_ca2_func, &m_config.m_out_ca2_func, this);
- devcb_resolve_write_line(&m_out_cb2_func, &m_config.m_out_cb2_func, this);
- devcb_resolve_write_line(&m_irq_func, &m_config.m_irq_func, this);
+ devcb_resolve_read8(&m_in_a_func, &m_in_a_cb, this);
+ devcb_resolve_read8(&m_in_b_func, &m_in_b_cb, this);
+ devcb_resolve_read_line(&m_in_ca1_func, &m_in_ca1_cb, this);
+ devcb_resolve_read_line(&m_in_cb1_func, &m_in_cb1_cb, this);
+ devcb_resolve_read_line(&m_in_ca2_func, &m_in_ca2_cb, this);
+ devcb_resolve_read_line(&m_in_cb2_func, &m_in_cb2_cb, this);
+ devcb_resolve_write8(&m_out_a_func, &m_out_a_cb, this);
+ devcb_resolve_write8(&m_out_b_func, &m_out_b_cb, this);
+ devcb_resolve_write_line(&m_out_ca1_func, &m_out_ca1_cb, this);
+ devcb_resolve_write_line(&m_out_cb1_func, &m_out_cb1_cb, this);
+ devcb_resolve_write_line(&m_out_ca2_func, &m_out_ca2_cb, this);
+ devcb_resolve_write_line(&m_out_cb2_func, &m_out_cb2_cb, this);
+ devcb_resolve_write_line(&m_irq_func, &m_irq_cb, this);
m_t1ll = 0xf3; /* via at 0x9110 in vic20 show these values */
m_t1lh = 0xb5; /* ports are not written by kernel! */
diff --git a/src/emu/machine/6522via.h b/src/emu/machine/6522via.h
index deb02af94f1..ba3373a133e 100644
--- a/src/emu/machine/6522via.h
+++ b/src/emu/machine/6522via.h
@@ -61,54 +61,33 @@
struct via6522_interface
{
- devcb_read8 m_in_a_func;
- devcb_read8 m_in_b_func;
- devcb_read_line m_in_ca1_func;
- devcb_read_line m_in_cb1_func;
- devcb_read_line m_in_ca2_func;
- devcb_read_line m_in_cb2_func;
- devcb_write8 m_out_a_func;
- devcb_write8 m_out_b_func;
- devcb_write_line m_out_ca1_func;
- devcb_write_line m_out_cb1_func;
- devcb_write_line m_out_ca2_func;
- devcb_write_line m_out_cb2_func;
- devcb_write_line m_irq_func;
-};
-
-
-// ======================> via6522_device_config
-
-class via6522_device_config : public device_config,
- public via6522_interface
-{
- friend class via6522_device;
-
- // construction/destruction
- via6522_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_a_cb;
+ devcb_read8 m_in_b_cb;
+ devcb_read_line m_in_ca1_cb;
+ devcb_read_line m_in_cb1_cb;
+ devcb_read_line m_in_ca2_cb;
+ devcb_read_line m_in_cb2_cb;
+ devcb_write8 m_out_a_cb;
+ devcb_write8 m_out_b_cb;
+ devcb_write_line m_out_ca1_cb;
+ devcb_write_line m_out_cb1_cb;
+ devcb_write_line m_out_ca2_cb;
+ devcb_write_line m_out_cb2_cb;
+ devcb_write_line m_irq_cb;
};
// ======================> via6522_device
-class via6522_device : public device_t
+class via6522_device : public device_t,
+ public via6522_interface
{
- friend class via6522_device_config;
friend class dart_channel;
+public:
// construction/destruction
- via6522_device(running_machine &_machine, const via6522_device_config &_config);
+ via6522_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -131,6 +110,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -200,8 +180,6 @@ private:
emu_timer *m_shift_timer;
UINT8 m_shift_counter;
-
- const via6522_device_config &m_config;
};
diff --git a/src/emu/machine/6526cia.c b/src/emu/machine/6526cia.c
index e8c6796e03f..3b0066d5f53 100644
--- a/src/emu/machine/6526cia.c
+++ b/src/emu/machine/6526cia.c
@@ -45,86 +45,34 @@
// DEVICE CONFIGURATION
//**************************************************************************
-//-------------------------------------------------
-// mos6526_device_config - constructor
-//-------------------------------------------------
-
-mos6526_device_config::mos6526_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "MOS6526", tag, owner, clock)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *mos6526_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(mos6526_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *mos6526_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, mos6526_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void mos6526_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const mos6526_interface *intf = reinterpret_cast<const mos6526_interface *>(static_config());
- if (intf != NULL)
- *static_cast<mos6526_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- m_tod_clock = 0;
- memset(&m_out_irq_func, 0, sizeof(m_out_irq_func));
- memset(&m_out_pc_func, 0, sizeof(m_out_pc_func));
- memset(&m_out_cnt_func, 0, sizeof(m_out_cnt_func));
- memset(&m_out_sp_func, 0, sizeof(m_out_sp_func));
- memset(&m_in_pa_func, 0, sizeof(m_in_pa_func));
- memset(&m_out_pa_func, 0, sizeof(m_out_pa_func));
- memset(&m_in_pb_func, 0, sizeof(m_in_pb_func));
- memset(&m_out_pb_func, 0, sizeof(m_out_pb_func));
- }
-}
-
-
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
-const device_type MOS6526R1 = mos6526_device_config::static_alloc_device_config;
-const device_type MOS6526R2 = mos6526_device_config::static_alloc_device_config;
-const device_type MOS8520 = mos6526_device_config::static_alloc_device_config;
+// device type definition
+const device_type MOS6526R1 = &device_creator<mos6526r1_device>;
+const device_type MOS6526R2 = &device_creator<mos6526r2_device>;
+const device_type MOS8520 = &device_creator<mos8520_device>;
//-------------------------------------------------
// mos6526_device - constructor
//-------------------------------------------------
-mos6526_device::mos6526_device(running_machine &_machine, const mos6526_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+mos6526_device::mos6526_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock)
{
-
}
+mos6526r1_device::mos6526r1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : mos6526_device(mconfig, MOS6526R1, "MOS6526r1", tag, owner, clock) { }
+
+mos6526r2_device::mos6526r2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : mos6526_device(mconfig, MOS6526R2, "MOS6526r2", tag, owner, clock) { }
+
+mos8520_device::mos8520_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : mos6526_device(mconfig, MOS8520, "MOS8520", tag, owner, clock) { }
+
//-------------------------------------------------
// device_reset - device-specific reset
@@ -173,23 +121,52 @@ void mos6526_device::device_reset()
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void mos6526_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const mos6526_interface *intf = reinterpret_cast<const mos6526_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<mos6526_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ m_tod_clock = 0;
+ memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
+ memset(&m_out_pc_cb, 0, sizeof(m_out_pc_cb));
+ memset(&m_out_cnt_cb, 0, sizeof(m_out_cnt_cb));
+ memset(&m_out_sp_cb, 0, sizeof(m_out_sp_cb));
+ memset(&m_in_pa_cb, 0, sizeof(m_in_pa_cb));
+ memset(&m_out_pa_cb, 0, sizeof(m_out_pa_cb));
+ memset(&m_in_pb_cb, 0, sizeof(m_in_pb_cb));
+ memset(&m_out_pb_cb, 0, sizeof(m_out_pb_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void mos6526_device::device_start()
{
/* clear out CIA structure, and copy the interface */
- devcb_resolve_write_line(&m_out_irq_func, &m_config.m_out_irq_func, this);
- devcb_resolve_write_line(&m_out_pc_func, &m_config.m_out_pc_func, this);
- devcb_resolve_write_line(&m_out_cnt_func, &m_config.m_out_cnt_func, this);
- devcb_resolve_write_line(&m_out_sp_func, &m_config.m_out_sp_func, this);
+ devcb_resolve_write_line(&m_out_irq_func, &m_out_irq_cb, this);
+ devcb_resolve_write_line(&m_out_pc_func, &m_out_pc_cb, this);
+ devcb_resolve_write_line(&m_out_cnt_func, &m_out_cnt_cb, this);
+ devcb_resolve_write_line(&m_out_sp_func, &m_out_sp_cb, this);
m_flag = 1;
/* setup ports */
- devcb_resolve_read8(&m_port[0].m_read, &m_config.m_in_pa_func, this);
- devcb_resolve_write8(&m_port[0].m_write, &m_config.m_out_pa_func, this);
- devcb_resolve_read8(&m_port[1].m_read, &m_config.m_in_pb_func, this);
- devcb_resolve_write8(&m_port[1].m_write, &m_config.m_out_pb_func, this);
+ devcb_resolve_read8(&m_port[0].m_read, &m_in_pa_cb, this);
+ devcb_resolve_write8(&m_port[0].m_write, &m_out_pa_cb, this);
+ devcb_resolve_read8(&m_port[1].m_read, &m_in_pb_cb, this);
+ devcb_resolve_write8(&m_port[1].m_write, &m_out_pb_cb, this);
for (int p = 0; p < (sizeof(m_port) / sizeof(m_port[0])); p++)
{
@@ -206,9 +183,9 @@ void mos6526_device::device_start()
}
/* setup TOD timer, if appropriate */
- if (m_config.m_tod_clock != 0)
+ if (m_tod_clock != 0)
{
- machine().scheduler().timer_pulse(attotime::from_hz(m_config.m_tod_clock), FUNC(clock_tod_callback), 0, (void *)this);
+ machine().scheduler().timer_pulse(attotime::from_hz(m_tod_clock), FUNC(clock_tod_callback), 0, (void *)this);
}
/* state save support */
diff --git a/src/emu/machine/6526cia.h b/src/emu/machine/6526cia.h
index 970d9ab91c1..ab17474524c 100644
--- a/src/emu/machine/6526cia.h
+++ b/src/emu/machine/6526cia.h
@@ -39,7 +39,7 @@
- //**************************************************************************
+//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
@@ -72,51 +72,30 @@ struct mos6526_interface
{
int m_tod_clock;
- devcb_write_line m_out_irq_func;
- devcb_write_line m_out_pc_func;
- devcb_write_line m_out_cnt_func;
- devcb_write_line m_out_sp_func;
-
- devcb_read8 m_in_pa_func;
- devcb_write8 m_out_pa_func;
-
- devcb_read8 m_in_pb_func;
- devcb_write8 m_out_pb_func;
-};
-
-
-
-// ======================> mos6526_device_config
+ devcb_write_line m_out_irq_cb;
+ devcb_write_line m_out_pc_cb;
+ devcb_write_line m_out_cnt_cb;
+ devcb_write_line m_out_sp_cb;
-class mos6526_device_config : public device_config,
- public mos6526_interface
-{
- friend class mos6526_device;
-
- // construction/destruction
- mos6526_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
+ devcb_read8 m_in_pa_cb;
+ devcb_write8 m_out_pa_cb;
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_pb_cb;
+ devcb_write8 m_out_pb_cb;
};
// ======================> mos6526_device
-class mos6526_device : public device_t
+class mos6526_device : public device_t,
+ public mos6526_interface
{
- friend class mos6526_device_config;
friend class dart_channel;
+protected:
// construction/destruction
- mos6526_device(running_machine &_machine, const mos6526_device_config &_config);
+ mos6526_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
public:
UINT8 reg_r(UINT8 offset);
@@ -148,6 +127,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load() { }
@@ -221,8 +201,24 @@ private:
UINT8 m_cnt;
UINT8 m_shift;
UINT8 m_serial;
+};
+
+class mos6526r1_device : public mos6526_device
+{
+public:
+ mos6526r1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
- const mos6526_device_config &m_config;
+class mos6526r2_device : public mos6526_device
+{
+public:
+ mos6526r2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class mos8520_device : public mos6526_device
+{
+public:
+ mos8520_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
diff --git a/src/emu/machine/6532riot.c b/src/emu/machine/6532riot.c
index 521516e2a7c..a5e239599cd 100644
--- a/src/emu/machine/6532riot.c
+++ b/src/emu/machine/6532riot.c
@@ -16,17 +16,12 @@ The timer seems to follow these rules:
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type RIOT6532 = riot6532_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
// CONSTANTS
//**************************************************************************
+// device type definition
+const device_type RIOT6532 = &device_creator<riot6532_device>;
+
enum
{
TIMER_IDLE,
@@ -39,68 +34,6 @@ enum
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// riot6532_device_config - constructor
-//-------------------------------------------------
-
-riot6532_device_config::riot6532_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "6532 (RIOT)", tag, owner, clock)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *riot6532_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(riot6532_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *riot6532_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, riot6532_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void riot6532_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const riot6532_interface *intf = reinterpret_cast<const riot6532_interface *>(static_config());
- if (intf != NULL)
- {
- *static_cast<riot6532_interface *>(this) = *intf;
- }
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_in_a_func, 0, sizeof(m_in_a_func));
- memset(&m_in_b_func, 0, sizeof(m_in_b_func));
- memset(&m_out_a_func, 0, sizeof(m_out_a_func));
- memset(&m_out_b_func, 0, sizeof(m_out_b_func));
- memset(&m_irq_func, 0, sizeof(m_irq_func));
- }
-}
-
-
/***************************************************************************
INTERNAL FUNCTIONS
@@ -506,12 +439,39 @@ UINT8 riot6532_device::portb_out_get()
// riot6532_device - constructor
//-------------------------------------------------
-riot6532_device::riot6532_device(running_machine &_machine, const riot6532_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+riot6532_device::riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, RIOT6532, "6532 (RIOT)", tag, owner, clock)
{
}
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void riot6532_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const riot6532_interface *intf = reinterpret_cast<const riot6532_interface *>(static_config());
+ if (intf != NULL)
+ {
+ *static_cast<riot6532_interface *>(this) = *intf;
+ }
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_in_a_cb, 0, sizeof(m_in_a_cb));
+ memset(&m_in_b_cb, 0, sizeof(m_in_b_cb));
+ memset(&m_out_a_cb, 0, sizeof(m_out_a_cb));
+ memset(&m_out_b_cb, 0, sizeof(m_out_b_cb));
+ memset(&m_irq_cb, 0, sizeof(m_irq_cb));
+ }
+}
+
+
/*-------------------------------------------------
device_start - device-specific startup
-------------------------------------------------*/
@@ -522,16 +482,16 @@ void riot6532_device::device_start()
assert(this != NULL);
/* set static values */
- m_index = machine().m_devicelist.indexof(RIOT6532, tag());
+ m_index = machine().devicelist().indexof(RIOT6532, tag());
/* configure the ports */
- devcb_resolve_read8(&m_port[0].m_in_func, &m_config.m_in_a_func, this);
- devcb_resolve_write8(&m_port[0].m_out_func, &m_config.m_out_a_func, this);
- devcb_resolve_read8(&m_port[1].m_in_func, &m_config.m_in_b_func, this);
- devcb_resolve_write8(&m_port[1].m_out_func, &m_config.m_out_b_func, this);
+ devcb_resolve_read8(&m_port[0].m_in_func, &m_in_a_cb, this);
+ devcb_resolve_write8(&m_port[0].m_out_func, &m_out_a_cb, this);
+ devcb_resolve_read8(&m_port[1].m_in_func, &m_in_b_cb, this);
+ devcb_resolve_write8(&m_port[1].m_out_func, &m_out_b_cb, this);
/* resolve irq func */
- devcb_resolve_write_line(&m_irq_func, &m_config.m_irq_func, this);
+ devcb_resolve_write_line(&m_irq_func, &m_irq_cb, this);
/* allocate timers */
m_timer = machine().scheduler().timer_alloc(FUNC(timer_end_callback), (void *)this);
diff --git a/src/emu/machine/6532riot.h b/src/emu/machine/6532riot.h
index adbdb9c1670..50ed7a39d44 100644
--- a/src/emu/machine/6532riot.h
+++ b/src/emu/machine/6532riot.h
@@ -32,47 +32,24 @@
struct riot6532_interface
{
- devcb_read8 m_in_a_func;
- devcb_read8 m_in_b_func;
- devcb_write8 m_out_a_func;
- devcb_write8 m_out_b_func;
- devcb_write_line m_irq_func;
-};
-
-
-
-// ======================> riot6532_device_config
-
-class riot6532_device_config : public device_config,
- public riot6532_interface
-{
- friend class riot6532_device;
-
- // construction/destruction
- riot6532_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_a_cb;
+ devcb_read8 m_in_b_cb;
+ devcb_write8 m_out_a_cb;
+ devcb_write8 m_out_b_cb;
+ devcb_write_line m_irq_cb;
};
// ======================> riot6532_device
-class riot6532_device : public device_t
+class riot6532_device : public device_t,
+ public riot6532_interface
{
- friend class riot6532_device_config;
-
+public:
// construction/destruction
- riot6532_device(running_machine &_machine, const riot6532_device_config &_config);
+ riot6532_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
UINT8 reg_r(UINT8 offset);
void reg_w(UINT8 offset, UINT8 data);
@@ -99,6 +76,7 @@ protected:
};
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load() { }
@@ -127,8 +105,6 @@ private:
UINT8 m_timershift;
UINT8 m_timerstate;
emu_timer * m_timer;
-
- const riot6532_device_config &m_config;
};
diff --git a/src/emu/machine/6821pia.c b/src/emu/machine/6821pia.c
index 94181f76459..b03b28ddddc 100644
--- a/src/emu/machine/6821pia.c
+++ b/src/emu/machine/6821pia.c
@@ -36,37 +36,21 @@
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// pia6821_device_config - constructor
-//-------------------------------------------------
-
-pia6821_device_config::pia6821_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "6822 PIA", tag, owner, clock)
-{
-}
+// device type definition
+const device_type PIA6821 = &device_creator<pia6821_device>;
//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
+// pia6821_device - constructor
//-------------------------------------------------
-device_config *pia6821_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
+pia6821_device::pia6821_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, PIA6821, "6822 PIA", tag, owner, clock)
{
- return global_alloc(pia6821_device_config(mconfig, tag, owner, clock));
-}
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *pia6821_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, pia6821_device(machine, *this));
}
@@ -76,7 +60,7 @@ device_t *pia6821_device_config::alloc_device(running_machine &machine) const
// complete
//-------------------------------------------------
-void pia6821_device_config::device_config_complete()
+void pia6821_device::device_config_complete()
{
// inherit a copy of the static data
const pia6821_interface *intf = reinterpret_cast<const pia6821_interface *>(static_config());
@@ -88,40 +72,22 @@ void pia6821_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_in_a_func, 0, sizeof(m_in_a_func));
- memset(&m_in_b_func, 0, sizeof(m_in_b_func));
- memset(&m_in_ca1_func, 0, sizeof(m_in_ca1_func));
- memset(&m_in_cb1_func, 0, sizeof(m_in_cb1_func));
- memset(&m_in_ca2_func, 0, sizeof(m_in_ca2_func));
- memset(&m_in_cb2_func, 0, sizeof(m_in_cb2_func));
- memset(&m_out_a_func, 0, sizeof(m_out_a_func));
- memset(&m_out_b_func, 0, sizeof(m_out_b_func));
- memset(&m_out_ca2_func, 0, sizeof(m_out_ca2_func));
- memset(&m_out_cb2_func, 0, sizeof(m_out_cb2_func));
- memset(&m_irq_a_func, 0, sizeof(m_irq_a_func));
- memset(&m_irq_b_func, 0, sizeof(m_irq_b_func));
+ memset(&m_in_a_cb, 0, sizeof(m_in_a_cb));
+ memset(&m_in_b_cb, 0, sizeof(m_in_b_cb));
+ memset(&m_in_ca1_cb, 0, sizeof(m_in_ca1_cb));
+ memset(&m_in_cb1_cb, 0, sizeof(m_in_cb1_cb));
+ memset(&m_in_ca2_cb, 0, sizeof(m_in_ca2_cb));
+ memset(&m_in_cb2_cb, 0, sizeof(m_in_cb2_cb));
+ memset(&m_out_a_cb, 0, sizeof(m_out_a_cb));
+ memset(&m_out_b_cb, 0, sizeof(m_out_b_cb));
+ memset(&m_out_ca2_cb, 0, sizeof(m_out_ca2_cb));
+ memset(&m_out_cb2_cb, 0, sizeof(m_out_cb2_cb));
+ memset(&m_irq_a_cb, 0, sizeof(m_irq_a_cb));
+ memset(&m_irq_b_cb, 0, sizeof(m_irq_b_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-const device_type PIA6821 = pia6821_device_config::static_alloc_device_config;
-
-//-------------------------------------------------
-// pia6821_device - constructor
-//-------------------------------------------------
-
-pia6821_device::pia6821_device(running_machine &_machine, const pia6821_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -129,18 +95,18 @@ pia6821_device::pia6821_device(running_machine &_machine, const pia6821_device_c
void pia6821_device::device_start()
{
/* resolve callbacks */
- devcb_resolve_read8(&m_in_a_func, &m_config.m_in_a_func, this);
- devcb_resolve_read8(&m_in_b_func, &m_config.m_in_b_func, this);
- devcb_resolve_read_line(&m_in_ca1_func, &m_config.m_in_ca1_func, this);
- devcb_resolve_read_line(&m_in_cb1_func, &m_config.m_in_cb1_func, this);
- devcb_resolve_read_line(&m_in_ca2_func, &m_config.m_in_ca2_func, this);
- devcb_resolve_read_line(&m_in_cb2_func, &m_config.m_in_cb2_func, this);
- devcb_resolve_write8(&m_out_a_func, &m_config.m_out_a_func, this);
- devcb_resolve_write8(&m_out_b_func, &m_config.m_out_b_func, this);
- devcb_resolve_write_line(&m_out_ca2_func, &m_config.m_out_ca2_func, this);
- devcb_resolve_write_line(&m_out_cb2_func, &m_config.m_out_cb2_func, this);
- devcb_resolve_write_line(&m_irq_a_func, &m_config.m_irq_a_func, this);
- devcb_resolve_write_line(&m_irq_b_func, &m_config.m_irq_b_func, this);
+ devcb_resolve_read8(&m_in_a_func, &m_in_a_cb, this);
+ devcb_resolve_read8(&m_in_b_func, &m_in_b_cb, this);
+ devcb_resolve_read_line(&m_in_ca1_func, &m_in_ca1_cb, this);
+ devcb_resolve_read_line(&m_in_cb1_func, &m_in_cb1_cb, this);
+ devcb_resolve_read_line(&m_in_ca2_func, &m_in_ca2_cb, this);
+ devcb_resolve_read_line(&m_in_cb2_func, &m_in_cb2_cb, this);
+ devcb_resolve_write8(&m_out_a_func, &m_out_a_cb, this);
+ devcb_resolve_write8(&m_out_b_func, &m_out_b_cb, this);
+ devcb_resolve_write_line(&m_out_ca2_func, &m_out_ca2_cb, this);
+ devcb_resolve_write_line(&m_out_cb2_func, &m_out_cb2_cb, this);
+ devcb_resolve_write_line(&m_irq_a_func, &m_irq_a_cb, this);
+ devcb_resolve_write_line(&m_irq_b_func, &m_irq_b_cb, this);
save_item(NAME(m_in_a));
save_item(NAME(m_in_ca1));
diff --git a/src/emu/machine/6821pia.h b/src/emu/machine/6821pia.h
index 394ba5aec1c..3b86bac895e 100644
--- a/src/emu/machine/6821pia.h
+++ b/src/emu/machine/6821pia.h
@@ -57,54 +57,30 @@
struct pia6821_interface
{
- devcb_read8 m_in_a_func;
- devcb_read8 m_in_b_func;
- devcb_read_line m_in_ca1_func;
- devcb_read_line m_in_cb1_func;
- devcb_read_line m_in_ca2_func;
- devcb_read_line m_in_cb2_func;
- devcb_write8 m_out_a_func;
- devcb_write8 m_out_b_func;
- devcb_write_line m_out_ca2_func;
- devcb_write_line m_out_cb2_func;
- devcb_write_line m_irq_a_func;
- devcb_write_line m_irq_b_func;
-};
-
-
-
-// ======================> pia6821_device_config
-
-class pia6821_device_config : public device_config,
- public pia6821_interface
-{
- friend class pia6821_device;
-
- // construction/destruction
- pia6821_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_a_cb;
+ devcb_read8 m_in_b_cb;
+ devcb_read_line m_in_ca1_cb;
+ devcb_read_line m_in_cb1_cb;
+ devcb_read_line m_in_ca2_cb;
+ devcb_read_line m_in_cb2_cb;
+ devcb_write8 m_out_a_cb;
+ devcb_write8 m_out_b_cb;
+ devcb_write_line m_out_ca2_cb;
+ devcb_write_line m_out_cb2_cb;
+ devcb_write_line m_irq_a_cb;
+ devcb_write_line m_irq_b_cb;
};
// ======================> pia6821_device
-class pia6821_device : public device_t
+class pia6821_device : public device_t,
+ public pia6821_interface
{
- friend class pia6821_device_config;
-
- // construction/destruction
- pia6821_device(running_machine &_machine, const pia6821_device_config &_config);
-
public:
+ // construction/destruction
+ pia6821_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
UINT8 reg_r(UINT8 offset);
void reg_w(UINT8 offset, UINT8 data);
@@ -145,6 +121,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load() { }
@@ -238,8 +215,6 @@ private:
UINT8 m_logged_ca2_not_connected;
UINT8 m_logged_cb1_not_connected;
UINT8 m_logged_cb2_not_connected;
-
- const pia6821_device_config &m_config;
};
diff --git a/src/emu/machine/6840ptm.c b/src/emu/machine/6840ptm.c
index 26b0f52a501..41547ca1e13 100644
--- a/src/emu/machine/6840ptm.c
+++ b/src/emu/machine/6840ptm.c
@@ -61,9 +61,18 @@ const char *const ptm6840_device::opmode[] =
IMPLEMENTATION
***************************************************************************/
-GENERIC_DEVICE_CONFIG_SETUP(ptm6840, "6840 PTM")
+// device type definition
+const device_type PTM6840 = &device_creator<ptm6840_device>;
+
+//-------------------------------------------------
+// ptm6840_device - constructor
+//-------------------------------------------------
+
+ptm6840_device::ptm6840_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, PTM6840, "6840 PTM", tag, owner, clock)
+{
+}
-const device_type PTM6840 = ptm6840_device_config::static_alloc_device_config;
//-------------------------------------------------
// device_config_complete - perform any
@@ -71,7 +80,7 @@ const device_type PTM6840 = ptm6840_device_config::static_alloc_device_config;
// complete
//-------------------------------------------------
-void ptm6840_device_config::device_config_complete()
+void ptm6840_device::device_config_complete()
{
// inherit a copy of the static data
const ptm6840_interface *intf = reinterpret_cast<const ptm6840_interface *>(static_config());
@@ -87,43 +96,32 @@ void ptm6840_device_config::device_config_complete()
m_external_clock[0] = 0.0;
m_external_clock[1] = 0.0;
m_external_clock[2] = 0.0;
- memset(&m_irq_func, 0, sizeof(m_irq_func));
- memset(&m_out_func[0], 0, sizeof(m_out_func[0]));
- memset(&m_out_func[1], 0, sizeof(m_out_func[1]));
- memset(&m_out_func[2], 0, sizeof(m_out_func[2]));
+ memset(&m_irq_cb, 0, sizeof(m_irq_cb));
+ memset(&m_out_cb[0], 0, sizeof(m_out_cb[0]));
+ memset(&m_out_cb[1], 0, sizeof(m_out_cb[1]));
+ memset(&m_out_cb[2], 0, sizeof(m_out_cb[2]));
}
}
//-------------------------------------------------
-// ptm6840_device - constructor
-//-------------------------------------------------
-
-ptm6840_device::ptm6840_device(running_machine &_machine, const ptm6840_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ptm6840_device::device_start()
{
- m_internal_clock = m_config.m_internal_clock;
+ m_internal_clock = m_internal_clock;
/* resolve callbacks */
for (int i = 0; i < 3; i++)
{
- devcb_resolve_write8(&m_out_func[i], &m_config.m_out_func[i], this);
+ devcb_resolve_write8(&m_out_func[i], &m_out_cb[i], this);
}
for (int i = 0; i < 3; i++)
{
- if ( m_config.m_external_clock[i] )
+ if ( m_external_clock[i] )
{
- m_external_clock[i] = m_config.m_external_clock[i];
+ m_external_clock[i] = m_external_clock[i];
}
else
{
@@ -141,7 +139,7 @@ void ptm6840_device::device_start()
m_timer[i]->enable(false);
}
- devcb_resolve_write_line(&m_irq_func, &m_config.m_irq_func, this);
+ devcb_resolve_write_line(&m_irq_func, &m_irq_cb, this);
/* register for state saving */
save_item(NAME(m_lsb_buffer));
diff --git a/src/emu/machine/6840ptm.h b/src/emu/machine/6840ptm.h
index d6c337fca4f..b27adcf1ee0 100644
--- a/src/emu/machine/6840ptm.h
+++ b/src/emu/machine/6840ptm.h
@@ -35,44 +35,20 @@ struct ptm6840_interface
double m_internal_clock;
double m_external_clock[3];
- devcb_write8 m_out_func[3]; // function to call when output[idx] changes
- devcb_write_line m_irq_func; // function called if IRQ line changes
-};
-
-
-
-// ======================> ptm6840_device_config
-
-class ptm6840_device_config : public device_config,
- public ptm6840_interface
-{
- friend class ptm6840_device;
-
- // construction/destruction
- ptm6840_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write8 m_out_cb[3]; // function to call when output[idx] changes
+ devcb_write_line m_irq_cb; // function called if IRQ line changes
};
// ======================> ptm6840_device
-class ptm6840_device : public device_t
+class ptm6840_device : public device_t,
+ public ptm6840_interface
{
- friend class ptm6840_device_config;
-
- // construction/destruction
- ptm6840_device(running_machine &_machine, const ptm6840_device_config &_config);
-
public:
+ // construction/destruction
+ ptm6840_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
int ptm6840_get_status(int clock); // get whether timer is enabled
int ptm6840_get_irq(); // get IRQ state
@@ -97,6 +73,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load() { }
@@ -129,9 +106,6 @@ private:
PTM_6840_LSB3 = 7,
};
- double m_internal_clock;
- double m_external_clock[3];
-
devcb_resolved_write8 m_out_func[3]; // function to call when output[idx] changes
devcb_resolved_write_line m_irq_func; // function called if IRQ line changes
@@ -156,8 +130,6 @@ private:
UINT16 m_latch[3];
UINT16 m_counter[3];
- const ptm6840_device_config &m_config;
-
static const char *const opmode[];
};
diff --git a/src/emu/machine/6850acia.c b/src/emu/machine/6850acia.c
index 17192e99e3a..7b51907a3a6 100644
--- a/src/emu/machine/6850acia.c
+++ b/src/emu/machine/6850acia.c
@@ -52,9 +52,19 @@ const int acia6850_device::ACIA6850_WORD[8][3] =
LIVE DEVICE
***************************************************************************/
-const device_type ACIA6850 = acia6850_device_config::static_alloc_device_config;
+// device type definition
+const device_type ACIA6850 = &device_creator<acia6850_device>;
+
+//-------------------------------------------------
+// acia6850_device - constructor
+//-------------------------------------------------
+
+acia6850_device::acia6850_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ACIA6850, "6850 ACIA", tag, owner, clock)
+{
+
+}
-GENERIC_DEVICE_CONFIG_SETUP(acia6850, "6850 ACIA")
//-------------------------------------------------
// device_config_complete - perform any
@@ -62,7 +72,7 @@ GENERIC_DEVICE_CONFIG_SETUP(acia6850, "6850 ACIA")
// complete
//-------------------------------------------------
-void acia6850_device_config::device_config_complete()
+void acia6850_device::device_config_complete()
{
// inherit a copy of the static data
const acia6850_interface *intf = reinterpret_cast<const acia6850_interface *>(static_config());
@@ -76,44 +86,30 @@ void acia6850_device_config::device_config_complete()
{
m_tx_clock = 0;
m_rx_clock = 0;
- memset(&m_in_rx_func, 0, sizeof(m_in_rx_func));
- memset(&m_out_tx_func, 0, sizeof(m_out_tx_func));
- memset(&m_in_cts_func, 0, sizeof(m_in_cts_func));
- memset(&m_out_rts_func, 0, sizeof(m_out_rts_func));
- memset(&m_in_dcd_func, 0, sizeof(m_in_dcd_func));
- memset(&m_out_irq_func, 0, sizeof(m_out_irq_func));
+ memset(&m_in_rx_cb, 0, sizeof(m_in_rx_cb));
+ memset(&m_out_tx_cb, 0, sizeof(m_out_tx_cb));
+ memset(&m_in_cts_cb, 0, sizeof(m_in_cts_cb));
+ memset(&m_out_rts_cb, 0, sizeof(m_out_rts_cb));
+ memset(&m_in_dcd_cb, 0, sizeof(m_in_dcd_cb));
+ memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
}
}
//-------------------------------------------------
-// acia6850_device - constructor
-//-------------------------------------------------
-
-acia6850_device::acia6850_device(running_machine &_machine, const acia6850_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void acia6850_device::device_start()
{
/* resolve callbacks */
- devcb_resolve_read_line(&m_in_rx_func, &m_config.m_in_rx_func, this);
- devcb_resolve_write_line(&m_out_tx_func, &m_config.m_out_tx_func, this);
- devcb_resolve_read_line(&m_in_cts_func, &m_config.m_in_cts_func, this);
- devcb_resolve_write_line(&m_out_rts_func, &m_config.m_out_rts_func, this);
- devcb_resolve_read_line(&m_in_dcd_func, &m_config.m_in_dcd_func, this);
- devcb_resolve_write_line(&m_out_irq_func, &m_config.m_out_irq_func, this);
-
- m_rx_clock = m_config.m_rx_clock;
- m_tx_clock = m_config.m_tx_clock;
+ devcb_resolve_read_line(&m_in_rx_func, &m_in_rx_cb, this);
+ devcb_resolve_write_line(&m_out_tx_func, &m_out_tx_cb, this);
+ devcb_resolve_read_line(&m_in_cts_func, &m_in_cts_cb, this);
+ devcb_resolve_write_line(&m_out_rts_func, &m_out_rts_cb, this);
+ devcb_resolve_read_line(&m_in_dcd_func, &m_in_dcd_cb, this);
+ devcb_resolve_write_line(&m_out_irq_func, &m_out_irq_cb, this);
+
m_tx_counter = 0;
m_rx_counter = 0;
m_rx_timer = machine().scheduler().timer_alloc(FUNC(receive_event_callback), (void *)this);
diff --git a/src/emu/machine/6850acia.h b/src/emu/machine/6850acia.h
index 76422482420..4e5b64702d8 100644
--- a/src/emu/machine/6850acia.h
+++ b/src/emu/machine/6850acia.h
@@ -54,50 +54,26 @@ struct acia6850_interface
int m_tx_clock;
int m_rx_clock;
- devcb_read_line m_in_rx_func;
- devcb_write_line m_out_tx_func;
+ devcb_read_line m_in_rx_cb;
+ devcb_write_line m_out_tx_cb;
- devcb_read_line m_in_cts_func;
- devcb_write_line m_out_rts_func;
- devcb_read_line m_in_dcd_func;
+ devcb_read_line m_in_cts_cb;
+ devcb_write_line m_out_rts_cb;
+ devcb_read_line m_in_dcd_cb;
- devcb_write_line m_out_irq_func;
-};
-
-
-
-// ======================> acia6850_device_config
-
-class acia6850_device_config : public device_config,
- public acia6850_interface
-{
- friend class acia6850_device;
-
- // construction/destruction
- acia6850_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line m_out_irq_cb;
};
// ======================> acia6850_device
-class acia6850_device : public device_t
+class acia6850_device : public device_t,
+ public acia6850_interface
{
- friend class acia6850_device_config;
-
- // construction/destruction
- acia6850_device(running_machine &_machine, const acia6850_device_config &_config);
-
public:
+ // construction/destruction
+ acia6850_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
void acia6850_tx_clock_in();
void acia6850_rx_clock_in();
@@ -120,6 +96,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load() { }
@@ -172,9 +149,6 @@ private:
UINT8 m_rx_counter;
UINT8 m_tx_counter;
- int m_rx_clock;
- int m_tx_clock;
-
int m_divide;
/* Counters */
@@ -203,8 +177,6 @@ private:
emu_timer *m_rx_timer;
emu_timer *m_tx_timer;
- const acia6850_device_config &m_config;
-
static const int ACIA6850_DIVIDE[3];
static const int ACIA6850_WORD[8][3];
};
diff --git a/src/emu/machine/68681.c b/src/emu/machine/68681.c
index a053f1e432c..eaf8265458d 100644
--- a/src/emu/machine/68681.c
+++ b/src/emu/machine/68681.c
@@ -707,7 +707,7 @@ static DEVICE_START(duart68681)
/* validate arguments */
assert(device != NULL);
- duart68681->duart_config = (const duart68681_config *)device->baseconfig().static_config();
+ duart68681->duart_config = (const duart68681_config *)device->static_config();
duart68681->device = device;
duart68681->channel[0].tx_timer = device->machine().scheduler().timer_alloc(FUNC(tx_timer_callback), (void*)device);
diff --git a/src/emu/machine/74123.c b/src/emu/machine/74123.c
index 5dd9bb6a657..eac124eeae4 100644
--- a/src/emu/machine/74123.c
+++ b/src/emu/machine/74123.c
@@ -14,45 +14,22 @@
#define LOG (0)
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type TTL74123 = ttl74123_device_config::static_alloc_device_config;
-
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// ttl74123_device_config - constructor
-//-------------------------------------------------
-
-ttl74123_device_config::ttl74123_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "TTL74123", tag, owner, clock)
-{
-}
-
+// device type definition
+const device_type TTL74123 = &device_creator<ttl74123_device>;
//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
+// ttl74123_device - constructor
//-------------------------------------------------
-device_config *ttl74123_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
+ttl74123_device::ttl74123_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TTL74123, "TTL74123", tag, owner, clock)
{
- return global_alloc(ttl74123_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-device_t *ttl74123_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, ttl74123_device(machine, *this));
}
@@ -62,7 +39,7 @@ device_t *ttl74123_device_config::alloc_device(running_machine &machine) const
// complete
//-------------------------------------------------
-void ttl74123_device_config::device_config_complete()
+void ttl74123_device::device_config_complete()
{
// inherit a copy of the static data
const ttl74123_interface *intf = reinterpret_cast<const ttl74123_interface *>(static_config());
@@ -83,23 +60,6 @@ void ttl74123_device_config::device_config_complete()
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// ttl74123_device - constructor
-//-------------------------------------------------
-
-ttl74123_device::ttl74123_device(running_machine &_machine, const ttl74123_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -108,11 +68,6 @@ void ttl74123_device::device_start()
{
m_timer = machine().scheduler().timer_alloc(FUNC(clear_callback), (void *)this);
- /* start with the defaults */
- m_a = m_config.m_a;
- m_b = m_config.m_b;
- m_clear = m_config.m_clear;
-
/* register for state saving */
save_item(NAME(m_a));
save_item(NAME(m_b));
@@ -139,26 +94,26 @@ attotime ttl74123_device::compute_duration()
{
double duration;
- switch (m_config.m_connection_type)
+ switch (m_connection_type)
{
case TTL74123_NOT_GROUNDED_NO_DIODE:
- duration = 0.28 * m_config.m_res * m_config.m_cap * (1.0 + (700.0 / m_config.m_res));
+ duration = 0.28 * m_res * m_cap * (1.0 + (700.0 / m_res));
break;
case TTL74123_NOT_GROUNDED_DIODE:
- duration = 0.25 * m_config.m_res * m_config.m_cap * (1.0 + (700.0 / m_config.m_res));
+ duration = 0.25 * m_res * m_cap * (1.0 + (700.0 / m_res));
break;
case TTL74123_GROUNDED:
default:
- if (m_config.m_cap < CAP_U(0.1))
+ if (m_cap < CAP_U(0.1))
{
/* this is really a curve - a very flat one in the 0.1uF-.01uF range */
- duration = 0.32 * m_config.m_res * m_config.m_cap;
+ duration = 0.32 * m_res * m_cap;
}
else
{
- duration = 0.33 * m_config.m_res * m_config.m_cap;
+ duration = 0.33 * m_res * m_cap;
}
break;
}
@@ -190,7 +145,7 @@ TIMER_CALLBACK( ttl74123_device::output_callback )
void ttl74123_device::output(INT32 param)
{
- m_config.m_output_changed_cb(this, 0, param);
+ m_output_changed_cb(this, 0, param);
}
@@ -222,7 +177,7 @@ void ttl74123_device::clear()
{
int output = timer_running();
- m_config.m_output_changed_cb(this, 0, output);
+ m_output_changed_cb(this, 0, output);
}
@@ -237,7 +192,7 @@ void ttl74123_device::start_pulse()
if(timer_running())
{
/* retriggering, but not if we are called to quickly */
- attotime delay_time = attotime(0, ATTOSECONDS_PER_SECOND * m_config.m_cap * 220);
+ attotime delay_time = attotime(0, ATTOSECONDS_PER_SECOND * m_cap * 220);
if(m_timer->elapsed() >= delay_time)
{
diff --git a/src/emu/machine/74123.h b/src/emu/machine/74123.h
index 005231a646d..1338c4e825d 100644
--- a/src/emu/machine/74123.h
+++ b/src/emu/machine/74123.h
@@ -87,38 +87,14 @@ struct ttl74123_interface
-// ======================> ttl74123_device_config
-
-class ttl74123_device_config : public device_config,
- public ttl74123_interface
-{
- friend class ttl74123_device;
-
- // construction/destruction
- ttl74123_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
-
// ======================> ttl74123_device
-class ttl74123_device : public device_t
+class ttl74123_device : public device_t,
+ public ttl74123_interface
{
- friend class ttl74123_device_config;
-
- // construction/destruction
- ttl74123_device(running_machine &_machine, const ttl74123_device_config &_config);
-
public:
+ // construction/destruction
+ ttl74123_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
void a_w(UINT8 data);
void b_w(UINT8 data);
@@ -127,6 +103,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load() { }
@@ -144,12 +121,7 @@ private:
attotime compute_duration();
void clear();
- UINT8 m_a; /* pin 1/9 */
- UINT8 m_b; /* pin 2/10 */
- UINT8 m_clear; /* pin 3/11 */
emu_timer *m_timer;
-
- const ttl74123_device_config &m_config;
};
diff --git a/src/emu/machine/74148.c b/src/emu/machine/74148.c
index 9a3a8df9556..accc2af5915 100644
--- a/src/emu/machine/74148.c
+++ b/src/emu/machine/74148.c
@@ -180,7 +180,7 @@ int ttl74148_enable_output_r(device_t *device)
static DEVICE_START( ttl74148 )
{
- ttl74148_config *config = (ttl74148_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ ttl74148_config *config = (ttl74148_config *)downcast<const legacy_device_base *>(device)->inline_config();
ttl74148_state *state = get_safe_token(device);
state->output_cb = config->output_cb;
diff --git a/src/emu/machine/74153.c b/src/emu/machine/74153.c
index 3d286195eed..cbb44d251ff 100644
--- a/src/emu/machine/74153.c
+++ b/src/emu/machine/74153.c
@@ -136,7 +136,7 @@ int ttl74153_output_r(device_t *device, int section)
static DEVICE_START( ttl74153 )
{
- ttl74153_config *config = (ttl74153_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ ttl74153_config *config = (ttl74153_config *)downcast<const legacy_device_base *>(device)->inline_config();
ttl74153_state *state = get_safe_token(device);
state->output_cb = config->output_cb;
diff --git a/src/emu/machine/7474.c b/src/emu/machine/7474.c
index 3b92dab2463..2bcacf7bce5 100644
--- a/src/emu/machine/7474.c
+++ b/src/emu/machine/7474.c
@@ -41,59 +41,34 @@
#include "7474.h"
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type MACHINE_TTL7474 = ttl7474_device_config::static_alloc_device_config;
-
-
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// ttl7474_device_config - constructor
-//-------------------------------------------------
-
-ttl7474_device_config::ttl7474_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "7474", tag, owner, clock)
-{
-}
-
+// device type definition
+const device_type MACHINE_TTL7474 = &device_creator<ttl7474_device>;
//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *ttl7474_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(ttl7474_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
+// ttl7474_device - constructor
//-------------------------------------------------
-device_t *ttl7474_device_config::alloc_device(running_machine &machine) const
+ttl7474_device::ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MACHINE_TTL7474, "7474", tag, owner, clock)
{
- return auto_alloc(machine, ttl7474_device(machine, *this));
+ init();
}
-
//-------------------------------------------------
// static_set_target_tag - configuration helper
// to set the target tag
//-------------------------------------------------
-void ttl7474_device_config::static_set_target_tag(device_config *device, const char *tag)
+void ttl7474_device::static_set_target_tag(device_t &device, const char *tag)
{
- ttl7474_device_config *ttl7474 = downcast<ttl7474_device_config *>(device);
- ttl7474->m_output_cb.tag = tag;
- ttl7474->m_comp_output_cb.tag = tag;
+ ttl7474_device &ttl7474 = downcast<ttl7474_device &>(device);
+ ttl7474.m_output_cb.tag = tag;
+ ttl7474.m_comp_output_cb.tag = tag;
}
@@ -102,16 +77,16 @@ void ttl7474_device_config::static_set_target_tag(device_config *device, const c
// to set the output callback
//-------------------------------------------------
-void ttl7474_device_config::static_set_output_cb(device_config *device, write_line_device_func callback)
+void ttl7474_device::static_set_output_cb(device_t &device, write_line_device_func callback)
{
- ttl7474_device_config *ttl7474 = downcast<ttl7474_device_config *>(device);
+ ttl7474_device &ttl7474 = downcast<ttl7474_device &>(device);
if (callback != NULL)
{
- ttl7474->m_output_cb.type = DEVCB_TYPE_DEVICE;
- ttl7474->m_output_cb.writeline = callback;
+ ttl7474.m_output_cb.type = DEVCB_TYPE_DEVICE;
+ ttl7474.m_output_cb.writeline = callback;
}
else
- ttl7474->m_output_cb.type = DEVCB_TYPE_NULL;
+ ttl7474.m_output_cb.type = DEVCB_TYPE_NULL;
}
@@ -120,35 +95,19 @@ void ttl7474_device_config::static_set_output_cb(device_config *device, write_li
// helper to set the comp. output callback
//-------------------------------------------------
-void ttl7474_device_config::static_set_comp_output_cb(device_config *device, write_line_device_func callback)
+void ttl7474_device::static_set_comp_output_cb(device_t &device, write_line_device_func callback)
{
- ttl7474_device_config *ttl7474 = downcast<ttl7474_device_config *>(device);
+ ttl7474_device &ttl7474 = downcast<ttl7474_device &>(device);
if (callback != NULL)
{
- ttl7474->m_comp_output_cb.type = DEVCB_TYPE_DEVICE;
- ttl7474->m_comp_output_cb.writeline = callback;
+ ttl7474.m_comp_output_cb.type = DEVCB_TYPE_DEVICE;
+ ttl7474.m_comp_output_cb.writeline = callback;
}
else
- ttl7474->m_comp_output_cb.type = DEVCB_TYPE_NULL;
+ ttl7474.m_comp_output_cb.type = DEVCB_TYPE_NULL;
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// ttl7474_device - constructor
-//-------------------------------------------------
-
-ttl7474_device::ttl7474_device(running_machine &_machine, const ttl7474_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
- init();
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -165,8 +124,8 @@ void ttl7474_device::device_start()
save_item(NAME(m_last_output));
save_item(NAME(m_last_output_comp));
- devcb_resolve_write_line(&m_output_cb, &m_config.m_output_cb, this);
- devcb_resolve_write_line(&m_comp_output_cb, &m_config.m_comp_output_cb, this);
+ devcb_resolve_write_line(&m_output_func, &m_output_cb, this);
+ devcb_resolve_write_line(&m_comp_output_func, &m_comp_output_cb, this);
}
//-------------------------------------------------
@@ -213,13 +172,13 @@ void ttl7474_device::update()
if (m_output != m_last_output)
{
m_last_output = m_output;
- devcb_call_write_line(&m_output_cb, m_output);
+ devcb_call_write_line(&m_output_func, m_output);
}
/* call callback if any of the outputs changed */
if (m_output_comp != m_last_output_comp)
{
m_last_output_comp = m_output_comp;
- devcb_call_write_line(&m_comp_output_cb, m_output_comp);
+ devcb_call_write_line(&m_comp_output_func, m_output_comp);
}
}
diff --git a/src/emu/machine/7474.h b/src/emu/machine/7474.h
index 0f04969b9ce..2fd595ef326 100644
--- a/src/emu/machine/7474.h
+++ b/src/emu/machine/7474.h
@@ -63,13 +63,13 @@
MCFG_7474_COMP_OUTPUT_CB(_comp_output_cb)
#define MCFG_7474_TARGET_TAG(_target_tag) \
- ttl7474_device_config::static_set_target_tag(device, _target_tag); \
+ ttl7474_device::static_set_target_tag(*device, _target_tag); \
#define MCFG_7474_OUTPUT_CB(_cb) \
- ttl7474_device_config::static_set_output_cb(device, _cb); \
+ ttl7474_device::static_set_output_cb(*device, _cb); \
#define MCFG_7474_COMP_OUTPUT_CB(_cb) \
- ttl7474_device_config::static_set_comp_output_cb(device, _cb); \
+ ttl7474_device::static_set_comp_output_cb(*device, _cb); \
@@ -77,43 +77,20 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> ttl7474_device_config
-
-class ttl7474_device_config : public device_config
-{
- friend class ttl7474_device;
-
- // construction/destruction
- ttl7474_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_target_tag(device_config *device, const char *tag);
- static void static_set_output_cb(device_config *device, write_line_device_func callback);
- static void static_set_comp_output_cb(device_config *device, write_line_device_func callback);
-
-protected:
- // internal state goes here
- devcb_write_line m_output_cb;
- devcb_write_line m_comp_output_cb;
-};
-
-
-
// ======================> ttl7474_device
class ttl7474_device : public device_t
{
- friend class ttl7474_device_config;
-
+public:
// construction/destruction
- ttl7474_device(running_machine &_machine, const ttl7474_device_config &config);
+ ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
+ // inline configuration helpers
+ static void static_set_target_tag(device_t &device, const char *tag);
+ static void static_set_output_cb(device_t &device, write_line_device_func callback);
+ static void static_set_comp_output_cb(device_t &device, write_line_device_func callback);
+
+ // public interfaces
void clear_w(UINT8 state);
void preset_w(UINT8 state);
void clock_w(UINT8 state);
@@ -128,13 +105,14 @@ protected:
virtual void device_post_load() { }
virtual void device_clock_changed() { }
- // internal state
- const ttl7474_device_config &m_config;
+ // configuration state
+ devcb_write_line m_output_cb;
+ devcb_write_line m_comp_output_cb;
private:
/* callbacks */
- devcb_resolved_write_line m_output_cb;
- devcb_resolved_write_line m_comp_output_cb;
+ devcb_resolved_write_line m_output_func;
+ devcb_resolved_write_line m_comp_output_func;
/* inputs */
UINT8 m_clear; /* pin 1/13 */
diff --git a/src/emu/machine/8237dma.c b/src/emu/machine/8237dma.c
index 0648e2925ff..3537fd832ec 100644
--- a/src/emu/machine/8237dma.c
+++ b/src/emu/machine/8237dma.c
@@ -45,10 +45,20 @@
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-GENERIC_DEVICE_CONFIG_SETUP(i8237, "Intel 8237")
+// device type definition
+const device_type I8237 = &device_creator<i8237_device>;
+
+//-------------------------------------------------
+// i8237_device - constructor
+//-------------------------------------------------
+
+i8237_device::i8237_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, I8237, "Intel 8237", tag, owner, clock)
+{
+}
//-------------------------------------------------
// device_config_complete - perform any
@@ -56,7 +66,7 @@ GENERIC_DEVICE_CONFIG_SETUP(i8237, "Intel 8237")
// complete
//-------------------------------------------------
-void i8237_device_config::device_config_complete()
+void i8237_device::device_config_complete()
{
// inherit a copy of the static data
const i8237_interface *intf = reinterpret_cast<const i8237_interface *>(static_config());
@@ -68,43 +78,26 @@ void i8237_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_out_hrq_func, 0, sizeof(m_out_hrq_func));
- memset(&m_out_eop_func, 0, sizeof(m_out_eop_func));
- memset(&m_in_memr_func, 0, sizeof(m_in_memr_func));
- memset(&m_out_memw_func, 0, sizeof(m_out_memw_func));
- memset(&m_in_ior_func[0], 0, sizeof(m_in_ior_func[0]));
- memset(&m_in_ior_func[1], 0, sizeof(m_in_ior_func[1]));
- memset(&m_in_ior_func[2], 0, sizeof(m_in_ior_func[2]));
- memset(&m_in_ior_func[3], 0, sizeof(m_in_ior_func[3]));
- memset(&m_out_iow_func[0], 0, sizeof(m_out_iow_func[0]));
- memset(&m_out_iow_func[1], 0, sizeof(m_out_iow_func[1]));
- memset(&m_out_iow_func[2], 0, sizeof(m_out_iow_func[2]));
- memset(&m_out_iow_func[3], 0, sizeof(m_out_iow_func[3]));
- memset(&m_out_dack_func[0], 0, sizeof(m_out_dack_func[0]));
- memset(&m_out_dack_func[1], 0, sizeof(m_out_dack_func[1]));
- memset(&m_out_dack_func[2], 0, sizeof(m_out_dack_func[2]));
- memset(&m_out_dack_func[3], 0, sizeof(m_out_dack_func[3]));
+ memset(&m_out_hrq_cb, 0, sizeof(m_out_hrq_cb));
+ memset(&m_out_eop_cb, 0, sizeof(m_out_eop_cb));
+ memset(&m_in_memr_cb, 0, sizeof(m_in_memr_cb));
+ memset(&m_out_memw_cb, 0, sizeof(m_out_memw_cb));
+ memset(&m_in_ior_cb[0], 0, sizeof(m_in_ior_cb[0]));
+ memset(&m_in_ior_cb[1], 0, sizeof(m_in_ior_cb[1]));
+ memset(&m_in_ior_cb[2], 0, sizeof(m_in_ior_cb[2]));
+ memset(&m_in_ior_cb[3], 0, sizeof(m_in_ior_cb[3]));
+ memset(&m_out_iow_cb[0], 0, sizeof(m_out_iow_cb[0]));
+ memset(&m_out_iow_cb[1], 0, sizeof(m_out_iow_cb[1]));
+ memset(&m_out_iow_cb[2], 0, sizeof(m_out_iow_cb[2]));
+ memset(&m_out_iow_cb[3], 0, sizeof(m_out_iow_cb[3]));
+ memset(&m_out_dack_cb[0], 0, sizeof(m_out_dack_cb[0]));
+ memset(&m_out_dack_cb[1], 0, sizeof(m_out_dack_cb[1]));
+ memset(&m_out_dack_cb[2], 0, sizeof(m_out_dack_cb[2]));
+ memset(&m_out_dack_cb[3], 0, sizeof(m_out_dack_cb[3]));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-const device_type I8237 = i8237_device_config::static_alloc_device_config;
-
-//-------------------------------------------------
-// i8237_device - constructor
-//-------------------------------------------------
-
-i8237_device::i8237_device(running_machine &_machine, const i8237_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -112,16 +105,16 @@ i8237_device::i8237_device(running_machine &_machine, const i8237_device_config
void i8237_device::device_start()
{
/* resolve callbacks */
- devcb_resolve_write_line(&m_out_hrq_func, &m_config.m_out_hrq_func, this);
- devcb_resolve_write_line(&m_out_eop_func, &m_config.m_out_eop_func, this);
- devcb_resolve_read8(&m_in_memr_func, &m_config.m_in_memr_func, this);
- devcb_resolve_write8(&m_out_memw_func, &m_config.m_out_memw_func, this);
+ devcb_resolve_write_line(&m_out_hrq_func, &m_out_hrq_cb, this);
+ devcb_resolve_write_line(&m_out_eop_func, &m_out_eop_cb, this);
+ devcb_resolve_read8(&m_in_memr_func, &m_in_memr_cb, this);
+ devcb_resolve_write8(&m_out_memw_func, &m_out_memw_cb, this);
for (int i = 0; i < 4; i++)
{
- devcb_resolve_read8(&m_chan[i].m_in_ior_func, &m_config.m_in_ior_func[i], this);
- devcb_resolve_write8(&m_chan[i].m_out_iow_func, &m_config.m_out_iow_func[i], this);
- devcb_resolve_write_line(&m_chan[i].m_out_dack_func, &m_config.m_out_dack_func[i], this);
+ devcb_resolve_read8(&m_chan[i].m_in_ior_func, &m_in_ior_cb[i], this);
+ devcb_resolve_write8(&m_chan[i].m_out_iow_func, &m_out_iow_cb[i], this);
+ devcb_resolve_write_line(&m_chan[i].m_out_dack_func, &m_out_dack_cb[i], this);
}
m_timer = machine().scheduler().timer_alloc(FUNC(i8237_timerproc_callback), (void *)this);
diff --git a/src/emu/machine/8237dma.h b/src/emu/machine/8237dma.h
index dd8f9829cd9..864aba746ad 100644
--- a/src/emu/machine/8237dma.h
+++ b/src/emu/machine/8237dma.h
@@ -60,53 +60,29 @@
struct i8237_interface
{
- devcb_write_line m_out_hrq_func;
- devcb_write_line m_out_eop_func;
+ devcb_write_line m_out_hrq_cb;
+ devcb_write_line m_out_eop_cb;
/* accessors to main memory */
- devcb_read8 m_in_memr_func;
- devcb_write8 m_out_memw_func;
+ devcb_read8 m_in_memr_cb;
+ devcb_write8 m_out_memw_cb;
/* channel accessors */
- devcb_read8 m_in_ior_func[4];
- devcb_write8 m_out_iow_func[4];
- devcb_write_line m_out_dack_func[4];
-};
-
-
-
-// ======================> i8237_device_config
-
-class i8237_device_config : public device_config,
- public i8237_interface
-{
- friend class i8237_device;
-
- // construction/destruction
- i8237_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_ior_cb[4];
+ devcb_write8 m_out_iow_cb[4];
+ devcb_write_line m_out_dack_cb[4];
};
// ======================> i8237_device
-class i8237_device : public device_t
+class i8237_device : public device_t,
+ public i8237_interface
{
- friend class i8237_device_config;
-
- // construction/destruction
- i8237_device(running_machine &_machine, const i8237_device_config &_config);
-
public:
+ // construction/destruction
+ i8237_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
/* register access */
UINT8 i8237_r(UINT32 offset);
@@ -122,6 +98,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load() { }
@@ -199,8 +176,6 @@ private:
dma8237_state m_state; /* State the device is currently in */
int m_service_channel; /* Channel we will be servicing */
int m_last_service_channel; /* Previous channel we serviced; used to determine channel priority. */
-
- const i8237_device_config &m_config;
};
diff --git a/src/emu/machine/8255ppi.c b/src/emu/machine/8255ppi.c
index 5ed908be7bb..9b98b24a5b2 100644
--- a/src/emu/machine/8255ppi.c
+++ b/src/emu/machine/8255ppi.c
@@ -94,11 +94,24 @@
#include "8255ppi.h"
#include "devhelpr.h"
+
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-GENERIC_DEVICE_CONFIG_SETUP(ppi8255, "Intel PPI8255")
+// device type definition
+const device_type PPI8255 = &device_creator<ppi8255_device>;
+
+//-------------------------------------------------
+// ppi8255_device - constructor
+//-------------------------------------------------
+
+ppi8255_device::ppi8255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, PPI8255, "Intel PPI8255", tag, owner, clock)
+{
+
+}
+
//-------------------------------------------------
// device_config_complete - perform any
@@ -106,7 +119,7 @@ GENERIC_DEVICE_CONFIG_SETUP(ppi8255, "Intel PPI8255")
// complete
//-------------------------------------------------
-void ppi8255_device_config::device_config_complete()
+void ppi8255_device::device_config_complete()
{
// inherit a copy of the static data
const ppi8255_interface *intf = reinterpret_cast<const ppi8255_interface *>(static_config());
@@ -128,37 +141,19 @@ void ppi8255_device_config::device_config_complete()
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-const device_type PPI8255 = ppi8255_device_config::static_alloc_device_config;
-
-//-------------------------------------------------
-// ppi8255_device - constructor
-//-------------------------------------------------
-
-ppi8255_device::ppi8255_device(running_machine &_machine, const ppi8255_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ppi8255_device::device_start()
{
- devcb_resolve_read8(&m_port_read[0], &m_config.m_port_a_read, this);
- devcb_resolve_read8(&m_port_read[1], &m_config.m_port_b_read, this);
- devcb_resolve_read8(&m_port_read[2], &m_config.m_port_c_read, this);
+ devcb_resolve_read8(&m_port_read[0], &m_port_a_read, this);
+ devcb_resolve_read8(&m_port_read[1], &m_port_b_read, this);
+ devcb_resolve_read8(&m_port_read[2], &m_port_c_read, this);
- devcb_resolve_write8(&m_port_write[0], &m_config.m_port_a_write, this);
- devcb_resolve_write8(&m_port_write[1], &m_config.m_port_b_write, this);
- devcb_resolve_write8(&m_port_write[2], &m_config.m_port_c_write, this);
+ devcb_resolve_write8(&m_port_write[0], &m_port_a_write, this);
+ devcb_resolve_write8(&m_port_write[1], &m_port_b_write, this);
+ devcb_resolve_write8(&m_port_write[2], &m_port_c_write, this);
/* register for state saving */
save_item(NAME(m_group_a_mode));
diff --git a/src/emu/machine/8255ppi.h b/src/emu/machine/8255ppi.h
index ecd7ebe6339..229dc8265cf 100644
--- a/src/emu/machine/8255ppi.h
+++ b/src/emu/machine/8255ppi.h
@@ -46,37 +46,14 @@ struct ppi8255_interface
};
-// ======================> ppi8255_device_config
-
-class ppi8255_device_config : public device_config,
- public ppi8255_interface
-{
- friend class ppi8255_device;
-
- // construction/destruction
- ppi8255_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
// ======================> ppi8255_device
-class ppi8255_device : public device_t
+class ppi8255_device : public device_t,
+ public ppi8255_interface
{
- friend class ppi8255_device_config;
-
- // construction/destruction
- ppi8255_device(running_machine &_machine, const ppi8255_device_config &_config);
-
public:
+ // construction/destruction
+ ppi8255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
UINT8 ppi8255_r(UINT32 offset);
void ppi8255_w(UINT32 offset, UINT8 data);
@@ -97,6 +74,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load() { }
@@ -141,8 +119,6 @@ private:
UINT8 m_latch[3]; /* data written to ports */
UINT8 m_output[3]; /* actual output data */
UINT8 m_control; /* mode control word */
-
- const ppi8255_device_config &m_config;
};
diff --git a/src/emu/machine/8257dma.c b/src/emu/machine/8257dma.c
index 55a20384e44..ba9ff0bfd5a 100644
--- a/src/emu/machine/8257dma.c
+++ b/src/emu/machine/8257dma.c
@@ -48,10 +48,30 @@
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-GENERIC_DEVICE_CONFIG_SETUP(i8257, "DMA8257")
+// device type definition
+const device_type I8257 = &device_creator<i8257_device>;
+
+//-------------------------------------------------
+// i8257_device - constructor
+//-------------------------------------------------
+
+i8257_device::i8257_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, I8257, "DMA8257", tag, owner, clock),
+ m_mode(0),
+ m_rr(0),
+ m_msb(0),
+ m_drq(0),
+ m_status(0x0f)
+{
+ memset(m_registers, 0, sizeof(m_registers));
+ memset(m_address, 0, sizeof(m_address));
+ memset(m_count, 0, sizeof(m_count));
+ memset(m_rwmode, 0, sizeof(m_rwmode));
+}
+
//-------------------------------------------------
// device_config_complete - perform any
@@ -59,7 +79,7 @@ GENERIC_DEVICE_CONFIG_SETUP(i8257, "DMA8257")
// complete
//-------------------------------------------------
-void i8257_device_config::device_config_complete()
+void i8257_device::device_config_complete()
{
// inherit a copy of the static data
const i8257_interface *intf = reinterpret_cast<const i8257_interface *>(static_config());
@@ -71,49 +91,23 @@ void i8257_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_out_hrq_func, 0, sizeof(m_out_hrq_func));
- memset(&m_out_tc_func, 0, sizeof(m_out_tc_func));
- memset(&m_out_mark_func, 0, sizeof(m_out_mark_func));
- memset(&m_in_memr_func, 0, sizeof(m_in_memr_func));
- memset(&m_out_memw_func, 0, sizeof(m_out_memw_func));
- memset(&m_in_ior_func[0], 0, sizeof(m_in_ior_func[0]));
- memset(&m_in_ior_func[1], 0, sizeof(m_in_ior_func[1]));
- memset(&m_in_ior_func[2], 0, sizeof(m_in_ior_func[2]));
- memset(&m_in_ior_func[3], 0, sizeof(m_in_ior_func[3]));
- memset(&m_out_iow_func[0], 0, sizeof(m_out_iow_func[0]));
- memset(&m_out_iow_func[1], 0, sizeof(m_out_iow_func[1]));
- memset(&m_out_iow_func[2], 0, sizeof(m_out_iow_func[2]));
- memset(&m_out_iow_func[3], 0, sizeof(m_out_iow_func[3]));
+ memset(&m_out_hrq_cb, 0, sizeof(m_out_hrq_cb));
+ memset(&m_out_tc_cb, 0, sizeof(m_out_tc_cb));
+ memset(&m_out_mark_cb, 0, sizeof(m_out_mark_cb));
+ memset(&m_in_memr_cb, 0, sizeof(m_in_memr_cb));
+ memset(&m_out_memw_cb, 0, sizeof(m_out_memw_cb));
+ memset(&m_in_ior_cb[0], 0, sizeof(m_in_ior_cb[0]));
+ memset(&m_in_ior_cb[1], 0, sizeof(m_in_ior_cb[1]));
+ memset(&m_in_ior_cb[2], 0, sizeof(m_in_ior_cb[2]));
+ memset(&m_in_ior_cb[3], 0, sizeof(m_in_ior_cb[3]));
+ memset(&m_out_iow_cb[0], 0, sizeof(m_out_iow_cb[0]));
+ memset(&m_out_iow_cb[1], 0, sizeof(m_out_iow_cb[1]));
+ memset(&m_out_iow_cb[2], 0, sizeof(m_out_iow_cb[2]));
+ memset(&m_out_iow_cb[3], 0, sizeof(m_out_iow_cb[3]));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-const device_type I8257 = i8257_device_config::static_alloc_device_config;
-
-//-------------------------------------------------
-// i8257_device - constructor
-//-------------------------------------------------
-
-i8257_device::i8257_device(running_machine &_machine, const i8257_device_config &config)
- : device_t(_machine, config),
- m_mode(0),
- m_rr(0),
- m_msb(0),
- m_drq(0),
- m_status(0x0f),
- m_config(config)
-{
- memset(m_registers, 0, sizeof(m_registers));
- memset(m_address, 0, sizeof(m_address));
- memset(m_count, 0, sizeof(m_count));
- memset(m_rwmode, 0, sizeof(m_rwmode));
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -124,16 +118,16 @@ void i8257_device::device_start()
assert(this != NULL);
/* resolve callbacks */
- devcb_resolve_write_line(&m_out_hrq_func, &m_config.m_out_hrq_func, this);
- devcb_resolve_write_line(&m_out_tc_func, &m_config.m_out_tc_func, this);
- devcb_resolve_write_line(&m_out_mark_func, &m_config.m_out_mark_func, this);
- devcb_resolve_read8(&m_in_memr_func, &m_config.m_in_memr_func, this);
- devcb_resolve_write8(&m_out_memw_func, &m_config.m_out_memw_func, this);
+ devcb_resolve_write_line(&m_out_hrq_func, &m_out_hrq_cb, this);
+ devcb_resolve_write_line(&m_out_tc_func, &m_out_tc_cb, this);
+ devcb_resolve_write_line(&m_out_mark_func, &m_out_mark_cb, this);
+ devcb_resolve_read8(&m_in_memr_func, &m_in_memr_cb, this);
+ devcb_resolve_write8(&m_out_memw_func, &m_out_memw_cb, this);
for (int i = 0; i < I8257_NUM_CHANNELS; i++)
{
- devcb_resolve_read8(&m_in_ior_func[i], &m_config.m_in_ior_func[i], this);
- devcb_resolve_write8(&m_out_iow_func[i], &m_config.m_out_iow_func[i], this);
+ devcb_resolve_read8(&m_in_ior_func[i], &m_in_ior_cb[i], this);
+ devcb_resolve_write8(&m_out_iow_func[i], &m_out_iow_cb[i], this);
}
/* set initial values */
diff --git a/src/emu/machine/8257dma.h b/src/emu/machine/8257dma.h
index e4cf1593f75..0c96150dfa7 100644
--- a/src/emu/machine/8257dma.h
+++ b/src/emu/machine/8257dma.h
@@ -62,53 +62,29 @@
struct i8257_interface
{
- devcb_write_line m_out_hrq_func;
- devcb_write_line m_out_tc_func;
- devcb_write_line m_out_mark_func;
+ devcb_write_line m_out_hrq_cb;
+ devcb_write_line m_out_tc_cb;
+ devcb_write_line m_out_mark_cb;
/* accessors to main memory */
- devcb_read8 m_in_memr_func; // TODO m_in_memr_func[I8257_NUM_CHANNELS];
- devcb_write8 m_out_memw_func; // TODO m_out_memw_func[I8257_NUM_CHANNELS];
+ devcb_read8 m_in_memr_cb; // TODO m_in_memr_cb[I8257_NUM_CHANNELS];
+ devcb_write8 m_out_memw_cb; // TODO m_out_memw_cb[I8257_NUM_CHANNELS];
/* channel accesors */
- devcb_read8 m_in_ior_func[I8257_NUM_CHANNELS];
- devcb_write8 m_out_iow_func[I8257_NUM_CHANNELS];
-};
-
-
-
-// ======================> i8257_device_config
-
-class i8257_device_config : public device_config,
- public i8257_interface
-{
- friend class i8257_device;
-
- // construction/destruction
- i8257_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_ior_cb[I8257_NUM_CHANNELS];
+ devcb_write8 m_out_iow_cb[I8257_NUM_CHANNELS];
};
// ======================> i8257_device
-class i8257_device : public device_t
+class i8257_device : public device_t,
+ public i8257_interface
{
- friend class i8257_device_config;
-
- // construction/destruction
- i8257_device(running_machine &_machine, const i8257_device_config &_config);
-
public:
+ // construction/destruction
+ i8257_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
/* register access */
UINT8 i8257_r(UINT32 offset);
@@ -119,6 +95,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -157,8 +134,6 @@ private:
/* bits 0- 3 : Terminal count for channels 0-3 */
UINT8 m_status;
-
- const i8257_device_config &m_config;
};
diff --git a/src/emu/machine/adc0808.c b/src/emu/machine/adc0808.c
index 35465093925..2dd30a21092 100644
--- a/src/emu/machine/adc0808.c
+++ b/src/emu/machine/adc0808.c
@@ -13,25 +13,26 @@
-//**************************************************************************
-// MACROS / CONSTANTS
-//**************************************************************************
-
-
//**************************************************************************
-// DEVICE DEFINITIONS
+// LIVE DEVICE
//**************************************************************************
-const device_type ADC0808 = adc0808_device_config::static_alloc_device_config;
+// device type definition
+const device_type ADC0808 = &device_creator<adc0808_device>;
+//-------------------------------------------------
+// adc0808_device - constructor
+//-------------------------------------------------
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(adc0808, "ADC0808")
+adc0808_device::adc0808_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ADC0808, "ADC0808", tag, owner, clock),
+ m_address(0),
+ m_start(0),
+ m_next_eoc(0),
+ m_cycle(0)
+{
+}
//-------------------------------------------------
@@ -40,7 +41,7 @@ GENERIC_DEVICE_CONFIG_SETUP(adc0808, "ADC0808")
// complete
//-------------------------------------------------
-void adc0808_device_config::device_config_complete()
+void adc0808_device::device_config_complete()
{
// inherit a copy of the static data
const adc0808_interface *intf = reinterpret_cast<const adc0808_interface *>(static_config());
@@ -50,31 +51,11 @@ void adc0808_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_out_eoc_func, 0, sizeof(m_out_eoc_func));
+ memset(&m_out_eoc_cb, 0, sizeof(m_out_eoc_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// adc0808_device - constructor
-//-------------------------------------------------
-
-adc0808_device::adc0808_device(running_machine &_machine, const adc0808_device_config &config)
- : device_t(_machine, config),
- m_address(0),
- m_start(0),
- m_next_eoc(0),
- m_cycle(0),
- m_config(config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -82,7 +63,7 @@ adc0808_device::adc0808_device(running_machine &_machine, const adc0808_device_c
void adc0808_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_eoc_func, &m_config.m_out_eoc_func, this);
+ devcb_resolve_write_line(&m_out_eoc_func, &m_out_eoc_cb, this);
// allocate timers
m_cycle_timer = timer_alloc();
@@ -114,10 +95,10 @@ void adc0808_device::device_timer(emu_timer &timer, device_timer_id id, int para
if (m_bit == 8)
{
/* sample input */
- double vref_pos = m_config.m_in_vref_pos_func(this);
- double vref_neg = m_config.m_in_vref_neg_func(this);
+ double vref_pos = m_in_vref_pos_func(this);
+ double vref_neg = m_in_vref_neg_func(this);
- double input = m_config.m_in_in_func[m_address](this);
+ double input = m_in_in_func[m_address](this);
m_sar = (255 * (input - vref_neg)) / (vref_pos - vref_neg);
diff --git a/src/emu/machine/adc0808.h b/src/emu/machine/adc0808.h
index 071572d52b7..68c132bdf9f 100644
--- a/src/emu/machine/adc0808.h
+++ b/src/emu/machine/adc0808.h
@@ -61,7 +61,7 @@ typedef double (*adc0808_analog_read) (device_t *device);
struct adc0808_interface
{
- devcb_write_line m_out_eoc_func;
+ devcb_write_line m_out_eoc_cb;
adc0808_analog_read m_in_vref_pos_func;
adc0808_analog_read m_in_vref_neg_func;
@@ -70,37 +70,15 @@ struct adc0808_interface
};
-// ======================> adc0808_device_config
-
-class adc0808_device_config : public device_config,
- public adc0808_interface
-{
- friend class adc0808_device;
-
- // construction/destruction
- adc0808_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
// ======================> adc0808_device
-class adc0808_device : public device_t
+class adc0808_device : public device_t,
+ public adc0808_interface
{
- friend class adc0808_device_config;
-
+public:
// construction/destruction
- adc0808_device(running_machine &_machine, const adc0808_device_config &_config);
+ adc0808_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( data_r );
DECLARE_WRITE8_MEMBER( ale_w );
@@ -108,6 +86,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -126,8 +105,6 @@ private:
// timers
emu_timer *m_cycle_timer;
-
- const adc0808_device_config &m_config;
};
diff --git a/src/emu/machine/adc083x.c b/src/emu/machine/adc083x.c
index 6e14a262e32..aab3d868600 100644
--- a/src/emu/machine/adc083x.c
+++ b/src/emu/machine/adc083x.c
@@ -82,7 +82,7 @@ INLINE const adc083x_interface *get_interface( device_t *device )
{
assert( device != NULL );
assert( ( device->type() == ADC0831 ) || ( device->type() == ADC0832 ) || ( device->type() == ADC0834 ) || ( device->type() == ADC0838 ) );
- return (const adc083x_interface *) device->baseconfig().static_config();
+ return (const adc083x_interface *) device->static_config();
}
diff --git a/src/emu/machine/adc1038.c b/src/emu/machine/adc1038.c
index f0f9036a99c..acf2ee32274 100644
--- a/src/emu/machine/adc1038.c
+++ b/src/emu/machine/adc1038.c
@@ -45,7 +45,7 @@ INLINE const adc1038_interface *adc1038_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == ADC1038));
- return (const adc1038_interface *) device->baseconfig().static_config();
+ return (const adc1038_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/emu/machine/adc1213x.c b/src/emu/machine/adc1213x.c
index 14a3fc1a48f..38a589c122d 100644
--- a/src/emu/machine/adc1213x.c
+++ b/src/emu/machine/adc1213x.c
@@ -65,7 +65,7 @@ INLINE const adc12138_interface *get_interface(device_t *device)
{
assert(device != NULL);
assert((device->type() == ADC12130) || (device->type() == ADC12132) || (device->type() == ADC12138));
- return (const adc12138_interface *) device->baseconfig().static_config();
+ return (const adc12138_interface *) device->static_config();
}
diff --git a/src/emu/machine/at28c16.c b/src/emu/machine/at28c16.c
index f7090fa3671..1101b3ee8e4 100644
--- a/src/emu/machine/at28c16.c
+++ b/src/emu/machine/at28c16.c
@@ -20,8 +20,6 @@
// GLOBAL VARIABLES
//**************************************************************************
-const device_type AT28C16 = at28c16_device_config::static_alloc_device_config;
-
static ADDRESS_MAP_START( at28c16_map8, AS_PROGRAM, 8 )
AM_RANGE(0x0000, 0x081f) AM_RAM
ADDRESS_MAP_END
@@ -29,41 +27,24 @@ ADDRESS_MAP_END
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// at28c16_device_config - constructor
-//-------------------------------------------------
-
-at28c16_device_config::at28c16_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock )
- : device_config(mconfig, static_alloc_device_config, "AT28C16", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- device_config_nvram_interface(mconfig, *this)
-{
-}
-
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *at28c16_device_config::static_alloc_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock )
-{
- return global_alloc( at28c16_device_config( mconfig, tag, owner, clock ) );
-}
-
-
+// device type definition
+const device_type AT28C16 = &device_creator<at28c16_device>;
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// at28c16_device - constructor
//-------------------------------------------------
-device_t *at28c16_device_config::alloc_device( running_machine &machine ) const
+at28c16_device::at28c16_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock )
+ : device_t(mconfig, AT28C16, "AT28C16", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ device_nvram_interface(mconfig, *this),
+ m_a9_12v( 0 ),
+ m_oe_12v( 0 ),
+ m_last_write( -1 )
{
- return auto_alloc( machine, at28c16_device( machine, *this ) );
}
@@ -73,7 +54,7 @@ device_t *at28c16_device_config::alloc_device( running_machine &machine ) const
// complete
//-------------------------------------------------
-void at28c16_device_config::device_config_complete()
+void at28c16_device::device_config_complete()
{
m_space_config = address_space_config( "at28c16", ENDIANNESS_BIG, 8, 12, 0, *ADDRESS_MAP_NAME( at28c16_map8 ) );
}
@@ -84,7 +65,7 @@ void at28c16_device_config::device_config_complete()
// on this device
//-------------------------------------------------
-bool at28c16_device_config::device_validity_check( emu_options &options, const game_driver &driver ) const
+bool at28c16_device::device_validity_check( emu_options &options, const game_driver &driver ) const
{
return false;
}
@@ -95,34 +76,12 @@ bool at28c16_device_config::device_validity_check( emu_options &options, const g
// any address spaces owned by this device
//-------------------------------------------------
-const address_space_config *at28c16_device_config::memory_space_config( address_spacenum spacenum ) const
+const address_space_config *at28c16_device::memory_space_config( address_spacenum spacenum ) const
{
return ( spacenum == 0 ) ? &m_space_config : NULL;
}
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// at28c16_device - constructor
-//-------------------------------------------------
-
-at28c16_device::at28c16_device( running_machine &_machine, const at28c16_device_config &config ) :
- device_t( _machine, config ),
- device_memory_interface( _machine, config, *this ),
- device_nvram_interface( _machine, config, *this ),
- m_config( config ),
- m_a9_12v( 0 ),
- m_oe_12v( 0 ),
- m_last_write( -1 )
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/emu/machine/at28c16.h b/src/emu/machine/at28c16.h
index 040a821b592..a891d51881b 100644
--- a/src/emu/machine/at28c16.h
+++ b/src/emu/machine/at28c16.h
@@ -31,56 +31,18 @@ struct at28c16_interface
};
-// ======================> at28c16_device_config
-
-class at28c16_device_config :
- public device_config,
- public device_config_memory_interface,
- public device_config_nvram_interface,
- public at28c16_interface
-{
- friend class at28c16_device;
-
- // construction/destruction
- at28c16_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock );
-
-public:
- // allocators
- static device_config *static_alloc_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock );
- virtual device_t *alloc_device( running_machine &machine ) const;
-
- // inline configuration indexes
- enum
- {
- INLINE_INTERFACE
- };
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
- virtual bool device_validity_check( emu_options &options, const game_driver &driver ) const;
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config( address_spacenum spacenum = AS_0 ) const;
-
- // device-specific configuration
- address_space_config m_space_config;
-};
-
-
// ======================> at28c16_device
class at28c16_device :
public device_t,
public device_memory_interface,
- public device_nvram_interface
+ public device_nvram_interface,
+ public at28c16_interface
{
- friend class at28c16_device_config;
-
+public:
// construction/destruction
- at28c16_device( running_machine &_machine, const at28c16_device_config &config );
+ at28c16_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock );
-public:
// I/O operations
void write( offs_t offset, UINT8 data );
UINT8 read( offs_t offset );
@@ -89,9 +51,14 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
+ virtual bool device_validity_check( emu_options &options, const game_driver &driver ) const;
virtual void device_start();
virtual void device_reset();
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config( address_spacenum spacenum = AS_0 ) const;
+
// device_nvram_interface overrides
virtual void nvram_default();
virtual void nvram_read( emu_file &file );
@@ -101,7 +68,7 @@ protected:
static TIMER_CALLBACK( write_finished );
// internal state
- const at28c16_device_config &m_config;
+ address_space_config m_space_config;
emu_timer *m_write_timer;
int m_a9_12v;
int m_oe_12v;
diff --git a/src/emu/machine/cdp1852.c b/src/emu/machine/cdp1852.c
index cffeb25d374..a57253c8e24 100644
--- a/src/emu/machine/cdp1852.c
+++ b/src/emu/machine/cdp1852.c
@@ -11,6 +11,9 @@
#include "machine/devhelpr.h"
+// device type definition
+const device_type CDP1852 = &device_creator<cdp1852_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -25,46 +28,6 @@ enum
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type CDP1852 = cdp1852_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(cdp1852, "CDP1852")
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void cdp1852_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const cdp1852_interface *intf = reinterpret_cast<const cdp1852_interface *>(static_config());
- if (intf != NULL)
- *static_cast<cdp1852_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_in_mode_func, 0, sizeof(m_in_mode_func));
- memset(&m_out_sr_func, 0, sizeof(m_out_sr_func));
- memset(&m_in_data_func, 0, sizeof(m_in_data_func));
- memset(&m_out_data_func, 0, sizeof(m_out_data_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -102,24 +65,47 @@ void cdp1852_device::set_sr_line(int state)
// cdp1852_device - constructor
//-------------------------------------------------
-cdp1852_device::cdp1852_device(running_machine &_machine, const cdp1852_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+cdp1852_device::cdp1852_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CDP1852, "CDP1852", tag, owner, clock)
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void cdp1852_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const cdp1852_interface *intf = reinterpret_cast<const cdp1852_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<cdp1852_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_in_mode_cb, 0, sizeof(m_in_mode_cb));
+ memset(&m_out_sr_cb, 0, sizeof(m_out_sr_cb));
+ memset(&m_in_data_cb, 0, sizeof(m_in_data_cb));
+ memset(&m_out_data_cb, 0, sizeof(m_out_data_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void cdp1852_device::device_start()
{
// resolve callbacks
- devcb_resolve_read_line(&m_in_mode_func, &m_config.m_in_mode_func, this);
- devcb_resolve_write_line(&m_out_sr_func, &m_config.m_out_sr_func, this);
- devcb_resolve_read8(&m_in_data_func, &m_config.m_in_data_func, this);
- devcb_resolve_write8(&m_out_data_func, &m_config.m_out_data_func, this);
+ devcb_resolve_read_line(&m_in_mode_func, &m_in_mode_cb, this);
+ devcb_resolve_write_line(&m_out_sr_func, &m_out_sr_cb, this);
+ devcb_resolve_read8(&m_in_data_func, &m_in_data_cb, this);
+ devcb_resolve_write8(&m_out_data_func, &m_out_data_cb, this);
// allocate timers
if (clock() > 0)
diff --git a/src/emu/machine/cdp1852.h b/src/emu/machine/cdp1852.h
index f72ffc5ab06..6ddf7eaf8aa 100644
--- a/src/emu/machine/cdp1852.h
+++ b/src/emu/machine/cdp1852.h
@@ -67,51 +67,30 @@
struct cdp1852_interface
{
- devcb_read_line m_in_mode_func;
+ devcb_read_line m_in_mode_cb;
- devcb_read8 m_in_data_func;
- devcb_write8 m_out_data_func;
+ devcb_read8 m_in_data_cb;
+ devcb_write8 m_out_data_cb;
- devcb_write_line m_out_sr_func;
-};
-
-
-// ======================> cdp1852_device_config
-
-class cdp1852_device_config : public device_config,
- public cdp1852_interface
-{
- friend class cdp1852_device;
-
- // construction/destruction
- cdp1852_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line m_out_sr_cb;
};
// ======================> cdp1852_device
-class cdp1852_device : public device_t
+class cdp1852_device : public device_t,
+ public cdp1852_interface
{
- friend class cdp1852_device_config;
-
+public:
// construction/destruction
- cdp1852_device(running_machine &_machine, const cdp1852_device_config &_config);
+ cdp1852_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -134,8 +113,6 @@ private:
// timers
emu_timer *m_scan_timer;
-
- const cdp1852_device_config &m_config;
};
diff --git a/src/emu/machine/cdp1871.c b/src/emu/machine/cdp1871.c
index 1acacdf25da..e7e55b537e4 100644
--- a/src/emu/machine/cdp1871.c
+++ b/src/emu/machine/cdp1871.c
@@ -13,6 +13,9 @@
#include "machine/devhelpr.h"
+// device type definition
+const device_type CDP1871 = &device_creator<cdp1871_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -84,18 +87,23 @@ static const UINT8 CDP1871_KEY_CODES[4][11][8] =
//**************************************************************************
-// DEVICE DEFINITIONS
+// LIVE DEVICE
//**************************************************************************
-const device_type CDP1871 = cdp1871_device_config::static_alloc_device_config;
-
-
+//-------------------------------------------------
+// cdp1871_device - constructor
+//-------------------------------------------------
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
+cdp1871_device::cdp1871_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CDP1871, "RCA CDP1871", tag, owner, clock),
+ m_inhibit(false),
+ m_sense(0),
+ m_drive(0),
+ m_next_da(CLEAR_LINE),
+ m_next_rpt(CLEAR_LINE)
+{
-GENERIC_DEVICE_CONFIG_SETUP(cdp1871, "RCA CDP1871")
+}
//-------------------------------------------------
@@ -104,7 +112,7 @@ GENERIC_DEVICE_CONFIG_SETUP(cdp1871, "RCA CDP1871")
// complete
//-------------------------------------------------
-void cdp1871_device_config::device_config_complete()
+void cdp1871_device::device_config_complete()
{
// inherit a copy of the static data
const cdp1871_interface *intf = reinterpret_cast<const cdp1871_interface *>(static_config());
@@ -114,38 +122,16 @@ void cdp1871_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&out_da_func, 0, sizeof(out_da_func));
- memset(&out_rpt_func, 0, sizeof(out_rpt_func));
- // m_in_d_func[]
- memset(&in_shift_func, 0, sizeof(in_shift_func));
- memset(&in_control_func, 0, sizeof(in_control_func));
- memset(&in_alpha_func, 0, sizeof(in_alpha_func));
+ memset(&out_da_cb, 0, sizeof(out_da_cb));
+ memset(&out_rpt_cb, 0, sizeof(out_rpt_cb));
+ // m_in_d_cb[]
+ memset(&in_shift_cb, 0, sizeof(in_shift_cb));
+ memset(&in_control_cb, 0, sizeof(in_control_cb));
+ memset(&in_alpha_cb, 0, sizeof(in_alpha_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// cdp1871_device - constructor
-//-------------------------------------------------
-
-cdp1871_device::cdp1871_device(running_machine &_machine, const cdp1871_device_config &config)
- : device_t(_machine, config),
- m_inhibit(false),
- m_sense(0),
- m_drive(0),
- m_next_da(CLEAR_LINE),
- m_next_rpt(CLEAR_LINE),
- m_config(config)
-{
-
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -153,22 +139,22 @@ cdp1871_device::cdp1871_device(running_machine &_machine, const cdp1871_device_c
void cdp1871_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_da_func, &m_config.out_da_func, this);
- devcb_resolve_write_line(&m_out_rpt_func, &m_config.out_rpt_func, this);
- devcb_resolve_read8(&m_in_d_func[0], &m_config.in_d1_func, this);
- devcb_resolve_read8(&m_in_d_func[1], &m_config.in_d2_func, this);
- devcb_resolve_read8(&m_in_d_func[2], &m_config.in_d3_func, this);
- devcb_resolve_read8(&m_in_d_func[3], &m_config.in_d4_func, this);
- devcb_resolve_read8(&m_in_d_func[4], &m_config.in_d5_func, this);
- devcb_resolve_read8(&m_in_d_func[5], &m_config.in_d6_func, this);
- devcb_resolve_read8(&m_in_d_func[6], &m_config.in_d7_func, this);
- devcb_resolve_read8(&m_in_d_func[7], &m_config.in_d8_func, this);
- devcb_resolve_read8(&m_in_d_func[8], &m_config.in_d9_func, this);
- devcb_resolve_read8(&m_in_d_func[9], &m_config.in_d10_func, this);
- devcb_resolve_read8(&m_in_d_func[10], &m_config.in_d11_func, this);
- devcb_resolve_read_line(&m_in_shift_func, &m_config.in_shift_func, this);
- devcb_resolve_read_line(&m_in_control_func, &m_config.in_control_func, this);
- devcb_resolve_read_line(&m_in_alpha_func, &m_config.in_alpha_func, this);
+ devcb_resolve_write_line(&m_out_da_func, &out_da_cb, this);
+ devcb_resolve_write_line(&m_out_rpt_func, &out_rpt_cb, this);
+ devcb_resolve_read8(&m_in_d_func[0], &in_d1_cb, this);
+ devcb_resolve_read8(&m_in_d_func[1], &in_d2_cb, this);
+ devcb_resolve_read8(&m_in_d_func[2], &in_d3_cb, this);
+ devcb_resolve_read8(&m_in_d_func[3], &in_d4_cb, this);
+ devcb_resolve_read8(&m_in_d_func[4], &in_d5_cb, this);
+ devcb_resolve_read8(&m_in_d_func[5], &in_d6_cb, this);
+ devcb_resolve_read8(&m_in_d_func[6], &in_d7_cb, this);
+ devcb_resolve_read8(&m_in_d_func[7], &in_d8_cb, this);
+ devcb_resolve_read8(&m_in_d_func[8], &in_d9_cb, this);
+ devcb_resolve_read8(&m_in_d_func[9], &in_d10_cb, this);
+ devcb_resolve_read8(&m_in_d_func[10], &in_d11_cb, this);
+ devcb_resolve_read_line(&m_in_shift_func, &in_shift_cb, this);
+ devcb_resolve_read_line(&m_in_control_func, &in_control_cb, this);
+ devcb_resolve_read_line(&m_in_alpha_func, &in_alpha_cb, this);
// set initial values
change_output_lines();
diff --git a/src/emu/machine/cdp1871.h b/src/emu/machine/cdp1871.h
index 6d3a7fffc6d..cc803c83821 100644
--- a/src/emu/machine/cdp1871.h
+++ b/src/emu/machine/cdp1871.h
@@ -67,61 +67,39 @@
struct cdp1871_interface
{
- devcb_read8 in_d1_func;
- devcb_read8 in_d2_func;
- devcb_read8 in_d3_func;
- devcb_read8 in_d4_func;
- devcb_read8 in_d5_func;
- devcb_read8 in_d6_func;
- devcb_read8 in_d7_func;
- devcb_read8 in_d8_func;
- devcb_read8 in_d9_func;
- devcb_read8 in_d10_func;
- devcb_read8 in_d11_func;
-
- devcb_read_line in_shift_func;
- devcb_read_line in_control_func;
- devcb_read_line in_alpha_func;
+ devcb_read8 in_d1_cb;
+ devcb_read8 in_d2_cb;
+ devcb_read8 in_d3_cb;
+ devcb_read8 in_d4_cb;
+ devcb_read8 in_d5_cb;
+ devcb_read8 in_d6_cb;
+ devcb_read8 in_d7_cb;
+ devcb_read8 in_d8_cb;
+ devcb_read8 in_d9_cb;
+ devcb_read8 in_d10_cb;
+ devcb_read8 in_d11_cb;
+
+ devcb_read_line in_shift_cb;
+ devcb_read_line in_control_cb;
+ devcb_read_line in_alpha_cb;
// this gets called for every change of the DA pin (pin 33)
- devcb_write_line out_da_func;
+ devcb_write_line out_da_cb;
// this gets called for every change of the RPT pin (pin 35)
- devcb_write_line out_rpt_func;
-};
-
-
-// ======================> cdp1871_device_config
-
-class cdp1871_device_config : public device_config,
- public cdp1871_interface
-{
- friend class cdp1871_device;
-
- // construction/destruction
- cdp1871_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line out_rpt_cb;
};
// ======================> cdp1871_device
-class cdp1871_device : public device_t
+class cdp1871_device : public device_t,
+ public cdp1871_interface
{
- friend class cdp1871_device_config;
-
+public:
// construction/destruction
- cdp1871_device(running_machine &_machine, const cdp1871_device_config &_config);
+ cdp1871_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( data_r );
DECLARE_READ_LINE_MEMBER( da_r );
@@ -129,6 +107,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -158,8 +137,6 @@ private:
// timers
emu_timer *m_scan_timer; // keyboard scan timer
-
- const cdp1871_device_config &m_config;
};
diff --git a/src/emu/machine/com8116.c b/src/emu/machine/com8116.c
index 228dde9cf19..b4ab56e8ee7 100644
--- a/src/emu/machine/com8116.c
+++ b/src/emu/machine/com8116.c
@@ -22,19 +22,20 @@
//**************************************************************************
-// GLOBAL VARIABLES
+// LIVE DEVICE
//**************************************************************************
-// devices
-const device_type COM8116 = com8116_device_config::static_alloc_device_config;
-
-
+// device type definition
+const device_type COM8116 = &device_creator<com8116_device>;
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
+//-------------------------------------------------
+// com8116_device - constructor
+//-------------------------------------------------
-GENERIC_DEVICE_CONFIG_SETUP(com8116, "COM8116")
+com8116_device::com8116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, COM8116, "COM8116", tag, owner, clock)
+{
+}
//-------------------------------------------------
@@ -43,7 +44,7 @@ GENERIC_DEVICE_CONFIG_SETUP(com8116, "COM8116")
// complete
//-------------------------------------------------
-void com8116_device_config::device_config_complete()
+void com8116_device::device_config_complete()
{
// inherit a copy of the static data
const com8116_interface *intf = reinterpret_cast<const com8116_interface *>(static_config());
@@ -53,29 +54,13 @@ void com8116_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_out_fx4_func, 0, sizeof(m_out_fx4_func));
- memset(&m_out_fr_func, 0, sizeof(m_out_fr_func));
- memset(&m_out_ft_func, 0, sizeof(m_out_ft_func));
+ memset(&m_out_fx4_cb, 0, sizeof(m_out_fx4_cb));
+ memset(&m_out_fr_cb, 0, sizeof(m_out_fr_cb));
+ memset(&m_out_ft_cb, 0, sizeof(m_out_ft_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// com8116_device - constructor
-//-------------------------------------------------
-
-com8116_device::com8116_device(running_machine &_machine, const com8116_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -83,9 +68,9 @@ com8116_device::com8116_device(running_machine &_machine, const com8116_device_c
void com8116_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_fx4_func, &m_config.m_out_fx4_func, this);
- devcb_resolve_write_line(&m_out_fr_func, &m_config.m_out_fr_func, this);
- devcb_resolve_write_line(&m_out_ft_func, &m_config.m_out_ft_func, this);
+ devcb_resolve_write_line(&m_out_fx4_func, &m_out_fx4_cb, this);
+ devcb_resolve_write_line(&m_out_fr_func, &m_out_fr_cb, this);
+ devcb_resolve_write_line(&m_out_ft_func, &m_out_ft_cb, this);
// allocate timers
m_fx4_timer = timer_alloc(TIMER_FX4);
@@ -132,7 +117,7 @@ WRITE8_MEMBER( com8116_device::str_w )
m_fr = data & 0x0f;
- m_fr_timer->adjust(attotime::zero, 0, attotime::from_hz(clock() / m_config.m_fr_divisors[m_fr] / 2));
+ m_fr_timer->adjust(attotime::zero, 0, attotime::from_hz(clock() / m_fr_divisors[m_fr] / 2));
}
@@ -146,5 +131,5 @@ WRITE8_MEMBER( com8116_device::stt_w )
m_ft = data & 0x0f;
- m_ft_timer->adjust(attotime::zero, 0, attotime::from_hz(clock() / m_config.m_ft_divisors[m_ft] / 2));
+ m_ft_timer->adjust(attotime::zero, 0, attotime::from_hz(clock() / m_ft_divisors[m_ft] / 2));
}
diff --git a/src/emu/machine/com8116.h b/src/emu/machine/com8116.h
index 754bd98e931..41137a5e95a 100644
--- a/src/emu/machine/com8116.h
+++ b/src/emu/machine/com8116.h
@@ -51,9 +51,9 @@
struct com8116_interface
{
- devcb_write_line m_out_fx4_func;
- devcb_write_line m_out_fr_func;
- devcb_write_line m_out_ft_func;
+ devcb_write_line m_out_fx4_cb;
+ devcb_write_line m_out_fr_cb;
+ devcb_write_line m_out_ft_cb;
// receiver divisor ROM (19-bit)
UINT32 m_fr_divisors[16];
@@ -63,43 +63,21 @@ struct com8116_interface
};
-// ======================> com8116_device_config
-
-class com8116_device_config : public device_config,
- public com8116_interface
-{
- friend class com8116_device;
-
- // construction/destruction
- com8116_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
-
// ======================> com8116_device
-class com8116_device : public device_t
+class com8116_device : public device_t,
+ public com8116_interface
{
- friend class com8116_device_config;
-
+public:
// construction/destruction
- com8116_device(running_machine &_machine, const com8116_device_config &_config);
+ com8116_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_WRITE8_MEMBER( str_w );
DECLARE_WRITE8_MEMBER( stt_w );
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_timer(emu_timer &timer, device_timer_id id, int m_param, void *ptr);
@@ -119,8 +97,6 @@ private:
emu_timer *m_fx4_timer;
emu_timer *m_fr_timer;
emu_timer *m_ft_timer;
-
- const com8116_device_config &m_config;
};
diff --git a/src/emu/machine/devhelpr.h b/src/emu/machine/devhelpr.h
index 97ee11a08d4..2593ba39b9a 100644
--- a/src/emu/machine/devhelpr.h
+++ b/src/emu/machine/devhelpr.h
@@ -38,35 +38,4 @@
{ return downcast<devname##_device *>(device)->funcname(state); } \
void devname##_device::funcname(UINT8 state)
-#define GENERIC_DEVICE_CONFIG_SETUP(devname, devtag) \
- devname##_device_config::devname##_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) \
- : device_config(mconfig, static_alloc_device_config, devtag, tag, owner, clock) \
- { } \
- \
- device_config *devname##_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) \
- { return global_alloc(devname##_device_config(mconfig, tag, owner, clock)); } \
- \
- device_t *devname##_device_config::alloc_device(running_machine &machine) const \
- { return auto_alloc(machine, devname##_device(machine, *this)); }
-
-#define GENERIC_DEVICE_DERIVED_CONFIG(basename, devname) \
- class devname##_device_config : public basename##_device_config \
- { \
- friend class devname##_device; \
- devname##_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); \
- public: \
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); \
- virtual device_t *alloc_device(running_machine &machine) const; \
- }; \
- \
- class devname##_device : public basename##_device \
- { \
- friend class basename##_device; \
- friend class devname##_device_config; \
- devname##_device(running_machine &_machine, const devname##_device_config &config); \
- protected: \
- virtual void device_start(); \
- virtual void device_reset(); \
- };
-
#endif // __DEVHELPR_H__
diff --git a/src/emu/machine/ds1302.c b/src/emu/machine/ds1302.c
index 55f4728cdf0..1f6bd0c4d91 100644
--- a/src/emu/machine/ds1302.c
+++ b/src/emu/machine/ds1302.c
@@ -40,53 +40,18 @@ INLINE UINT8 convert_to_bcd(int val)
***************************************************************************/
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// ds1302_device_config - constructor
-//-------------------------------------------------
-
-ds1302_device_config::ds1302_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Dallas DS1302 RTC", tag, owner, clock)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *ds1302_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(ds1302_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *ds1302_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, ds1302_device(machine, *this));
-}
-
-
-//**************************************************************************
// LIVE DEVICE
//**************************************************************************
-const device_type DS1302 = ds1302_device_config::static_alloc_device_config;
+// device type definition
+const device_type DS1302 = &device_creator<ds1302_device>;
//-------------------------------------------------
// ds1302_device - constructor
//-------------------------------------------------
-ds1302_device::ds1302_device(running_machine &_machine, const ds1302_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+ds1302_device::ds1302_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DS1302, "Dallas DS1302 RTC", tag, owner, clock)
{
}
diff --git a/src/emu/machine/ds1302.h b/src/emu/machine/ds1302.h
index 7b97d58be65..30f53c1aa52 100644
--- a/src/emu/machine/ds1302.h
+++ b/src/emu/machine/ds1302.h
@@ -28,33 +28,13 @@
***************************************************************************/
-// ======================> ds1302_device_config
-
-class ds1302_device_config : public device_config
-{
- friend class ds1302_device;
-
- // construction/destruction
- ds1302_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
-
-
// ======================> ds1302_device
class ds1302_device : public device_t
{
- friend class ds1302_device_config;
-
- // construction/destruction
- ds1302_device(running_machine &_machine, const ds1302_device_config &_config);
-
public:
+ // construction/destruction
+ ds1302_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
void ds1302_dat_w(UINT32 offset, UINT8 data);
void ds1302_clk_w(UINT32 offset, UINT8 data);
@@ -75,8 +55,6 @@ private:
UINT8 m_last_clk;
UINT8 m_last_cmd;
UINT8 m_sram[0x20];
-
- const ds1302_device_config &m_config;
};
diff --git a/src/emu/machine/ds2401.c b/src/emu/machine/ds2401.c
index c3bee02b0e0..f0e9e5ce33c 100644
--- a/src/emu/machine/ds2401.c
+++ b/src/emu/machine/ds2401.c
@@ -20,30 +20,15 @@ inline void ATTR_PRINTF(3,4) ds2401_device::verboselog(int n_level, const char *
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("ds2401 %s %s: %s", config.tag(), machine().describe_context(), buf);
+ logerror("ds2401 %s %s: %s", tag(), machine().describe_context(), buf);
}
}
-const device_type DS2401 = ds2401_device_config::static_alloc_device_config;
+// device type definition
+const device_type DS2401 = &device_creator<ds2401_device>;
-ds2401_device_config::ds2401_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "DS2401", tag, owner, clock)
-{
-}
-
-device_config *ds2401_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(ds2401_device_config(mconfig, tag, owner, clock));
-}
-
-device_t *ds2401_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, ds2401_device(machine, *this));
-}
-
-ds2401_device::ds2401_device(running_machine &_machine, const ds2401_device_config &_config)
- : device_t(_machine, _config),
- config(_config)
+ds2401_device::ds2401_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DS2401, "DS2401", tag, owner, clock)
{
}
@@ -80,7 +65,7 @@ void ds2401_device::device_reset()
// Ensure the size is correct though
if(m_region->bytes() != SIZE_DATA)
logerror("ds2401 %s: Wrong region length for id data, expected 0x%x, got 0x%x\n",
- config.tag(),
+ tag(),
SIZE_DATA,
m_region->bytes());
else {
@@ -92,7 +77,7 @@ void ds2401_device::device_reset()
// That chip is useless without an id, so bitch if there
// isn't one
- logerror("ds2401 %s: Warning, no id provided, answer will be all zeroes.\n", config.tag());
+ logerror("ds2401 %s: Warning, no id provided, answer will be all zeroes.\n", tag());
memset(data, 0, SIZE_DATA);
}
diff --git a/src/emu/machine/ds2401.h b/src/emu/machine/ds2401.h
index e1b79962d03..353735899f7 100644
--- a/src/emu/machine/ds2401.h
+++ b/src/emu/machine/ds2401.h
@@ -14,27 +14,12 @@
#include "emu.h"
-class ds2401_device_config : public device_config
-{
- friend class ds2401_device;
-
- // construction/destruction
- ds2401_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
class ds2401_device : public device_t
{
- friend class ds2401_device_config;
-
+public:
// construction/destruction
- ds2401_device(running_machine &_machine, const ds2401_device_config &config);
+ ds2401_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
void write(bool line);
bool read();
UINT8 direct_read(int index);
@@ -66,8 +51,6 @@ protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
// internal state
- const ds2401_device_config &config;
-
int state, bit, shift;
UINT8 byte;
bool rx, tx;
diff --git a/src/emu/machine/ds2404.c b/src/emu/machine/ds2404.c
index 4c4c43fedc2..8ce9c29c900 100644
--- a/src/emu/machine/ds2404.c
+++ b/src/emu/machine/ds2404.c
@@ -11,43 +11,22 @@
#include <time.h>
#include "devhelpr.h"
-/***************************************************************************
- IMPLEMENTATION
-***************************************************************************/
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// ds2404_device_config - constructor
-//-------------------------------------------------
-
-ds2404_device_config::ds2404_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "DS2404", tag, owner, clock),
- device_config_nvram_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *ds2404_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(ds2404_device_config(mconfig, tag, owner, clock));
-}
-
+// device type definition
+const device_type DS2404 = &device_creator<ds2404_device>;
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// ds2404_device - constructor
//-------------------------------------------------
-device_t *ds2404_device_config::alloc_device(running_machine &machine) const
+ds2404_device::ds2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DS2404, "DS2404", tag, owner, clock),
+ device_nvram_interface(mconfig, *this)
{
- return auto_alloc(machine, ds2404_device(machine, *this));
}
@@ -56,10 +35,10 @@ device_t *ds2404_device_config::alloc_device(running_machine &machine) const
// to set the reference year
//-------------------------------------------------
-void ds2404_device_config::static_set_ref_year(device_config *device, UINT32 year)
+void ds2404_device::static_set_ref_year(device_t &device, UINT32 year)
{
- ds2404_device_config *ds2404 = downcast<ds2404_device_config *>(device);
- ds2404->m_ref_year = year;
+ ds2404_device &ds2404 = downcast<ds2404_device &>(device);
+ ds2404.m_ref_year = year;
}
@@ -68,10 +47,10 @@ void ds2404_device_config::static_set_ref_year(device_config *device, UINT32 yea
// to set the reference month
//-------------------------------------------------
-void ds2404_device_config::static_set_ref_month(device_config *device, UINT8 month)
+void ds2404_device::static_set_ref_month(device_t &device, UINT8 month)
{
- ds2404_device_config *ds2404 = downcast<ds2404_device_config *>(device);
- ds2404->m_ref_month = month;
+ ds2404_device &ds2404 = downcast<ds2404_device &>(device);
+ ds2404.m_ref_month = month;
}
@@ -80,30 +59,13 @@ void ds2404_device_config::static_set_ref_month(device_config *device, UINT8 mon
// to set the reference day
//-------------------------------------------------
-void ds2404_device_config::static_set_ref_day(device_config *device, UINT8 day)
+void ds2404_device::static_set_ref_day(device_t &device, UINT8 day)
{
- ds2404_device_config *ds2404 = downcast<ds2404_device_config *>(device);
- ds2404->m_ref_day = day;
+ ds2404_device &ds2404 = downcast<ds2404_device &>(device);
+ ds2404.m_ref_day = day;
}
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-const device_type DS2404 = ds2404_device_config::static_alloc_device_config;
-
-//-------------------------------------------------
-// ds2404_device - constructor
-//-------------------------------------------------
-
-ds2404_device::ds2404_device(running_machine &_machine, const ds2404_device_config &config)
- : device_t(_machine, config),
- device_nvram_interface(_machine, config, *this),
- m_config(config)
-{
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -113,9 +75,9 @@ void ds2404_device::device_start()
struct tm ref_tm;
memset(&ref_tm, 0, sizeof(ref_tm));
- ref_tm.tm_year = m_config.m_ref_year - 1900;
- ref_tm.tm_mon = m_config.m_ref_month - 1;
- ref_tm.tm_mday = m_config.m_ref_day;
+ ref_tm.tm_year = m_ref_year - 1900;
+ ref_tm.tm_mon = m_ref_month - 1;
+ ref_tm.tm_mday = m_ref_day;
time_t ref_time = mktime(&ref_tm);
diff --git a/src/emu/machine/ds2404.h b/src/emu/machine/ds2404.h
index 60f508e6dcd..8f28e2164c4 100644
--- a/src/emu/machine/ds2404.h
+++ b/src/emu/machine/ds2404.h
@@ -24,62 +24,33 @@
MCFG_DS2404_REF_DAY(_ref_day)
#define MCFG_DS2404_REF_YEAR(_ref_year) \
- ds2404_device_config::static_set_ref_year(device, _ref_year);
+ ds2404_device::static_set_ref_year(*device, _ref_year);
#define MCFG_DS2404_REF_MONTH(_ref_month) \
- ds2404_device_config::static_set_ref_month(device, _ref_month);
+ ds2404_device::static_set_ref_month(*device, _ref_month);
#define MCFG_DS2404_REF_DAY(_ref_day) \
- ds2404_device_config::static_set_ref_day(device, _ref_day);
+ ds2404_device::static_set_ref_day(*device, _ref_day);
-/***************************************************************************
- TYPE DEFINITIONS
-***************************************************************************/
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> ds2404_device_config
-
-class ds2404_device_config : public device_config,
- public device_config_nvram_interface
-{
- friend class ds2404_device;
-
- // construction/destruction
- ds2404_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_ref_year(device_config *device, UINT32 m_ref_year);
- static void static_set_ref_month(device_config *device, UINT8 m_ref_month);
- static void static_set_ref_day(device_config *device, UINT8 m_ref_day);
-
-protected:
- // internal state goes here
- UINT32 m_ref_year;
- UINT8 m_ref_month;
- UINT8 m_ref_day;
-};
-
-
// ======================> ds2404_device
class ds2404_device : public device_t,
public device_nvram_interface
{
- friend class ds2404_device_config;
-
+public:
// construction/destruction
- ds2404_device(running_machine &_machine, const ds2404_device_config &_config);
+ ds2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
+ // inline configuration helpers
+ static void static_set_ref_year(device_t &device, UINT32 m_ref_year);
+ static void static_set_ref_month(device_t &device, UINT8 m_ref_month);
+ static void static_set_ref_day(device_t &device, UINT8 m_ref_day);
/* 1-wire interface reset */
void ds2404_1w_reset_w(UINT32 offset, UINT8 data);
@@ -129,6 +100,11 @@ private:
DS2404_STATE_COPY_SCRATCHPAD /* Copy Scratchpad command active */
};
+ // configuration state
+ UINT32 m_ref_year;
+ UINT8 m_ref_month;
+ UINT8 m_ref_day;
+
UINT16 m_address;
UINT16 m_offset;
UINT16 m_end_offset;
@@ -139,8 +115,6 @@ private:
UINT8 m_rtc[5]; /* 40-bit RTC counter */
DS2404_STATE m_state[8];
int m_state_ptr;
-
- const ds2404_device_config &m_config;
};
diff --git a/src/emu/machine/e0516.c b/src/emu/machine/e0516.c
index a686d9cd959..dcfeab3b0ad 100644
--- a/src/emu/machine/e0516.c
+++ b/src/emu/machine/e0516.c
@@ -41,51 +41,6 @@ enum
};
-
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type E0516 = e0516_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// e0516_device_config - constructor
-//-------------------------------------------------
-
-e0516_device_config::e0516_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "E05-16", tag, owner, clock),
- device_config_rtc_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *e0516_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(e0516_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *e0516_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, e0516_device(machine, *this));
-}
-
-
//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -141,14 +96,16 @@ inline void e0516_device::advance_seconds()
// LIVE DEVICE
//**************************************************************************
+// device type definition
+const device_type E0516 = &device_creator<e0516_device>;
+
//-------------------------------------------------
// e0516_device - constructor
//-------------------------------------------------
-e0516_device::e0516_device(running_machine &_machine, const e0516_device_config &config)
- : device_t(_machine, config),
- device_rtc_interface(_machine, config, *this),
- m_config(config)
+e0516_device::e0516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, E0516, "E05-16", tag, owner, clock),
+ device_rtc_interface(mconfig, *this)
{
}
diff --git a/src/emu/machine/e0516.h b/src/emu/machine/e0516.h
index 9ebce2e92ce..ea2c04da29b 100644
--- a/src/emu/machine/e0516.h
+++ b/src/emu/machine/e0516.h
@@ -41,36 +41,15 @@
//**************************************************************************
-// ======================> e0516_device_config
-
-class e0516_device_config : public device_config,
- public device_config_rtc_interface
-{
- friend class e0516_device;
-
- // construction/destruction
- e0516_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
-};
-
-
// ======================> e0516_device
class e0516_device : public device_t,
public device_rtc_interface
{
- friend class e0516_device_config;
-
+public:
// construction/destruction
- e0516_device(running_machine &_machine, const e0516_device_config &_config);
+ e0516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_WRITE_LINE_MEMBER( cs_w );
DECLARE_WRITE_LINE_MEMBER( clk_w );
DECLARE_WRITE_LINE_MEMBER( dio_w );
@@ -102,8 +81,6 @@ private:
// timers
emu_timer *m_timer;
-
- const e0516_device_config &m_config;
};
diff --git a/src/emu/machine/eeprom.c b/src/emu/machine/eeprom.c
index 14cfbefa011..ee4b836db5c 100644
--- a/src/emu/machine/eeprom.c
+++ b/src/emu/machine/eeprom.c
@@ -24,7 +24,8 @@
// GLOBAL VARIABLES
//**************************************************************************
-const device_type EEPROM = eeprom_device_config::static_alloc_device_config;
+// device type definition
+const device_type EEPROM = &device_creator<eeprom_device>;
const eeprom_interface eeprom_interface_93C46 =
{
@@ -69,42 +70,31 @@ ADDRESS_MAP_END
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
-// eeprom_device_config - constructor
+// eeprom_device - constructor
//-------------------------------------------------
-eeprom_device_config::eeprom_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "EEPROM", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- device_config_nvram_interface(mconfig, *this),
+eeprom_device::eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, EEPROM, "EEPROM", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ device_nvram_interface(mconfig, *this),
m_default_data_size(0),
- m_default_value(0)
+ m_default_value(0),
+ m_serial_count(0),
+ m_read_address(0),
+ m_clock_count(0),
+ m_latch(0),
+ m_reset_line(CLEAR_LINE),
+ m_clock_line(CLEAR_LINE),
+ m_sending(0),
+ m_locked(false),
+ m_reset_delay(0)
{
m_default_data.u8 = NULL;
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *eeprom_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(eeprom_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *eeprom_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, eeprom_device(machine, *this));
+ memset(downcast<eeprom_interface *>(this), 0, sizeof(eeprom_interface));
}
@@ -113,16 +103,16 @@ device_t *eeprom_device_config::alloc_device(running_machine &machine) const
// to set the interface
//-------------------------------------------------
-void eeprom_device_config::static_set_interface(device_config *device, const eeprom_interface &interface)
+void eeprom_device::static_set_interface(device_t &device, const eeprom_interface &interface)
{
- eeprom_device_config *eeprom = downcast<eeprom_device_config *>(device);
- *static_cast<eeprom_interface *>(eeprom) = interface;
+ eeprom_device &eeprom = downcast<eeprom_device &>(device);
+ static_cast<eeprom_interface &>(eeprom) = interface;
// describe our address space
- if (eeprom->m_data_bits == 8)
- eeprom->m_space_config = address_space_config("eeprom", ENDIANNESS_BIG, 8, eeprom->m_address_bits, 0, *ADDRESS_MAP_NAME(eeprom_map8));
+ if (eeprom.m_data_bits == 8)
+ eeprom.m_space_config = address_space_config("eeprom", ENDIANNESS_BIG, 8, eeprom.m_address_bits, 0, *ADDRESS_MAP_NAME(eeprom_map8));
else
- eeprom->m_space_config = address_space_config("eeprom", ENDIANNESS_BIG, 16, eeprom->m_address_bits * 2, 0, *ADDRESS_MAP_NAME(eeprom_map16));
+ eeprom.m_space_config = address_space_config("eeprom", ENDIANNESS_BIG, 16, eeprom.m_address_bits * 2, 0, *ADDRESS_MAP_NAME(eeprom_map16));
}
@@ -131,20 +121,20 @@ void eeprom_device_config::static_set_interface(device_config *device, const eep
// to set the default data
//-------------------------------------------------
-void eeprom_device_config::static_set_default_data(device_config *device, const UINT8 *data, UINT32 size)
+void eeprom_device::static_set_default_data(device_t &device, const UINT8 *data, UINT32 size)
{
- eeprom_device_config *eeprom = downcast<eeprom_device_config *>(device);
- assert(eeprom->m_data_bits == 8);
- eeprom->m_default_data.u8 = const_cast<UINT8 *>(data);
- eeprom->m_default_data_size = size;
+ eeprom_device &eeprom = downcast<eeprom_device &>(device);
+ assert(eeprom.m_data_bits == 8);
+ eeprom.m_default_data.u8 = const_cast<UINT8 *>(data);
+ eeprom.m_default_data_size = size;
}
-void eeprom_device_config::static_set_default_data(device_config *device, const UINT16 *data, UINT32 size)
+void eeprom_device::static_set_default_data(device_t &device, const UINT16 *data, UINT32 size)
{
- eeprom_device_config *eeprom = downcast<eeprom_device_config *>(device);
- assert(eeprom->m_data_bits == 16);
- eeprom->m_default_data.u16 = const_cast<UINT16 *>(data);
- eeprom->m_default_data_size = size / 2;
+ eeprom_device &eeprom = downcast<eeprom_device &>(device);
+ assert(eeprom.m_data_bits == 16);
+ eeprom.m_default_data.u16 = const_cast<UINT16 *>(data);
+ eeprom.m_default_data_size = size / 2;
}
@@ -153,9 +143,9 @@ void eeprom_device_config::static_set_default_data(device_config *device, const
// to set the default value
//-------------------------------------------------
-void eeprom_device_config::static_set_default_value(device_config *device, UINT16 value)
+void eeprom_device::static_set_default_value(device_t &device, UINT16 value)
{
- downcast<eeprom_device_config *>(device)->m_default_value = 0x10000 | value;
+ downcast<eeprom_device &>(device).m_default_value = 0x10000 | value;
}
@@ -164,7 +154,7 @@ void eeprom_device_config::static_set_default_value(device_config *device, UINT1
// on this device
//-------------------------------------------------
-bool eeprom_device_config::device_validity_check(emu_options &options, const game_driver &driver) const
+bool eeprom_device::device_validity_check(emu_options &options, const game_driver &driver) const
{
bool error = false;
@@ -179,50 +169,13 @@ bool eeprom_device_config::device_validity_check(emu_options &options, const gam
//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *eeprom_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == 0) ? &m_space_config : NULL;
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// eeprom_device - constructor
-//-------------------------------------------------
-
-eeprom_device::eeprom_device(running_machine &_machine, const eeprom_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
- device_nvram_interface(_machine, config, *this),
- m_config(config),
- m_serial_count(0),
- m_data_bits(0),
- m_read_address(0),
- m_clock_count(0),
- m_latch(0),
- m_reset_line(CLEAR_LINE),
- m_clock_line(CLEAR_LINE),
- m_sending(0),
- m_locked(m_config.m_cmd_unlock != NULL),
- m_reset_delay(0)
-{
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void eeprom_device::device_start()
{
+ m_locked = (m_cmd_unlock != NULL);
+
save_pointer(NAME(m_serial_buffer), SERIAL_BUFFER_LENGTH);
save_item(NAME(m_clock_line));
save_item(NAME(m_reset_line));
@@ -246,45 +199,56 @@ void eeprom_device::device_reset()
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *eeprom_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == 0) ? &m_space_config : NULL;
+}
+
+
+//-------------------------------------------------
// nvram_default - called to initialize NVRAM to
// its default state
//-------------------------------------------------
void eeprom_device::nvram_default()
{
- UINT32 eeprom_length = 1 << m_config.m_address_bits;
- UINT32 eeprom_bytes = eeprom_length * m_config.m_data_bits / 8;
+ UINT32 eeprom_length = 1 << m_address_bits;
+ UINT32 eeprom_bytes = eeprom_length * m_data_bits / 8;
/* initialize to the default value */
UINT16 default_value = 0xffff;
- if (m_config.m_default_value != 0)
- default_value = m_config.m_default_value;
+ if (m_default_value != 0)
+ default_value = m_default_value;
for (offs_t offs = 0; offs < eeprom_length; offs++)
- if (m_config.m_data_bits == 8)
+ if (m_data_bits == 8)
m_addrspace[0]->write_byte(offs, default_value);
else
m_addrspace[0]->write_word(offs * 2, default_value);
/* handle hard-coded data from the driver */
- if (m_config.m_default_data.u8 != NULL)
- for (offs_t offs = 0; offs < m_config.m_default_data_size; offs++)
- if (m_config.m_data_bits == 8)
- m_addrspace[0]->write_byte(offs, m_config.m_default_data.u8[offs]);
+ if (m_default_data.u8 != NULL)
+ for (offs_t offs = 0; offs < m_default_data_size; offs++)
+ if (m_data_bits == 8)
+ m_addrspace[0]->write_byte(offs, m_default_data.u8[offs]);
else
- m_addrspace[0]->write_word(offs * 2, m_config.m_default_data.u16[offs]);
+ m_addrspace[0]->write_word(offs * 2, m_default_data.u16[offs]);
/* populate from a memory region if present */
if (m_region != NULL)
{
if (m_region->bytes() != eeprom_bytes)
fatalerror("eeprom region '%s' wrong size (expected size = 0x%X)", tag(), eeprom_bytes);
- if (m_config.m_data_bits == 8 && m_region->width() != 1)
+ if (m_data_bits == 8 && m_region->width() != 1)
fatalerror("eeprom region '%s' needs to be an 8-bit region", tag());
- if (m_config.m_data_bits == 16 && (m_region->width() != 2 || m_region->endianness() != ENDIANNESS_BIG))
+ if (m_data_bits == 16 && (m_region->width() != 2 || m_region->endianness() != ENDIANNESS_BIG))
fatalerror("eeprom region '%s' needs to be a 16-bit big-endian region", tag());
for (offs_t offs = 0; offs < eeprom_length; offs++)
- if (m_config.m_data_bits == 8)
+ if (m_data_bits == 8)
m_addrspace[0]->write_byte(offs, m_region->u8(offs));
else
m_addrspace[0]->write_word(offs * 2, m_region->u16(offs));
@@ -299,8 +263,8 @@ void eeprom_device::nvram_default()
void eeprom_device::nvram_read(emu_file &file)
{
- UINT32 eeprom_length = 1 << m_config.m_address_bits;
- UINT32 eeprom_bytes = eeprom_length * m_config.m_data_bits / 8;
+ UINT32 eeprom_length = 1 << m_address_bits;
+ UINT32 eeprom_bytes = eeprom_length * m_data_bits / 8;
UINT8 *buffer = auto_alloc_array(machine(), UINT8, eeprom_bytes);
file.read(buffer, eeprom_bytes);
@@ -317,8 +281,8 @@ void eeprom_device::nvram_read(emu_file &file)
void eeprom_device::nvram_write(emu_file &file)
{
- UINT32 eeprom_length = 1 << m_config.m_address_bits;
- UINT32 eeprom_bytes = eeprom_length * m_config.m_data_bits / 8;
+ UINT32 eeprom_length = 1 << m_address_bits;
+ UINT32 eeprom_bytes = eeprom_length * m_data_bits / 8;
UINT8 *buffer = auto_alloc_array(machine(), UINT8, eeprom_bytes);
for (offs_t offs = 0; offs < eeprom_bytes; offs++)
@@ -355,7 +319,7 @@ int eeprom_device::read_bit()
int res;
if (m_sending)
- res = (m_data_bits >> m_config.m_data_bits) & 1;
+ res = (m_data_bits >> m_data_bits) & 1;
else
{
if (m_reset_delay > 0)
@@ -392,7 +356,7 @@ void eeprom_device::set_cs_line(int state)
m_serial_count = 0;
m_sending = 0;
- m_reset_delay = m_config.m_reset_delay; /* delay a little before returning setting data to 1 (needed by wbeachvl) */
+ m_reset_delay = m_reset_delay; /* delay a little before returning setting data to 1 (needed by wbeachvl) */
}
}
@@ -412,10 +376,10 @@ void eeprom_device::set_clock_line(int state)
{
if (m_sending)
{
- if (m_clock_count == m_config.m_data_bits && m_config.m_enable_multi_read)
+ if (m_clock_count == m_data_bits && m_enable_multi_read)
{
- m_read_address = (m_read_address + 1) & ((1 << m_config.m_address_bits) - 1);
- if (m_config.m_data_bits == 16)
+ m_read_address = (m_read_address + 1) & ((1 << m_address_bits) - 1);
+ if (m_data_bits == 16)
m_data_bits = m_addrspace[0]->read_word(m_read_address * 2);
else
m_data_bits = m_addrspace[0]->read_byte(m_read_address);
@@ -452,18 +416,18 @@ void eeprom_device::write(int bit)
m_serial_buffer[m_serial_count++] = (bit ? '1' : '0');
m_serial_buffer[m_serial_count] = 0; /* nul terminate so we can treat it as a string */
- if ( (m_serial_count > m_config.m_address_bits) &&
- command_match((char*)(m_serial_buffer),m_config.m_cmd_read,strlen((char*)(m_serial_buffer))-m_config.m_address_bits) )
+ if ( (m_serial_count > m_address_bits) &&
+ command_match((char*)(m_serial_buffer),m_cmd_read,strlen((char*)(m_serial_buffer))-m_address_bits) )
{
int i,address;
address = 0;
- for (i = m_serial_count-m_config.m_address_bits;i < m_serial_count;i++)
+ for (i = m_serial_count-m_address_bits;i < m_serial_count;i++)
{
address <<= 1;
if (m_serial_buffer[i] == '1') address |= 1;
}
- if (m_config.m_data_bits == 16)
+ if (m_data_bits == 16)
m_data_bits = m_addrspace[0]->read_word(address * 2);
else
m_data_bits = m_addrspace[0]->read_byte(address);
@@ -473,13 +437,13 @@ void eeprom_device::write(int bit)
m_serial_count = 0;
logerror("EEPROM read %04x from address %02x\n",m_data_bits,address);
}
- else if ( (m_serial_count > m_config.m_address_bits) &&
- command_match((char*)(m_serial_buffer),m_config.m_cmd_erase,strlen((char*)(m_serial_buffer))-m_config.m_address_bits) )
+ else if ( (m_serial_count > m_address_bits) &&
+ command_match((char*)(m_serial_buffer),m_cmd_erase,strlen((char*)(m_serial_buffer))-m_address_bits) )
{
int i,address;
address = 0;
- for (i = m_serial_count-m_config.m_address_bits;i < m_serial_count;i++)
+ for (i = m_serial_count-m_address_bits;i < m_serial_count;i++)
{
address <<= 1;
if (m_serial_buffer[i] == '1') address |= 1;
@@ -487,7 +451,7 @@ logerror("EEPROM read %04x from address %02x\n",m_data_bits,address);
logerror("EEPROM erase address %02x\n",address);
if (m_locked == 0)
{
- if (m_config.m_data_bits == 16)
+ if (m_data_bits == 16)
m_addrspace[0]->write_word(address * 2, 0x0000);
else
m_addrspace[0]->write_byte(address, 0x00);
@@ -496,19 +460,19 @@ logerror("EEPROM erase address %02x\n",address);
logerror("Error: EEPROM is m_locked\n");
m_serial_count = 0;
}
- else if ( (m_serial_count > (m_config.m_address_bits + m_config.m_data_bits)) &&
- command_match((char*)(m_serial_buffer),m_config.m_cmd_write,strlen((char*)(m_serial_buffer))-(m_config.m_address_bits + m_config.m_data_bits)) )
+ else if ( (m_serial_count > (m_address_bits + m_data_bits)) &&
+ command_match((char*)(m_serial_buffer),m_cmd_write,strlen((char*)(m_serial_buffer))-(m_address_bits + m_data_bits)) )
{
int i,address,data;
address = 0;
- for (i = m_serial_count-m_config.m_data_bits-m_config.m_address_bits;i < (m_serial_count-m_config.m_data_bits);i++)
+ for (i = m_serial_count-m_data_bits-m_address_bits;i < (m_serial_count-m_data_bits);i++)
{
address <<= 1;
if (m_serial_buffer[i] == '1') address |= 1;
}
data = 0;
- for (i = m_serial_count-m_config.m_data_bits;i < m_serial_count;i++)
+ for (i = m_serial_count-m_data_bits;i < m_serial_count;i++)
{
data <<= 1;
if (m_serial_buffer[i] == '1') data |= 1;
@@ -516,7 +480,7 @@ logerror("Error: EEPROM is m_locked\n");
logerror("EEPROM write %04x to address %02x\n",data,address);
if (m_locked == 0)
{
- if (m_config.m_data_bits == 16)
+ if (m_data_bits == 16)
m_addrspace[0]->write_word(address * 2, data);
else
m_addrspace[0]->write_byte(address, data);
@@ -525,13 +489,13 @@ logerror("EEPROM write %04x to address %02x\n",data,address);
logerror("Error: EEPROM is m_locked\n");
m_serial_count = 0;
}
- else if ( command_match((char*)(m_serial_buffer),m_config.m_cmd_lock,strlen((char*)(m_serial_buffer))) )
+ else if ( command_match((char*)(m_serial_buffer),m_cmd_lock,strlen((char*)(m_serial_buffer))) )
{
logerror("EEPROM lock\n");
m_locked = 1;
m_serial_count = 0;
}
- else if ( command_match((char*)(m_serial_buffer),m_config.m_cmd_unlock,strlen((char*)(m_serial_buffer))) )
+ else if ( command_match((char*)(m_serial_buffer),m_cmd_unlock,strlen((char*)(m_serial_buffer))) )
{
logerror("EEPROM unlock\n");
m_locked = 0;
diff --git a/src/emu/machine/eeprom.h b/src/emu/machine/eeprom.h
index 3a59d3c3c46..b64aa5c28d9 100644
--- a/src/emu/machine/eeprom.h
+++ b/src/emu/machine/eeprom.h
@@ -19,7 +19,7 @@
#define MCFG_EEPROM_ADD(_tag, _interface) \
MCFG_DEVICE_ADD(_tag, EEPROM, 0) \
- eeprom_device_config::static_set_interface(device, _interface); \
+ eeprom_device::static_set_interface(*device, _interface); \
#define MCFG_EEPROM_93C46_ADD(_tag) \
MCFG_EEPROM_ADD(_tag, eeprom_interface_93C46)
@@ -28,10 +28,10 @@
MCFG_EEPROM_ADD(_tag, eeprom_interface_93C66B)
#define MCFG_EEPROM_DATA(_data, _size) \
- eeprom_device_config::static_set_default_data(device, _data, _size); \
+ eeprom_device::static_set_default_data(*device, _data, _size); \
#define MCFG_EEPROM_DEFAULT_VALUE(_value) \
- eeprom_device_config::static_set_default_value(device, _value); \
+ eeprom_device::static_set_default_value(*device, _value); \
@@ -58,58 +58,23 @@ struct eeprom_interface
-// ======================> eeprom_device_config
-
-class eeprom_device_config : public device_config,
- public device_config_memory_interface,
- public device_config_nvram_interface,
- public eeprom_interface
-{
- friend class eeprom_device;
-
- // construction/destruction
- eeprom_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_interface(device_config *deviec, const eeprom_interface &interface);
- static void static_set_default_data(device_config *device, const UINT8 *data, UINT32 size);
- static void static_set_default_data(device_config *device, const UINT16 *data, UINT32 size);
- static void static_set_default_value(device_config *device, UINT16 value);
-
-protected:
- // device_config overrides
- virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // device-specific configuration
- address_space_config m_space_config;
-
- // internal state
- generic_ptr m_default_data;
- int m_default_data_size;
- UINT32 m_default_value;
-};
-
-
// ======================> eeprom_device
class eeprom_device : public device_t,
public device_memory_interface,
- public device_nvram_interface
+ public device_nvram_interface,
+ public eeprom_interface
{
- friend class eeprom_device_config;
-
+public:
// construction/destruction
- eeprom_device(running_machine &_machine, const eeprom_device_config &config);
+ eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_interface(device_t &device, const eeprom_interface &interface);
+ static void static_set_default_data(device_t &device, const UINT8 *data, UINT32 size);
+ static void static_set_default_data(device_t &device, const UINT16 *data, UINT32 size);
+ static void static_set_default_value(device_t &device, UINT16 value);
-public:
// I/O operations
void write_bit(int state);
int read_bit();
@@ -118,9 +83,13 @@ public:
protected:
// device-level overrides
+ virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
virtual void device_start();
virtual void device_reset();
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
// device_nvram_interface overrides
virtual void nvram_default();
virtual void nvram_read(emu_file &file);
@@ -132,20 +101,23 @@ protected:
static const int SERIAL_BUFFER_LENGTH = 40;
- // internal state
- const eeprom_device_config &m_config;
-
- int m_serial_count;
- UINT8 m_serial_buffer[SERIAL_BUFFER_LENGTH];
- int m_data_bits;
- int m_read_address;
- int m_clock_count;
- int m_latch;
- int m_reset_line;
- int m_clock_line;
- int m_sending;
- int m_locked;
- int m_reset_delay;
+ // configuration state
+ address_space_config m_space_config;
+ generic_ptr m_default_data;
+ int m_default_data_size;
+ UINT32 m_default_value;
+
+ // runtime state
+ int m_serial_count;
+ UINT8 m_serial_buffer[SERIAL_BUFFER_LENGTH];
+ int m_read_address;
+ int m_clock_count;
+ int m_latch;
+ int m_reset_line;
+ int m_clock_line;
+ int m_sending;
+ int m_locked;
+ int m_reset_delay;
};
@@ -154,7 +126,6 @@ extern const device_type EEPROM;
-
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
diff --git a/src/emu/machine/er2055.c b/src/emu/machine/er2055.c
index ddf735fe3a0..a4e336e83ab 100644
--- a/src/emu/machine/er2055.c
+++ b/src/emu/machine/er2055.c
@@ -45,7 +45,8 @@
// GLOBAL VARIABLES
//**************************************************************************
-const device_type ER2055 = er2055_device_config::static_alloc_device_config;
+// device type definition
+const device_type ER2055 = &device_creator<er2055_device>;
static ADDRESS_MAP_START( er2055_map, AS_PROGRAM, 8 )
AM_RANGE(0x0000, 0x003f) AM_RAM
@@ -54,56 +55,6 @@ ADDRESS_MAP_END
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// er2055_device_config - constructor
-//-------------------------------------------------
-
-er2055_device_config::er2055_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "ER2055", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- device_config_nvram_interface(mconfig, *this),
- m_space_config("EAROM", ENDIANNESS_BIG, 8, 6, 0, *ADDRESS_MAP_NAME(er2055_map))
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *er2055_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(er2055_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *er2055_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, er2055_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *er2055_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == 0) ? &m_space_config : NULL;
-}
-
-
-
-//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@@ -111,11 +62,11 @@ const address_space_config *er2055_device_config::memory_space_config(address_sp
// er2055_device - constructor
//-------------------------------------------------
-er2055_device::er2055_device(running_machine &_machine, const er2055_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
- device_nvram_interface(_machine, config, *this),
- m_config(config),
+er2055_device::er2055_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ER2055, "ER2055", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ device_nvram_interface(mconfig, *this),
+ m_space_config("EAROM", ENDIANNESS_BIG, 8, 6, 0, *ADDRESS_MAP_NAME(er2055_map)),
m_control_state(0),
m_address(0),
m_data(0)
@@ -138,6 +89,17 @@ void er2055_device::device_start()
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *er2055_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == 0) ? &m_space_config : NULL;
+}
+
+
+//-------------------------------------------------
// nvram_default - called to initialize NVRAM to
// its default state
//-------------------------------------------------
diff --git a/src/emu/machine/er2055.h b/src/emu/machine/er2055.h
index 833b43918e4..f47b503d57c 100644
--- a/src/emu/machine/er2055.h
+++ b/src/emu/machine/er2055.h
@@ -58,43 +58,16 @@
//**************************************************************************
-// ======================> er2055_device_config
-
-class er2055_device_config : public device_config,
- public device_config_memory_interface,
- public device_config_nvram_interface
-{
- friend class er2055_device;
-
- // construction/destruction
- er2055_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // device-specific configuration
- address_space_config m_space_config;
-};
-
-
// ======================> er2055_device
class er2055_device : public device_t,
public device_memory_interface,
public device_nvram_interface
{
- friend class er2055_device_config;
-
+public:
// construction/destruction
- er2055_device(running_machine &_machine, const er2055_device_config &config);
+ er2055_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
// I/O operations
UINT8 data() const { return m_data; }
void set_address(UINT8 address) { m_address = address & 0x3f; }
@@ -107,6 +80,9 @@ protected:
// device-level overrides
virtual void device_start();
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
// device_nvram_interface overrides
virtual void nvram_default();
virtual void nvram_read(emu_file &file);
@@ -120,9 +96,10 @@ protected:
static const UINT8 CS1 = 0x08;
static const UINT8 CS2 = 0x10;
- // internal state
- const er2055_device_config &m_config;
+ // configuration state
+ address_space_config m_space_config;
+ // internal state
UINT8 m_control_state;
UINT8 m_address;
UINT8 m_data;
diff --git a/src/emu/machine/f3853.c b/src/emu/machine/f3853.c
index 19ff8f563ea..993028d4595 100644
--- a/src/emu/machine/f3853.c
+++ b/src/emu/machine/f3853.c
@@ -38,37 +38,20 @@
***************************************************************************/
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// f3853_device_config - constructor
-//-------------------------------------------------
-
-f3853_device_config::f3853_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "F3853", tag, owner, clock)
-{
-}
-
+// device type definition
+const device_type F3853 = &device_creator<f3853_device>;
//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
+// f3853_device - constructor
//-------------------------------------------------
-device_config *f3853_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
+f3853_device::f3853_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, F3853, "F3853", tag, owner, clock)
{
- return global_alloc(f3853_device_config(mconfig, tag, owner, clock));
-}
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *f3853_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, f3853_device(machine, *this));
}
@@ -78,7 +61,7 @@ device_t *f3853_device_config::alloc_device(running_machine &machine) const
// complete
//-------------------------------------------------
-void f3853_device_config::device_config_complete()
+void f3853_device::device_config_complete()
{
// inherit a copy of the static data
const f3853_interface *intf = reinterpret_cast<const f3853_interface *>(static_config());
@@ -95,24 +78,6 @@ void f3853_device_config::device_config_complete()
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-const device_type F3853 = f3853_device_config::static_alloc_device_config;
-
-//-------------------------------------------------
-// f3853_device - constructor
-//-------------------------------------------------
-
-f3853_device::f3853_device(running_machine &_machine, const f3853_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -166,22 +131,22 @@ void f3853_device::device_reset()
void f3853_device::f3853_set_interrupt_request_line()
{
- if(!m_config.m_interrupt_request)
+ if(!m_interrupt_request)
{
return;
}
if(m_external_enable && !m_priority_line)
{
- m_config.m_interrupt_request(this, INTERRUPT_VECTOR(TRUE), TRUE);
+ m_interrupt_request(this, INTERRUPT_VECTOR(TRUE), TRUE);
}
else if( m_timer_enable && !m_priority_line && m_request_flipflop)
{
- m_config.m_interrupt_request(this, INTERRUPT_VECTOR(FALSE), TRUE);
+ m_interrupt_request(this, INTERRUPT_VECTOR(FALSE), TRUE);
}
else
{
- m_config.m_interrupt_request(this, 0, FALSE);
+ m_interrupt_request(this, 0, FALSE);
}
}
diff --git a/src/emu/machine/f3853.h b/src/emu/machine/f3853.h
index cc0cb3b427e..9ee50c68c13 100644
--- a/src/emu/machine/f3853.h
+++ b/src/emu/machine/f3853.h
@@ -64,37 +64,14 @@ struct f3853_interface
};
-// ======================> f3853_device_config
-
-class f3853_device_config : public device_config,
- public f3853_interface
-{
- friend class f3853_device;
-
- // construction/destruction
- f3853_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
// ======================> f3853_device
-class f3853_device : public device_t
+class f3853_device : public device_t,
+ public f3853_interface
{
- friend class f3853_device_config;
-
- // construction/destruction
- f3853_device(running_machine &_machine, const f3853_device_config &_config);
-
public:
+ // construction/destruction
+ f3853_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
UINT8 f3853_r(UINT32 offset);
void f3853_w(UINT32 offset, UINT8 data);
@@ -104,6 +81,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load() { }
@@ -130,8 +108,6 @@ private:
emu_timer *m_timer;
UINT8 m_value_to_cycle[0x100];
-
- const f3853_device_config &m_config;
};
diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c
index ddf9cc9a098..2dddd85a17a 100644
--- a/src/emu/machine/generic.c
+++ b/src/emu/machine/generic.c
@@ -96,7 +96,7 @@ void generic_machine_init(running_machine &machine)
memset(state->interrupt_device, 0, sizeof(state->interrupt_device));
device_execute_interface *exec = NULL;
int index = 0;
- for (bool gotone = machine.m_devicelist.first(exec); gotone && index < ARRAY_LENGTH(state->interrupt_device); gotone = exec->next(exec))
+ for (bool gotone = machine.devicelist().first(exec); gotone && index < ARRAY_LENGTH(state->interrupt_device); gotone = exec->next(exec))
state->interrupt_device[index++] = &exec->device();
/* register coin save state */
@@ -319,7 +319,7 @@ void nvram_load(running_machine &machine)
{
// only need to do something if we have an NVRAM device or an nvram_handler
device_nvram_interface *nvram = NULL;
- if (!machine.m_devicelist.first(nvram) && machine.config().m_nvram_handler == NULL)
+ if (!machine.devicelist().first(nvram) && machine.config().m_nvram_handler == NULL)
return;
// open the file; if it exists, call everyone to read from it
@@ -357,7 +357,7 @@ void nvram_save(running_machine &machine)
{
// only need to do something if we have an NVRAM device or an nvram_handler
device_nvram_interface *nvram = NULL;
- if (!machine.m_devicelist.first(nvram) && machine.config().m_nvram_handler == NULL)
+ if (!machine.devicelist().first(nvram) && machine.config().m_nvram_handler == NULL)
return;
// open the file; if it exists, call everyone to read from it
diff --git a/src/emu/machine/i2cmem.c b/src/emu/machine/i2cmem.c
index d6577137cbe..0aaacf24026 100644
--- a/src/emu/machine/i2cmem.c
+++ b/src/emu/machine/i2cmem.c
@@ -55,7 +55,8 @@ INLINE void ATTR_PRINTF( 3, 4 ) verboselog( device_t *device, int n_level, const
// GLOBAL VARIABLES
//**************************************************************************
-const device_type I2CMEM = i2cmem_device_config::static_alloc_device_config;
+// device type definition
+const device_type I2CMEM = &device_creator<i2cmem_device>;
static ADDRESS_MAP_START( i2cmem_map8, AS_PROGRAM, 8 )
AM_RANGE(0x0000, 0x0fff) AM_RAM
@@ -64,17 +65,25 @@ ADDRESS_MAP_END
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
-// i2cmem_device_config - constructor
+// i2cmem_device - constructor
//-------------------------------------------------
-i2cmem_device_config::i2cmem_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock )
- : device_config(mconfig, static_alloc_device_config, "I2CMEM", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- device_config_nvram_interface(mconfig, *this)
+i2cmem_device::i2cmem_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock )
+ : device_t(mconfig, I2CMEM, "I2CMEM", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ device_nvram_interface(mconfig, *this),
+ m_scl( 0 ),
+ m_sdaw( 0 ),
+ m_e0( 0 ),
+ m_e1( 0 ),
+ m_e2( 0 ),
+ m_wc( 0 ),
+ m_sdar( 1 ),
+ m_state( STATE_IDLE )
{
m_address_bits = 0;
@@ -87,38 +96,15 @@ i2cmem_device_config::i2cmem_device_config( const machine_config &mconfig, const
}
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *i2cmem_device_config::static_alloc_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock )
-{
- return global_alloc( i2cmem_device_config( mconfig, tag, owner, clock ) );
-}
-
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *i2cmem_device_config::alloc_device( running_machine &machine ) const
-{
- return auto_alloc( machine, i2cmem_device( machine, *this ) );
-}
-
-
//-------------------------------------------------
// static_set_interface - set the device
// configuration
//-------------------------------------------------
-void i2cmem_device_config::static_set_interface(device_config *device, const i2cmem_interface &interface)
+void i2cmem_device::static_set_interface(device_t &device, const i2cmem_interface &interface)
{
- i2cmem_device_config *i2cmem = downcast<i2cmem_device_config *>(device);
- *static_cast<i2cmem_interface *>(i2cmem) = interface;
+ i2cmem_device &i2cmem = downcast<i2cmem_device &>(device);
+ static_cast<i2cmem_interface &>(i2cmem) = interface;
}
@@ -128,7 +114,7 @@ void i2cmem_device_config::static_set_interface(device_config *device, const i2c
// complete
//-------------------------------------------------
-void i2cmem_device_config::device_config_complete()
+void i2cmem_device::device_config_complete()
{
m_space_config = address_space_config( "i2cmem", ENDIANNESS_BIG, 8, m_address_bits, 0, *ADDRESS_MAP_NAME( i2cmem_map8 ) );
}
@@ -139,7 +125,7 @@ void i2cmem_device_config::device_config_complete()
// on this device
//-------------------------------------------------
-bool i2cmem_device_config::device_validity_check( emu_options &options, const game_driver &driver ) const
+bool i2cmem_device::device_validity_check( emu_options &options, const game_driver &driver ) const
{
bool error = false;
return error;
@@ -147,52 +133,16 @@ bool i2cmem_device_config::device_validity_check( emu_options &options, const ga
//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *i2cmem_device_config::memory_space_config( address_spacenum spacenum ) const
-{
- return ( spacenum == 0 ) ? &m_space_config : NULL;
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// i2cmem_device - constructor
+// device_start - device-specific startup
//-------------------------------------------------
-i2cmem_device::i2cmem_device( running_machine &_machine, const i2cmem_device_config &config ) :
- device_t( _machine, config ),
- device_memory_interface( _machine, config, *this ),
- device_nvram_interface( _machine, config, *this ),
- m_config( config ),
- m_scl( 0 ),
- m_sdaw( 0 ),
- m_e0( 0 ),
- m_e1( 0 ),
- m_e2( 0 ),
- m_wc( 0 ),
- m_sdar( 1 ),
- m_state( STATE_IDLE )
+void i2cmem_device::device_start()
{
- if( m_config.m_page_size > 0 )
+ if( m_page_size > 0 )
{
- m_page = auto_alloc_array( machine(), UINT8, m_config.m_page_size );
+ m_page = auto_alloc_array( machine(), UINT8, m_page_size );
}
-}
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void i2cmem_device::device_start()
-{
save_item( NAME(m_scl) );
save_item( NAME(m_sdaw) );
save_item( NAME(m_e0) );
@@ -205,7 +155,7 @@ void i2cmem_device::device_start()
save_item( NAME(m_shift) );
save_item( NAME(m_devsel) );
save_item( NAME(m_byteaddr) );
- save_pointer( NAME(m_page), m_config.m_page_size );
+ save_pointer( NAME(m_page), m_page_size );
}
@@ -219,13 +169,24 @@ void i2cmem_device::device_reset()
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *i2cmem_device::memory_space_config( address_spacenum spacenum ) const
+{
+ return ( spacenum == 0 ) ? &m_space_config : NULL;
+}
+
+
+//-------------------------------------------------
// nvram_default - called to initialize NVRAM to
// its default state
//-------------------------------------------------
void i2cmem_device::nvram_default()
{
- int i2cmem_bytes = m_config.m_data_size;
+ int i2cmem_bytes = m_data_size;
UINT16 default_value = 0xff;
for( offs_t offs = 0; offs < i2cmem_bytes; offs++ )
@@ -261,7 +222,7 @@ void i2cmem_device::nvram_default()
void i2cmem_device::nvram_read( emu_file &file )
{
- int i2cmem_bytes = m_config.m_data_size;
+ int i2cmem_bytes = m_data_size;
UINT8 *buffer = auto_alloc_array( machine(), UINT8, i2cmem_bytes );
file.read( buffer, i2cmem_bytes );
@@ -281,7 +242,7 @@ void i2cmem_device::nvram_read( emu_file &file )
void i2cmem_device::nvram_write( emu_file &file )
{
- int i2cmem_bytes = m_config.m_data_size;
+ int i2cmem_bytes = m_data_size;
UINT8 *buffer = auto_alloc_array( machine(), UINT8, i2cmem_bytes );
for( offs_t offs = 0; offs < i2cmem_bytes; offs++ )
@@ -446,19 +407,19 @@ void i2cmem_device::set_scl_line( int state )
verboselog( this, 0, "write not enabled\n" );
m_state = STATE_IDLE;
}
- else if( m_config.m_page_size > 0 )
+ else if( m_page_size > 0 )
{
m_page[ m_page_offset ] = m_shift;
verboselog( this, 1, "page[ %04x ] <- %02x\n", m_page_offset, m_page[ m_page_offset ] );
m_page_offset++;
- if( m_page_offset == m_config.m_page_size )
+ if( m_page_offset == m_page_size )
{
- int offset = data_offset() & ~( m_config.m_page_size - 1 );
+ int offset = data_offset() & ~( m_page_size - 1 );
- verboselog( this, 1, "data[ %04x to %04x ] = page\n", offset, offset + m_config.m_page_size - 1 );
+ verboselog( this, 1, "data[ %04x to %04x ] = page\n", offset, offset + m_page_size - 1 );
- for( int i = 0; i < m_config.m_page_size; i++ )
+ for( int i = 0; i < m_page_size; i++ )
{
m_addrspace[ 0 ]->write_byte( offset + i, m_page[ i ] );
}
@@ -583,12 +544,12 @@ int i2cmem_device::read_sda_line()
int i2cmem_device::address_mask()
{
- return (m_config.m_data_size - 1);
+ return (m_data_size - 1);
}
int i2cmem_device::select_device()
{
- int device = ( m_config.m_slave_address & 0xf0 ) | ( m_e2 << 3 ) | ( m_e1 << 2 ) | ( m_e0 << 1 );
+ int device = ( m_slave_address & 0xf0 ) | ( m_e2 << 3 ) | ( m_e1 << 2 ) | ( m_e0 << 1 );
int mask = DEVSEL_ADDRESS & ~( address_mask() >> 7 );
if( ( m_devsel & mask ) == ( device & mask ) )
diff --git a/src/emu/machine/i2cmem.h b/src/emu/machine/i2cmem.h
index db353a0ec86..f0c6aa14deb 100644
--- a/src/emu/machine/i2cmem.h
+++ b/src/emu/machine/i2cmem.h
@@ -26,7 +26,7 @@
#define MCFG_I2CMEM_ADD( _tag, _interface ) \
MCFG_DEVICE_ADD( _tag, I2CMEM, 0 ) \
- i2cmem_device_config::static_set_interface(device, _interface);
+ i2cmem_device::static_set_interface(*device, _interface);
//**************************************************************************
@@ -43,54 +43,21 @@ struct i2cmem_interface
};
-// ======================> i2cmem_device_config
-
-class i2cmem_device_config :
- public device_config,
- public device_config_memory_interface,
- public device_config_nvram_interface,
- public i2cmem_interface
-{
- friend class i2cmem_device;
-
- // construction/destruction
- i2cmem_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock );
-
-public:
- // allocators
- static device_config *static_alloc_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock );
- virtual device_t *alloc_device( running_machine &machine ) const;
-
- // inline configuration
- static void static_set_interface(device_config *device, const i2cmem_interface &interface);
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
- virtual bool device_validity_check( emu_options &options, const game_driver &driver ) const;
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config( address_spacenum spacenum = AS_0 ) const;
-
- // device-specific configuration
- address_space_config m_space_config;
- int m_address_bits;
-};
-
-
// ======================> i2cmem_device
class i2cmem_device :
public device_t,
public device_memory_interface,
- public device_nvram_interface
+ public device_nvram_interface,
+ public i2cmem_interface
{
- friend class i2cmem_device_config;
-
+public:
// construction/destruction
- i2cmem_device( running_machine &_machine, const i2cmem_device_config &config );
+ i2cmem_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock );
+
+ // inline configuration
+ static void static_set_interface(device_t &device, const i2cmem_interface &interface);
-public:
// I/O operations
void set_e0_line( int state );
void set_e1_line( int state );
@@ -102,9 +69,14 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
+ virtual bool device_validity_check( emu_options &options, const game_driver &driver ) const;
virtual void device_start();
virtual void device_reset();
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config( address_spacenum spacenum = AS_0 ) const;
+
// device_nvram_interface overrides
virtual void nvram_default();
virtual void nvram_read( emu_file &file );
@@ -115,9 +87,11 @@ protected:
int select_device();
int data_offset();
- // internal state
- const i2cmem_device_config &m_config;
+ // device-specific configuration
+ address_space_config m_space_config;
+ int m_address_bits;
+ // internal state
int m_scl;
int m_sdaw;
int m_e0;
diff --git a/src/emu/machine/i8155.c b/src/emu/machine/i8155.c
index 3726e766029..f103a70561d 100644
--- a/src/emu/machine/i8155.c
+++ b/src/emu/machine/i8155.c
@@ -19,6 +19,9 @@
#include "i8155.h"
+// device type definition
+const device_type I8155 = &device_creator<i8155_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -94,10 +97,6 @@ enum
// GLOBAL VARIABLES
//**************************************************************************
-// devices
-const device_type I8155 = i8155_device_config::static_alloc_device_config;
-
-
// default address map
static ADDRESS_MAP_START( i8155, AS_0, 8 )
AM_RANGE(0x00, 0xff) AM_RAM
@@ -106,82 +105,6 @@ ADDRESS_MAP_END
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// i8155_device_config - constructor
-//-------------------------------------------------
-
-i8155_device_config::i8155_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Intel 8155", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- m_space_config("ram", ENDIANNESS_LITTLE, 8, 8, 0, NULL, *ADDRESS_MAP_NAME(i8155))
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *i8155_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(i8155_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *i8155_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, i8155_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *i8155_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_0) ? &m_space_config : NULL;
-}
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void i8155_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const i8155_interface *intf = reinterpret_cast<const i8155_interface *>(static_config());
- if (intf != NULL)
- *static_cast<i8155_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&in_pa_func, 0, sizeof(in_pa_func));
- memset(&out_pa_func, 0, sizeof(out_pa_func));
- memset(&in_pb_func, 0, sizeof(in_pb_func));
- memset(&out_pb_func, 0, sizeof(out_pb_func));
- memset(&in_pc_func, 0, sizeof(in_pc_func));
- memset(&out_pc_func, 0, sizeof(out_pc_func));
- memset(&out_to_func, 0, sizeof(out_to_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -291,12 +214,39 @@ inline void i8155_device::write_port(int port, UINT8 data)
// i8155_device - constructor
//-------------------------------------------------
-i8155_device::i8155_device(running_machine &_machine, const i8155_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
- m_config(config)
+i8155_device::i8155_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, I8155, "Intel 8155", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ m_space_config("ram", ENDIANNESS_LITTLE, 8, 8, 0, NULL, *ADDRESS_MAP_NAME(i8155))
+{
+
+}
+
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void i8155_device::device_config_complete()
{
+ // inherit a copy of the static data
+ const i8155_interface *intf = reinterpret_cast<const i8155_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<i8155_interface *>(this) = *intf;
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&in_pa_cb, 0, sizeof(in_pa_cb));
+ memset(&out_pa_cb, 0, sizeof(out_pa_cb));
+ memset(&in_pb_cb, 0, sizeof(in_pb_cb));
+ memset(&out_pb_cb, 0, sizeof(out_pb_cb));
+ memset(&in_pc_cb, 0, sizeof(in_pc_cb));
+ memset(&out_pc_cb, 0, sizeof(out_pc_cb));
+ memset(&out_to_cb, 0, sizeof(out_to_cb));
+ }
}
@@ -307,13 +257,13 @@ i8155_device::i8155_device(running_machine &_machine, const i8155_device_config
void i8155_device::device_start()
{
// resolve callbacks
- devcb_resolve_read8(&m_in_port_func[0], &m_config.in_pa_func, this);
- devcb_resolve_read8(&m_in_port_func[1], &m_config.in_pb_func, this);
- devcb_resolve_read8(&m_in_port_func[2], &m_config.in_pc_func, this);
- devcb_resolve_write8(&m_out_port_func[0], &m_config.out_pa_func, this);
- devcb_resolve_write8(&m_out_port_func[1], &m_config.out_pb_func, this);
- devcb_resolve_write8(&m_out_port_func[2], &m_config.out_pc_func, this);
- devcb_resolve_write_line(&m_out_to_func, &m_config.out_to_func, this);
+ devcb_resolve_read8(&m_in_port_func[0], &in_pa_cb, this);
+ devcb_resolve_read8(&m_in_port_func[1], &in_pb_cb, this);
+ devcb_resolve_read8(&m_in_port_func[2], &in_pc_cb, this);
+ devcb_resolve_write8(&m_out_port_func[0], &out_pa_cb, this);
+ devcb_resolve_write8(&m_out_port_func[1], &out_pb_cb, this);
+ devcb_resolve_write8(&m_out_port_func[2], &out_pc_cb, this);
+ devcb_resolve_write_line(&m_out_to_func, &out_to_cb, this);
// allocate timers
m_timer = timer_alloc();
@@ -417,6 +367,17 @@ void i8155_device::device_timer(emu_timer &timer, device_timer_id id, int param,
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *i8155_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_0) ? &m_space_config : NULL;
+}
+
+
+//-------------------------------------------------
// io_r - register read
//-------------------------------------------------
diff --git a/src/emu/machine/i8155.h b/src/emu/machine/i8155.h
index 282791da933..56929d9caf0 100644
--- a/src/emu/machine/i8155.h
+++ b/src/emu/machine/i8155.h
@@ -67,46 +67,17 @@
struct i8155_interface
{
- devcb_read8 in_pa_func;
- devcb_write8 out_pa_func;
+ devcb_read8 in_pa_cb;
+ devcb_write8 out_pa_cb;
- devcb_read8 in_pb_func;
- devcb_write8 out_pb_func;
+ devcb_read8 in_pb_cb;
+ devcb_write8 out_pb_cb;
- devcb_read8 in_pc_func;
- devcb_write8 out_pc_func;
+ devcb_read8 in_pc_cb;
+ devcb_write8 out_pc_cb;
// this gets called for each change of the TIMER OUT pin (pin 6)
- devcb_write_line out_to_func;
-};
-
-
-
-// ======================> i8155_device_config
-
-class i8155_device_config : public device_config,
- public device_config_memory_interface,
- public i8155_interface
-{
- friend class i8155_device;
-
- // construction/destruction
- i8155_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // address space configurations
- const address_space_config m_space_config;
+ devcb_write_line out_to_cb;
};
@@ -114,14 +85,13 @@ protected:
// ======================> i8155_device
class i8155_device : public device_t,
- public device_memory_interface
+ public device_memory_interface,
+ public i8155_interface
{
- friend class i8155_device_config;
-
+public:
// construction/destruction
- i8155_device(running_machine &_machine, const i8155_device_config &_config);
+ i8155_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( io_r );
DECLARE_WRITE8_MEMBER( io_w );
@@ -134,10 +104,13 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
inline UINT8 get_timer_mode();
inline void timer_output();
inline void pulse_timer_output();
@@ -169,7 +142,7 @@ private:
// timers
emu_timer *m_timer; // counter timer
- const i8155_device_config &m_config;
+ const address_space_config m_space_config;
};
diff --git a/src/emu/machine/i8212.c b/src/emu/machine/i8212.c
index af98db9947e..dbe6fe1e1a0 100644
--- a/src/emu/machine/i8212.c
+++ b/src/emu/machine/i8212.c
@@ -22,19 +22,23 @@
//**************************************************************************
-// GLOBAL VARIABLES
+// LIVE DEVICE
//**************************************************************************
-// devices
-const device_type I8212 = i8212_device_config::static_alloc_device_config;
-
+// device type definition
+const device_type I8212 = &device_creator<i8212_device>;
+//-------------------------------------------------
+// i8212_device - constructor
+//-------------------------------------------------
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
+i8212_device::i8212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, I8212, "Intel 8212", tag, owner, clock),
+ m_md(I8212_MODE_INPUT),
+ m_stb(0)
+{
-GENERIC_DEVICE_CONFIG_SETUP(i8212, "Intel 8212")
+}
//-------------------------------------------------
@@ -43,7 +47,7 @@ GENERIC_DEVICE_CONFIG_SETUP(i8212, "Intel 8212")
// complete
//-------------------------------------------------
-void i8212_device_config::device_config_complete()
+void i8212_device::device_config_complete()
{
// inherit a copy of the static data
const i8212_interface *intf = reinterpret_cast<const i8212_interface *>(static_config());
@@ -53,32 +57,13 @@ void i8212_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&out_int_func, 0, sizeof(out_int_func));
- memset(&in_di_func, 0, sizeof(in_di_func));
- memset(&out_do_func, 0, sizeof(out_do_func));
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
+ memset(&m_in_di_cb, 0, sizeof(m_in_di_cb));
+ memset(&m_out_do_cb, 0, sizeof(m_out_do_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// i8212_device - constructor
-//-------------------------------------------------
-
-i8212_device::i8212_device(running_machine &_machine, const i8212_device_config &config)
- : device_t(_machine, config),
- m_md(I8212_MODE_INPUT),
- m_stb(0),
- m_config(config)
-{
-
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -86,9 +71,9 @@ i8212_device::i8212_device(running_machine &_machine, const i8212_device_config
void i8212_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_int_func, &m_config.out_int_func, this);
- devcb_resolve_read8(&m_in_di_func, &m_config.in_di_func, this);
- devcb_resolve_write8(&m_out_do_func, &m_config.out_do_func, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
+ devcb_resolve_read8(&m_in_di_func, &m_in_di_cb, this);
+ devcb_resolve_write8(&m_out_do_func, &m_out_do_cb, this);
// register for state saving
save_item(NAME(m_md));
diff --git a/src/emu/machine/i8212.h b/src/emu/machine/i8212.h
index 6390a4d6f7d..3ed32cbbfe9 100644
--- a/src/emu/machine/i8212.h
+++ b/src/emu/machine/i8212.h
@@ -64,46 +64,22 @@ enum
struct i8212_interface
{
- devcb_write_line out_int_func;
+ devcb_write_line m_out_int_cb;
- devcb_read8 in_di_func;
- devcb_write8 out_do_func;
-};
-
-
-
-// ======================> i8212_device_config
-
-class i8212_device_config : public device_config,
- public i8212_interface
-{
- friend class i8212_device;
-
- // construction/destruction
- i8212_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_di_cb;
+ devcb_write8 m_out_do_cb;
};
// ======================> i8212_device
-class i8212_device : public device_t
+class i8212_device : public device_t, public i8212_interface
{
- friend class i8212_device_config;
-
+public:
// construction/destruction
- i8212_device(running_machine &_machine, const i8212_device_config &_config);
+ i8212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( data_r );
DECLARE_WRITE8_MEMBER( data_w );
@@ -112,6 +88,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
@@ -123,8 +100,6 @@ private:
int m_md; // mode
int m_stb; // strobe
UINT8 m_data; // data latch
-
- const i8212_device_config &m_config;
};
diff --git a/src/emu/machine/i8214.c b/src/emu/machine/i8214.c
index 0d77ad1da1f..521cccd7007 100644
--- a/src/emu/machine/i8214.c
+++ b/src/emu/machine/i8214.c
@@ -13,50 +13,15 @@
-//**************************************************************************
-// MACROS / CONSTANTS
-//**************************************************************************
+// device type definition
+const device_type I8214 = &device_creator<i8214_device>;
-#define LOG 0
-
-
-//**************************************************************************
-// GLOBAL VARIABLES
//**************************************************************************
-
-// devices
-const device_type I8214 = i8214_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
+// MACROS / CONSTANTS
//**************************************************************************
-GENERIC_DEVICE_CONFIG_SETUP(i8214, "I8214")
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void i8214_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const i8214_interface *intf = reinterpret_cast<const i8214_interface *>(static_config());
- if (intf != NULL)
- *static_cast<i8214_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_int_func, 0, sizeof(m_out_int_func));
- memset(&m_out_enlg_func, 0, sizeof(m_out_enlg_func));
- }
-}
+#define LOG 0
@@ -125,10 +90,31 @@ inline void i8214_device::check_interrupt()
// i8214_device - constructor
//-------------------------------------------------
-i8214_device::i8214_device(running_machine &_machine, const i8214_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+i8214_device::i8214_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, I8214, "I8214", tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void i8214_device::device_config_complete()
{
+ // inherit a copy of the static data
+ const i8214_interface *intf = reinterpret_cast<const i8214_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<i8214_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
+ memset(&m_out_enlg_cb, 0, sizeof(m_out_enlg_cb));
+ }
}
@@ -139,8 +125,8 @@ i8214_device::i8214_device(running_machine &_machine, const i8214_device_config
void i8214_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
- devcb_resolve_write_line(&m_out_enlg_func, &m_config.m_out_enlg_func, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
+ devcb_resolve_write_line(&m_out_enlg_func, &m_out_enlg_cb, this);
// register for state saving
save_item(NAME(m_inte));
diff --git a/src/emu/machine/i8214.h b/src/emu/machine/i8214.h
index 06e4a59ed94..29c528c7997 100644
--- a/src/emu/machine/i8214.h
+++ b/src/emu/machine/i8214.h
@@ -53,43 +53,19 @@
struct i8214_interface
{
- devcb_write_line m_out_int_func;
- devcb_write_line m_out_enlg_func;
+ devcb_write_line m_out_int_cb;
+ devcb_write_line m_out_enlg_cb;
};
-// ======================> i8214_device_config
-
-class i8214_device_config : public device_config,
- public i8214_interface
-{
- friend class i8214_device;
-
- // construction/destruction
- i8214_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
-
// ======================> i8214_device
-class i8214_device : public device_t
+class i8214_device : public device_t, public i8214_interface
{
- friend class i8214_device_config;
-
+public:
// construction/destruction
- i8214_device(running_machine &_machine, const i8214_device_config &_config);
+ i8214_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_WRITE_LINE_MEMBER( sgs_w );
DECLARE_WRITE_LINE_MEMBER( etlg_w );
DECLARE_WRITE_LINE_MEMBER( inte_w );
@@ -100,6 +76,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
private:
@@ -116,8 +93,6 @@ private:
UINT8 m_r; // interrupt request latch
int m_sgs; // status group select
int m_etlg; // enable this level group
-
- const i8214_device_config &m_config;
};
diff --git a/src/emu/machine/i8243.c b/src/emu/machine/i8243.c
index 70bb448afb3..9a15afc1dcf 100644
--- a/src/emu/machine/i8243.c
+++ b/src/emu/machine/i8243.c
@@ -13,27 +13,39 @@
#include "devhelpr.h"
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-GENERIC_DEVICE_CONFIG_SETUP(i8243, "I8243")
+// device type definition
+const device_type I8243 = &device_creator<i8243_device>;
+
+//-------------------------------------------------
+// i8243_device - constructor
+//-------------------------------------------------
+
+i8243_device::i8243_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, I8243, "I8243", tag, owner, clock)
+{
+
+}
+
//-------------------------------------------------
// static_set_read_handler - configuration helper
// to set the read handler
//-------------------------------------------------
-void i8243_device_config::static_set_read_handler(device_config *device, read8_device_func callback)
+void i8243_device::static_set_read_handler(device_t &device, read8_device_func callback)
{
- i8243_device_config *i8243 = downcast<i8243_device_config *>(device);
+ i8243_device &i8243 = downcast<i8243_device &>(device);
if(callback != NULL)
{
- i8243->m_readhandler.type = DEVCB_TYPE_SELF;
- i8243->m_readhandler.readdevice = callback;
+ i8243.m_readhandler_cb.type = DEVCB_TYPE_SELF;
+ i8243.m_readhandler_cb.readdevice = callback;
}
else
{
- i8243->m_readhandler.type = DEVCB_TYPE_NULL;
+ i8243.m_readhandler_cb.type = DEVCB_TYPE_NULL;
}
}
@@ -43,51 +55,29 @@ void i8243_device_config::static_set_read_handler(device_config *device, read8_d
// to set the write handler
//-------------------------------------------------
-void i8243_device_config::static_set_write_handler(device_config *device, write8_device_func callback)
+void i8243_device::static_set_write_handler(device_t &device, write8_device_func callback)
{
- i8243_device_config *i8243 = downcast<i8243_device_config *>(device);
+ i8243_device &i8243 = downcast<i8243_device &>(device);
if(callback != NULL)
{
- i8243->m_writehandler.type = DEVCB_TYPE_SELF;
- i8243->m_writehandler.writedevice = callback;
+ i8243.m_writehandler_cb.type = DEVCB_TYPE_SELF;
+ i8243.m_writehandler_cb.writedevice = callback;
}
else
{
- i8243->m_writehandler.type = DEVCB_TYPE_NULL;
+ i8243.m_writehandler_cb.type = DEVCB_TYPE_NULL;
}
}
-
-/***************************************************************************
- LIVE DEVICE
-***************************************************************************/
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-const device_type I8243 = i8243_device_config::static_alloc_device_config;
-
-//-------------------------------------------------
-// i8243_device - constructor
-//-------------------------------------------------
-
-i8243_device::i8243_device(running_machine &_machine, const i8243_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void i8243_device::device_start()
{
- devcb_resolve_read8(&m_readhandler, &m_config.m_readhandler, this);
- devcb_resolve_write8(&m_writehandler, &m_config.m_writehandler, this);
+ devcb_resolve_read8(&m_readhandler, &m_readhandler_cb, this);
+ devcb_resolve_write8(&m_writehandler, &m_writehandler_cb, this);
}
diff --git a/src/emu/machine/i8243.h b/src/emu/machine/i8243.h
index 00b170ebe0c..325a1bdf5ba 100644
--- a/src/emu/machine/i8243.h
+++ b/src/emu/machine/i8243.h
@@ -28,50 +28,28 @@
MCFG_I8243_WRITEHANDLER(_write) \
#define MCFG_I8243_READHANDLER(_read) \
- i8243_device_config::static_set_read_handler(device, _read); \
+ i8243_device::static_set_read_handler(*device, _read); \
#define MCFG_I8243_WRITEHANDLER(_write) \
- i8243_device_config::static_set_write_handler(device, _write); \
+ i8243_device::static_set_write_handler(*device, _write); \
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
-// ======================> i8243_device_config
-
-class i8243_device_config : public device_config
-{
- friend class i8243_device;
-
- // construction/destruction
- i8243_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_read_handler(device_config *device, read8_device_func callback);
- static void static_set_write_handler(device_config *device, write8_device_func callback);
-
-protected:
- devcb_read8 m_readhandler;
- devcb_write8 m_writehandler;
-};
-
-
// ======================> i8243_device
class i8243_device : public device_t
{
- friend class i8243_device_config;
-
+public:
// construction/destruction
- i8243_device(running_machine &_machine, const i8243_device_config &_config);
+ i8243_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_read_handler(device_t &device, read8_device_func callback);
+ static void static_set_write_handler(device_t &device, write8_device_func callback);
-public:
UINT8 i8243_p2_r(UINT32 offset);
void i8243_p2_w(UINT32 offset, UINT8 data);
@@ -93,10 +71,11 @@ private:
UINT8 m_opcode; /* latched opcode */
UINT8 m_prog; /* previous PROG state */
+ devcb_read8 m_readhandler_cb;
+ devcb_write8 m_writehandler_cb;
+
devcb_resolved_read8 m_readhandler;
devcb_resolved_write8 m_writehandler;
-
- const i8243_device_config &m_config;
};
diff --git a/src/emu/machine/i8255.c b/src/emu/machine/i8255.c
index 176567d21fa..954c688afbe 100644
--- a/src/emu/machine/i8255.c
+++ b/src/emu/machine/i8255.c
@@ -64,42 +64,8 @@ enum
// DEVICE DEFINITIONS
//**************************************************************************
-const device_type I8255 = i8255_device_config::static_alloc_device_config;
-const device_type I8255A = i8255_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(i8255, "I8255")
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void i8255_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const i8255_interface *intf = reinterpret_cast<const i8255_interface *>(static_config());
- if (intf != NULL)
- *static_cast<i8255_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_in_pa_func, 0, sizeof(m_in_pa_func));
- memset(&m_out_pa_func, 0, sizeof(m_out_pa_func));
- memset(&m_in_pb_func, 0, sizeof(m_in_pb_func));
- memset(&m_out_pb_func, 0, sizeof(m_out_pb_func));
- memset(&m_in_pc_func, 0, sizeof(m_in_pc_func));
- memset(&m_out_pc_func, 0, sizeof(m_out_pc_func));
- }
-}
+const device_type I8255 = &device_creator<i8255_device>;
+const device_type I8255A = &device_creator<i8255_device>;
@@ -311,10 +277,35 @@ inline int i8255_device::port_c_upper_mode()
// i8255_device - constructor
//-------------------------------------------------
-i8255_device::i8255_device(running_machine &_machine, const i8255_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+i8255_device::i8255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, I8255, "I8255", tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void i8255_device::device_config_complete()
{
+ // inherit a copy of the static data
+ const i8255_interface *intf = reinterpret_cast<const i8255_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<i8255_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_in_pa_cb, 0, sizeof(m_in_pa_cb));
+ memset(&m_out_pa_cb, 0, sizeof(m_out_pa_cb));
+ memset(&m_in_pb_cb, 0, sizeof(m_in_pb_cb));
+ memset(&m_out_pb_cb, 0, sizeof(m_out_pb_cb));
+ memset(&m_in_pc_cb, 0, sizeof(m_in_pc_cb));
+ memset(&m_out_pc_cb, 0, sizeof(m_out_pc_cb));
+ }
}
@@ -325,12 +316,12 @@ i8255_device::i8255_device(running_machine &_machine, const i8255_device_config
void i8255_device::device_start()
{
// resolve callbacks
- devcb_resolve_read8(&m_in_port_func[PORT_A], &m_config.m_in_pa_func, this);
- devcb_resolve_write8(&m_out_port_func[PORT_A], &m_config.m_out_pa_func, this);
- devcb_resolve_read8(&m_in_port_func[PORT_B], &m_config.m_in_pb_func, this);
- devcb_resolve_write8(&m_out_port_func[PORT_B], &m_config.m_out_pb_func, this);
- devcb_resolve_read8(&m_in_port_func[PORT_C], &m_config.m_in_pc_func, this);
- devcb_resolve_write8(&m_out_port_func[PORT_C], &m_config.m_out_pc_func, this);
+ devcb_resolve_read8(&m_in_port_func[PORT_A], &m_in_pa_cb, this);
+ devcb_resolve_write8(&m_out_port_func[PORT_A], &m_out_pa_cb, this);
+ devcb_resolve_read8(&m_in_port_func[PORT_B], &m_in_pb_cb, this);
+ devcb_resolve_write8(&m_out_port_func[PORT_B], &m_out_pb_cb, this);
+ devcb_resolve_read8(&m_in_port_func[PORT_C], &m_in_pc_cb, this);
+ devcb_resolve_write8(&m_out_port_func[PORT_C], &m_out_pc_cb, this);
// register for state saving
save_item(NAME(m_control));
diff --git a/src/emu/machine/i8255.h b/src/emu/machine/i8255.h
index 2d0d242dbdf..ae8db18cef3 100644
--- a/src/emu/machine/i8255.h
+++ b/src/emu/machine/i8255.h
@@ -69,46 +69,24 @@
struct i8255_interface
{
- devcb_read8 m_in_pa_func;
- devcb_write8 m_out_pa_func;
- devcb_read8 m_in_pb_func;
- devcb_write8 m_out_pb_func;
- devcb_read8 m_in_pc_func;
- devcb_write8 m_out_pc_func;
-};
-
-
-// ======================> i8255_device_config
-
-class i8255_device_config : public device_config,
- public i8255_interface
-{
- friend class i8255_device;
-
- // construction/destruction
- i8255_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_pa_cb;
+ devcb_write8 m_out_pa_cb;
+ devcb_read8 m_in_pb_cb;
+ devcb_write8 m_out_pb_cb;
+ devcb_read8 m_in_pc_cb;
+ devcb_write8 m_out_pc_cb;
};
// ======================> i8255_device
-class i8255_device : public device_t
+class i8255_device : public device_t,
+ public i8255_interface
{
- friend class i8255_device_config;
-
+public:
// construction/destruction
- i8255_device(running_machine &_machine, const i8255_device_config &_config);
+ i8255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -124,6 +102,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
@@ -165,8 +144,6 @@ private:
int m_inte1; // interrupt enable
int m_inte2; // interrupt enable
int m_intr[2]; // interrupt
-
- const i8255_device_config &m_config;
};
diff --git a/src/emu/machine/i8355.c b/src/emu/machine/i8355.c
index 10671198227..52ef3393343 100644
--- a/src/emu/machine/i8355.c
+++ b/src/emu/machine/i8355.c
@@ -39,9 +39,8 @@ enum
// GLOBAL VARIABLES
//**************************************************************************
-// devices
-const device_type I8355 = i8355_device_config::static_alloc_device_config;
-
+// device type definition
+const device_type I8355 = &device_creator<i8355_device>;
// default address map
static ADDRESS_MAP_START( i8355, AS_0, 8 )
@@ -51,79 +50,6 @@ ADDRESS_MAP_END
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// i8355_device_config - constructor
-//-------------------------------------------------
-
-i8355_device_config::i8355_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Intel 8355", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- m_space_config("ram", ENDIANNESS_LITTLE, 8, 11, 0, NULL, *ADDRESS_MAP_NAME(i8355))
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *i8355_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(i8355_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *i8355_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, i8355_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *i8355_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_0) ? &m_space_config : NULL;
-}
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void i8355_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const i8355_interface *intf = reinterpret_cast<const i8355_interface *>(static_config());
- if (intf != NULL)
- *static_cast<i8355_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&in_pa_func, 0, sizeof(in_pa_func));
- memset(&out_pa_func, 0, sizeof(out_pa_func));
- memset(&in_pb_func, 0, sizeof(in_pb_func));
- memset(&out_pb_func, 0, sizeof(out_pb_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -165,26 +91,50 @@ inline void i8355_device::write_port(int port, UINT8 data)
// i8355_device - constructor
//-------------------------------------------------
-i8355_device::i8355_device(running_machine &_machine, const i8355_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
- m_config(config)
+i8355_device::i8355_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, I8355, "Intel 8355", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ m_space_config("ram", ENDIANNESS_LITTLE, 8, 11, 0, NULL, *ADDRESS_MAP_NAME(i8355))
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void i8355_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const i8355_interface *intf = reinterpret_cast<const i8355_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<i8355_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_in_pa_cb, 0, sizeof(m_in_pa_cb));
+ memset(&m_out_pa_cb, 0, sizeof(m_out_pa_cb));
+ memset(&m_in_pb_cb, 0, sizeof(m_in_pb_cb));
+ memset(&m_out_pb_cb, 0, sizeof(m_out_pb_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void i8355_device::device_start()
{
// resolve callbacks
- devcb_resolve_read8(&m_in_port_func[0], &m_config.in_pa_func, this);
- devcb_resolve_read8(&m_in_port_func[1], &m_config.in_pb_func, this);
- devcb_resolve_write8(&m_out_port_func[0], &m_config.out_pa_func, this);
- devcb_resolve_write8(&m_out_port_func[1], &m_config.out_pb_func, this);
+ devcb_resolve_read8(&m_in_port_func[0], &m_in_pa_cb, this);
+ devcb_resolve_read8(&m_in_port_func[1], &m_in_pb_cb, this);
+ devcb_resolve_write8(&m_out_port_func[0], &m_out_pa_cb, this);
+ devcb_resolve_write8(&m_out_port_func[1], &m_out_pb_cb, this);
// register for state saving
save_item(NAME(m_output));
@@ -205,6 +155,18 @@ void i8355_device::device_reset()
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *i8355_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_0) ? &m_space_config : NULL;
+}
+
+
+
+//-------------------------------------------------
// io_r - register read
//-------------------------------------------------
diff --git a/src/emu/machine/i8355.h b/src/emu/machine/i8355.h
index a332d4fa264..142b4a36ef1 100644
--- a/src/emu/machine/i8355.h
+++ b/src/emu/machine/i8355.h
@@ -67,40 +67,11 @@
struct i8355_interface
{
- devcb_read8 in_pa_func;
- devcb_write8 out_pa_func;
+ devcb_read8 m_in_pa_cb;
+ devcb_write8 m_out_pa_cb;
- devcb_read8 in_pb_func;
- devcb_write8 out_pb_func;
-};
-
-
-
-// ======================> i8355_device_config
-
-class i8355_device_config : public device_config,
- public device_config_memory_interface,
- public i8355_interface
-{
- friend class i8355_device;
-
- // construction/destruction
- i8355_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // address space configurations
- const address_space_config m_space_config;
+ devcb_read8 m_in_pb_cb;
+ devcb_write8 m_out_pb_cb;
};
@@ -108,14 +79,13 @@ protected:
// ======================> i8355_device
class i8355_device : public device_t,
- public device_memory_interface
+ public device_memory_interface,
+ public i8355_interface
{
- friend class i8355_device_config;
-
+public:
// construction/destruction
- i8355_device(running_machine &_machine, const i8355_device_config &_config);
+ i8355_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( io_r );
DECLARE_WRITE8_MEMBER( io_w );
@@ -124,9 +94,13 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
inline UINT8 read_port(int port);
inline void write_port(int port, UINT8 data);
@@ -138,7 +112,7 @@ private:
UINT8 m_output[2]; // output latches
UINT8 m_ddr[2]; // DDR latches
- const i8355_device_config &m_config;
+ const address_space_config m_space_config;
};
diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c
index 433badd8821..7a9a991435c 100644
--- a/src/emu/machine/idectrl.c
+++ b/src/emu/machine/idectrl.c
@@ -204,7 +204,7 @@ INLINE ide_state *get_safe_token(device_t *device)
INLINE void signal_interrupt(ide_state *ide)
{
- const ide_config *config = (const ide_config *)downcast<const legacy_device_config_base &>(ide->device->baseconfig()).inline_config();
+ const ide_config *config = (const ide_config *)downcast<const legacy_device_base *>(ide->device)->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 *)downcast<const legacy_device_config_base &>(ide->device->baseconfig()).inline_config();
+ const ide_config *config = (const ide_config *)downcast<const legacy_device_base *>(ide->device)->inline_config();
LOG(("IDE interrupt clear\n"));
@@ -1807,14 +1807,14 @@ static DEVICE_START( ide_controller )
/* validate some basic stuff */
assert(device != NULL);
- assert(device->baseconfig().static_config() == NULL);
- assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
+ assert(device->static_config() == NULL);
+ assert(downcast<const legacy_device_base *>(device)->inline_config() != NULL);
/* store a pointer back to the device */
ide->device = device;
/* set MAME harddisk handle */
- config = (const ide_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ config = (const ide_config *)downcast<const legacy_device_base *>(device)->inline_config();
ide->handle = get_disk_handle(device->machine(), (config->master != NULL) ? config->master : device->tag());
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/ins8154.c b/src/emu/machine/ins8154.c
index ff319ad785a..29baae92eaf 100644
--- a/src/emu/machine/ins8154.c
+++ b/src/emu/machine/ins8154.c
@@ -30,15 +30,24 @@ enum
};
-/***************************************************************************
- IMPLEMENTATION
-***************************************************************************/
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-GENERIC_DEVICE_CONFIG_SETUP(ins8154, "INS8154")
+// device type definition
+const device_type INS8154 = &device_creator<ins8154_device>;
+
+//-------------------------------------------------
+// ins8154_device - constructor
+//-------------------------------------------------
+
+ins8154_device::ins8154_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, INS8154, "INS8154", tag, owner, clock)
+{
+
+}
+
//-------------------------------------------------
// device_config_complete - perform any
@@ -46,7 +55,7 @@ GENERIC_DEVICE_CONFIG_SETUP(ins8154, "INS8154")
// complete
//-------------------------------------------------
-void ins8154_device_config::device_config_complete()
+void ins8154_device::device_config_complete()
{
// inherit a copy of the static data
const ins8154_interface *intf = reinterpret_cast<const ins8154_interface *>(static_config());
@@ -58,33 +67,15 @@ void ins8154_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_in_a_func, 0, sizeof(m_in_a_func));
- memset(&m_in_b_func, 0, sizeof(m_in_b_func));
- memset(&m_out_a_func, 0, sizeof(m_out_a_func));
- memset(&m_out_b_func, 0, sizeof(m_out_b_func));
- memset(&m_out_irq_func, 0, sizeof(m_out_irq_func));
+ memset(&m_in_a_cb, 0, sizeof(m_in_a_cb));
+ memset(&m_in_b_cb, 0, sizeof(m_in_b_cb));
+ memset(&m_out_a_cb, 0, sizeof(m_out_a_cb));
+ memset(&m_out_b_cb, 0, sizeof(m_out_b_cb));
+ memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-const device_type INS8154 = ins8154_device_config::static_alloc_device_config;
-
-//-------------------------------------------------
-// ins8154_device - constructor
-//-------------------------------------------------
-
-ins8154_device::ins8154_device(running_machine &_machine, const ins8154_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -92,11 +83,11 @@ ins8154_device::ins8154_device(running_machine &_machine, const ins8154_device_c
void ins8154_device::device_start()
{
/* resolve callbacks */
- devcb_resolve_read8(&m_in_a_func, &m_config.m_in_a_func, this);
- devcb_resolve_write8(&m_out_a_func, &m_config.m_out_a_func, this);
- devcb_resolve_read8(&m_in_b_func, &m_config.m_in_b_func, this);
- devcb_resolve_write8(&m_out_b_func, &m_config.m_out_b_func, this);
- devcb_resolve_write_line(&m_out_irq_func, &m_config.m_out_irq_func, this);
+ devcb_resolve_read8(&m_in_a_func, &m_in_a_cb, this);
+ devcb_resolve_write8(&m_out_a_func, &m_out_a_cb, this);
+ devcb_resolve_read8(&m_in_b_func, &m_in_b_cb, this);
+ devcb_resolve_write8(&m_out_b_func, &m_out_b_cb, this);
+ devcb_resolve_write_line(&m_out_irq_func, &m_out_irq_cb, this);
/* register for state saving */
save_item(NAME(m_in_a));
diff --git a/src/emu/machine/ins8154.h b/src/emu/machine/ins8154.h
index 13acfc521b2..1857a428223 100644
--- a/src/emu/machine/ins8154.h
+++ b/src/emu/machine/ins8154.h
@@ -55,47 +55,23 @@
struct ins8154_interface
{
- devcb_read8 m_in_a_func;
- devcb_write8 m_out_a_func;
- devcb_read8 m_in_b_func;
- devcb_write8 m_out_b_func;
- devcb_write_line m_out_irq_func;
-};
-
-
-
-// ======================> ins8154_device_config
-
-class ins8154_device_config : public device_config,
- public ins8154_interface
-{
- friend class ins8154_device;
-
- // construction/destruction
- ins8154_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_a_cb;
+ devcb_write8 m_out_a_cb;
+ devcb_read8 m_in_b_cb;
+ devcb_write8 m_out_b_cb;
+ devcb_write_line m_out_irq_cb;
};
// ======================> ins8154_device
-class ins8154_device : public device_t
+class ins8154_device : public device_t,
+ public ins8154_interface
{
- friend class ins8154_device_config;
-
- // construction/destruction
- ins8154_device(running_machine &_machine, const ins8154_device_config &_config);
-
public:
+ // construction/destruction
+ ins8154_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
UINT8 ins8154_r(UINT32 offset);
void ins8154_w(UINT32 offset, UINT8 data);
@@ -105,6 +81,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_post_load() { }
@@ -127,8 +104,6 @@ private:
UINT8 m_mdr; /* Mode Definition Register */
UINT8 m_odra; /* Output Definition Register Port A */
UINT8 m_odrb; /* Output Definition Register Port B */
-
- const ins8154_device_config &m_config;
};
diff --git a/src/emu/machine/ins8250.c b/src/emu/machine/ins8250.c
index e44641922b3..e3efc887f03 100644
--- a/src/emu/machine/ins8250.c
+++ b/src/emu/machine/ins8250.c
@@ -547,7 +547,7 @@ static void common_start( device_t *device, int device_type )
{
ins8250_t *ins8250 = get_safe_token(device);
- ins8250->interface = (const ins8250_interface*)device->baseconfig().static_config();
+ ins8250->interface = (const ins8250_interface*)device->static_config();
ins8250->device_type = device_type;
}
diff --git a/src/emu/machine/intelfsh.c b/src/emu/machine/intelfsh.c
index c8948d46c07..60c988c1b21 100644
--- a/src/emu/machine/intelfsh.c
+++ b/src/emu/machine/intelfsh.c
@@ -41,45 +41,22 @@ enum
//**************************************************************************
-// DEVICE DEFINITIONS
+// GLOBAL VARIABLES
//**************************************************************************
-// 8-bit variants
-DEFINE_TRIVIAL_DERIVED_DEVICE(intel_28f016s5_device_config, intelfsh8_device_config, intel_28f016s5_device, intelfsh8_device, "Sharp LH28F400 Flash", intelfsh_device_config::FLASH_SHARP_LH28F400)
-DEFINE_TRIVIAL_DERIVED_DEVICE(fujitsu_29f016a_device_config, intelfsh8_device_config, fujitsu_29f016a_device, intelfsh8_device, "Fujitsu 29F016A Flash", intelfsh_device_config::FLASH_FUJITSU_29F016A)
-DEFINE_TRIVIAL_DERIVED_DEVICE(fujitsu_29dl16x_device_config, intelfsh8_device_config, fujitsu_29dl16x_device, intelfsh8_device, "Fujitsu 29DL16X Flash", intelfsh_device_config::FLASH_FUJITSU_29DL16X)
-DEFINE_TRIVIAL_DERIVED_DEVICE(sharp_lh28f016s_device_config, intelfsh8_device_config, sharp_lh28f016s_device, intelfsh8_device, "Sharp LH28F016S Flash", intelfsh_device_config::FLASH_SHARP_LH28F016S)
-DEFINE_TRIVIAL_DERIVED_DEVICE(intel_e28f008sa_device_config, intelfsh8_device_config, intel_e28f008sa_device, intelfsh8_device, "Intel E28F008SA Flash", intelfsh_device_config::FLASH_INTEL_E28F008SA)
-DEFINE_TRIVIAL_DERIVED_DEVICE(macronix_29l001mc_device_config, intelfsh8_device_config, macronix_29l001mc_device, intelfsh8_device, "Macronix 29L001MC Flash", intelfsh_device_config::FLASH_MACRONIX_29L001MC)
-DEFINE_TRIVIAL_DERIVED_DEVICE(panasonic_mn63f805mnp_device_config, intelfsh8_device_config, panasonic_mn63f805mnp_device, intelfsh8_device, "Panasonic MN63F805MNP Flash", intelfsh_device_config::FLASH_PANASONIC_MN63F805MNP)
-DEFINE_TRIVIAL_DERIVED_DEVICE(sanyo_le26fv10n1ts_device_config, intelfsh8_device_config, sanyo_le26fv10n1ts_device, intelfsh8_device, "Sanyo LE26FV10N1TS Flash", intelfsh_device_config::FLASH_SANYO_LE26FV10N1TS)
-
-const device_type INTEL_28F016S5 = intel_28f016s5_device_config::static_alloc_device_config;
-const device_type SHARP_LH28F016S = sharp_lh28f016s_device_config::static_alloc_device_config;
-const device_type FUJITSU_29F016A = fujitsu_29f016a_device_config::static_alloc_device_config;
-const device_type FUJITSU_29DL16X = fujitsu_29dl16x_device_config::static_alloc_device_config;
-const device_type INTEL_E28F008SA = intel_e28f008sa_device_config::static_alloc_device_config;
-const device_type MACRONIX_29L001MC = macronix_29l001mc_device_config::static_alloc_device_config;
-const device_type PANASONIC_MN63F805MNP = panasonic_mn63f805mnp_device_config::static_alloc_device_config;
-const device_type SANYO_LE26FV10N1TS = sanyo_le26fv10n1ts_device_config::static_alloc_device_config;
-
-
-// 16-bit variants
-DEFINE_TRIVIAL_DERIVED_DEVICE(sharp_lh28f400_device_config, intelfsh16_device_config, sharp_lh28f400_device, intelfsh16_device, "Sharp LH28F400 Flash", intelfsh_device_config::FLASH_SHARP_LH28F400)
-DEFINE_TRIVIAL_DERIVED_DEVICE(intel_te28f160_device_config, intelfsh16_device_config, intel_te28f160_device, intelfsh16_device, "Intel TE28F160 Flash", intelfsh_device_config::FLASH_INTEL_TE28F160)
-DEFINE_TRIVIAL_DERIVED_DEVICE(intel_e28f400_device_config, intelfsh16_device_config, intel_e28f400_device, intelfsh16_device, "Intel E28F400 Flash", intelfsh_device_config::FLASH_INTEL_E28F400)
-DEFINE_TRIVIAL_DERIVED_DEVICE(sharp_unk128mbit_device_config, intelfsh16_device_config, sharp_unk128mbit_device, intelfsh16_device, "Sharp Unknown 128Mb Flash", intelfsh_device_config::FLASH_SHARP_UNK128MBIT)
-
-const device_type SHARP_LH28F400 = sharp_lh28f400_device_config::static_alloc_device_config;
-const device_type INTEL_TE28F160 = intel_te28f160_device_config::static_alloc_device_config;
-const device_type INTEL_E28F400 = intel_e28f400_device_config::static_alloc_device_config;
-const device_type SHARP_UNK128MBIT = sharp_unk128mbit_device_config::static_alloc_device_config;
-
-
+// device type definition
+const device_type INTEL_28F016S5 = &device_creator<intel_28f016s5_device>;
+const device_type SHARP_LH28F016S = &device_creator<sharp_lh28f016s_device>;
+const device_type FUJITSU_29F016A = &device_creator<fujitsu_29f016a_device>;
+const device_type INTEL_E28F400 = &device_creator<intel_e28f400_device>;
+const device_type MACRONIX_29L001MC = &device_creator<macronix_29l001mc_device>;
+const device_type PANASONIC_MN63F805MNP = &device_creator<panasonic_mn63f805mnp_device>;
+const device_type SANYO_LE26FV10N1TS = &device_creator<sanyo_le26fv10n1ts_device>;
-//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
+const device_type SHARP_LH28F400 = &device_creator<sharp_lh28f400_device>;
+const device_type INTEL_E28F008SA = &device_creator<intel_e28f008sa_device>;
+const device_type INTEL_TE28F160 = &device_creator<intel_te28f160_device>;
+const device_type SHARP_UNK128MBIT = &device_creator<sharp_unk128mbit_device>;
static ADDRESS_MAP_START( memory_map8_512Kb, AS_PROGRAM, 8 )
AM_RANGE(0x00000, 0x00ffff) AM_RAM
@@ -113,23 +90,29 @@ ADDRESS_MAP_END
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
-// intelfsh_device_config - constructor
+// intelfsh_device - constructor
//-------------------------------------------------
-intelfsh_device_config::intelfsh_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 variant)
- : device_config(mconfig, type, name, tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- device_config_nvram_interface(mconfig, *this),
+intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ device_nvram_interface(mconfig, *this),
m_type(variant),
m_size(0),
m_bits(8),
m_device_id(0),
m_maker_id(0),
- m_sector_is_4k(false)
+ m_sector_is_4k(false),
+ m_status(0x80),
+ m_erase_sector(0),
+ m_flash_mode(FM_NORMAL),
+ m_flash_master_lock(false),
+ m_timer(NULL),
+ m_bank(0)
{
address_map_constructor map = NULL;
@@ -219,56 +202,45 @@ intelfsh_device_config::intelfsh_device_config(const machine_config &mconfig, de
m_space_config = address_space_config("flash", ENDIANNESS_BIG, m_bits, addrbits, (m_bits == 8) ? 0 : -1, map);
}
-intelfsh8_device_config::intelfsh8_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 variant)
- : intelfsh_device_config(mconfig, type, name, tag, owner, clock, variant)
-{
-}
+intelfsh8_device::intelfsh8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
+ : intelfsh_device(mconfig, type, name, tag, owner, clock, variant) { }
-intelfsh16_device_config::intelfsh16_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 variant)
- : intelfsh_device_config(mconfig, type, name, tag, owner, clock, variant)
-{
-}
+intelfsh16_device::intelfsh16_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant)
+ : intelfsh_device(mconfig, type, name, tag, owner, clock, variant) { }
-//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
+intel_28f016s5_device::intel_28f016s5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh8_device(mconfig, INTEL_28F016S5, "Intel 28F016S5 Flash", tag, owner, clock, FLASH_INTEL_28F016S5) { }
-const address_space_config *intelfsh_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == 0) ? &m_space_config : NULL;
-}
+fujitsu_29f016a_device::fujitsu_29f016a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh8_device(mconfig, FUJITSU_29F016A, "Fujitsu 29F016A Flash", tag, owner, clock, FLASH_FUJITSU_29F016A) { }
+sharp_lh28f016s_device::sharp_lh28f016s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh8_device(mconfig, SHARP_LH28F016S, "Sharp LH28F016S Flash", tag, owner, clock, FLASH_SHARP_LH28F016S) { }
+intel_e28f008sa_device::intel_e28f008sa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh8_device(mconfig, INTEL_E28F008SA, "Intel E28F008SA Flash", tag, owner, clock, FLASH_INTEL_E28F008SA) { }
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
+macronix_29l001mc_device::macronix_29l001mc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh8_device(mconfig, MACRONIX_29L001MC, "Macronix 29L001MC Flash", tag, owner, clock, FLASH_MACRONIX_29L001MC) { }
-//-------------------------------------------------
-// intelfsh_device - constructor
-//-------------------------------------------------
+panasonic_mn63f805mnp_device::panasonic_mn63f805mnp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh8_device(mconfig, PANASONIC_MN63F805MNP, "Panasonic MN63F805MNP Flash", tag, owner, clock, FLASH_PANASONIC_MN63F805MNP) { }
-intelfsh_device::intelfsh_device(running_machine &_machine, const intelfsh_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
- device_nvram_interface(_machine, config, *this),
- m_config(config),
- m_status(0x80),
- m_erase_sector(0),
- m_flash_mode(FM_NORMAL),
- m_flash_master_lock(false),
- m_timer(NULL),
- m_bank(0)
-{
-}
+sanyo_le26fv10n1ts_device::sanyo_le26fv10n1ts_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh8_device(mconfig, SANYO_LE26FV10N1TS, "Sanyo LE26FV10N1TS Flash", tag, owner, clock, FLASH_SANYO_LE26FV10N1TS) { }
+
+sharp_lh28f400_device::sharp_lh28f400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh16_device(mconfig, SHARP_LH28F400, "Sharp LH28F400 Flash", tag, owner, clock, FLASH_SHARP_LH28F400) { }
-intelfsh8_device::intelfsh8_device(running_machine &_machine, const intelfsh_device_config &config)
- : intelfsh_device(_machine, config) { }
+intel_te28f160_device::intel_te28f160_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh16_device(mconfig, INTEL_TE28F160, "Intel TE28F160 Flash", tag, owner, clock, FLASH_INTEL_TE28F160) { }
-intelfsh16_device::intelfsh16_device(running_machine &_machine, const intelfsh_device_config &config)
- : intelfsh_device(_machine, config) { }
+intel_e28f400_device::intel_e28f400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh16_device(mconfig, INTEL_E28F400, "Intel E28F400 Flash", tag, owner, clock, FLASH_INTEL_E28F400) { }
+
+sharp_unk128mbit_device::sharp_unk128mbit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh16_device(mconfig, SHARP_UNK128MBIT, "Sharp Unknown 128Mbit Flash", tag, owner, clock, FLASH_SHARP_UNK128MBIT) { }
//-------------------------------------------------
@@ -305,6 +277,17 @@ void intelfsh_device::device_timer(emu_timer &timer, device_timer_id id, int par
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *intelfsh_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == 0) ? &m_space_config : NULL;
+}
+
+
+//-------------------------------------------------
// nvram_default - called to initialize NVRAM to
// its default state
//-------------------------------------------------
@@ -315,10 +298,10 @@ void intelfsh_device::nvram_default()
if (m_region != NULL)
{
UINT32 bytes = m_region->bytes();
- if (bytes > m_config.m_size)
- bytes = m_config.m_size;
+ if (bytes > m_size)
+ bytes = m_size;
- if (m_config.m_bits == 8)
+ if (m_bits == 8)
{
for (offs_t offs = 0; offs < bytes; offs++)
m_addrspace[0]->write_byte(offs, m_region->u8(offs));
@@ -332,7 +315,7 @@ void intelfsh_device::nvram_default()
}
// otherwise, default to 0xff
- for (offs_t offs = 0; offs < m_config.m_size; offs++)
+ for (offs_t offs = 0; offs < m_size; offs++)
m_addrspace[0]->write_byte(offs, 0xff);
}
@@ -344,9 +327,9 @@ void intelfsh_device::nvram_default()
void intelfsh_device::nvram_read(emu_file &file)
{
- UINT8 *buffer = global_alloc_array(UINT8, m_config.m_size);
- file.read(buffer, m_config.m_size);
- for (int byte = 0; byte < m_config.m_size; byte++)
+ UINT8 *buffer = global_alloc_array(UINT8, m_size);
+ file.read(buffer, m_size);
+ for (int byte = 0; byte < m_size; byte++)
m_addrspace[0]->write_byte(byte, buffer[byte]);
global_free(buffer);
}
@@ -359,10 +342,10 @@ void intelfsh_device::nvram_read(emu_file &file)
void intelfsh_device::nvram_write(emu_file &file)
{
- UINT8 *buffer = global_alloc_array(UINT8, m_config.m_size);
- for (int byte = 0; byte < m_config.m_size; byte++)
+ UINT8 *buffer = global_alloc_array(UINT8, m_size);
+ for (int byte = 0; byte < m_size; byte++)
buffer[byte] = m_addrspace[0]->read_byte(byte);
- file.write(buffer, m_config.m_size);
+ file.write(buffer, m_size);
global_free(buffer);
}
@@ -380,7 +363,7 @@ UINT32 intelfsh_device::read_full(UINT32 address)
{
default:
case FM_NORMAL:
- switch( m_config.m_bits )
+ switch( m_bits )
{
case 8:
{
@@ -398,13 +381,13 @@ UINT32 intelfsh_device::read_full(UINT32 address)
data = m_status;
break;
case FM_READAMDID3:
- if (m_config.m_maker_id == 0x04 && m_config.m_device_id == 0x35)
+ if (m_maker_id == 0x04 && m_device_id == 0x35)
{
//used in Fujitsu 29DL16X 8bits mode
switch (address)
{
- case 0: data = m_config.m_maker_id; break;
- case 2: data = m_config.m_device_id; break;
+ case 0: data = m_maker_id; break;
+ case 2: data = m_device_id; break;
case 4: data = 0; break;
}
}
@@ -412,8 +395,8 @@ UINT32 intelfsh_device::read_full(UINT32 address)
{
switch (address)
{
- case 0: data = m_config.m_maker_id; break;
- case 1: data = m_config.m_device_id; break;
+ case 0: data = m_maker_id; break;
+ case 1: data = m_device_id; break;
case 2: data = 0; break;
}
}
@@ -422,10 +405,10 @@ UINT32 intelfsh_device::read_full(UINT32 address)
switch (address)
{
case 0: // maker ID
- data = m_config.m_maker_id;
+ data = m_maker_id;
break;
case 1: // chip ID
- data = m_config.m_device_id;
+ data = m_device_id;
break;
case 2: // block lock config
data = 0; // we don't support this yet
@@ -446,7 +429,7 @@ UINT32 intelfsh_device::read_full(UINT32 address)
// reads outside of the erasing sector return normal data
if ((address < m_erase_sector) || (address >= m_erase_sector+(64*1024)))
{
- switch( m_config.m_bits )
+ switch( m_bits )
{
case 8:
{
@@ -600,7 +583,7 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
{
m_flash_mode = FM_NORMAL;
}
- else if( ( address & 0xffff ) == 0x5555 && ( data & 0xff ) == 0xb0 && m_config.m_maker_id == 0x62 && m_config.m_device_id == 0x13 )
+ else if( ( address & 0xffff ) == 0x5555 && ( data & 0xff ) == 0xb0 && m_maker_id == 0x62 && m_device_id == 0x13 )
{
m_flash_mode = FM_BANKSELECT;
}
@@ -647,13 +630,13 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
(( address & 0xfff ) == 0xaaa && ( data & 0xff ) == 0x10 ) )
{
// chip erase
- for (offs_t offs = 0; offs < m_config.m_size; offs++)
+ for (offs_t offs = 0; offs < m_size; offs++)
m_addrspace[0]->write_byte(offs, 0xff);
m_status = 1 << 3;
m_flash_mode = FM_ERASEAMD4;
- if (m_config.m_sector_is_4k)
+ if (m_sector_is_4k)
{
m_timer->adjust( attotime::from_seconds( 1 ) );
}
@@ -666,19 +649,19 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
{
// sector erase
// clear the 4k/64k block containing the current address to all 0xffs
- UINT32 base = address * ((m_config.m_bits == 16) ? 2 : 1);
- if (m_config.m_sector_is_4k)
+ UINT32 base = address * ((m_bits == 16) ? 2 : 1);
+ if (m_sector_is_4k)
{
for (offs_t offs = 0; offs < 4 * 1024; offs++)
m_addrspace[0]->write_byte((base & ~0xfff) + offs, 0xff);
- m_erase_sector = address & ((m_config.m_bits == 16) ? ~0x7ff : ~0xfff);
+ m_erase_sector = address & ((m_bits == 16) ? ~0x7ff : ~0xfff);
m_timer->adjust( attotime::from_msec( 125 ) );
}
else
{
for (offs_t offs = 0; offs < 64 * 1024; offs++)
m_addrspace[0]->write_byte((base & ~0xffff) + offs, 0xff);
- m_erase_sector = address & ((m_config.m_bits == 16) ? ~0x7fff : ~0xffff);
+ m_erase_sector = address & ((m_bits == 16) ? ~0x7fff : ~0xffff);
m_timer->adjust( attotime::from_seconds( 1 ) );
}
@@ -691,7 +674,7 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
}
break;
case FM_BYTEPROGRAM:
- switch( m_config.m_bits )
+ switch( m_bits )
{
case 8:
{
@@ -699,13 +682,13 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
}
break;
default:
- logerror( "FM_BYTEPROGRAM not supported when m_bits == %d\n", m_config.m_bits );
+ logerror( "FM_BYTEPROGRAM not supported when m_bits == %d\n", m_bits );
break;
}
m_flash_mode = FM_NORMAL;
break;
case FM_WRITEPART1:
- switch( m_config.m_bits )
+ switch( m_bits )
{
case 8:
{
@@ -718,7 +701,7 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
}
break;
default:
- logerror( "FM_WRITEPART1 not supported when m_bits == %d\n", m_config.m_bits );
+ logerror( "FM_WRITEPART1 not supported when m_bits == %d\n", m_bits );
break;
}
m_status = 0x80;
@@ -728,7 +711,7 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
if( ( data & 0xff ) == 0xd0 )
{
// clear the 64k block containing the current address to all 0xffs
- UINT32 base = address * ((m_config.m_bits == 16) ? 2 : 1);
+ UINT32 base = address * ((m_bits == 16) ? 2 : 1);
for (offs_t offs = 0; offs < 64 * 1024; offs++)
m_addrspace[0]->write_byte((base & ~0xffff) + offs, 0xff);
diff --git a/src/emu/machine/intelfsh.h b/src/emu/machine/intelfsh.h
index d6faa63ffa4..9d68b9147f4 100644
--- a/src/emu/machine/intelfsh.h
+++ b/src/emu/machine/intelfsh.h
@@ -55,16 +55,13 @@
class intelfsh_device;
-// ======================> intelfsh_device_config
+// ======================> intelfsh_device
-class intelfsh_device_config : public device_config,
- public device_config_memory_interface,
- public device_config_nvram_interface
+class intelfsh_device : public device_t,
+ public device_memory_interface,
+ public device_nvram_interface
{
- friend class intelfsh_device;
-
-protected:
- // constants
+public:
enum
{
// 8-bit variants
@@ -84,41 +81,19 @@ protected:
FLASH_SHARP_UNK128MBIT
};
- // construction/destruction
- intelfsh_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 variant);
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // internal state
- address_space_config m_space_config;
- UINT32 m_type;
- INT32 m_size;
- UINT8 m_bits;
- UINT8 m_device_id;
- UINT8 m_maker_id;
- bool m_sector_is_4k;
-};
-
-
-// ======================> intelfsh_device
-
-class intelfsh_device : public device_t,
- public device_memory_interface,
- public device_nvram_interface
-{
- friend class intelfsh_device_config;
-
protected:
// construction/destruction
- intelfsh_device(running_machine &_machine, const intelfsh_device_config &config);
+ intelfsh_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
protected:
// device-level overrides
virtual void device_start();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
- // device_config_nvram_interface overrides
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
+ // device_nvram_interface overrides
virtual void nvram_default();
virtual void nvram_read(emu_file &file);
virtual void nvram_write(emu_file &file);
@@ -127,27 +102,22 @@ protected:
UINT32 read_full(UINT32 offset);
void write_full(UINT32 offset, UINT32 data);
- // internal state
- const intelfsh_device_config & m_config;
-
- UINT8 m_status;
- INT32 m_erase_sector;
- INT32 m_flash_mode;
- bool m_flash_master_lock;
- emu_timer * m_timer;
- INT32 m_bank;
-};
-
-
-// ======================> intelfsh8_device_config
-
-class intelfsh8_device_config : public intelfsh_device_config
-{
- friend class intelfsh8_device;
+ // configuration state
+ address_space_config m_space_config;
+ UINT32 m_type;
+ INT32 m_size;
+ UINT8 m_bits;
+ UINT8 m_device_id;
+ UINT8 m_maker_id;
+ bool m_sector_is_4k;
-protected:
- // construction/destruction
- intelfsh8_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 variant);
+ // internal state
+ UINT8 m_status;
+ INT32 m_erase_sector;
+ INT32 m_flash_mode;
+ bool m_flash_master_lock;
+ emu_timer * m_timer;
+ INT32 m_bank;
};
@@ -155,19 +125,9 @@ protected:
class intelfsh8_device : public intelfsh_device
{
- friend class intelfsh8_device_config;
- friend class intel_28f016s5_device_config;
- friend class fujitsu_29f016a_device_config;
- friend class fujitsu_29dl16x_device_config;
- friend class sharp_lh28f016s_device_config;
- friend class intel_e28f008sa_device_config;
- friend class macronix_29l001mc_device_config;
- friend class panasonic_mn63f805mnp_device_config;
- friend class sanyo_le26fv10n1ts_device_config;
-
protected:
// construction/destruction
- intelfsh8_device(running_machine &_machine, const intelfsh_device_config &config);
+ intelfsh8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
public:
// public interface
@@ -179,31 +139,13 @@ public:
};
-// ======================> intelfsh16_device_config
-
-class intelfsh16_device_config : public intelfsh_device_config
-{
- friend class intelfsh16_device;
-
-protected:
- // construction/destruction
- intelfsh16_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 variant);
-};
-
-
// ======================> intelfsh16_device
class intelfsh16_device : public intelfsh_device
{
- friend class intelfsh16_device_config;
- friend class sharp_lh28f400_device_config;
- friend class intel_te28f160_device_config;
- friend class intel_e28f400_device_config;
- friend class sharp_unk128mbit_device_config;
-
protected:
// construction/destruction
- intelfsh16_device(running_machine &_machine, const intelfsh_device_config &config);
+ intelfsh16_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant);
public:
// public interface
@@ -218,21 +160,73 @@ public:
// ======================> trivial variants
// 8-bit variants
-DECLARE_TRIVIAL_DERIVED_DEVICE(intel_28f016s5_device_config, intelfsh8_device_config, intel_28f016s5_device, intelfsh8_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(fujitsu_29f016a_device_config, intelfsh8_device_config, fujitsu_29f016a_device, intelfsh8_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(fujitsu_29dl16x_device_config, intelfsh8_device_config, fujitsu_29dl16x_device, intelfsh8_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(sharp_lh28f016s_device_config, intelfsh8_device_config, sharp_lh28f016s_device, intelfsh8_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(intel_e28f008sa_device_config, intelfsh8_device_config, intel_e28f008sa_device, intelfsh8_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(macronix_29l001mc_device_config, intelfsh8_device_config, macronix_29l001mc_device, intelfsh8_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(panasonic_mn63f805mnp_device_config, intelfsh8_device_config, panasonic_mn63f805mnp_device, intelfsh8_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(sanyo_le26fv10n1ts_device_config, intelfsh8_device_config, sanyo_le26fv10n1ts_device, intelfsh8_device)
+class intel_28f016s5_device : public intelfsh8_device
+{
+public:
+ intel_28f016s5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class fujitsu_29f016a_device : public intelfsh8_device
+{
+public:
+ fujitsu_29f016a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class sharp_lh28f016s_device : public intelfsh8_device
+{
+public:
+ sharp_lh28f016s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class intel_e28f008sa_device : public intelfsh8_device
+{
+public:
+ intel_e28f008sa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class macronix_29l001mc_device : public intelfsh8_device
+{
+public:
+ macronix_29l001mc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class panasonic_mn63f805mnp_device : public intelfsh8_device
+{
+public:
+ panasonic_mn63f805mnp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class sanyo_le26fv10n1ts_device : public intelfsh8_device
+{
+public:
+ sanyo_le26fv10n1ts_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
// 16-bit variants
-DECLARE_TRIVIAL_DERIVED_DEVICE(sharp_lh28f400_device_config, intelfsh16_device_config, sharp_lh28f400_device, intelfsh16_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(intel_te28f160_device_config, intelfsh16_device_config, intel_te28f160_device, intelfsh16_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(intel_e28f400_device_config, intelfsh16_device_config, intel_e28f400_device, intelfsh16_device)
-DECLARE_TRIVIAL_DERIVED_DEVICE(sharp_unk128mbit_device_config, intelfsh16_device_config, sharp_unk128mbit_device, intelfsh16_device)
+class sharp_lh28f400_device : public intelfsh16_device
+{
+public:
+ sharp_lh28f400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class intel_te28f160_device : public intelfsh16_device
+{
+public:
+ intel_te28f160_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class intel_e28f400_device : public intelfsh16_device
+{
+public:
+ intel_e28f400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class sharp_unk128mbit_device : public intelfsh16_device
+{
+public:
+ sharp_unk128mbit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
diff --git a/src/emu/machine/k033906.c b/src/emu/machine/k033906.c
index 99e20ed6aee..2e8aa7dac70 100644
--- a/src/emu/machine/k033906.c
+++ b/src/emu/machine/k033906.c
@@ -11,10 +11,21 @@
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-GENERIC_DEVICE_CONFIG_SETUP(k033906, "Konami 033906")
+// device type definition
+const device_type K033906 = &device_creator<k033906_device>;
+
+//-------------------------------------------------
+// k033906_device - constructor
+//-------------------------------------------------
+
+k033906_device::k033906_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, K033906, "Konami 033906", tag, owner, clock)
+{
+
+}
//-------------------------------------------------
// device_config_complete - perform any
@@ -22,7 +33,7 @@ GENERIC_DEVICE_CONFIG_SETUP(k033906, "Konami 033906")
// complete
//-------------------------------------------------
-void k033906_device_config::device_config_complete()
+void k033906_device::device_config_complete()
{
// inherit a copy of the static data
const k033906_interface *intf = reinterpret_cast<const k033906_interface *>(static_config());
@@ -39,31 +50,13 @@ void k033906_device_config::device_config_complete()
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-const device_type K033906 = k033906_device_config::static_alloc_device_config;
-
-//-------------------------------------------------
-// k033906_device - constructor
-//-------------------------------------------------
-
-k033906_device::k033906_device(running_machine &_machine, const k033906_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void k033906_device::device_start()
{
- m_voodoo = machine().device(m_config.m_voodoo_tag);
+ m_voodoo = machine().device(m_voodoo_tag);
m_reg = auto_alloc_array(machine(), UINT32, 256);
m_ram = auto_alloc_array(machine(), UINT32, 32768);
diff --git a/src/emu/machine/k033906.h b/src/emu/machine/k033906.h
index 43b6e127b0e..7a46d253539 100644
--- a/src/emu/machine/k033906.h
+++ b/src/emu/machine/k033906.h
@@ -36,38 +36,14 @@ struct k033906_interface
-// ======================> k033906_device_config
-
-class k033906_device_config : public device_config,
- public k033906_interface
-{
- friend class k033906_device;
-
- // construction/destruction
- k033906_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
-
// ======================> k033906_device
-class k033906_device : public device_t
+class k033906_device : public device_t,
+ public k033906_interface
{
- friend class k033906_device_config;
-
- // construction/destruction
- k033906_device(running_machine &_machine, const k033906_device_config &_config);
-
public:
+ // construction/destruction
+ k033906_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
UINT32 k033906_r(UINT32 offset);
void k033906_w(UINT32 offset, UINT32 data, UINT32 mem_mask);
@@ -75,6 +51,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset() { }
virtual void device_post_load() { }
@@ -92,8 +69,6 @@ private:
int m_reg_set; // 1 = access reg / 0 = access ram
device_t *m_voodoo;
-
- const k033906_device_config &m_config;
};
diff --git a/src/emu/machine/k056230.c b/src/emu/machine/k056230.c
index 979db7186fa..4a5ead590b0 100644
--- a/src/emu/machine/k056230.c
+++ b/src/emu/machine/k056230.c
@@ -10,10 +10,22 @@
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-GENERIC_DEVICE_CONFIG_SETUP(k056230, "Konami 056230")
+// device type definition
+const device_type K056230 = &device_creator<k056230_device>;
+
+//-------------------------------------------------
+// k056230_device - constructor
+//-------------------------------------------------
+
+k056230_device::k056230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, K056230, "Konami 056230", tag, owner, clock)
+{
+
+}
+
//-------------------------------------------------
// device_config_complete - perform any
@@ -21,7 +33,7 @@ GENERIC_DEVICE_CONFIG_SETUP(k056230, "Konami 056230")
// complete
//-------------------------------------------------
-void k056230_device_config::device_config_complete()
+void k056230_device::device_config_complete()
{
// inherit a copy of the static data
const k056230_interface *intf = reinterpret_cast<const k056230_interface *>(static_config());
@@ -33,47 +45,27 @@ void k056230_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- m_cpu = NULL;
- m_is_thunderh = 0;
+ m_cpu_tag = NULL;
+ m_is_thunderh = false;
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-const device_type K0506230 = k056230_device_config::static_alloc_device_config;
-
-//-------------------------------------------------
-// k056230_device - constructor
-//-------------------------------------------------
-
-k056230_device::k056230_device(running_machine &_machine, const k056230_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-
-}
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void k056230_device::device_start()
{
- if(m_config.m_cpu)
+ if(m_cpu_tag)
{
- m_cpu = machine().device(m_config.m_cpu);
+ m_cpu = machine().device(m_cpu_tag);
}
else
{
m_cpu = NULL;
}
- m_is_thunderh = m_config.m_is_thunderh;
-
m_ram = auto_alloc_array(machine(), UINT32, 0x2000);
save_pointer(NAME(m_ram), 0x2000);
diff --git a/src/emu/machine/k056230.h b/src/emu/machine/k056230.h
index 81ee41ebc96..5d6d67ec103 100644
--- a/src/emu/machine/k056230.h
+++ b/src/emu/machine/k056230.h
@@ -18,7 +18,7 @@
***************************************************************************/
#define MCFG_K056230_ADD(_tag, _config) \
- MCFG_DEVICE_ADD(_tag, K0506230, 0) \
+ MCFG_DEVICE_ADD(_tag, K056230, 0) \
MCFG_DEVICE_CONFIG(_config)
@@ -31,44 +31,20 @@
struct k056230_interface
{
- const char *m_cpu;
- int m_is_thunderh;
-};
-
-
-
-// ======================> k056230_device_config
-
-class k056230_device_config : public device_config,
- public k056230_interface
-{
- friend class k056230_device;
-
- // construction/destruction
- k056230_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ const char *m_cpu_tag;
+ bool m_is_thunderh;
};
// ======================> k056230_device
-class k056230_device : public device_t
+class k056230_device : public device_t,
+ public k056230_interface
{
- friend class k056230_device_config;
-
- // construction/destruction
- k056230_device(running_machine &_machine, const k056230_device_config &_config);
-
public:
+ // construction/destruction
+ k056230_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
UINT32 lanc_ram_r(UINT32 offset);
void lanc_ram_w(UINT32 offset, UINT32 data, UINT32 mem_mask);
@@ -80,6 +56,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset() { }
virtual void device_post_load() { }
@@ -90,16 +67,12 @@ private:
void network_irq_clear();
UINT32 *m_ram;
- int m_is_thunderh;
-
device_t *m_cpu;
-
- const k056230_device_config &m_config;
};
// device type definition
-extern const device_type K0506230;
+extern const device_type K056230;
diff --git a/src/emu/machine/latch8.c b/src/emu/machine/latch8.c
index 5ec709f1597..1187a491900 100644
--- a/src/emu/machine/latch8.c
+++ b/src/emu/machine/latch8.c
@@ -187,7 +187,7 @@ static DEVICE_START( latch8 )
int i;
/* validate arguments */
- latch8->intf = (latch8_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ latch8->intf = (latch8_config *)downcast<const legacy_device_base *>(device)->inline_config();
latch8->value = 0x0;
diff --git a/src/emu/machine/ldcore.c b/src/emu/machine/ldcore.c
index 353fb68d130..759d7a94a11 100644
--- a/src/emu/machine/ldcore.c
+++ b/src/emu/machine/ldcore.c
@@ -1124,9 +1124,9 @@ static void configuration_save(running_machine &machine, int config_type, xml_da
return;
/* iterate over disc devices */
- for (device = machine.m_devicelist.first(LASERDISC); device != NULL; device = device->typenext())
+ for (device = machine.devicelist().first(LASERDISC); device != NULL; device = device->typenext())
{
- laserdisc_config *origconfig = (laserdisc_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ laserdisc_config *origconfig = (laserdisc_config *)downcast<const legacy_device_base *>(device)->inline_config();
laserdisc_state *ld = get_safe_token(device);
ldcore_data *ldcore = ld->core;
xml_data_node *overnode;
@@ -1214,7 +1214,7 @@ void laserdisc_overlay_enable(device_t *device, int enable)
SCREEN_UPDATE( laserdisc )
{
- device_t *laserdisc = screen->machine().m_devicelist.first(LASERDISC);
+ device_t *laserdisc = screen->machine().devicelist().first(LASERDISC);
if (laserdisc != NULL)
{
const rectangle &visarea = screen->visible_area();
@@ -1322,7 +1322,7 @@ void laserdisc_set_config(device_t *device, const laserdisc_config *config)
static void init_disc(device_t *device)
{
- const laserdisc_config *config = (const laserdisc_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ const laserdisc_config *config = (const laserdisc_config *)downcast<const legacy_device_base *>(device)->inline_config();
laserdisc_state *ld = get_safe_token(device);
ldcore_data *ldcore = ld->core;
chd_error err;
@@ -1473,7 +1473,7 @@ static void init_audio(device_t *device)
static DEVICE_START( laserdisc )
{
- const laserdisc_config *config = (const laserdisc_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ const laserdisc_config *config = (const laserdisc_config *)downcast<const legacy_device_base *>(device)->inline_config();
laserdisc_state *ld = get_safe_token(device);
ldcore_data *ldcore;
int statesize;
@@ -1616,12 +1616,12 @@ void laserdisc_set_type(device_t *device, int type)
device get info callback
-------------------------------------------------*/
-static const ldplayer_interface *get_interface(const device_config *devconfig)
+static const ldplayer_interface *get_interface(const device_t *device)
{
- if (devconfig == NULL)
+ if (device == NULL)
return NULL;
- const laserdisc_config *config = (const laserdisc_config *)downcast<const legacy_device_config_base *>(devconfig)->inline_config();
+ const laserdisc_config *config = (const laserdisc_config *)downcast<const legacy_device_base *>(device)->inline_config();
if (config == NULL)
return NULL;
diff --git a/src/emu/machine/mb3773.c b/src/emu/machine/mb3773.c
index e6e1eac96d7..925def0a33f 100644
--- a/src/emu/machine/mb3773.c
+++ b/src/emu/machine/mb3773.c
@@ -15,58 +15,29 @@
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type MB3773 = mb3773_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// mb3773_device_config - constructor
-//-------------------------------------------------
-
-mb3773_device_config::mb3773_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock )
- : device_config(mconfig, static_alloc_device_config, "MB3773", tag, owner, clock)
-{
-}
-
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *mb3773_device_config::static_alloc_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock )
-{
- return global_alloc( mb3773_device_config( mconfig, tag, owner, clock ) );
-}
-
-
+// device type definition
+const device_type MB3773 = &device_creator<mb3773_device>;
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// mb3773_device - constructor
//-------------------------------------------------
-device_t *mb3773_device_config::alloc_device( running_machine &machine ) const
+mb3773_device::mb3773_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock )
+ : device_t(mconfig, MB3773, "MB3773", tag, owner, clock)
{
- return auto_alloc( machine, mb3773_device( machine, *this ) );
}
-
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
-void mb3773_device_config::device_config_complete()
+void mb3773_device::device_config_complete()
{
}
@@ -76,29 +47,12 @@ void mb3773_device_config::device_config_complete()
// on this device
//-------------------------------------------------
-bool mb3773_device_config::device_validity_check( emu_options &options, const game_driver &driver ) const
+bool mb3773_device::device_validity_check( emu_options &options, const game_driver &driver ) const
{
return false;
}
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// mb3773_device - constructor
-//-------------------------------------------------
-
-mb3773_device::mb3773_device( running_machine &_machine, const mb3773_device_config &config ) :
- device_t( _machine, config ),
- m_config( config )
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/emu/machine/mb3773.h b/src/emu/machine/mb3773.h
index 80dbb855645..24874b3f534 100644
--- a/src/emu/machine/mb3773.h
+++ b/src/emu/machine/mb3773.h
@@ -20,44 +20,22 @@
MCFG_DEVICE_ADD(_tag, MB3773, 0)
-// ======================> mb3773_device_config
-
-class mb3773_device_config :
- public device_config
-{
- friend class mb3773_device;
-
- // construction/destruction
- mb3773_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock );
-
-public:
- // allocators
- static device_config *static_alloc_device_config( const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock );
- virtual device_t *alloc_device( running_machine &machine ) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
- virtual bool device_validity_check( emu_options &options, const game_driver &driver ) const;
-};
-
-
// ======================> mb3773_device
class mb3773_device :
public device_t
{
- friend class mb3773_device_config;
-
+public:
// construction/destruction
- mb3773_device( running_machine &_machine, const mb3773_device_config &config );
+ mb3773_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock );
-public:
// I/O operations
void set_ck( int state );
protected:
// device-level overrides
+ virtual void device_config_complete();
+ virtual bool device_validity_check( emu_options &options, const game_driver &driver ) const;
virtual void device_start();
virtual void device_reset();
@@ -66,7 +44,6 @@ protected:
void reset_timer();
// internal state
- const mb3773_device_config &m_config;
emu_timer *m_watchdog_timer;
int m_ck;
};
diff --git a/src/emu/machine/mb87078.c b/src/emu/machine/mb87078.c
index c487e751ae8..26cd8680ac0 100644
--- a/src/emu/machine/mb87078.c
+++ b/src/emu/machine/mb87078.c
@@ -123,7 +123,7 @@ INLINE const mb87078_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == MB87078));
- return (const mb87078_interface *) device->baseconfig().static_config();
+ return (const mb87078_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/emu/machine/mc146818.c b/src/emu/machine/mc146818.c
index 3120cca44f0..9b8fa827cc9 100644
--- a/src/emu/machine/mc146818.c
+++ b/src/emu/machine/mc146818.c
@@ -101,48 +101,26 @@
//**************************************************************************
-// DEVICE DEFINITIONS
+// LIVE DEVICE
//**************************************************************************
-const device_type MC146818 = mc146818_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
+// device type definition
+const device_type MC146818 = &device_creator<mc146818_device>;
//-------------------------------------------------
-// mc146818_device_config - constructor
-//-------------------------------------------------
-
-mc146818_device_config::mc146818_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "NVRAM", tag, owner, clock),
- device_config_rtc_interface(mconfig, *this),
- device_config_nvram_interface(mconfig, *this),
- m_type(MC146818_STANDARD)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *mc146818_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(mc146818_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
+// mc146818_device - constructor
//-------------------------------------------------
-device_t *mc146818_device_config::alloc_device(running_machine &machine) const
+mc146818_device::mc146818_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MC146818, "NVRAM", tag, owner, clock),
+ device_rtc_interface(mconfig, *this),
+ device_nvram_interface(mconfig, *this),
+ m_type(MC146818_STANDARD),
+ m_index(0),
+ m_eindex(0),
+ m_updated(false),
+ m_last_refresh(attotime::zero)
{
- return auto_alloc(machine, mc146818_device(machine, *this));
}
@@ -151,31 +129,9 @@ device_t *mc146818_device_config::alloc_device(running_machine &machine) const
// to set the interface
//-------------------------------------------------
-void mc146818_device_config::static_set_type(device_config *device, mc146818_type type)
-{
- downcast<mc146818_device_config *>(device)->m_type = type;
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// mc146818_device - constructor
-//-------------------------------------------------
-
-mc146818_device::mc146818_device(running_machine &_machine, const mc146818_device_config &config)
- : device_t(_machine, config),
- device_rtc_interface(_machine, config, *this),
- device_nvram_interface(_machine, config, *this),
- m_config(config),
- m_index(0),
- m_eindex(0),
- m_updated(false),
- m_last_refresh(attotime::zero)
+void mc146818_device::static_set_type(device_t &device, mc146818_type type)
{
+ downcast<mc146818_device &>(device).m_type = type;
}
@@ -187,7 +143,7 @@ void mc146818_device::device_start()
{
m_last_refresh = machine().time();
emu_timer *timer = timer_alloc();
- if (m_config.m_type == mc146818_device_config::MC146818_UTC) {
+ if (m_type == MC146818_UTC) {
// hack: for apollo we increase the update frequency to stay in sync with real time
timer->adjust(attotime::from_hz(2), 0, attotime::from_hz(2));
} else {
@@ -205,7 +161,7 @@ void mc146818_device::device_timer(emu_timer &timer, device_timer_id id, int par
{
int year/*, month*/;
- if (m_config.m_type == mc146818_device_config::MC146818_UTC) {
+ if (m_type == MC146818_UTC) {
// hack: set correct real time even for overloaded emulation
// (at least for apollo)
static osd_ticks_t t0 = 0;
@@ -247,7 +203,7 @@ void mc146818_device::device_timer(emu_timer &timer, device_timer_id id, int par
DAY=bcd_adjust(DAY+1);
//month=bcd_2_dec(MONTH);
year=bcd_2_dec(YEAR);
- if (m_config.m_type!=mc146818_device_config::MC146818_IGNORE_CENTURY) year+=bcd_2_dec(CENTURY)*100;
+ if (m_type!=MC146818_IGNORE_CENTURY) year+=bcd_2_dec(CENTURY)*100;
else year+=2000; // save for julian_days_in_month calculation
DAY=bcd_adjust(DAY+1);
if (DAY>gregorian_days_in_month(MONTH, year))
@@ -258,7 +214,7 @@ void mc146818_device::device_timer(emu_timer &timer, device_timer_id id, int par
{
MONTH=1;
YEAR=year=bcd_adjust(YEAR+1);
- if (m_config.m_type!=mc146818_device_config::MC146818_IGNORE_CENTURY)
+ if (m_type!=MC146818_IGNORE_CENTURY)
{
if (year>=0x100)
{
@@ -286,14 +242,14 @@ void mc146818_device::device_timer(emu_timer &timer, device_timer_id id, int par
m_data[4]=0;
WEEK_DAY=(WEEK_DAY+1)%7;
year=YEAR;
- if (m_config.m_type!=mc146818_device_config::MC146818_IGNORE_CENTURY) year+=CENTURY*100;
+ if (m_type!=MC146818_IGNORE_CENTURY) year+=CENTURY*100;
else year+=2000; // save for julian_days_in_month calculation
if (++DAY>gregorian_days_in_month(MONTH, year)) {
DAY=1;
if (++MONTH>12) {
MONTH=1;
YEAR++;
- if (m_config.m_type!=mc146818_device_config::MC146818_IGNORE_CENTURY) {
+ if (m_type!=MC146818_IGNORE_CENTURY) {
if (YEAR>=100) { CENTURY++;YEAR=0; }
} else {
YEAR%=100;
@@ -407,7 +363,7 @@ void mc146818_device::set_base_datetime()
machine().base_datetime(systime);
- current_time = m_config.m_type == mc146818_device_config::MC146818_UTC ? systime.utc_time: systime.local_time;
+ current_time = m_type == MC146818_UTC ? systime.utc_time: systime.local_time;
// temporary hack to go back 20 year (e.g. from 2010 -> 1990)
// current_time.year -= 20;
@@ -421,7 +377,7 @@ void mc146818_device::set_base_datetime()
else
m_data[4] = dec_2_local(current_time.hour - 12) | 0x80;
- if (m_config.m_type != mc146818_device_config::MC146818_IGNORE_CENTURY)
+ if (m_type != MC146818_IGNORE_CENTURY)
CENTURY = dec_2_local(current_time.year /100);
m_data[0] = dec_2_local(current_time.second);
diff --git a/src/emu/machine/mc146818.h b/src/emu/machine/mc146818.h
index da35b90ecc4..d7d09ebf7ad 100644
--- a/src/emu/machine/mc146818.h
+++ b/src/emu/machine/mc146818.h
@@ -21,7 +21,7 @@
#define MCFG_MC146818_ADD(_tag, _type) \
MCFG_DEVICE_ADD(_tag, MC146818, 0) \
- mc146818_device_config::static_set_type(device, mc146818_device_config::_type); \
+ mc146818_device::static_set_type(*device, mc146818_device::_type); \
@@ -29,20 +29,12 @@
// TYPE DEFINITIONS
//**************************************************************************
-class mc146818_device;
-
-
-// ======================> mc146818_device_config
+// ======================> mc146818_device
-class mc146818_device_config : public device_config,
- public device_config_rtc_interface,
- public device_config_nvram_interface
+class mc146818_device : public device_t,
+ public device_rtc_interface,
+ public device_nvram_interface
{
- friend class mc146818_device;
-
- // construction/destruction
- mc146818_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
public:
// values
enum mc146818_type
@@ -53,31 +45,12 @@ public:
MC146818_UTC
};
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
+ // construction/destruction
+ mc146818_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// inline configuration helpers
- static void static_set_type(device_config *device, mc146818_type type);
+ static void static_set_type(device_t &device, mc146818_type type);
-protected:
- // internal state
- mc146818_type m_type;
-};
-
-
-// ======================> mc146818_device
-
-class mc146818_device : public device_t,
- public device_rtc_interface,
- public device_nvram_interface
-{
- friend class mc146818_device_config;
-
- // construction/destruction
- mc146818_device(running_machine &_machine, const mc146818_device_config &config);
-
-public:
// read/write access
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -103,7 +76,7 @@ protected:
// internal state
static const int MC146818_DATA_SIZE = 0x80;
- const mc146818_device_config & m_config;
+ mc146818_type m_type;
UINT8 m_index;
UINT8 m_data[MC146818_DATA_SIZE];
diff --git a/src/emu/machine/mc6852.c b/src/emu/machine/mc6852.c
index db2c7ce697b..735865630f9 100644
--- a/src/emu/machine/mc6852.c
+++ b/src/emu/machine/mc6852.c
@@ -27,6 +27,9 @@
#include "machine/devhelpr.h"
+// device type definition
+const device_type MC6852 = &device_creator<mc6852_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -81,19 +84,31 @@
//**************************************************************************
-// GLOBAL VARIABLES
+// INLINE HELPERS
//**************************************************************************
-// devices
-const device_type MC6852 = mc6852_device_config::static_alloc_device_config;
+inline void mc6852_device::receive()
+{
+}
+
+inline void mc6852_device::transmit()
+{
+}
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-GENERIC_DEVICE_CONFIG_SETUP(mc6852, "MC6852")
+//-------------------------------------------------
+// mc6852_device - constructor
+//-------------------------------------------------
+
+mc6852_device::mc6852_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MC6852, "MC6852", tag, owner, clock)
+{
+}
//-------------------------------------------------
@@ -102,7 +117,7 @@ GENERIC_DEVICE_CONFIG_SETUP(mc6852, "MC6852")
// complete
//-------------------------------------------------
-void mc6852_device_config::device_config_complete()
+void mc6852_device::device_config_complete()
{
// inherit a copy of the static data
const mc6852_interface *intf = reinterpret_cast<const mc6852_interface *>(static_config());
@@ -112,47 +127,17 @@ void mc6852_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_in_rx_data_func, 0, sizeof(m_in_rx_data_func));
- memset(&m_out_tx_data_func, 0, sizeof(m_out_tx_data_func));
- memset(&m_out_irq_func, 0, sizeof(m_out_irq_func));
- memset(&m_in_cts_func, 0, sizeof(m_in_cts_func));
- memset(&m_in_dcd_func, 0, sizeof(m_in_dcd_func));
- memset(&m_out_sm_dtr_func, 0, sizeof(m_out_sm_dtr_func));
- memset(&m_out_tuf_func, 0, sizeof(m_out_tuf_func));
+ memset(&m_in_rx_data_cb, 0, sizeof(m_in_rx_data_cb));
+ memset(&m_out_tx_data_cb, 0, sizeof(m_out_tx_data_cb));
+ memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
+ memset(&m_in_cts_cb, 0, sizeof(m_in_cts_cb));
+ memset(&m_in_dcd_cb, 0, sizeof(m_in_dcd_cb));
+ memset(&m_out_sm_dtr_cb, 0, sizeof(m_out_sm_dtr_cb));
+ memset(&m_out_tuf_cb, 0, sizeof(m_out_tuf_cb));
}
}
-
-//**************************************************************************
-// INLINE HELPERS
-//**************************************************************************
-
-inline void mc6852_device::receive()
-{
-}
-
-inline void mc6852_device::transmit()
-{
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// mc6852_device - constructor
-//-------------------------------------------------
-
-mc6852_device::mc6852_device(running_machine &_machine, const mc6852_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -160,24 +145,24 @@ mc6852_device::mc6852_device(running_machine &_machine, const mc6852_device_conf
void mc6852_device::device_start()
{
// resolve callbacks
- devcb_resolve_read_line(&m_in_rx_data_func, &m_config.m_in_rx_data_func, this);
- devcb_resolve_write_line(&m_out_tx_data_func, &m_config.m_out_tx_data_func, this);
- devcb_resolve_write_line(&m_out_irq_func, &m_config.m_out_irq_func, this);
- devcb_resolve_read_line(&m_in_cts_func, &m_config.m_in_cts_func, this);
- devcb_resolve_read_line(&m_in_dcd_func, &m_config.m_in_dcd_func, this);
- devcb_resolve_write_line(&m_out_sm_dtr_func, &m_config.m_out_sm_dtr_func, this);
- devcb_resolve_write_line(&m_out_tuf_func, &m_config.m_out_tuf_func, this);
-
- if (m_config.m_rx_clock > 0)
+ devcb_resolve_read_line(&m_in_rx_data_func, &m_in_rx_data_cb, this);
+ devcb_resolve_write_line(&m_out_tx_data_func, &m_out_tx_data_cb, this);
+ devcb_resolve_write_line(&m_out_irq_func, &m_out_irq_cb, this);
+ devcb_resolve_read_line(&m_in_cts_func, &m_in_cts_cb, this);
+ devcb_resolve_read_line(&m_in_dcd_func, &m_in_dcd_cb, this);
+ devcb_resolve_write_line(&m_out_sm_dtr_func, &m_out_sm_dtr_cb, this);
+ devcb_resolve_write_line(&m_out_tuf_func, &m_out_tuf_cb, this);
+
+ if (m_rx_clock > 0)
{
m_rx_timer = timer_alloc(TIMER_RX);
- m_rx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock));
+ m_rx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_rx_clock));
}
- if (m_config.m_tx_clock > 0)
+ if (m_tx_clock > 0)
{
m_tx_timer = timer_alloc(TIMER_TX);
- m_tx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock));
+ m_tx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_tx_clock));
}
// register for state saving
diff --git a/src/emu/machine/mc6852.h b/src/emu/machine/mc6852.h
index 7385402c75d..c0c6090d624 100644
--- a/src/emu/machine/mc6852.h
+++ b/src/emu/machine/mc6852.h
@@ -55,51 +55,27 @@ struct mc6852_interface
UINT32 m_rx_clock;
UINT32 m_tx_clock;
- devcb_read_line m_in_rx_data_func;
- devcb_write_line m_out_tx_data_func;
+ devcb_read_line m_in_rx_data_cb;
+ devcb_write_line m_out_tx_data_cb;
- devcb_write_line m_out_irq_func;
+ devcb_write_line m_out_irq_cb;
- devcb_read_line m_in_cts_func;
- devcb_read_line m_in_dcd_func;
- devcb_write_line m_out_sm_dtr_func;
- devcb_write_line m_out_tuf_func;
+ devcb_read_line m_in_cts_cb;
+ devcb_read_line m_in_dcd_cb;
+ devcb_write_line m_out_sm_dtr_cb;
+ devcb_write_line m_out_tuf_cb;
};
-
-// ======================> mc6852_device_config
-
-class mc6852_device_config : public device_config,
- public mc6852_interface
-{
- friend class mc6852_device;
-
- // construction/destruction
- mc6852_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
-
// ======================> mc6852_device
-class mc6852_device : public device_t
+class mc6852_device : public device_t,
+ public mc6852_interface
{
- friend class mc6852_device_config;
-
+public:
// construction/destruction
- mc6852_device(running_machine &_machine, const mc6852_device_config &_config);
+ mc6852_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -113,6 +89,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int m_param, void *ptr);
@@ -151,8 +128,6 @@ private:
// timers
emu_timer *m_rx_timer;
emu_timer *m_tx_timer;
-
- const mc6852_device_config &m_config;
};
diff --git a/src/emu/machine/mc68901.c b/src/emu/machine/mc68901.c
index cc3bc818c1b..65553a18185 100644
--- a/src/emu/machine/mc68901.c
+++ b/src/emu/machine/mc68901.c
@@ -46,6 +46,9 @@
#include "machine/devhelpr.h"
+// device type definition
+const device_type MC68901 = &device_creator<mc68901_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -261,44 +264,6 @@ static const int PRESCALER[] = { 0, 4, 10, 16, 50, 64, 100, 200 };
//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// devices
-const device_type MC68901 = mc68901_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(mc68901, "Motorola MC68901")
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void mc68901_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const mc68901_interface *intf = reinterpret_cast<const mc68901_interface *>(static_config());
- if (intf != NULL)
- *static_cast<mc68901_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
-// memset(&in_pa_func, 0, sizeof(in_pa_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -771,34 +736,51 @@ inline void mc68901_device::gpio_input(int bit, int state)
// mc68901_device - constructor
//-------------------------------------------------
-mc68901_device::mc68901_device(running_machine &_machine, const mc68901_device_config &config)
- : device_t(_machine, config),
+mc68901_device::mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MC68901, "Motorola MC68901", tag, owner, clock),
m_gpip(0),
- m_tsr(TSR_BUFFER_EMPTY),
- m_config(config)
+ m_tsr(TSR_BUFFER_EMPTY)
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void mc68901_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const mc68901_interface *intf = reinterpret_cast<const mc68901_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<mc68901_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+// memset(&in_pa_cb, 0, sizeof(in_pa_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void mc68901_device::device_start()
{
/* resolve callbacks */
- devcb_resolve_read8(&m_in_gpio_func, &m_config.in_gpio_func, this);
- devcb_resolve_write8(&m_out_gpio_func, &m_config.out_gpio_func, this);
- devcb_resolve_read_line(&m_in_si_func, &m_config.in_si_func, this);
- devcb_resolve_write_line(&m_out_so_func, &m_config.out_so_func, this);
- devcb_resolve_write_line(&m_out_tao_func, &m_config.out_tao_func, this);
- devcb_resolve_write_line(&m_out_tbo_func, &m_config.out_tbo_func, this);
- devcb_resolve_write_line(&m_out_tco_func, &m_config.out_tco_func, this);
- devcb_resolve_write_line(&m_out_tdo_func, &m_config.out_tdo_func, this);
- devcb_resolve_write_line(&m_out_irq_func, &m_config.out_irq_func, this);
-
- /* set initial values */
- m_timer_clock = m_config.timer_clock;
+ devcb_resolve_read8(&m_in_gpio_func, &m_in_gpio_cb, this);
+ devcb_resolve_write8(&m_out_gpio_func, &m_out_gpio_cb, this);
+ devcb_resolve_read_line(&m_in_si_func, &m_in_si_cb, this);
+ devcb_resolve_write_line(&m_out_so_func, &m_out_so_cb, this);
+ devcb_resolve_write_line(&m_out_tao_func, &m_out_tao_cb, this);
+ devcb_resolve_write_line(&m_out_tbo_func, &m_out_tbo_cb, this);
+ devcb_resolve_write_line(&m_out_tco_func, &m_out_tco_cb, this);
+ devcb_resolve_write_line(&m_out_tdo_func, &m_out_tdo_cb, this);
+ devcb_resolve_write_line(&m_out_irq_func, &m_out_irq_cb, this);
/* create the timers */
m_timer[TIMER_A] = timer_alloc(TIMER_A);
@@ -806,16 +788,16 @@ void mc68901_device::device_start()
m_timer[TIMER_C] = timer_alloc(TIMER_C);
m_timer[TIMER_D] = timer_alloc(TIMER_D);
- if (m_config.rx_clock > 0)
+ if (m_rx_clock > 0)
{
m_rx_timer = timer_alloc(TIMER_RX);
- m_rx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.rx_clock));
+ m_rx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_rx_clock));
}
- if (m_config.tx_clock > 0)
+ if (m_tx_clock > 0)
{
m_tx_timer = timer_alloc(TIMER_TX);
- m_tx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.tx_clock));
+ m_tx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_tx_clock));
}
/* register for state saving */
diff --git a/src/emu/machine/mc68901.h b/src/emu/machine/mc68901.h
index 7990d31f9d3..5bfaf4cb2e7 100644
--- a/src/emu/machine/mc68901.h
+++ b/src/emu/machine/mc68901.h
@@ -71,60 +71,37 @@
struct mc68901_interface
{
- int timer_clock; /* timer clock */
- int rx_clock; /* serial receive clock */
- int tx_clock; /* serial transmit clock */
+ int m_timer_clock; /* timer clock */
+ int m_rx_clock; /* serial receive clock */
+ int m_tx_clock; /* serial transmit clock */
- devcb_write_line out_irq_func;
+ devcb_write_line m_out_irq_cb;
- devcb_read8 in_gpio_func;
- devcb_write8 out_gpio_func;
+ devcb_read8 m_in_gpio_cb;
+ devcb_write8 m_out_gpio_cb;
- devcb_write_line out_tao_func;
- devcb_write_line out_tbo_func;
- devcb_write_line out_tco_func;
- devcb_write_line out_tdo_func;
+ devcb_write_line m_out_tao_cb;
+ devcb_write_line m_out_tbo_cb;
+ devcb_write_line m_out_tco_cb;
+ devcb_write_line m_out_tdo_cb;
- devcb_read_line in_si_func;
- devcb_write_line out_so_func;
- devcb_write_line out_rr_func;
- devcb_write_line out_tr_func;
-};
-
-
-
-// ======================> mc68901_device_config
-
-class mc68901_device_config : public device_config,
- public mc68901_interface
-{
- friend class mc68901_device;
-
- // construction/destruction
- mc68901_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read_line m_in_si_cb;
+ devcb_write_line m_out_so_cb;
+ devcb_write_line m_out_rr_cb;
+ devcb_write_line m_out_tr_cb;
};
// ======================> mc68901_device
-class mc68901_device : public device_t
+class mc68901_device : public device_t,
+ public mc68901_interface
{
- friend class mc68901_device_config;
-
+public:
// construction/destruction
- mc68901_device(running_machine &_machine, const mc68901_device_config &_config);
+ mc68901_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -147,6 +124,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -188,7 +166,6 @@ private:
devcb_resolved_write_line m_out_irq_func;
int m_device_type; /* device type */
- int m_timer_clock; /* timer clock */
/* registers */
UINT8 m_gpip; /* general purpose I/O register */
@@ -244,8 +221,6 @@ private:
emu_timer *m_timer[4]; /* counter timers */
emu_timer *m_rx_timer; /* receive timer */
emu_timer *m_tx_timer; /* transmit timer */
-
- const mc68901_device_config &m_config;
};
diff --git a/src/emu/machine/mm74c922.c b/src/emu/machine/mm74c922.c
index a2c6424dd78..1aab9cc43ce 100644
--- a/src/emu/machine/mm74c922.c
+++ b/src/emu/machine/mm74c922.c
@@ -24,54 +24,8 @@
// DEVICE DEFINITIONS
//**************************************************************************
-const device_type MM74C922 = mm74c922_device_config::static_alloc_device_config;
-const device_type MM74C923 = mm74c922_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(mm74c922, "MM74C922")
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void mm74c922_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const mm74c922_interface *intf = reinterpret_cast<const mm74c922_interface *>(static_config());
- if (intf != NULL)
- *static_cast<mm74c922_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_da_func, 0, sizeof(m_out_da_func));
- memset(&m_in_x1_func, 0, sizeof(m_in_x1_func));
- memset(&m_in_x2_func, 0, sizeof(m_in_x2_func));
- memset(&m_in_x3_func, 0, sizeof(m_in_x3_func));
- memset(&m_in_x4_func, 0, sizeof(m_in_x4_func));
- memset(&m_in_x5_func, 0, sizeof(m_in_x5_func));
- }
-}
-
-
-//-------------------------------------------------
-// static_set_config - configuration helper
-//-------------------------------------------------
-
-void mm74c922_device_config::static_set_config(device_config *device, int max_y)
-{
- mm74c922_device_config *mm74c922 = downcast<mm74c922_device_config *>(device);
-
- mm74c922->m_max_y = max_y;
-}
+const device_type MM74C922 = &device_creator<mm74c922_device>;
+const device_type MM74C923 = &device_creator<mm74c922_device>;
@@ -134,7 +88,7 @@ inline void mm74c922_device::detect_keypress()
{
UINT8 data = devcb_call_read8(&m_in_x_func[m_x], 0);
- for (int y = 0; y < m_config.m_max_y; y++)
+ for (int y = 0; y < m_max_y; y++)
{
if (!BIT(data, y))
{
@@ -161,13 +115,50 @@ inline void mm74c922_device::detect_keypress()
// mm74c922_device - constructor
//-------------------------------------------------
-mm74c922_device::mm74c922_device(running_machine &_machine, const mm74c922_device_config &config)
- : device_t(_machine, config),
+mm74c922_device::mm74c922_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MM74C922, "MM74C922", tag, owner, clock),
m_x(0),
m_y(0),
- m_next_da(0),
- m_config(config)
+ m_next_da(0)
+{
+}
+
+
+//-------------------------------------------------
+// static_set_config - configuration helper
+//-------------------------------------------------
+
+void mm74c922_device::static_set_config(device_t &device, int max_y)
{
+ mm74c922_device &mm74c922 = downcast<mm74c922_device &>(device);
+
+ mm74c922.m_max_y = max_y;
+}
+
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void mm74c922_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const mm74c922_interface *intf = reinterpret_cast<const mm74c922_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<mm74c922_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_out_da_cb, 0, sizeof(m_out_da_cb));
+ memset(&m_in_x1_cb, 0, sizeof(m_in_x1_cb));
+ memset(&m_in_x2_cb, 0, sizeof(m_in_x2_cb));
+ memset(&m_in_x3_cb, 0, sizeof(m_in_x3_cb));
+ memset(&m_in_x4_cb, 0, sizeof(m_in_x4_cb));
+ memset(&m_in_x5_cb, 0, sizeof(m_in_x5_cb));
+ }
}
@@ -178,12 +169,12 @@ mm74c922_device::mm74c922_device(running_machine &_machine, const mm74c922_devic
void mm74c922_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_da_func, &m_config.m_out_da_func, this);
- devcb_resolve_read8(&m_in_x_func[0], &m_config.m_in_x1_func, this);
- devcb_resolve_read8(&m_in_x_func[1], &m_config.m_in_x2_func, this);
- devcb_resolve_read8(&m_in_x_func[2], &m_config.m_in_x3_func, this);
- devcb_resolve_read8(&m_in_x_func[3], &m_config.m_in_x4_func, this);
- devcb_resolve_read8(&m_in_x_func[4], &m_config.m_in_x5_func, this);
+ devcb_resolve_write_line(&m_out_da_func, &m_out_da_cb, this);
+ devcb_resolve_read8(&m_in_x_func[0], &m_in_x1_cb, this);
+ devcb_resolve_read8(&m_in_x_func[1], &m_in_x2_cb, this);
+ devcb_resolve_read8(&m_in_x_func[2], &m_in_x3_cb, this);
+ devcb_resolve_read8(&m_in_x_func[3], &m_in_x4_cb, this);
+ devcb_resolve_read8(&m_in_x_func[4], &m_in_x5_cb, this);
// set initial values
change_output_lines();
diff --git a/src/emu/machine/mm74c922.h b/src/emu/machine/mm74c922.h
index 94746d846a3..a51b85b1152 100644
--- a/src/emu/machine/mm74c922.h
+++ b/src/emu/machine/mm74c922.h
@@ -47,13 +47,13 @@
#define MCFG_MM74C922_ADD(_tag, _config) \
MCFG_DEVICE_ADD(_tag, MM74C922, 0) \
MCFG_DEVICE_CONFIG(_config) \
- mm74c922_device_config::static_set_config(device, 4);
+ mm74c922_device::static_set_config(*device, 4);
#define MCFG_MM74C923_ADD(_tag, _config) \
MCFG_DEVICE_ADD(_tag, MM74C923, 0) \
MCFG_DEVICE_CONFIG(_config) \
- mm74c922_device_config::static_set_config(device, 5);
+ mm74c922_device::static_set_config(*device, 5);
#define MM74C922_INTERFACE(name) \
@@ -76,57 +76,33 @@ struct mm74c922_interface
double m_cap_osc;
double m_cap_debounce;
- devcb_write_line m_out_da_func;
+ devcb_write_line m_out_da_cb;
- devcb_read8 m_in_x1_func;
- devcb_read8 m_in_x2_func;
- devcb_read8 m_in_x3_func;
- devcb_read8 m_in_x4_func;
- devcb_read8 m_in_x5_func;
+ devcb_read8 m_in_x1_cb;
+ devcb_read8 m_in_x2_cb;
+ devcb_read8 m_in_x3_cb;
+ devcb_read8 m_in_x4_cb;
+ devcb_read8 m_in_x5_cb;
};
-// ======================> mm74c922_device_config
+// ======================> mm74c922_device
-class mm74c922_device_config : public device_config,
- public mm74c922_interface
+class mm74c922_device : public device_t,
+ public mm74c922_interface
{
- friend class mm74c922_device;
-
- // construction/destruction
- mm74c922_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
+ // construction/destruction
+ mm74c922_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// inline configuration helpers
- static void static_set_config(device_config *device, int max_y);
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-
-private:
- int m_max_y;
-};
+ static void static_set_config(device_t &device, int max_y);
-
-// ======================> mm74c922_device
-
-class mm74c922_device : public device_t
-{
- friend class mm74c922_device_config;
-
- // construction/destruction
- mm74c922_device(running_machine &_machine, const mm74c922_device_config &_config);
-
-public:
UINT8 data_out_r();
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -135,6 +111,8 @@ private:
inline void clock_scan_counters();
inline void detect_keypress();
+ int m_max_y;
+
devcb_resolved_write_line m_out_da_func;
devcb_resolved_read8 m_in_x_func[5];
@@ -149,8 +127,6 @@ private:
// timers
emu_timer *m_scan_timer; // keyboard scan timer
-
- const mm74c922_device_config &m_config;
};
diff --git a/src/emu/machine/mos6529.c b/src/emu/machine/mos6529.c
index 452012584fb..874495bcf6f 100644
--- a/src/emu/machine/mos6529.c
+++ b/src/emu/machine/mos6529.c
@@ -21,20 +21,20 @@
//**************************************************************************
-// GLOBAL VARIABLES
+// LIVE DEVICE
//**************************************************************************
-// devices
-const device_type MOS6529 = mos6529_device_config::static_alloc_device_config;
-
-
+// device type definition
+const device_type MOS6529 = &device_creator<mos6529_device>;
+//-------------------------------------------------
+// mos6529_device - constructor
+//-------------------------------------------------
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(mos6529, "MOS6529")
+mos6529_device::mos6529_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MOS6529, "MOS6529", tag, owner, clock)
+{
+}
//-------------------------------------------------
@@ -43,7 +43,7 @@ GENERIC_DEVICE_CONFIG_SETUP(mos6529, "MOS6529")
// complete
//-------------------------------------------------
-void mos6529_device_config::device_config_complete()
+void mos6529_device::device_config_complete()
{
// inherit a copy of the static data
const mos6529_interface *intf = reinterpret_cast<const mos6529_interface *>(static_config());
@@ -53,28 +53,12 @@ void mos6529_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_in_p_func, 0, sizeof(m_in_p_func));
- memset(&m_out_p_func, 0, sizeof(m_out_p_func));
+ memset(&m_in_p_cb, 0, sizeof(m_in_p_cb));
+ memset(&m_out_p_cb, 0, sizeof(m_out_p_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// mos6529_device - constructor
-//-------------------------------------------------
-
-mos6529_device::mos6529_device(running_machine &_machine, const mos6529_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -82,8 +66,8 @@ mos6529_device::mos6529_device(running_machine &_machine, const mos6529_device_c
void mos6529_device::device_start()
{
// resolve callbacks
- devcb_resolve_read8(&m_in_p_func, &m_config.m_in_p_func, this);
- devcb_resolve_write8(&m_out_p_func, &m_config.m_out_p_func, this);
+ devcb_resolve_read8(&m_in_p_func, &m_in_p_cb, this);
+ devcb_resolve_write8(&m_out_p_func, &m_out_p_cb, this);
}
diff --git a/src/emu/machine/mos6529.h b/src/emu/machine/mos6529.h
index b4545a1eb7f..f9ad7a5ad26 100644
--- a/src/emu/machine/mos6529.h
+++ b/src/emu/machine/mos6529.h
@@ -50,54 +50,31 @@
struct mos6529_interface
{
- devcb_read8 m_in_p_func;
- devcb_write8 m_out_p_func;
-};
-
-
-// ======================> mos6529_device_config
-
-class mos6529_device_config : public device_config,
- public mos6529_interface
-{
- friend class mos6529_device;
-
- // construction/destruction
- mos6529_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_p_cb;
+ devcb_write8 m_out_p_cb;
};
// ======================> mos6529_device
-class mos6529_device : public device_t
+class mos6529_device : public device_t,
+ public mos6529_interface
{
- friend class mos6529_device_config;
-
+public:
// construction/destruction
- mos6529_device(running_machine &_machine, const mos6529_device_config &_config);
+ mos6529_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
private:
devcb_resolved_read8 m_in_p_func;
devcb_resolved_write8 m_out_p_func;
-
- const mos6529_device_config &m_config;
};
diff --git a/src/emu/machine/msm5832.c b/src/emu/machine/msm5832.c
index 9a0af084775..7f8eb374a39 100644
--- a/src/emu/machine/msm5832.c
+++ b/src/emu/machine/msm5832.c
@@ -22,6 +22,9 @@
#include "msm5832.h"
+// device type definition
+const device_type MSM5832 = &device_creator<msm5832_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -56,51 +59,6 @@ static const int DAYS_PER_MONTH[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31,
//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// devices
-const device_type MSM5832 = msm5832_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// msm5832_device_config - constructor
-//-------------------------------------------------
-
-msm5832_device_config::msm5832_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "MSM5832", tag, owner, clock),
- device_config_rtc_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *msm5832_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(msm5832_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *msm5832_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, msm5832_device(machine, *this));
-}
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -214,15 +172,14 @@ inline void msm5832_device::advance_minutes()
// msm5832_device - constructor
//-------------------------------------------------
-msm5832_device::msm5832_device(running_machine &_machine, const msm5832_device_config &config)
- : device_t(_machine, config),
- device_rtc_interface(_machine, config, *this),
+msm5832_device::msm5832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MSM5832, "MSM5832", tag, owner, clock),
+ device_rtc_interface(mconfig, *this),
m_hold(0),
m_address(0),
m_read(0),
m_write(0),
- m_cs(0),
- m_config(config)
+ m_cs(0)
{
for (int i = 0; i < 13; i++)
m_reg[i] = 0;
diff --git a/src/emu/machine/msm5832.h b/src/emu/machine/msm5832.h
index 9a220af11cc..a93c2589ffc 100644
--- a/src/emu/machine/msm5832.h
+++ b/src/emu/machine/msm5832.h
@@ -41,35 +41,15 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> msm5832_device_config
-
-class msm5832_device_config : public device_config,
- public device_config_rtc_interface
-{
- friend class msm5832_device;
-
- // construction/destruction
- msm5832_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
-
-
// ======================> msm5832_device
class msm5832_device : public device_t,
public device_rtc_interface
{
- friend class msm5832_device_config;
-
+public:
// construction/destruction
- msm5832_device(running_machine &_machine, const msm5832_device_config &_config);
+ msm5832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( data_r );
DECLARE_WRITE8_MEMBER( data_w );
@@ -111,8 +91,6 @@ private:
// timers
emu_timer *m_clock_timer;
-
- const msm5832_device_config &m_config;
};
diff --git a/src/emu/machine/msm58321.c b/src/emu/machine/msm58321.c
index 28f324c1002..22866d345d5 100644
--- a/src/emu/machine/msm58321.c
+++ b/src/emu/machine/msm58321.c
@@ -23,6 +23,9 @@
#include "msm58321.h"
+// device type definition
+const device_type MSM58321 = &device_creator<msm58321_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -59,72 +62,6 @@ static const int DAYS_PER_MONTH[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31,
//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// devices
-const device_type MSM58321 = msm58321_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// msm58321_device_config - constructor
-//-------------------------------------------------
-
-msm58321_device_config::msm58321_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "MSM58321", tag, owner, clock),
- device_config_rtc_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *msm58321_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(msm58321_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *msm58321_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, msm58321_device(machine, *this));
-}
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void msm58321_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const msm58321_interface *intf = reinterpret_cast<const msm58321_interface *>(static_config());
- if (intf != NULL)
- *static_cast<msm58321_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_busy_func, 0, sizeof(m_out_busy_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -238,10 +175,9 @@ inline void msm58321_device::advance_minutes()
// msm58321_device - constructor
//-------------------------------------------------
-msm58321_device::msm58321_device(running_machine &_machine, const msm58321_device_config &config)
- : device_t(_machine, config),
- device_rtc_interface(_machine, config, *this),
- m_config(config)
+msm58321_device::msm58321_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MSM58321, "MSM58321", tag, owner, clock),
+ device_rtc_interface(mconfig, *this)
{
for (int i = 0; i < 13; i++)
m_reg[i] = 0;
@@ -249,13 +185,34 @@ msm58321_device::msm58321_device(running_machine &_machine, const msm58321_devic
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void msm58321_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const msm58321_interface *intf = reinterpret_cast<const msm58321_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<msm58321_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_out_busy_cb, 0, sizeof(m_out_busy_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void msm58321_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_busy_func, &m_config.m_out_busy_func, this);
+ devcb_resolve_write_line(&m_out_busy_func, &m_out_busy_cb, this);
// allocate timers
m_clock_timer = timer_alloc(TIMER_CLOCK);
diff --git a/src/emu/machine/msm58321.h b/src/emu/machine/msm58321.h
index dce7eedc7e5..a2e55f00ea7 100644
--- a/src/emu/machine/msm58321.h
+++ b/src/emu/machine/msm58321.h
@@ -48,30 +48,7 @@
struct msm58321_interface
{
- devcb_write_line m_out_busy_func;
-};
-
-
-
-// ======================> msm58321_device_config
-
-class msm58321_device_config : public device_config,
- public msm58321_interface,
- public device_config_rtc_interface
-{
- friend class msm58321_device;
-
- // construction/destruction
- msm58321_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line m_out_busy_cb;
};
@@ -79,14 +56,13 @@ protected:
// ======================> msm58321_device
class msm58321_device : public device_t,
- public device_rtc_interface
+ public device_rtc_interface,
+ public msm58321_interface
{
- friend class msm58321_device_config;
-
+public:
// construction/destruction
- msm58321_device(running_machine &_machine, const msm58321_device_config &_config);
+ msm58321_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -101,6 +77,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -133,8 +110,6 @@ private:
// timers
emu_timer *m_clock_timer;
emu_timer *m_busy_timer;
-
- const msm58321_device_config &m_config;
};
diff --git a/src/emu/machine/nmc9306.c b/src/emu/machine/nmc9306.c
index 7fef8bd7eaa..627f282bd93 100644
--- a/src/emu/machine/nmc9306.c
+++ b/src/emu/machine/nmc9306.c
@@ -54,54 +54,12 @@ enum
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type NMC9306 = nmc9306_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// nmc9306_device_config - constructor
-//-------------------------------------------------
-
-nmc9306_device_config::nmc9306_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "NMC9306", tag, owner, clock),
- device_config_nvram_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *nmc9306_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(nmc9306_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *nmc9306_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, nmc9306_device(machine, *this));
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
+// device type definition
+const device_type NMC9306 = &device_creator<nmc9306_device>;
+
//-------------------------------------------------
// nmc9306_device - constructor
//-------------------------------------------------
@@ -147,12 +105,11 @@ inline void nmc9306_device::erase(offs_t offset)
// nmc9306_device - constructor
//-------------------------------------------------
-nmc9306_device::nmc9306_device(running_machine &_machine, const nmc9306_device_config &config)
- : device_t(_machine, config),
- device_nvram_interface(_machine, config, *this),
+nmc9306_device::nmc9306_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, NMC9306, "NMC9306", tag, owner, clock),
+ device_nvram_interface(mconfig, *this),
m_state(STATE_IDLE),
- m_ewen(false),
- m_config(config)
+ m_ewen(false)
{
}
diff --git a/src/emu/machine/nmc9306.h b/src/emu/machine/nmc9306.h
index 366738b9a5e..6658775d56e 100644
--- a/src/emu/machine/nmc9306.h
+++ b/src/emu/machine/nmc9306.h
@@ -44,36 +44,15 @@
//**************************************************************************
-// ======================> nmc9306_device_config
-
-class nmc9306_device_config : public device_config,
- public device_config_nvram_interface
-{
- friend class nmc9306_device;
-
- // construction/destruction
- nmc9306_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
-};
-
-
// ======================> nmc9306_device
class nmc9306_device : public device_t,
public device_nvram_interface
{
- friend class nmc9306_device_config;
-
+public:
// construction/destruction
- nmc9306_device(running_machine &_machine, const nmc9306_device_config &_config);
+ nmc9306_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_WRITE_LINE_MEMBER( cs_w );
DECLARE_WRITE_LINE_MEMBER( sk_w );
DECLARE_WRITE_LINE_MEMBER( di_w );
@@ -105,8 +84,6 @@ private:
int m_sk;
int m_do;
int m_di;
-
- const nmc9306_device_config &m_config;
};
@@ -114,5 +91,4 @@ private:
extern const device_type NMC9306;
-
#endif
diff --git a/src/emu/machine/nvram.c b/src/emu/machine/nvram.c
index 7671f316fb7..76f088e4ea4 100644
--- a/src/emu/machine/nvram.c
+++ b/src/emu/machine/nvram.c
@@ -43,47 +43,23 @@
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type NVRAM = nvram_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// nvram_device_config - constructor
-//-------------------------------------------------
-
-nvram_device_config::nvram_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "NVRAM", tag, owner, clock),
- device_config_nvram_interface(mconfig, *this),
- m_default_value(DEFAULT_ALL_1)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *nvram_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(nvram_device_config(mconfig, tag, owner, clock));
-}
-
+// device type definition
+const device_type NVRAM = &device_creator<nvram_device>;
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// nvram_device - constructor
//-------------------------------------------------
-device_t *nvram_device_config::alloc_device(running_machine &machine) const
+nvram_device::nvram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, NVRAM, "NVRAM", tag, owner, clock),
+ device_nvram_interface(mconfig, *this),
+ m_default_value(DEFAULT_ALL_1),
+ m_base(NULL),
+ m_length(0)
{
- return auto_alloc(machine, nvram_device(machine, *this));
}
@@ -92,10 +68,10 @@ device_t *nvram_device_config::alloc_device(running_machine &machine) const
// to set the interface
//-------------------------------------------------
-void nvram_device_config::static_set_default_value(device_config *device, default_value value)
+void nvram_device::static_set_default_value(device_t &device, default_value value)
{
- nvram_device_config *nvram = downcast<nvram_device_config *>(device);
- nvram->m_default_value = value;
+ nvram_device &nvram = downcast<nvram_device &>(device);
+ nvram.m_default_value = value;
}
@@ -104,30 +80,11 @@ void nvram_device_config::static_set_default_value(device_config *device, defaul
// helper to set a custom callback
//-------------------------------------------------
-void nvram_device_config::static_set_custom_handler(device_config *device, nvram_init_delegate handler)
-{
- nvram_device_config *nvram = downcast<nvram_device_config *>(device);
- nvram->m_default_value = DEFAULT_CUSTOM;
- nvram->m_custom_handler = handler;
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// nvram_device - constructor
-//-------------------------------------------------
-
-nvram_device::nvram_device(running_machine &_machine, const nvram_device_config &config)
- : device_t(_machine, config),
- device_nvram_interface(_machine, config, *this),
- m_config(config),
- m_base(NULL),
- m_length(0)
+void nvram_device::static_set_custom_handler(device_t &device, nvram_init_delegate handler)
{
+ nvram_device &nvram = downcast<nvram_device &>(device);
+ nvram.m_default_value = DEFAULT_CUSTOM;
+ nvram.m_custom_handler = handler;
}
@@ -138,8 +95,8 @@ nvram_device::nvram_device(running_machine &_machine, const nvram_device_config
void nvram_device::device_start()
{
// bind our handler
- if (!m_config.m_custom_handler.isnull())
- m_custom_handler = nvram_init_delegate(m_config.m_custom_handler, m_owner);
+ if (!m_custom_handler.isnull())
+ m_custom_handler = nvram_init_delegate(m_custom_handler, m_owner);
}
@@ -161,21 +118,21 @@ void nvram_device::nvram_default()
}
// default values for other cases
- switch (m_config.m_default_value)
+ switch (m_default_value)
{
// all-0's
- case nvram_device_config::DEFAULT_ALL_0:
+ case DEFAULT_ALL_0:
memset(m_base, 0, m_length);
break;
// all 1's
default:
- case nvram_device_config::DEFAULT_ALL_1:
+ case DEFAULT_ALL_1:
memset(m_base, 0xff, m_length);
break;
// random values
- case nvram_device_config::DEFAULT_RANDOM:
+ case DEFAULT_RANDOM:
{
UINT8 *nvram = reinterpret_cast<UINT8 *>(m_base);
for (int index = 0; index < m_length; index++)
@@ -184,12 +141,12 @@ void nvram_device::nvram_default()
}
// custom handler
- case nvram_device_config::DEFAULT_CUSTOM:
+ case DEFAULT_CUSTOM:
m_custom_handler(*this, m_base, m_length);
break;
// none - do nothing
- case nvram_device_config::DEFAULT_NONE:
+ case DEFAULT_NONE:
break;
}
}
diff --git a/src/emu/machine/nvram.h b/src/emu/machine/nvram.h
index 736a6bbac19..06906161ecc 100644
--- a/src/emu/machine/nvram.h
+++ b/src/emu/machine/nvram.h
@@ -50,40 +50,40 @@
#define MCFG_NVRAM_ADD_0FILL(_tag) \
MCFG_DEVICE_ADD(_tag, NVRAM, 0) \
- nvram_device_config::static_set_default_value(device, nvram_device_config::DEFAULT_ALL_0); \
+ nvram_device::static_set_default_value(*device, nvram_device::DEFAULT_ALL_0); \
#define MCFG_NVRAM_ADD_1FILL(_tag) \
MCFG_DEVICE_ADD(_tag, NVRAM, 0) \
- nvram_device_config::static_set_default_value(device, nvram_device_config::DEFAULT_ALL_1); \
+ nvram_device::static_set_default_value(*device, nvram_device::DEFAULT_ALL_1); \
#define MCFG_NVRAM_ADD_RANDOM_FILL(_tag) \
MCFG_DEVICE_ADD(_tag, NVRAM, 0) \
- nvram_device_config::static_set_default_value(device, nvram_device_config::DEFAULT_RANDOM); \
+ nvram_device::static_set_default_value(*device, nvram_device::DEFAULT_RANDOM); \
#define MCFG_NVRAM_ADD_NO_FILL(_tag) \
MCFG_DEVICE_ADD(_tag, NVRAM, 0) \
- nvram_device_config::static_set_default_value(device, nvram_device_config::DEFAULT_NONE); \
+ nvram_device::static_set_default_value(*device, nvram_device::DEFAULT_NONE); \
#define MCFG_NVRAM_ADD_CUSTOM(_tag, _class, _method) \
MCFG_DEVICE_ADD(_tag, NVRAM, 0) \
- nvram_device_config::static_set_custom_handler(device, nvram_init_delegate(&_class::_method, #_class "::" #_method, (_class *)0)); \
+ nvram_device::static_set_custom_handler(*device, nvram_init_delegate(&_class::_method, #_class "::" #_method, (_class *)0)); \
#define MCFG_NVRAM_REPLACE_0FILL(_tag) \
MCFG_DEVICE_REPLACE(_tag, NVRAM, 0) \
- nvram_device_config::static_set_default_value(device, nvram_device_config::DEFAULT_ALL_0); \
+ nvram_device::static_set_default_value(*device, nvram_device::DEFAULT_ALL_0); \
#define MCFG_NVRAM_REPLACE_1FILL(_tag) \
MCFG_DEVICE_REPLACE(_tag, NVRAM, 0) \
- nvram_device_config::static_set_default_value(device, nvram_device_config::DEFAULT_ALL_1); \
+ nvram_device::static_set_default_value(*device, nvram_device::DEFAULT_ALL_1); \
#define MCFG_NVRAM_REPLACE_RANDOM_FILL(_tag) \
MCFG_DEVICE_REPLACE(_tag, NVRAM, 0) \
- nvram_device_config::static_set_default_value(device, nvram_device_config::DEFAULT_RANDOM); \
+ nvram_device::static_set_default_value(*device, nvram_device::DEFAULT_RANDOM); \
#define MCFG_NVRAM_REPLACE_CUSTOM(_tag, _class, _method) \
MCFG_DEVICE_REPLACE(_tag, NVRAM, 0) \
- nvram_device_config::static_set_custom_handler(device, nvram_init_delegate(&_class::_method, #_class "::" #_method, (_class *)0)); \
+ nvram_device::static_set_custom_handler(*device, nvram_init_delegate(&_class::_method, #_class "::" #_method, (_class *)0)); \
@@ -98,16 +98,11 @@ class nvram_device;
typedef delegate<void (nvram_device &, void *, size_t)> nvram_init_delegate;
-// ======================> nvram_device_config
+// ======================> nvram_device
-class nvram_device_config : public device_config,
- public device_config_nvram_interface
+class nvram_device : public device_t,
+ public device_nvram_interface
{
- friend class nvram_device;
-
- // construction/destruction
- nvram_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
public:
// values
enum default_value
@@ -119,32 +114,13 @@ public:
DEFAULT_NONE
};
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
+ // construction/destruction
+ nvram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// inline configuration helpers
- static void static_set_default_value(device_config *device, default_value value);
- static void static_set_custom_handler(device_config *device, nvram_init_delegate callback);
-
-protected:
- // internal state
- default_value m_default_value;
- nvram_init_delegate m_custom_handler;
-};
-
+ static void static_set_default_value(device_t &device, default_value value);
+ static void static_set_custom_handler(device_t &device, nvram_init_delegate callback);
-// ======================> nvram_device
-
-class nvram_device : public device_t,
- public device_nvram_interface
-{
- friend class nvram_device_config;
-
- // construction/destruction
- nvram_device(running_machine &_machine, const nvram_device_config &config);
-
-public:
// controls
void set_base(void *base, size_t length) { m_base = base; m_length = length; }
@@ -160,11 +136,13 @@ protected:
// internal helpers
void determine_final_base();
- // internal state
- const nvram_device_config & m_config;
+ // configuration state
+ default_value m_default_value;
+ nvram_init_delegate m_custom_handler;
+
+ // runtime state
void * m_base;
size_t m_length;
- nvram_init_delegate m_custom_handler;
};
diff --git a/src/emu/machine/pci.c b/src/emu/machine/pci.c
index 650c87fb789..8d1e09cc67e 100644
--- a/src/emu/machine/pci.c
+++ b/src/emu/machine/pci.c
@@ -234,7 +234,7 @@ int pci_add_sibling( running_machine &machine, char *pcitag, char *sibling )
return 0;
if (pcibus1->siblings_count == 8)
return 0;
- config2 = (pci_bus_config *)downcast<const legacy_device_config_base &>(device2->baseconfig()).inline_config();
+ config2 = (pci_bus_config *)downcast<const legacy_device_base *>(device2)->inline_config();
pcibus1->siblings[pcibus1->siblings_count] = get_safe_token(device2);
pcibus1->siblings_busnum[pcibus1->siblings_count] = config2->busnum;
pcibus1->siblings_count++;
@@ -269,11 +269,11 @@ static DEVICE_START( pci_bus )
/* validate some basic stuff */
assert(device != NULL);
- assert(device->baseconfig().static_config() == NULL);
- assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
+ assert(device->static_config() == NULL);
+ assert(downcast<const legacy_device_base *>(device)->inline_config() != NULL);
/* store a pointer back to the device */
- pcibus->config = (const pci_bus_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ pcibus->config = (const pci_bus_config *)downcast<const legacy_device_base *>(device)->inline_config();
pcibus->busdevice = device;
pcibus->devicenum = -1;
diff --git a/src/emu/machine/pci.h b/src/emu/machine/pci.h
index c61fcb709ba..5a2dcb64e6e 100644
--- a/src/emu/machine/pci.h
+++ b/src/emu/machine/pci.h
@@ -71,5 +71,3 @@ int pci_add_sibling( running_machine &machine, char *pcitag, char *sibling );
DECLARE_LEGACY_DEVICE(PCI_BUS, pci_bus);
#endif /* PCI_H */
-
-
diff --git a/src/emu/machine/pic8259.c b/src/emu/machine/pic8259.c
index a7972c7e00c..8e9af6ed2dc 100644
--- a/src/emu/machine/pic8259.c
+++ b/src/emu/machine/pic8259.c
@@ -413,7 +413,7 @@ WRITE8_DEVICE_HANDLER( pic8259_w )
static DEVICE_START( pic8259 )
{
pic8259_t *pic8259 = get_safe_token(device);
- const struct pic8259_interface *intf = (const struct pic8259_interface *)device->baseconfig().static_config();
+ const struct pic8259_interface *intf = (const struct pic8259_interface *)device->static_config();
assert(intf != NULL);
diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c
index 1781aae3a44..bd760971d17 100644
--- a/src/emu/machine/pit8253.c
+++ b/src/emu/machine/pit8253.c
@@ -1071,7 +1071,7 @@ static void common_start( device_t *device, int device_type ) {
pit8253_t *pit8253 = get_safe_token(device);
int timerno;
- pit8253->config = (const struct pit8253_config *)device->baseconfig().static_config();
+ pit8253->config = (const struct pit8253_config *)device->static_config();
pit8253->device_type = device_type;
/* register for state saving */
diff --git a/src/emu/machine/ram.c b/src/emu/machine/ram.c
index dee4fa83c4e..7e7aa69196c 100644
--- a/src/emu/machine/ram.c
+++ b/src/emu/machine/ram.c
@@ -95,7 +95,7 @@ UINT32 ram_parse_string(const char *s)
static DEVICE_START( ram )
{
ram_state *ram = get_safe_token(device);
- ram_config *config = (ram_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ ram_config *config = (ram_config *)downcast<const legacy_device_base *>(device)->inline_config();
/* the device named 'ram' can get ram options from command line */
if (strcmp(device->tag(), RAM_TAG) == 0)
@@ -123,7 +123,7 @@ static DEVICE_START( ram )
static DEVICE_VALIDITY_CHECK( ram )
{
- ram_config *config = (ram_config *)downcast<const legacy_device_config_base *>(device)->inline_config();
+ ram_config *config = (ram_config *)downcast<const legacy_device_base *>(device)->inline_config();
const char *ramsize_string = NULL;
int is_valid = FALSE;
UINT32 specified_ram = 0;
diff --git a/src/emu/machine/rp5c01.c b/src/emu/machine/rp5c01.c
index ff1f047dc5e..6ac11223606 100644
--- a/src/emu/machine/rp5c01.c
+++ b/src/emu/machine/rp5c01.c
@@ -20,6 +20,9 @@
#include "rp5c01.h"
+// device type definition
+const device_type RP5C01 = &device_creator<rp5c01_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -97,74 +100,6 @@ enum
//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// devices
-const device_type RP5C01 = rp5c01_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// rp5c01_device_config - constructor
-//-------------------------------------------------
-
-rp5c01_device_config::rp5c01_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "RP5C01", tag, owner, clock),
- device_config_rtc_interface(mconfig, *this),
- device_config_nvram_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *rp5c01_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(rp5c01_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *rp5c01_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, rp5c01_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void rp5c01_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const rp5c01_interface *intf = reinterpret_cast<const rp5c01_interface *>(static_config());
- if (intf != NULL)
- *static_cast<rp5c01_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_alarm_func, 0, sizeof(m_out_alarm_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -342,27 +277,47 @@ inline void rp5c01_device::check_alarm()
// rp5c01_device - constructor
//-------------------------------------------------
-rp5c01_device::rp5c01_device(running_machine &_machine, const rp5c01_device_config &config)
- : device_t(_machine, config),
- device_rtc_interface(_machine, config, *this),
- device_nvram_interface(_machine, config, *this),
+rp5c01_device::rp5c01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, RP5C01, "RP5C01", tag, owner, clock),
+ device_rtc_interface(mconfig, *this),
+ device_nvram_interface(mconfig, *this),
m_alarm(1),
m_alarm_on(1),
m_1hz(1),
- m_16hz(1),
- m_config(config)
+ m_16hz(1)
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void rp5c01_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const rp5c01_interface *intf = reinterpret_cast<const rp5c01_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<rp5c01_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_out_alarm_cb, 0, sizeof(m_out_alarm_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void rp5c01_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_alarm_func, &m_config.m_out_alarm_func, this);
+ devcb_resolve_write_line(&m_out_alarm_func, &m_out_alarm_cb, this);
// allocate timers
m_clock_timer = timer_alloc(TIMER_CLOCK);
diff --git a/src/emu/machine/rp5c01.h b/src/emu/machine/rp5c01.h
index c5ef20c8050..c91a35c45b4 100644
--- a/src/emu/machine/rp5c01.h
+++ b/src/emu/machine/rp5c01.h
@@ -50,31 +50,7 @@
struct rp5c01_interface
{
- devcb_write_line m_out_alarm_func;
-};
-
-
-
-// ======================> rp5c01_device_config
-
-class rp5c01_device_config : public device_config,
- public rp5c01_interface,
- public device_config_rtc_interface,
- public device_config_nvram_interface
-{
- friend class rp5c01_device;
-
- // construction/destruction
- rp5c01_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line m_out_alarm_cb;
};
@@ -83,20 +59,20 @@ protected:
class rp5c01_device : public device_t,
public device_rtc_interface,
- public device_nvram_interface
+ public device_nvram_interface,
+ public rp5c01_interface
{
- friend class rp5c01_device_config;
-
+public:
// construction/destruction
- rp5c01_device(running_machine &_machine, const rp5c01_device_config &_config);
+ rp5c01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
DECLARE_WRITE_LINE_MEMBER( adj_w );
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -136,8 +112,6 @@ private:
// timers
emu_timer *m_clock_timer;
emu_timer *m_16hz_timer;
-
- const rp5c01_device_config &m_config;
};
diff --git a/src/emu/machine/rp5c15.c b/src/emu/machine/rp5c15.c
index 3da17c9c6be..714a7149da0 100644
--- a/src/emu/machine/rp5c15.c
+++ b/src/emu/machine/rp5c15.c
@@ -110,66 +110,7 @@ enum
//**************************************************************************
// devices
-const device_type RP5C15 = rp5c15_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// rp5c15_device_config - constructor
-//-------------------------------------------------
-
-rp5c15_device_config::rp5c15_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "RP5C15", tag, owner, clock),
- device_config_rtc_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *rp5c15_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(rp5c15_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *rp5c15_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, rp5c15_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void rp5c15_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const rp5c15_interface *intf = reinterpret_cast<const rp5c15_interface *>(static_config());
- if (intf != NULL)
- *static_cast<rp5c15_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_alarm_func, 0, sizeof(m_out_alarm_func));
- memset(&m_out_clkout_func, 0, sizeof(m_out_clkout_func));
- }
-}
+const device_type RP5C15 = &device_creator<rp5c15_device>;
@@ -351,28 +292,49 @@ inline void rp5c15_device::check_alarm()
// rp5c15_device - constructor
//-------------------------------------------------
-rp5c15_device::rp5c15_device(running_machine &_machine, const rp5c15_device_config &config)
- : device_t(_machine, config),
- device_rtc_interface(_machine, config, *this),
+rp5c15_device::rp5c15_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, RP5C15, "RP5C15", tag, owner, clock),
+ device_rtc_interface(mconfig, *this),
m_alarm(1),
m_alarm_on(1),
m_1hz(1),
m_16hz(1),
- m_clkout(1),
- m_config(config)
+ m_clkout(1)
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void rp5c15_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const rp5c15_interface *intf = reinterpret_cast<const rp5c15_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<rp5c15_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_out_alarm_cb, 0, sizeof(m_out_alarm_cb));
+ memset(&m_out_clkout_cb, 0, sizeof(m_out_clkout_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void rp5c15_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_alarm_func, &m_config.m_out_alarm_func, this);
- devcb_resolve_write_line(&m_out_clkout_func, &m_config.m_out_clkout_func, this);
+ devcb_resolve_write_line(&m_out_alarm_func, &m_out_alarm_cb, this);
+ devcb_resolve_write_line(&m_out_clkout_func, &m_out_clkout_cb, this);
// allocate timers
m_clock_timer = timer_alloc(TIMER_CLOCK);
diff --git a/src/emu/machine/rp5c15.h b/src/emu/machine/rp5c15.h
index 0deebc55401..9a2191d6316 100644
--- a/src/emu/machine/rp5c15.h
+++ b/src/emu/machine/rp5c15.h
@@ -50,31 +50,8 @@
struct rp5c15_interface
{
- devcb_write_line m_out_alarm_func;
- devcb_write_line m_out_clkout_func;
-};
-
-
-
-// ======================> rp5c15_device_config
-
-class rp5c15_device_config : public device_config,
- public rp5c15_interface,
- public device_config_rtc_interface
-{
- friend class rp5c15_device;
-
- // construction/destruction
- rp5c15_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line m_out_alarm_cb;
+ devcb_write_line m_out_clkout_cb;
};
@@ -82,20 +59,20 @@ protected:
// ======================> rp5c15_device
class rp5c15_device : public device_t,
- public device_rtc_interface
+ public device_rtc_interface,
+ public rp5c15_interface
{
- friend class rp5c15_device_config;
-
+public:
// construction/destruction
- rp5c15_device(running_machine &_machine, const rp5c15_device_config &_config);
+ rp5c15_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
DECLARE_WRITE_LINE_MEMBER( adj_w );
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -134,8 +111,6 @@ private:
emu_timer *m_clock_timer;
emu_timer *m_16hz_timer;
emu_timer *m_clkout_timer;
-
- const rp5c15_device_config &m_config;
};
diff --git a/src/emu/machine/rp5h01.c b/src/emu/machine/rp5h01.c
index 51b024e8664..115b040d812 100644
--- a/src/emu/machine/rp5h01.c
+++ b/src/emu/machine/rp5h01.c
@@ -173,7 +173,7 @@ static DEVICE_START( rp5h01 )
{
rp5h01_state *rp5h01 = get_safe_token(device);
- assert(device->baseconfig().static_config() == NULL);
+ assert(device->static_config() == NULL);
rp5h01->data = *device->region();
diff --git a/src/emu/machine/rtc65271.c b/src/emu/machine/rtc65271.c
index 502826c90e9..5208579ea65 100644
--- a/src/emu/machine/rtc65271.c
+++ b/src/emu/machine/rtc65271.c
@@ -685,7 +685,7 @@ static TIMER_CALLBACK( rtc_end_update_callback )
static DEVICE_START( rtc65271 )
{
- rtc65271_config *config = (rtc65271_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ rtc65271_config *config = (rtc65271_config *)downcast<const legacy_device_base *>(device)->inline_config();
rtc65271_state *state = get_safe_token(device);
state->update_timer = device->machine().scheduler().timer_alloc(FUNC(rtc_begin_update_callback), (void *)device);
diff --git a/src/emu/machine/s3c24xx.c b/src/emu/machine/s3c24xx.c
index fcd4ac80a95..77218904352 100644
--- a/src/emu/machine/s3c24xx.c
+++ b/src/emu/machine/s3c24xx.c
@@ -3167,7 +3167,7 @@ static DEVICE_RESET( s3c24xx )
static DEVICE_START( s3c24xx )
{
s3c24xx_t *s3c24xx = get_token( device);
- s3c24xx->iface = (const s3c24xx_interface *)device->baseconfig().static_config();
+ s3c24xx->iface = (const s3c24xx_interface *)device->static_config();
for (int i = 0; i < 5; i++) s3c24xx->pwm.timer[i] = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_pwm_timer_exp), (void*)device);
for (int i = 0; i < 4; i++) s3c24xx->dma[i].timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_dma_timer_exp), (void*)device);
s3c24xx->iic.timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_iic_timer_exp), (void*)device);
diff --git a/src/emu/machine/secflash.c b/src/emu/machine/secflash.c
index ee2b1c56bad..ffa07f15634 100644
--- a/src/emu/machine/secflash.c
+++ b/src/emu/machine/secflash.c
@@ -1,17 +1,12 @@
#include "emu.h"
#include "machine/secflash.h"
-device_secure_serial_flash_config::device_secure_serial_flash_config(const machine_config &mconfig,
+device_secure_serial_flash::device_secure_serial_flash(const machine_config &mconfig,
device_type type,
const char *name, const char *tag,
- const device_config *owner, UINT32 clock, UINT32 param)
- : device_config(mconfig, type, name, tag, owner, clock, param),
- device_config_nvram_interface(mconfig, *this)
-{
-}
-
-device_secure_serial_flash::device_secure_serial_flash(running_machine &_machine, const device_secure_serial_flash_config &config) : device_t(_machine, config),
- device_nvram_interface(_machine, config, *this)
+ device_t *owner, UINT32 clock) :
+ device_t(mconfig, type, name, tag, owner, clock),
+ device_nvram_interface(mconfig, *this)
{
}
diff --git a/src/emu/machine/secflash.h b/src/emu/machine/secflash.h
index c2291435349..907238a2bd1 100644
--- a/src/emu/machine/secflash.h
+++ b/src/emu/machine/secflash.h
@@ -5,13 +5,6 @@
#include "emu.h"
-class device_secure_serial_flash_config : public device_config,
- public device_config_nvram_interface
-{
-public:
- device_secure_serial_flash_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock, UINT32 param = 0);
-};
-
class device_secure_serial_flash : public device_t,
public device_nvram_interface
{
@@ -34,7 +27,7 @@ protected:
virtual void sda_0() = 0;
virtual void sda_1() = 0;
- device_secure_serial_flash(running_machine &_machine, const device_secure_serial_flash_config &config);
+ device_secure_serial_flash(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
virtual void device_start();
virtual void device_reset();
};
diff --git a/src/emu/machine/smc91c9x.c b/src/emu/machine/smc91c9x.c
index 94c9afd9c27..194654ce0fa 100644
--- a/src/emu/machine/smc91c9x.c
+++ b/src/emu/machine/smc91c9x.c
@@ -509,13 +509,13 @@ WRITE16_DEVICE_HANDLER( smc91c9x_w )
static DEVICE_START( smc91c9x )
{
- const smc91c9x_config *config = (const smc91c9x_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ const smc91c9x_config *config = (const smc91c9x_config *)downcast<const legacy_device_base *>(device)->inline_config();
smc91c9x_state *smc = get_safe_token(device);
/* validate some basic stuff */
assert(device != NULL);
- assert(device->baseconfig().static_config() == NULL);
- assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
+ assert(device->static_config() == NULL);
+ assert(downcast<const legacy_device_base *>(device)->inline_config() != NULL);
/* store a pointer back to the device */
smc->device = device;
diff --git a/src/emu/machine/timekpr.c b/src/emu/machine/timekpr.c
index 998c9bcc2c6..eb7c9737d62 100644
--- a/src/emu/machine/timekpr.c
+++ b/src/emu/machine/timekpr.c
@@ -15,6 +15,14 @@
#include "machine/timekpr.h"
+// device type definition
+const device_type M48T02 = &device_creator<m48t02_device>;
+const device_type M48T35 = &device_creator<m48t35_device>;
+const device_type M48T37 = &device_creator<m48t37_device>;
+const device_type M48T58 = &device_creator<m48t58_device>;
+const device_type MK48T08 = &device_creator<mk48t08_device>;
+
+
/***************************************************************************
MACROS
***************************************************************************/
@@ -46,66 +54,6 @@
#define FLAGS_AF ( 0x40 ) /* M48T37: not emulated */
#define FLAGS_WDF ( 0x80 ) /* M48T37: not emulated */
-#define TIMEKPR_DEV_DERIVED_CTOR(devtype) \
- devtype##_device::devtype##_device(running_machine &_machine, const devtype##_device_config &config) \
- : timekeeper_device(_machine, config) \
- { }
-
-#define TIMEKPR_DEVCFG_DERIVED_CTOR(devtype, name, shortname) \
- devtype##_device_config::devtype##_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) \
- : timekeeper_device_config(mconfig, name, tag, owner, clock) \
- { }
-
-#define TIMEKPR_DEVCFG_DERIVED_STATIC_ALLOC(devtype) \
- device_config *devtype##_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) \
- { return global_alloc(devtype##_device_config(mconfig, tag, owner, clock)); }
-
-#define TIMEKPR_DEVCFG_DERIVED_DEV_ALLOC(devtype) \
- device_t *devtype##_device_config::alloc_device(running_machine &machine) const \
- { return auto_alloc(machine, devtype##_device(machine, *this)); }
-
-#define TIMEKPR_DERIVE(devtype, name, shortname) \
- TIMEKPR_DEV_DERIVED_CTOR(devtype) \
- TIMEKPR_DEVCFG_DERIVED_CTOR(devtype, name, shortname) \
- TIMEKPR_DEVCFG_DERIVED_STATIC_ALLOC(devtype) \
- TIMEKPR_DEVCFG_DERIVED_DEV_ALLOC(devtype)
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// timekeeper_device_config - constructor
-//-------------------------------------------------
-
-timekeeper_device_config::timekeeper_device_config(const machine_config &mconfig, const char *type, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, type, tag, owner, clock),
- device_config_nvram_interface(mconfig, *this)
-{
-
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *timekeeper_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(timekeeper_device_config(mconfig, "TIMEKEEPER", tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *timekeeper_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, timekeeper_device(machine, *this));
-}
/***************************************************************************
INLINE FUNCTIONS
@@ -165,76 +113,19 @@ static int counter_from_ram( UINT8 *data, int offset )
// LIVE DEVICE
//**************************************************************************
-const device_type M48T02 = m48t02_device_config::static_alloc_device_config;
-const device_type M48T35 = m48t35_device_config::static_alloc_device_config;
-const device_type M48T37 = m48t37_device_config::static_alloc_device_config;
-const device_type M48T58 = m48t58_device_config::static_alloc_device_config;
-const device_type MK48T08 = mk48t08_device_config::static_alloc_device_config;
-
-TIMEKPR_DERIVE(m48t02, "M48T02", "m48t02")
-TIMEKPR_DERIVE(m48t35, "M48T35", "m48t35")
-TIMEKPR_DERIVE(m48t37, "M48T37", "m48t37")
-TIMEKPR_DERIVE(m48t58, "M48T58", "m48t58")
-TIMEKPR_DERIVE(mk48t08, "MK48T08", "mk48t08")
-
//-------------------------------------------------
-// timekeeper_device - constructor
+// timekeeper_device_config - constructor
//-------------------------------------------------
-timekeeper_device::timekeeper_device(running_machine &_machine, const timekeeper_device_config &config)
- : device_t(_machine, config),
- device_nvram_interface(_machine, config, *this),
- m_config(config)
+timekeeper_device::timekeeper_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ device_nvram_interface(mconfig, *this)
{
}
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void timekeeper_device::device_start()
-{
- system_time systime;
-
- /* validate some basic stuff */
- assert(this != NULL);
-
- machine().base_datetime(systime);
-
- m_control = 0;
- m_seconds = make_bcd( systime.local_time.second );
- m_minutes = make_bcd( systime.local_time.minute );
- m_hours = make_bcd( systime.local_time.hour );
- m_day = make_bcd( systime.local_time.weekday + 1 );
- m_date = make_bcd( systime.local_time.mday );
- m_month = make_bcd( systime.local_time.month + 1 );
- m_year = make_bcd( systime.local_time.year % 100 );
- m_century = make_bcd( systime.local_time.year / 100 );
- m_data = auto_alloc_array( machine(), UINT8, m_size );
-
- m_default_data = *region();
- if (m_default_data)
- {
- assert( region()->bytes() == m_size );
- }
-
- save_item( NAME(m_control) );
- save_item( NAME(m_seconds) );
- save_item( NAME(m_minutes) );
- save_item( NAME(m_hours) );
- save_item( NAME(m_day) );
- save_item( NAME(m_date) );
- save_item( NAME(m_month) );
- save_item( NAME(m_year) );
- save_item( NAME(m_century) );
- save_pointer( NAME(m_data), m_size );
-
- emu_timer *timer = timer_alloc();
- timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1));
-}
-
-void m48t02_device::device_start()
+m48t02_device::m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : timekeeper_device(mconfig, M48T02, "M48T02", tag, owner, clock)
{
m_offset_control = 0x7f8;
m_offset_seconds = 0x7f9;
@@ -247,11 +138,10 @@ void m48t02_device::device_start()
m_offset_century = -1;
m_offset_flags = -1;
m_size = 0x800;
-
- timekeeper_device::device_start();
}
-void m48t35_device::device_start()
+m48t35_device::m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : timekeeper_device(mconfig, M48T35, "M48T35", tag, owner, clock)
{
m_offset_control = 0x7ff8;
m_offset_seconds = 0x7ff9;
@@ -264,11 +154,10 @@ void m48t35_device::device_start()
m_offset_century = -1;
m_offset_flags = -1;
m_size = 0x8000;
-
- timekeeper_device::device_start();
}
-void m48t37_device::device_start()
+m48t37_device::m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : timekeeper_device(mconfig, M48T37, "M48T37", tag, owner, clock)
{
m_offset_control = 0x7ff8;
m_offset_seconds = 0x7ff9;
@@ -281,11 +170,10 @@ void m48t37_device::device_start()
m_offset_century = 0x7ff1;
m_offset_flags = 0x7ff0;
m_size = 0x8000;
-
- timekeeper_device::device_start();
}
-void m48t58_device::device_start()
+m48t58_device::m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : timekeeper_device(mconfig, M48T58, "M48T58", tag, owner, clock)
{
m_offset_control = 0x1ff8;
m_offset_seconds = 0x1ff9;
@@ -298,11 +186,10 @@ void m48t58_device::device_start()
m_offset_century = -1;
m_offset_flags = -1;
m_size = 0x2000;
-
- timekeeper_device::device_start();
}
-void mk48t08_device::device_start()
+mk48t08_device::mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : timekeeper_device(mconfig, MK48T08, "MK48T08", tag, owner, clock)
{
m_offset_control = 0x1ff8;
m_offset_seconds = 0x1ff9;
@@ -315,8 +202,52 @@ void mk48t08_device::device_start()
m_offset_century = 0x1ff1;
m_offset_flags = 0x1ff0;
m_size = 0x2000;
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void timekeeper_device::device_start()
+{
+ system_time systime;
+
+ /* validate some basic stuff */
+ assert(this != NULL);
- timekeeper_device::device_start();
+ machine().base_datetime(systime);
+
+ m_control = 0;
+ m_seconds = make_bcd( systime.local_time.second );
+ m_minutes = make_bcd( systime.local_time.minute );
+ m_hours = make_bcd( systime.local_time.hour );
+ m_day = make_bcd( systime.local_time.weekday + 1 );
+ m_date = make_bcd( systime.local_time.mday );
+ m_month = make_bcd( systime.local_time.month + 1 );
+ m_year = make_bcd( systime.local_time.year % 100 );
+ m_century = make_bcd( systime.local_time.year / 100 );
+ m_data = auto_alloc_array( machine(), UINT8, m_size );
+
+ m_default_data = *region();
+ if (m_default_data)
+ {
+ assert( region()->bytes() == m_size );
+ }
+
+ save_item( NAME(m_control) );
+ save_item( NAME(m_seconds) );
+ save_item( NAME(m_minutes) );
+ save_item( NAME(m_hours) );
+ save_item( NAME(m_day) );
+ save_item( NAME(m_date) );
+ save_item( NAME(m_month) );
+ save_item( NAME(m_year) );
+ save_item( NAME(m_century) );
+ save_pointer( NAME(m_data), m_size );
+
+ emu_timer *timer = timer_alloc();
+ timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1));
}
//-------------------------------------------------
@@ -324,11 +255,6 @@ void mk48t08_device::device_start()
//-------------------------------------------------
void timekeeper_device::device_reset() { }
-void m48t02_device::device_reset() { }
-void m48t35_device::device_reset() { }
-void m48t37_device::device_reset() { }
-void m48t58_device::device_reset() { }
-void mk48t08_device::device_reset() { }
void timekeeper_device::counters_to_ram()
{
diff --git a/src/emu/machine/timekpr.h b/src/emu/machine/timekpr.h
index 67e48aae1b5..4dd5cb64aa8 100644
--- a/src/emu/machine/timekpr.h
+++ b/src/emu/machine/timekpr.h
@@ -54,44 +54,15 @@ struct timekeeper_config
const UINT8 *m_data;
};
-// ======================> timekeeper_device_config
-
-class timekeeper_device_config : public device_config,
- public device_config_nvram_interface,
- public timekeeper_config
-{
- friend class timekeeper_device;
- friend class m48t02_device_config;
- friend class m48t35_device_config;
- friend class m48t37_device_config;
- friend class m48t58_device_config;
- friend class mk48t08_device_config;
-
-protected:
- // construction/destruction
- timekeeper_device_config(const machine_config &mconfig, const char *type, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
// ======================> timekeeper_device
class timekeeper_device : public device_t,
public device_nvram_interface
{
- friend class timekeeper_device_config;
- friend class m48t02_device;
- friend class m48t35_device;
- friend class m48t37_device;
- friend class m48t58_device;
- friend class mk48t08_device;
-
+protected:
// construction/destruction
- timekeeper_device(running_machine &_machine, const timekeeper_device_config &config);
+ timekeeper_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
public:
void write(UINT16 offset, UINT8 data);
@@ -108,13 +79,11 @@ protected:
virtual void nvram_read(emu_file &file);
virtual void nvram_write(emu_file &file);
- // internal state
- const timekeeper_device_config &m_config;
-
private:
void counters_to_ram();
void counters_from_ram();
+ // internal state
UINT8 m_control;
UINT8 m_seconds;
UINT8 m_minutes;
@@ -128,6 +97,7 @@ private:
UINT8 *m_data;
UINT8 *m_default_data;
+protected:
int m_size;
int m_offset_control;
int m_offset_seconds;
@@ -141,11 +111,35 @@ private:
int m_offset_flags;
};
-GENERIC_DEVICE_DERIVED_CONFIG(timekeeper, m48t02)
-GENERIC_DEVICE_DERIVED_CONFIG(timekeeper, m48t35)
-GENERIC_DEVICE_DERIVED_CONFIG(timekeeper, m48t37)
-GENERIC_DEVICE_DERIVED_CONFIG(timekeeper, m48t58)
-GENERIC_DEVICE_DERIVED_CONFIG(timekeeper, mk48t08)
+class m48t02_device : public timekeeper_device
+{
+public:
+ m48t02_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class m48t35_device : public timekeeper_device
+{
+public:
+ m48t35_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class m48t37_device : public timekeeper_device
+{
+public:
+ m48t37_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class m48t58_device : public timekeeper_device
+{
+public:
+ m48t58_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class mk48t08_device : public timekeeper_device
+{
+public:
+ mk48t08_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
// device type definition
extern const device_type M48T02;
diff --git a/src/emu/machine/tms6100.c b/src/emu/machine/tms6100.c
index 48f9b0aef30..8bbb2e08202 100644
--- a/src/emu/machine/tms6100.c
+++ b/src/emu/machine/tms6100.c
@@ -141,7 +141,7 @@ static DEVICE_START( tms6100 )
assert_always(tms != NULL, "Error creating TMS6100 chip");
- //tms->intf = device->baseconfig().static_config ? (const tms5110_interface *)device->baseconfig().static_config : &dummy;
+ //tms->intf = device->static_config ? (const tms5110_interface *)device->static_config : &dummy;
tms->rom = *device->region();
tms->device = device;
diff --git a/src/emu/machine/upd1990a.c b/src/emu/machine/upd1990a.c
index bc3d4f11d9d..1ed6019e3fe 100644
--- a/src/emu/machine/upd1990a.c
+++ b/src/emu/machine/upd1990a.c
@@ -19,6 +19,9 @@
#include "upd1990a.h"
+// device type definition
+const device_type UPD1990A = &device_creator<upd1990a_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -43,73 +46,6 @@ enum
//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// devices
-const device_type UPD1990A = upd1990a_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// upd1990a_device_config - constructor
-//-------------------------------------------------
-
-upd1990a_device_config::upd1990a_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "uPD1990A", tag, owner, clock),
- device_config_rtc_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *upd1990a_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(upd1990a_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *upd1990a_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, upd1990a_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void upd1990a_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const upd1990a_interface *intf = reinterpret_cast<const upd1990a_interface *>(static_config());
- if (intf != NULL)
- *static_cast<upd1990a_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
-// memset(&in_pa_func, 0, sizeof(in_pa_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -202,23 +138,43 @@ inline void upd1990a_device::advance_seconds()
// upd1990a_device - constructor
//-------------------------------------------------
-upd1990a_device::upd1990a_device(running_machine &_machine, const upd1990a_device_config &config)
- : device_t(_machine, config),
- device_rtc_interface(_machine, config, *this),
- m_config(config)
+upd1990a_device::upd1990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, UPD1990A, "uPD1990A", tag, owner, clock),
+ device_rtc_interface(mconfig, *this)
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void upd1990a_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const upd1990a_interface *intf = reinterpret_cast<const upd1990a_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<upd1990a_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+// memset(&in_pa_cb, 0, sizeof(in_pa_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void upd1990a_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_data_func, &m_config.m_out_data_func, this);
- devcb_resolve_write_line(&m_out_tp_func, &m_config.m_out_tp_func, this);
+ devcb_resolve_write_line(&m_out_data_func, &m_out_data_cb, this);
+ devcb_resolve_write_line(&m_out_tp_func, &m_out_tp_cb, this);
// allocate timers
m_timer_clock = timer_alloc(TIMER_CLOCK);
diff --git a/src/emu/machine/upd1990a.h b/src/emu/machine/upd1990a.h
index be89551e670..2a6654424bc 100644
--- a/src/emu/machine/upd1990a.h
+++ b/src/emu/machine/upd1990a.h
@@ -54,31 +54,8 @@
struct upd1990a_interface
{
- devcb_write_line m_out_data_func;
- devcb_write_line m_out_tp_func;
-};
-
-
-
-// ======================> upd1990a_device_config
-
-class upd1990a_device_config : public device_config,
- public upd1990a_interface,
- public device_config_rtc_interface
-{
- friend class upd1990a_device;
-
- // construction/destruction
- upd1990a_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line m_out_data_cb;
+ devcb_write_line m_out_tp_cb;
};
@@ -86,14 +63,13 @@ protected:
// ======================> upd1990a_device
class upd1990a_device : public device_t,
- public device_rtc_interface
+ public device_rtc_interface,
+ public upd1990a_interface
{
- friend class upd1990a_device_config;
-
+public:
// construction/destruction
- upd1990a_device(running_machine &_machine, const upd1990a_device_config &_config);
+ upd1990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_WRITE_LINE_MEMBER( oe_w );
DECLARE_WRITE_LINE_MEMBER( cs_w );
DECLARE_WRITE_LINE_MEMBER( stb_w );
@@ -107,6 +83,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -143,8 +120,6 @@ private:
emu_timer *m_timer_clock;
emu_timer *m_timer_tp;
emu_timer *m_timer_data_out;
-
- const upd1990a_device_config &m_config;
};
diff --git a/src/emu/machine/upd7201.c b/src/emu/machine/upd7201.c
index dc74e5bdb08..9063765b403 100644
--- a/src/emu/machine/upd7201.c
+++ b/src/emu/machine/upd7201.c
@@ -21,6 +21,9 @@
#include "machine/devhelpr.h"
+// device type definition
+const device_type UPD7201 = &device_creator<upd7201_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -38,44 +41,6 @@ enum
//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// devices
-const device_type UPD7201 = upd7201_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(upd7201, "UPD7201")
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void upd7201_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const upd7201_interface *intf = reinterpret_cast<const upd7201_interface *>(static_config());
- if (intf != NULL)
- *static_cast<upd7201_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_int_func, 0, sizeof(m_out_int_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -106,21 +71,41 @@ inline void upd7201_device::transmit(int channel)
// upd7201_device - constructor
//-------------------------------------------------
-upd7201_device::upd7201_device(running_machine &_machine, const upd7201_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+upd7201_device::upd7201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, UPD7201, "UPD7201", tag, owner, clock)
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void upd7201_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const upd7201_interface *intf = reinterpret_cast<const upd7201_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<upd7201_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void upd7201_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
}
diff --git a/src/emu/machine/upd7201.h b/src/emu/machine/upd7201.h
index 69ebfb45ae1..90d65d53f7d 100644
--- a/src/emu/machine/upd7201.h
+++ b/src/emu/machine/upd7201.h
@@ -60,63 +60,40 @@
struct upd7201_interface
{
- devcb_write_line m_out_int_func;
+ devcb_write_line m_out_int_cb;
struct
{
int m_rx_clock;
int m_tx_clock;
- devcb_write_line m_out_drqrx_func;
- devcb_write_line m_out_drqtx_func;
+ devcb_write_line m_out_drqrx_cb;
+ devcb_write_line m_out_drqtx_cb;
- devcb_read_line m_in_rxd_func;
- devcb_write_line m_out_txd_func;
+ devcb_read_line m_in_rxd_cb;
+ devcb_write_line m_out_txd_cb;
- devcb_read_line m_in_cts_func;
- devcb_read_line m_in_dcd_func;
- devcb_write_line m_out_rts_func;
- devcb_write_line m_out_dtr_func;
+ devcb_read_line m_in_cts_cb;
+ devcb_read_line m_in_dcd_cb;
+ devcb_write_line m_out_rts_cb;
+ devcb_write_line m_out_dtr_cb;
- devcb_write_line m_out_wait_func;
- devcb_write_line m_out_sync_func;
+ devcb_write_line m_out_wait_cb;
+ devcb_write_line m_out_sync_cb;
} m_channel[2];
};
-// ======================> upd7201_device_config
-
-class upd7201_device_config : public device_config,
- public upd7201_interface
-{
- friend class upd7201_device;
-
- // construction/destruction
- upd7201_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
-
// ======================> upd7201_device
-class upd7201_device : public device_t
+class upd7201_device : public device_t,
+ public upd7201_interface
{
- friend class upd7201_device_config;
-
+public:
// construction/destruction
- upd7201_device(running_machine &_machine, const upd7201_device_config &_config);
+ upd7201_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( cd_ba_r );
DECLARE_WRITE8_MEMBER( cd_ba_w );
DECLARE_READ8_MEMBER( ba_cd_r );
@@ -142,6 +119,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int m_param, void *ptr);
@@ -162,8 +140,6 @@ private:
emu_timer *m_tx_a_timer;
emu_timer *m_rx_b_timer;
emu_timer *m_tx_b_timer;
-
- const upd7201_device_config &m_config;
};
diff --git a/src/emu/machine/x2212.c b/src/emu/machine/x2212.c
index e246ca53e05..a20a8321a54 100644
--- a/src/emu/machine/x2212.c
+++ b/src/emu/machine/x2212.c
@@ -14,8 +14,6 @@
// GLOBAL VARIABLES
//**************************************************************************
-const device_type X2212 = x2212_device_config::static_alloc_device_config;
-
static ADDRESS_MAP_START( x2212_sram_map, AS_0, 8 )
AM_RANGE(0x0000, 0x00ff) AM_RAM
ADDRESS_MAP_END
@@ -27,42 +25,51 @@ ADDRESS_MAP_END
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
+// device type definition
+const device_type X2212 = &device_creator<x2212_device>;
+
//-------------------------------------------------
-// x2212_device_config - constructor
+// x2212_device - constructor
//-------------------------------------------------
-x2212_device_config::x2212_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "X2212", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- device_config_nvram_interface(mconfig, *this),
+x2212_device::x2212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, X2212, "X2212", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ device_nvram_interface(mconfig, *this),
+ m_auto_save(false),
m_sram_space_config("SRAM", ENDIANNESS_BIG, 8, 8, 0, *ADDRESS_MAP_NAME(x2212_sram_map)),
m_e2prom_space_config("E2PROM", ENDIANNESS_BIG, 8, 8, 0, *ADDRESS_MAP_NAME(x2212_e2prom_map)),
- m_auto_save(false)
+ m_store(false),
+ m_array_recall(false)
{
}
//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
+// static_set_auto_save - configuration helper
+// to set the auto-save flag
//-------------------------------------------------
-device_config *x2212_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
+void x2212_device::static_set_auto_save(device_t &device)
{
- return global_alloc(x2212_device_config(mconfig, tag, owner, clock));
+ downcast<x2212_device &>(device).m_auto_save = true;
}
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// device_start - device-specific startup
//-------------------------------------------------
-device_t *x2212_device_config::alloc_device(running_machine &machine) const
+void x2212_device::device_start()
{
- return auto_alloc(machine, x2212_device(machine, *this));
+ save_item(NAME(m_store));
+ save_item(NAME(m_array_recall));
+
+ m_sram = m_addrspace[0];
+ m_e2prom = m_addrspace[1];
}
@@ -71,58 +78,13 @@ device_t *x2212_device_config::alloc_device(running_machine &machine) const
// any address spaces owned by this device
//-------------------------------------------------
-const address_space_config *x2212_device_config::memory_space_config(address_spacenum spacenum) const
+const address_space_config *x2212_device::memory_space_config(address_spacenum spacenum) const
{
return (spacenum == 0) ? &m_sram_space_config : (spacenum == 1) ? &m_e2prom_space_config : NULL;
}
//-------------------------------------------------
-// static_set_auto_save - configuration helper
-// to set the auto-save flag
-//-------------------------------------------------
-
-void x2212_device_config::static_set_auto_save(device_config *device)
-{
- downcast<x2212_device_config *>(device)->m_auto_save = true;
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// x2212_device - constructor
-//-------------------------------------------------
-
-x2212_device::x2212_device(running_machine &_machine, const x2212_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
- device_nvram_interface(_machine, config, *this),
- m_config(config),
- m_store(false),
- m_array_recall(false)
-{
-}
-
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void x2212_device::device_start()
-{
- save_item(NAME(m_store));
- save_item(NAME(m_array_recall));
-
- m_sram = m_addrspace[0];
- m_e2prom = m_addrspace[1];
-}
-
-
-//-------------------------------------------------
// nvram_default - called to initialize NVRAM to
// its default state
//-------------------------------------------------
@@ -175,7 +137,7 @@ void x2212_device::nvram_read(emu_file &file)
void x2212_device::nvram_write(emu_file &file)
{
// auto-save causes an implicit store prior to exiting (writing)
- if (m_config.m_auto_save)
+ if (m_auto_save)
store();
UINT8 buffer[SIZE_DATA];
diff --git a/src/emu/machine/x2212.h b/src/emu/machine/x2212.h
index fc85f32e9be..bebc5590baf 100644
--- a/src/emu/machine/x2212.h
+++ b/src/emu/machine/x2212.h
@@ -24,7 +24,7 @@
// to fire on power-down, effectively creating an "auto-save" functionality
#define MCFG_X2212_ADD_AUTOSAVE(_tag) \
MCFG_DEVICE_ADD(_tag, X2212, 0) \
- x2212_device_config::static_set_auto_save(device); \
+ x2212_device::static_set_auto_save(*device); \
@@ -33,50 +33,19 @@
//**************************************************************************
-// ======================> x2212_device_config
-
-class x2212_device_config : public device_config,
- public device_config_memory_interface,
- public device_config_nvram_interface
-{
- friend class x2212_device;
-
- // construction/destruction
- x2212_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_auto_save(device_config *device);
-
-protected:
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // device-specific configuration
- address_space_config m_sram_space_config;
- address_space_config m_e2prom_space_config;
-
- // internal state
- bool m_auto_save;
-};
-
-
// ======================> x2212_device
class x2212_device : public device_t,
public device_memory_interface,
public device_nvram_interface
{
- friend class x2212_device_config;
-
+public:
// construction/destruction
- x2212_device(running_machine &_machine, const x2212_device_config &config);
+ x2212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_auto_save(device_t &device);
-public:
// I/O operations
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -92,6 +61,9 @@ protected:
// device-level overrides
virtual void device_start();
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
// device_nvram_interface overrides
virtual void nvram_default();
virtual void nvram_read(emu_file &file);
@@ -99,9 +71,14 @@ protected:
static const int SIZE_DATA = 0x100;
- // internal state
- const x2212_device_config &m_config;
+ // configuration state
+ bool m_auto_save;
+
+ // device-specific configuration
+ address_space_config m_sram_space_config;
+ address_space_config m_e2prom_space_config;
+ // internal state
address_space * m_sram;
address_space * m_e2prom;
diff --git a/src/emu/machine/x76f041.c b/src/emu/machine/x76f041.c
index c42b5571b34..a3ee45df84d 100644
--- a/src/emu/machine/x76f041.c
+++ b/src/emu/machine/x76f041.c
@@ -25,30 +25,15 @@ inline void ATTR_PRINTF(3,4) x76f041_device::verboselog(int n_level, const char
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("x76f041 %s %s: %s", config.tag(), machine().describe_context(), buf);
+ logerror("x76f041 %s %s: %s", tag(), machine().describe_context(), buf);
}
}
-const device_type X76F041 = x76f041_device_config::static_alloc_device_config;
+// device type definition
+const device_type X76F041 = &device_creator<x76f041_device>;
-x76f041_device_config::x76f041_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_secure_serial_flash_config(mconfig, static_alloc_device_config, "X76F041", tag, owner, clock)
-{
-}
-
-device_config *x76f041_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(x76f041_device_config(mconfig, tag, owner, clock));
-}
-
-device_t *x76f041_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, x76f041_device(machine, *this));
-}
-
-x76f041_device::x76f041_device(running_machine &_machine, const x76f041_device_config &_config)
- : device_secure_serial_flash(_machine, _config),
- config(_config)
+x76f041_device::x76f041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_secure_serial_flash(mconfig, X76F041, "X76F041", tag, owner, clock)
{
}
diff --git a/src/emu/machine/x76f041.h b/src/emu/machine/x76f041.h
index 88c492a359a..70df0bf8fe3 100644
--- a/src/emu/machine/x76f041.h
+++ b/src/emu/machine/x76f041.h
@@ -13,25 +13,11 @@
#include "machine/secflash.h"
-class x76f041_device_config : public device_secure_serial_flash_config
-{
- friend class x76f041_device;
-
- // construction/destruction
- x76f041_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
class x76f041_device : public device_secure_serial_flash
{
- friend class x76f041_device_config;
-
+public:
// construction/destruction
- x76f041_device(running_machine &_machine, const x76f041_device_config &config);
+ x76f041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
@@ -54,8 +40,6 @@ protected:
virtual void sda_1();
// internal state
- const x76f041_device_config &config;
-
enum {
SIZE_WRITE_BUFFER = 8,
SIZE_RESPONSE_TO_RESET = 4,
diff --git a/src/emu/machine/x76f100.c b/src/emu/machine/x76f100.c
index 89db4b05e4b..c6f4d3a01a5 100644
--- a/src/emu/machine/x76f100.c
+++ b/src/emu/machine/x76f100.c
@@ -23,30 +23,15 @@ inline void ATTR_PRINTF(3,4) x76f100_device::verboselog(int n_level, const char
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("x76f100 %s %s: %s", config.tag(), machine().describe_context(), buf);
+ logerror("x76f100 %s %s: %s", tag(), machine().describe_context(), buf);
}
}
-const device_type X76F100 = x76f100_device_config::static_alloc_device_config;
+// device type definition
+const device_type X76F100 = &device_creator<x76f100_device>;
-x76f100_device_config::x76f100_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_secure_serial_flash_config(mconfig, static_alloc_device_config, "X76F100", tag, owner, clock)
-{
-}
-
-device_config *x76f100_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(x76f100_device_config(mconfig, tag, owner, clock));
-}
-
-device_t *x76f100_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, x76f100_device(machine, *this));
-}
-
-x76f100_device::x76f100_device(running_machine &_machine, const x76f100_device_config &_config)
- : device_secure_serial_flash(_machine, _config),
- config(_config)
+x76f100_device::x76f100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_secure_serial_flash(mconfig, X76F100, "X76F100", tag, owner, clock)
{
}
@@ -84,7 +69,7 @@ void x76f100_device::nvram_default()
// Ensure the size is correct though
if(m_region->bytes() != SIZE_RESPONSE_TO_RESET+SIZE_WRITE_PASSWORD+SIZE_READ_PASSWORD+SIZE_DATA)
logerror("x76f100 %s: Wrong region length for initialization data, expected 0x%x, got 0x%x\n",
- config.tag(),
+ tag(),
SIZE_RESPONSE_TO_RESET+SIZE_WRITE_PASSWORD+SIZE_READ_PASSWORD+SIZE_DATA,
m_region->bytes());
else {
@@ -100,7 +85,7 @@ void x76f100_device::nvram_default()
// That chip isn't really usable without the passwords, so bitch
// if there's no region
- logerror("x76f100 %s: Warning, no default data provided, chip is unusable.\n", config.tag());
+ logerror("x76f100 %s: Warning, no default data provided, chip is unusable.\n", tag());
memset(response_to_reset, 0, SIZE_RESPONSE_TO_RESET);
memset(write_password, 0, SIZE_WRITE_PASSWORD);
memset(read_password, 0, SIZE_READ_PASSWORD);
diff --git a/src/emu/machine/x76f100.h b/src/emu/machine/x76f100.h
index 92cbaaf8ecb..0eab9d26347 100644
--- a/src/emu/machine/x76f100.h
+++ b/src/emu/machine/x76f100.h
@@ -13,25 +13,11 @@
#include "machine/secflash.h"
-class x76f100_device_config : public device_secure_serial_flash_config
-{
- friend class x76f100_device;
-
- // construction/destruction
- x76f100_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
class x76f100_device : public device_secure_serial_flash
{
- friend class x76f100_device_config;
-
+public:
// construction/destruction
- x76f100_device(running_machine &_machine, const x76f100_device_config &config);
+ x76f100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
@@ -54,8 +40,6 @@ protected:
virtual void sda_1();
// internal state
- const x76f100_device_config &config;
-
enum {
SIZE_WRITE_BUFFER = 8,
SIZE_RESPONSE_TO_RESET = 4,
diff --git a/src/emu/machine/z80ctc.c b/src/emu/machine/z80ctc.c
index fe195f62913..a992193b9a0 100644
--- a/src/emu/machine/z80ctc.c
+++ b/src/emu/machine/z80ctc.c
@@ -27,14 +27,6 @@
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type Z80CTC = z80ctc_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
// CONSTANTS
//**************************************************************************
@@ -77,38 +69,20 @@ const int WAITING_FOR_TRIG = 0x100;
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// z80ctc_device_config - constructor
-//-------------------------------------------------
-
-z80ctc_device_config::z80ctc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Zilog Z80 CTC", tag, owner, clock),
- device_config_z80daisy_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *z80ctc_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(z80ctc_device_config(mconfig, tag, owner, clock));
-}
-
+// device type definition
+const device_type Z80CTC = &device_creator<z80ctc_device>;
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// z80ctc_device - constructor
//-------------------------------------------------
-device_t *z80ctc_device_config::alloc_device(running_machine &machine) const
+z80ctc_device::z80ctc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, Z80CTC, "Zilog Z80 CTC", tag, owner, clock),
+ device_z80daisy_interface(mconfig, *this)
{
- return auto_alloc(machine, z80ctc_device(machine, *this));
}
@@ -118,7 +92,7 @@ device_t *z80ctc_device_config::alloc_device(running_machine &machine) const
// complete
//-------------------------------------------------
-void z80ctc_device_config::device_config_complete()
+void z80ctc_device::device_config_complete()
{
// inherit a copy of the static data
const z80ctc_interface *intf = reinterpret_cast<const z80ctc_interface *>(static_config());
@@ -129,31 +103,14 @@ void z80ctc_device_config::device_config_complete()
else
{
m_notimer = 0;
- memset(&m_intr, 0, sizeof(m_intr));
- memset(&m_zc0, 0, sizeof(m_zc0));
- memset(&m_zc1, 0, sizeof(m_zc1));
- memset(&m_zc2, 0, sizeof(m_zc2));
+ memset(&m_intr_cb, 0, sizeof(m_intr_cb));
+ memset(&m_zc0_cb, 0, sizeof(m_zc0_cb));
+ memset(&m_zc1_cb, 0, sizeof(m_zc1_cb));
+ memset(&m_zc2_cb, 0, sizeof(m_zc2_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// z80ctc_device - constructor
-//-------------------------------------------------
-
-z80ctc_device::z80ctc_device(running_machine &_machine, const z80ctc_device_config &_config)
- : device_t(_machine, _config),
- device_z80daisy_interface(_machine, _config, *this),
- m_config(_config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -164,13 +121,13 @@ void z80ctc_device::device_start()
m_period256 = attotime::from_hz(m_clock) * 256;
// resolve callbacks
- devcb_resolve_write_line(&m_intr, &m_config.m_intr, this);
+ devcb_resolve_write_line(&m_intr, &m_intr_cb, this);
// start each channel
- m_channel[0].start(this, 0, (m_config.m_notimer & NOTIMER_0) != 0, &m_config.m_zc0);
- m_channel[1].start(this, 1, (m_config.m_notimer & NOTIMER_1) != 0, &m_config.m_zc1);
- m_channel[2].start(this, 2, (m_config.m_notimer & NOTIMER_2) != 0, &m_config.m_zc2);
- m_channel[3].start(this, 3, (m_config.m_notimer & NOTIMER_3) != 0, NULL);
+ m_channel[0].start(this, 0, (m_notimer & NOTIMER_0) != 0, &m_zc0_cb);
+ m_channel[1].start(this, 1, (m_notimer & NOTIMER_1) != 0, &m_zc1_cb);
+ m_channel[2].start(this, 2, (m_notimer & NOTIMER_2) != 0, &m_zc2_cb);
+ m_channel[3].start(this, 3, (m_notimer & NOTIMER_3) != 0, NULL);
// register for save states
save_item(NAME(m_vector));
diff --git a/src/emu/machine/z80ctc.h b/src/emu/machine/z80ctc.h
index 543295f4346..1700275c368 100644
--- a/src/emu/machine/z80ctc.h
+++ b/src/emu/machine/z80ctc.h
@@ -65,33 +65,10 @@ const int NOTIMER_3 = (1<<3);
struct z80ctc_interface
{
UINT8 m_notimer; // timer disabler mask
- devcb_write_line m_intr; // callback when change interrupt status
- devcb_write_line m_zc0; // ZC/TO0 callback
- devcb_write_line m_zc1; // ZC/TO1 callback
- devcb_write_line m_zc2; // ZC/TO2 callback
-};
-
-
-
-// ======================> z80ctc_device_config
-
-class z80ctc_device_config : public device_config,
- public device_config_z80daisy_interface,
- public z80ctc_interface
-{
- friend class z80ctc_device;
-
- // construction/destruction
- z80ctc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line m_intr_cb; // callback when change interrupt status
+ devcb_write_line m_zc0_cb; // ZC/TO0 callback
+ devcb_write_line m_zc1_cb; // ZC/TO1 callback
+ devcb_write_line m_zc2_cb; // ZC/TO2 callback
};
@@ -99,14 +76,13 @@ protected:
// ======================> z80ctc_device
class z80ctc_device : public device_t,
- public device_z80daisy_interface
+ public device_z80daisy_interface,
+ public z80ctc_interface
{
- friend class z80ctc_device_config;
-
+public:
// construction/destruction
- z80ctc_device(running_machine &_machine, const z80ctc_device_config &_config);
+ z80ctc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
// state getters
attotime period(int ch) const { return m_channel[ch].period(); }
@@ -117,6 +93,7 @@ public:
private:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
@@ -161,7 +138,6 @@ private:
};
// internal state
- const z80ctc_device_config &m_config;
devcb_resolved_write_line m_intr; // interrupt callback
UINT8 m_vector; // interrupt vector
diff --git a/src/emu/machine/z80dart.c b/src/emu/machine/z80dart.c
index 8bb3c212cf8..ea3b80e9cb0 100644
--- a/src/emu/machine/z80dart.c
+++ b/src/emu/machine/z80dart.c
@@ -44,19 +44,6 @@
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type Z80DART = z80dart_device_config::static_alloc_device_config;
-const device_type Z80SIO0 = z80dart_device_config::static_alloc_device_config; // FIXME
-const device_type Z80SIO1 = z80dart_device_config::static_alloc_device_config; // FIXME
-const device_type Z80SIO2 = z80dart_device_config::static_alloc_device_config; // FIXME
-const device_type Z80SIO3 = z80dart_device_config::static_alloc_device_config; // FIXME
-const device_type Z80SIO4 = z80dart_device_config::static_alloc_device_config; // FIXME
-
-
-
-//**************************************************************************
// CONSTANTS
//**************************************************************************
@@ -190,38 +177,27 @@ const int WR5_DTR = 0x80;
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// z80dart_device_config - constructor
-//-------------------------------------------------
-
-z80dart_device_config::z80dart_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Zilog Z80 DART", tag, owner, clock),
- device_config_z80daisy_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *z80dart_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(z80dart_device_config(mconfig, tag, owner, clock));
-}
-
+// device type definition
+const device_type Z80DART = &device_creator<z80dart_device>;
+const device_type Z80SIO0 = &device_creator<z80dart_device>;
+const device_type Z80SIO1 = &device_creator<z80dart_device>;
+const device_type Z80SIO2 = &device_creator<z80dart_device>;
+const device_type Z80SIO3 = &device_creator<z80dart_device>;
+const device_type Z80SIO4 = &device_creator<z80dart_device>;
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// z80dart_device - constructor
//-------------------------------------------------
-device_t *z80dart_device_config::alloc_device(running_machine &machine) const
+z80dart_device::z80dart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, Z80DART, "Zilog Z80 DART", tag, owner, clock),
+ device_z80daisy_interface(mconfig, *this)
{
- return auto_alloc(machine, z80dart_device(machine, *this));
+ for (int i = 0; i < 8; i++)
+ m_int_state[i] = 0;
}
@@ -231,7 +207,7 @@ device_t *z80dart_device_config::alloc_device(running_machine &machine) const
// complete
//-------------------------------------------------
-void z80dart_device_config::device_config_complete()
+void z80dart_device::device_config_complete()
{
// inherit a copy of the static data
const z80dart_interface *intf = reinterpret_cast<const z80dart_interface *>(static_config());
@@ -242,42 +218,23 @@ void z80dart_device_config::device_config_complete()
else
{
m_rx_clock_a = m_tx_clock_a = m_rx_clock_b = m_tx_clock_b = 0;
- memset(&m_in_rxda_func, 0, sizeof(m_in_rxda_func));
- memset(&m_out_txda_func, 0, sizeof(m_out_txda_func));
- memset(&m_out_dtra_func, 0, sizeof(m_out_dtra_func));
- memset(&m_out_rtsa_func, 0, sizeof(m_out_rtsa_func));
- memset(&m_out_wrdya_func, 0, sizeof(m_out_wrdya_func));
- memset(&m_out_synca_func, 0, sizeof(m_out_synca_func));
- memset(&m_in_rxdb_func, 0, sizeof(m_in_rxdb_func));
- memset(&m_out_txdb_func, 0, sizeof(m_out_txdb_func));
- memset(&m_out_dtrb_func, 0, sizeof(m_out_dtrb_func));
- memset(&m_out_rtsb_func, 0, sizeof(m_out_rtsb_func));
- memset(&m_out_wrdyb_func, 0, sizeof(m_out_wrdyb_func));
- memset(&m_out_syncb_func, 0, sizeof(m_out_syncb_func));
- memset(&m_out_int_func, 0, sizeof(m_out_int_func));
+ memset(&m_in_rxda_cb, 0, sizeof(m_in_rxda_cb));
+ memset(&m_out_txda_cb, 0, sizeof(m_out_txda_cb));
+ memset(&m_out_dtra_cb, 0, sizeof(m_out_dtra_cb));
+ memset(&m_out_rtsa_cb, 0, sizeof(m_out_rtsa_cb));
+ memset(&m_out_wrdya_cb, 0, sizeof(m_out_wrdya_cb));
+ memset(&m_out_synca_cb, 0, sizeof(m_out_synca_cb));
+ memset(&m_in_rxdb_cb, 0, sizeof(m_in_rxdb_cb));
+ memset(&m_out_txdb_cb, 0, sizeof(m_out_txdb_cb));
+ memset(&m_out_dtrb_cb, 0, sizeof(m_out_dtrb_cb));
+ memset(&m_out_rtsb_cb, 0, sizeof(m_out_rtsb_cb));
+ memset(&m_out_wrdyb_cb, 0, sizeof(m_out_wrdyb_cb));
+ memset(&m_out_syncb_cb, 0, sizeof(m_out_syncb_cb));
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// z80dart_device - constructor
-//-------------------------------------------------
-
-z80dart_device::z80dart_device(running_machine &_machine, const z80dart_device_config &config)
- : device_t(_machine, config),
- device_z80daisy_interface(_machine, config, *this),
- m_config(config)
-{
- for (int i = 0; i < 8; i++)
- m_int_state[i] = 0;
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -285,37 +242,37 @@ z80dart_device::z80dart_device(running_machine &_machine, const z80dart_device_c
void z80dart_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
- m_channel[CHANNEL_A].start(this, CHANNEL_A, m_config.m_in_rxda_func, m_config.m_out_txda_func, m_config.m_out_dtra_func, m_config.m_out_rtsa_func, m_config.m_out_wrdya_func, m_config.m_out_synca_func);
- m_channel[CHANNEL_B].start(this, CHANNEL_B, m_config.m_in_rxdb_func, m_config.m_out_txdb_func, m_config.m_out_dtrb_func, m_config.m_out_rtsb_func, m_config.m_out_wrdyb_func, m_config.m_out_syncb_func);
+ m_channel[CHANNEL_A].start(this, CHANNEL_A, m_in_rxda_cb, m_out_txda_cb, m_out_dtra_cb, m_out_rtsa_cb, m_out_wrdya_cb, m_out_synca_cb);
+ m_channel[CHANNEL_B].start(this, CHANNEL_B, m_in_rxdb_cb, m_out_txdb_cb, m_out_dtrb_cb, m_out_rtsb_cb, m_out_wrdyb_cb, m_out_syncb_cb);
- if (m_config.m_rx_clock_a != 0)
+ if (m_rx_clock_a != 0)
{
// allocate channel A receive timer
m_rxca_timer = machine().scheduler().timer_alloc(FUNC(dart_channel::static_rxc_tick), (void *)&m_channel[CHANNEL_A]);
- m_rxca_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock_a));
+ m_rxca_timer->adjust(attotime::zero, 0, attotime::from_hz(m_rx_clock_a));
}
- if (m_config.m_tx_clock_a != 0)
+ if (m_tx_clock_a != 0)
{
// allocate channel A transmit timer
m_txca_timer = machine().scheduler().timer_alloc(FUNC(dart_channel::static_txc_tick), (void *)&m_channel[CHANNEL_A]);
- m_txca_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock_a));
+ m_txca_timer->adjust(attotime::zero, 0, attotime::from_hz(m_tx_clock_a));
}
- if (m_config.m_rx_clock_b != 0)
+ if (m_rx_clock_b != 0)
{
// allocate channel B receive timer
m_rxcb_timer = machine().scheduler().timer_alloc(FUNC(dart_channel::static_rxc_tick), (void *)&m_channel[CHANNEL_B]);
- m_rxcb_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock_b));
+ m_rxcb_timer->adjust(attotime::zero, 0, attotime::from_hz(m_rx_clock_b));
}
- if (m_config.m_tx_clock_b != 0)
+ if (m_tx_clock_b != 0)
{
// allocate channel B transmit timer
m_txcb_timer = machine().scheduler().timer_alloc(FUNC(dart_channel::static_txc_tick), (void *)&m_channel[CHANNEL_B]);
- m_txcb_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock_b));
+ m_txcb_timer->adjust(attotime::zero, 0, attotime::from_hz(m_tx_clock_b));
}
save_item(NAME(m_int_state));
diff --git a/src/emu/machine/z80dart.h b/src/emu/machine/z80dart.h
index 00b3557e2e6..805c9427f0d 100644
--- a/src/emu/machine/z80dart.h
+++ b/src/emu/machine/z80dart.h
@@ -153,44 +153,21 @@ struct z80dart_interface
int m_rx_clock_b; // channel B receive clock
int m_tx_clock_b; // channel B transmit clock
- devcb_read_line m_in_rxda_func;
- devcb_write_line m_out_txda_func;
- devcb_write_line m_out_dtra_func;
- devcb_write_line m_out_rtsa_func;
- devcb_write_line m_out_wrdya_func;
- devcb_write_line m_out_synca_func;
-
- devcb_read_line m_in_rxdb_func;
- devcb_write_line m_out_txdb_func;
- devcb_write_line m_out_dtrb_func;
- devcb_write_line m_out_rtsb_func;
- devcb_write_line m_out_wrdyb_func;
- devcb_write_line m_out_syncb_func;
-
- devcb_write_line m_out_int_func;
-};
-
-
-
-// ======================> z80dart_device_config
-
-class z80dart_device_config : public device_config,
- public device_config_z80daisy_interface,
- public z80dart_interface
-{
- friend class z80dart_device;
-
- // construction/destruction
- z80dart_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read_line m_in_rxda_cb;
+ devcb_write_line m_out_txda_cb;
+ devcb_write_line m_out_dtra_cb;
+ devcb_write_line m_out_rtsa_cb;
+ devcb_write_line m_out_wrdya_cb;
+ devcb_write_line m_out_synca_cb;
+
+ devcb_read_line m_in_rxdb_cb;
+ devcb_write_line m_out_txdb_cb;
+ devcb_write_line m_out_dtrb_cb;
+ devcb_write_line m_out_rtsb_cb;
+ devcb_write_line m_out_wrdyb_cb;
+ devcb_write_line m_out_syncb_cb;
+
+ devcb_write_line m_out_int_cb;
};
@@ -198,15 +175,15 @@ protected:
// ======================> z80dart_device
class z80dart_device : public device_t,
- public device_z80daisy_interface
+ public device_z80daisy_interface,
+ public z80dart_interface
{
- friend class z80dart_device_config;
friend class dart_channel;
+public:
// construction/destruction
- z80dart_device(running_machine &_machine, const z80dart_device_config &_config);
+ z80dart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
// control register access
UINT8 control_read(int which) { return m_channel[which].control_read(); }
void control_write(int which, UINT8 data) { return m_channel[which].control_write(data); }
@@ -228,6 +205,7 @@ public:
private:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
@@ -333,7 +311,6 @@ private:
};
// internal state
- const z80dart_device_config & m_config;
devcb_resolved_write_line m_out_int_func;
dart_channel m_channel[2]; // channels
int m_int_state[8]; // interrupt state
diff --git a/src/emu/machine/z80dma.c b/src/emu/machine/z80dma.c
index bfdcea40ead..2a2c8f3a291 100644
--- a/src/emu/machine/z80dma.c
+++ b/src/emu/machine/z80dma.c
@@ -28,14 +28,6 @@
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type Z80DMA = z80dma_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
// CONSTANTS
//**************************************************************************
@@ -141,38 +133,20 @@ const int TM_SEARCH_TRANSFER = 0x03;
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// z80dma_device_config - constructor
-//-------------------------------------------------
-
-z80dma_device_config::z80dma_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Z8410", tag, owner, clock),
- device_config_z80daisy_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *z80dma_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(z80dma_device_config(mconfig, tag, owner, clock));
-}
-
+// device type definition
+const device_type Z80DMA = &device_creator<z80dma_device>;
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// z80dma_device - constructor
//-------------------------------------------------
-device_t *z80dma_device_config::alloc_device(running_machine &machine) const
+z80dma_device::z80dma_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, Z80DMA, "Z8410", tag, owner, clock),
+ device_z80daisy_interface(mconfig, *this)
{
- return auto_alloc(machine, z80dma_device(machine, *this));
}
@@ -182,7 +156,7 @@ device_t *z80dma_device_config::alloc_device(running_machine &machine) const
// complete
//-------------------------------------------------
-void z80dma_device_config::device_config_complete()
+void z80dma_device::device_config_complete()
{
// inherit a copy of the static data
const z80dma_interface *intf = reinterpret_cast<const z80dma_interface *>(static_config());
@@ -192,34 +166,17 @@ void z80dma_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_out_busreq_func, 0, sizeof(m_out_busreq_func));
- memset(&m_out_int_func, 0, sizeof(m_out_int_func));
- memset(&m_out_bao_func, 0, sizeof(m_out_bao_func));
- memset(&m_in_mreq_func, 0, sizeof(m_in_mreq_func));
- memset(&m_out_mreq_func, 0, sizeof(m_out_mreq_func));
- memset(&m_in_iorq_func, 0, sizeof(m_in_iorq_func));
- memset(&m_out_iorq_func, 0, sizeof(m_out_iorq_func));
+ memset(&m_out_busreq_cb, 0, sizeof(m_out_busreq_cb));
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
+ memset(&m_out_bao_cb, 0, sizeof(m_out_bao_cb));
+ memset(&m_in_mreq_cb, 0, sizeof(m_in_mreq_cb));
+ memset(&m_out_mreq_cb, 0, sizeof(m_out_mreq_cb));
+ memset(&m_in_iorq_cb, 0, sizeof(m_in_iorq_cb));
+ memset(&m_out_iorq_cb, 0, sizeof(m_out_iorq_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// z80dma_device - constructor
-//-------------------------------------------------
-
-z80dma_device::z80dma_device(running_machine &_machine, const z80dma_device_config &_config)
- : device_t(_machine, _config),
- device_z80daisy_interface(_machine, _config, *this),
- m_config(_config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -227,13 +184,13 @@ z80dma_device::z80dma_device(running_machine &_machine, const z80dma_device_conf
void z80dma_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_busreq_func, &m_config.m_out_busreq_func, this);
- devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
- devcb_resolve_write_line(&m_out_bao_func, &m_config.m_out_bao_func, this);
- devcb_resolve_read8(&m_in_mreq_func, &m_config.m_in_mreq_func, this);
- devcb_resolve_write8(&m_out_mreq_func, &m_config.m_out_mreq_func, this);
- devcb_resolve_read8(&m_in_iorq_func, &m_config.m_in_iorq_func, this);
- devcb_resolve_write8(&m_out_iorq_func, &m_config.m_out_iorq_func, this);
+ devcb_resolve_write_line(&m_out_busreq_func, &m_out_busreq_cb, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
+ devcb_resolve_write_line(&m_out_bao_func, &m_out_bao_cb, this);
+ devcb_resolve_read8(&m_in_mreq_func, &m_in_mreq_cb, this);
+ devcb_resolve_write8(&m_out_mreq_func, &m_out_mreq_cb, this);
+ devcb_resolve_read8(&m_in_iorq_func, &m_in_iorq_cb, this);
+ devcb_resolve_write8(&m_out_iorq_func, &m_out_iorq_cb, this);
// allocate timer
m_timer = machine().scheduler().timer_alloc(FUNC(static_timerproc), (void *)this);
diff --git a/src/emu/machine/z80dma.h b/src/emu/machine/z80dma.h
index 47643814d42..252c25a137b 100644
--- a/src/emu/machine/z80dma.h
+++ b/src/emu/machine/z80dma.h
@@ -58,40 +58,17 @@
struct z80dma_interface
{
- devcb_write_line m_out_busreq_func;
- devcb_write_line m_out_int_func;
- devcb_write_line m_out_bao_func;
+ devcb_write_line m_out_busreq_cb;
+ devcb_write_line m_out_int_cb;
+ devcb_write_line m_out_bao_cb;
// memory accessors
- devcb_read8 m_in_mreq_func;
- devcb_write8 m_out_mreq_func;
+ devcb_read8 m_in_mreq_cb;
+ devcb_write8 m_out_mreq_cb;
// I/O accessors
- devcb_read8 m_in_iorq_func;
- devcb_write8 m_out_iorq_func;
-};
-
-
-
-// ======================> z80dma_device_config
-
-class z80dma_device_config : public device_config,
- public device_config_z80daisy_interface,
- public z80dma_interface
-{
- friend class z80dma_device;
-
- // construction/destruction
- z80dma_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_iorq_cb;
+ devcb_write8 m_out_iorq_cb;
};
@@ -99,14 +76,13 @@ protected:
// ======================> z80dma_device
class z80dma_device : public device_t,
- public device_z80daisy_interface
+ public device_z80daisy_interface,
+ public z80dma_interface
{
- friend class z80dma_device_config;
-
+public:
// construction/destruction
- z80dma_device(running_machine &_machine, const z80dma_device_config &_config);
+ z80dma_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
UINT8 read();
void write(UINT8 data);
@@ -116,6 +92,7 @@ public:
private:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
@@ -140,8 +117,6 @@ private:
void rdy_write_callback(int state);
// internal state
- const z80dma_device_config &m_config;
-
devcb_resolved_write_line m_out_busreq_func;
devcb_resolved_write_line m_out_int_func;
devcb_resolved_write_line m_out_bao_func;
diff --git a/src/emu/machine/z80pio.c b/src/emu/machine/z80pio.c
index 1e6c123d308..35046726c07 100644
--- a/src/emu/machine/z80pio.c
+++ b/src/emu/machine/z80pio.c
@@ -13,14 +13,6 @@
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type Z80PIO = z80pio_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
// CONSTANTS
//**************************************************************************
@@ -53,38 +45,20 @@ const int ICW_MASK_FOLLOWS = 0x10;
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// z80pio_device_config - constructor
-//-------------------------------------------------
-
-z80pio_device_config::z80pio_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Z8420", tag, owner, clock),
- device_config_z80daisy_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *z80pio_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(z80pio_device_config(mconfig, tag, owner, clock));
-}
-
+// device type definition
+const device_type Z80PIO = &device_creator<z80pio_device>;
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// z80pio_device - constructor
//-------------------------------------------------
-device_t *z80pio_device_config::alloc_device(running_machine &machine) const
+z80pio_device::z80pio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, Z80PIO, "Z8420", tag, owner, clock),
+ device_z80daisy_interface(mconfig, *this)
{
- return auto_alloc(machine, z80pio_device(machine, *this));
}
@@ -94,7 +68,7 @@ device_t *z80pio_device_config::alloc_device(running_machine &machine) const
// complete
//-------------------------------------------------
-void z80pio_device_config::device_config_complete()
+void z80pio_device::device_config_complete()
{
// inherit a copy of the static data
const z80pio_interface *intf = reinterpret_cast<const z80pio_interface *>(static_config());
@@ -104,45 +78,28 @@ void z80pio_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_out_int_func, 0, sizeof(m_out_int_func));
- memset(&m_in_pa_func, 0, sizeof(m_in_pa_func));
- memset(&m_out_pa_func, 0, sizeof(m_out_pa_func));
- memset(&m_out_ardy_func, 0, sizeof(m_out_ardy_func));
- memset(&m_in_pb_func, 0, sizeof(m_in_pb_func));
- memset(&m_out_pb_func, 0, sizeof(m_out_pb_func));
- memset(&m_out_brdy_func, 0, sizeof(m_out_brdy_func));
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
+ memset(&m_in_pa_cb, 0, sizeof(m_in_pa_cb));
+ memset(&m_out_pa_cb, 0, sizeof(m_out_pa_cb));
+ memset(&m_out_ardy_cb, 0, sizeof(m_out_ardy_cb));
+ memset(&m_in_pb_cb, 0, sizeof(m_in_pb_cb));
+ memset(&m_out_pb_cb, 0, sizeof(m_out_pb_cb));
+ memset(&m_out_brdy_cb, 0, sizeof(m_out_brdy_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// z80pio_device - constructor
-//-------------------------------------------------
-
-z80pio_device::z80pio_device(running_machine &_machine, const z80pio_device_config &config)
- : device_t(_machine, config),
- device_z80daisy_interface(_machine, config, *this),
- m_config(config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void z80pio_device::device_start()
{
- m_port[PORT_A].start(this, PORT_A, m_config.m_in_pa_func, m_config.m_out_pa_func, m_config.m_out_ardy_func);
- m_port[PORT_B].start(this, PORT_B, m_config.m_in_pb_func, m_config.m_out_pb_func, m_config.m_out_brdy_func);
+ m_port[PORT_A].start(this, PORT_A, m_in_pa_cb, m_out_pa_cb, m_out_ardy_cb);
+ m_port[PORT_B].start(this, PORT_B, m_in_pb_cb, m_out_pb_cb, m_out_brdy_cb);
// resolve callbacks
- devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
}
diff --git a/src/emu/machine/z80pio.h b/src/emu/machine/z80pio.h
index 26762e153b1..4a2df0bb03e 100644
--- a/src/emu/machine/z80pio.h
+++ b/src/emu/machine/z80pio.h
@@ -58,38 +58,15 @@
struct z80pio_interface
{
- devcb_write_line m_out_int_func;
+ devcb_write_line m_out_int_cb;
- devcb_read8 m_in_pa_func;
- devcb_write8 m_out_pa_func;
- devcb_write_line m_out_ardy_func;
+ devcb_read8 m_in_pa_cb;
+ devcb_write8 m_out_pa_cb;
+ devcb_write_line m_out_ardy_cb;
- devcb_read8 m_in_pb_func;
- devcb_write8 m_out_pb_func;
- devcb_write_line m_out_brdy_func;
-};
-
-
-
-// ======================> z80pio_device_config
-
-class z80pio_device_config : public device_config,
- public device_config_z80daisy_interface,
- public z80pio_interface
-{
- friend class z80pio_device;
-
- // construction/destruction
- z80pio_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_pb_cb;
+ devcb_write8 m_out_pb_cb;
+ devcb_write_line m_out_brdy_cb;
};
@@ -97,13 +74,9 @@ protected:
// ======================> z80pio_device
class z80pio_device : public device_t,
- public device_z80daisy_interface
+ public device_z80daisy_interface,
+ public z80pio_interface
{
- friend class z80pio_device_config;
-
- // construction/destruction
- z80pio_device(running_machine &_machine, const z80pio_device_config &config);
-
public:
enum
{
@@ -112,6 +85,9 @@ public:
PORT_COUNT
};
+ // construction/destruction
+ z80pio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
// I/O line access
int rdy(int which) { return m_port[which].rdy(); }
void strobe(int which, bool state) { m_port[which].strobe(state); }
@@ -130,6 +106,7 @@ public:
private:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
@@ -197,7 +174,6 @@ private:
};
// internal state
- const z80pio_device_config &m_config;
pio_port m_port[2];
devcb_resolved_write_line m_out_int_func;
};
diff --git a/src/emu/machine/z80sio.c b/src/emu/machine/z80sio.c
index ecc93d16913..8ddcd54806a 100644
--- a/src/emu/machine/z80sio.c
+++ b/src/emu/machine/z80sio.c
@@ -13,6 +13,9 @@
#include "cpu/z80/z80daisy.h"
+// device type definition
+const device_type Z80SIO = &device_creator<z80sio_device>;
+
//**************************************************************************
// DEBUGGING
@@ -25,14 +28,6 @@
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type Z80SIO = z80sio_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
// CONSTANTS
//**************************************************************************
@@ -248,8 +243,8 @@ const UINT8 z80sio_device::k_int_priority[] =
inline void z80sio_device::update_interrupt_state()
{
// if we have a callback, update it with the current state
- if (m_config.m_irq_cb != NULL)
- (*m_config.m_irq_cb)(this, (z80daisy_irq_state() & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE);
+ if (m_irq_cb != NULL)
+ (*m_irq_cb)(this, (z80daisy_irq_state() & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -295,38 +290,19 @@ inline attotime z80sio_device::sio_channel::compute_time_per_character()
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
-// z80sio_device_config - constructor
-//-------------------------------------------------
-
-z80sio_device_config::z80sio_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Zilog Z80 SIO", tag, owner, clock),
- device_config_z80daisy_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *z80sio_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(z80sio_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
+// z80sio_device - constructor
//-------------------------------------------------
-device_t *z80sio_device_config::alloc_device(running_machine &machine) const
+z80sio_device::z80sio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, Z80SIO, "Zilog Z80 SIO", tag, owner, clock),
+ device_z80daisy_interface(mconfig, *this)
{
- return auto_alloc(machine, z80sio_device(machine, *this));
+ for (int i = 0; i < 8; i++)
+ m_int_state[i] = 0;
}
@@ -336,7 +312,7 @@ device_t *z80sio_device_config::alloc_device(running_machine &machine) const
// complete
//-------------------------------------------------
-void z80sio_device_config::device_config_complete()
+void z80sio_device::device_config_complete()
{
// inherit a copy of the static data
const z80sio_interface *intf = reinterpret_cast<const z80sio_interface *>(static_config());
@@ -356,25 +332,6 @@ void z80sio_device_config::device_config_complete()
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// z80sio_device - constructor
-//-------------------------------------------------
-
-z80sio_device::z80sio_device(running_machine &_machine, const z80sio_device_config &config)
- : device_t(_machine, config),
- device_z80daisy_interface(_machine, config, *this),
- m_config(config)
-{
- for (int i = 0; i < 8; i++)
- m_int_state[i] = 0;
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -609,12 +566,12 @@ void z80sio_device::sio_channel::control_write(UINT8 data)
// SIO write register 5
case 5:
- if (((old ^ data) & SIO_WR5_DTR) && m_device->m_config.m_dtr_changed_cb)
- (*m_device->m_config.m_dtr_changed_cb)(m_device, m_index, (data & SIO_WR5_DTR) != 0);
- if (((old ^ data) & SIO_WR5_SEND_BREAK) && m_device->m_config.m_break_changed_cb)
- (*m_device->m_config.m_break_changed_cb)(m_device, m_index, (data & SIO_WR5_SEND_BREAK) != 0);
- if (((old ^ data) & SIO_WR5_RTS) && m_device->m_config.m_rts_changed_cb)
- (*m_device->m_config.m_rts_changed_cb)(m_device, m_index, (data & SIO_WR5_RTS) != 0);
+ if (((old ^ data) & SIO_WR5_DTR) && m_device->m_dtr_changed_cb)
+ (*m_device->m_dtr_changed_cb)(m_device, m_index, (data & SIO_WR5_DTR) != 0);
+ if (((old ^ data) & SIO_WR5_SEND_BREAK) && m_device->m_break_changed_cb)
+ (*m_device->m_break_changed_cb)(m_device, m_index, (data & SIO_WR5_SEND_BREAK) != 0);
+ if (((old ^ data) & SIO_WR5_RTS) && m_device->m_rts_changed_cb)
+ (*m_device->m_rts_changed_cb)(m_device, m_index, (data & SIO_WR5_RTS) != 0);
break;
}
}
@@ -784,8 +741,8 @@ void z80sio_device::sio_channel::serial_callback()
VPRINTF(("serial_callback(%c): Transmitting %02x\n", 'A' + m_index, m_outbuf));
// actually transmit the character
- if (m_device->m_config.m_transmit_cb != NULL)
- (*m_device->m_config.m_transmit_cb)(m_device, m_index, m_outbuf);
+ if (m_device->m_transmit_cb != NULL)
+ (*m_device->m_transmit_cb)(m_device, m_index, m_outbuf);
// update the status register
m_status[0] |= SIO_RR0_TX_BUFFER_EMPTY;
@@ -799,8 +756,8 @@ void z80sio_device::sio_channel::serial_callback()
}
// ask the polling callback if there is data to receive
- if (m_device->m_config.m_receive_poll_cb != NULL)
- data = (*m_device->m_config.m_receive_poll_cb)(m_device, m_index);
+ if (m_device->m_receive_poll_cb != NULL)
+ data = (*m_device->m_receive_poll_cb)(m_device, m_index);
// if we have buffered data, pull it
if (m_receive_inptr != m_receive_outptr)
diff --git a/src/emu/machine/z80sio.h b/src/emu/machine/z80sio.h
index b50cf583c57..c1141251036 100644
--- a/src/emu/machine/z80sio.h
+++ b/src/emu/machine/z80sio.h
@@ -42,40 +42,16 @@ struct z80sio_interface
-// ======================> z80sio_device_config
-
-class z80sio_device_config : public device_config,
- public device_config_z80daisy_interface,
- public z80sio_interface
-{
- friend class z80sio_device;
-
- // construction/destruction
- z80sio_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
-
// ======================> z80sio_device
class z80sio_device : public device_t,
- public device_z80daisy_interface
+ public device_z80daisy_interface,
+ public z80sio_interface
{
- friend class z80sio_device_config;
-
+public:
// construction/destruction
- z80sio_device(running_machine &_machine, const z80sio_device_config &config);
+ z80sio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
// control register I/O
UINT8 control_read(int ch) { return m_channel[ch].control_read(); }
void control_write(int ch, UINT8 data) { m_channel[ch].control_write(data); }
@@ -93,6 +69,7 @@ public:
private:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
@@ -152,7 +129,6 @@ private:
};
// internal state
- const z80sio_device_config &m_config;
sio_channel m_channel[2]; // 2 channels
UINT8 m_int_state[8]; // interrupt states
diff --git a/src/emu/machine/z80sti.c b/src/emu/machine/z80sti.c
index 2dfc89e7c9a..79ddaf09329 100644
--- a/src/emu/machine/z80sti.c
+++ b/src/emu/machine/z80sti.c
@@ -24,6 +24,9 @@
+// device type definition
+const device_type Z80STI = &device_creator<z80sti_device>;
+
//**************************************************************************
// DEBUGGING
//**************************************************************************
@@ -35,14 +38,6 @@
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type Z80STI = z80sti_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
// CONSTANTS
//**************************************************************************
@@ -144,38 +139,17 @@ static const int PRESCALER[] = { 0, 4, 10, 16, 50, 64, 100, 200 };
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
-// z80sti_device_config - constructor
-//-------------------------------------------------
-
-z80sti_device_config::z80sti_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Mostek MK3801", tag, owner, clock),
- device_config_z80daisy_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *z80sti_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(z80sti_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
+// z80sti_device - constructor
//-------------------------------------------------
-device_t *z80sti_device_config::alloc_device(running_machine &machine) const
+z80sti_device::z80sti_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, Z80STI, "Mostek MK3801", tag, owner, clock),
+ device_z80daisy_interface(mconfig, *this)
{
- return auto_alloc(machine, z80sti_device(machine, *this));
}
@@ -185,7 +159,7 @@ device_t *z80sti_device_config::alloc_device(running_machine &machine) const
// complete
//-------------------------------------------------
-void z80sti_device_config::device_config_complete()
+void z80sti_device::device_config_complete()
{
// inherit a copy of the static data
const z80sti_interface *intf = reinterpret_cast<const z80sti_interface *>(static_config());
@@ -196,36 +170,19 @@ void z80sti_device_config::device_config_complete()
else
{
m_rx_clock = m_tx_clock = 0;
- memset(&m_out_int_func, 0, sizeof(m_out_int_func));
- memset(&m_in_gpio_func, 0, sizeof(m_in_gpio_func));
- memset(&m_out_gpio_func, 0, sizeof(m_out_gpio_func));
- memset(&m_in_si_func, 0, sizeof(m_in_si_func));
- memset(&m_out_so_func, 0, sizeof(m_out_so_func));
- memset(&m_out_tao_func, 0, sizeof(m_out_tao_func));
- memset(&m_out_tbo_func, 0, sizeof(m_out_tbo_func));
- memset(&m_out_tco_func, 0, sizeof(m_out_tco_func));
- memset(&m_out_tdo_func, 0, sizeof(m_out_tdo_func));
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
+ memset(&m_in_gpio_cb, 0, sizeof(m_in_gpio_cb));
+ memset(&m_out_gpio_cb, 0, sizeof(m_out_gpio_cb));
+ memset(&m_in_si_cb, 0, sizeof(m_in_si_cb));
+ memset(&m_out_so_cb, 0, sizeof(m_out_so_cb));
+ memset(&m_out_tao_cb, 0, sizeof(m_out_tao_cb));
+ memset(&m_out_tbo_cb, 0, sizeof(m_out_tbo_cb));
+ memset(&m_out_tco_cb, 0, sizeof(m_out_tco_cb));
+ memset(&m_out_tdo_cb, 0, sizeof(m_out_tdo_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// z80sti_device - constructor
-//-------------------------------------------------
-
-z80sti_device::z80sti_device(running_machine &_machine, const z80sti_device_config &config)
- : device_t(_machine, config),
- device_z80daisy_interface(_machine, config, *this),
- m_config(config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -233,15 +190,15 @@ z80sti_device::z80sti_device(running_machine &_machine, const z80sti_device_conf
void z80sti_device::device_start()
{
// resolve callbacks
- devcb_resolve_read8(&m_in_gpio_func, &m_config.m_in_gpio_func, this);
- devcb_resolve_write8(&m_out_gpio_func, &m_config.m_out_gpio_func, this);
- devcb_resolve_read_line(&m_in_si_func, &m_config.m_in_si_func, this);
- devcb_resolve_write_line(&m_out_so_func, &m_config.m_out_so_func, this);
- devcb_resolve_write_line(&m_out_timer_func[TIMER_A], &m_config.m_out_tao_func, this);
- devcb_resolve_write_line(&m_out_timer_func[TIMER_B], &m_config.m_out_tbo_func, this);
- devcb_resolve_write_line(&m_out_timer_func[TIMER_C], &m_config.m_out_tco_func, this);
- devcb_resolve_write_line(&m_out_timer_func[TIMER_D], &m_config.m_out_tdo_func, this);
- devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
+ devcb_resolve_read8(&m_in_gpio_func, &m_in_gpio_cb, this);
+ devcb_resolve_write8(&m_out_gpio_func, &m_out_gpio_cb, this);
+ devcb_resolve_read_line(&m_in_si_func, &m_in_si_cb, this);
+ devcb_resolve_write_line(&m_out_so_func, &m_out_so_cb, this);
+ devcb_resolve_write_line(&m_out_timer_func[TIMER_A], &m_out_tao_cb, this);
+ devcb_resolve_write_line(&m_out_timer_func[TIMER_B], &m_out_tbo_cb, this);
+ devcb_resolve_write_line(&m_out_timer_func[TIMER_C], &m_out_tco_cb, this);
+ devcb_resolve_write_line(&m_out_timer_func[TIMER_D], &m_out_tdo_cb, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
// create the counter timers
m_timer[TIMER_A] = machine().scheduler().timer_alloc(FUNC(static_timer_count), (void *)this);
@@ -250,17 +207,17 @@ void z80sti_device::device_start()
m_timer[TIMER_D] = machine().scheduler().timer_alloc(FUNC(static_timer_count), (void *)this);
// create serial receive clock timer
- if (m_config.m_rx_clock > 0)
+ if (m_rx_clock > 0)
{
m_rx_timer = machine().scheduler().timer_alloc(FUNC(static_rx_tick), (void *)this);
- m_rx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock));
+ m_rx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_rx_clock));
}
// create serial transmit clock timer
- if (m_config.m_tx_clock > 0)
+ if (m_tx_clock > 0)
{
m_tx_timer = machine().scheduler().timer_alloc(FUNC(static_tx_tick), (void *)this);
- m_tx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock));
+ m_tx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_tx_clock));
}
// register for state saving
diff --git a/src/emu/machine/z80sti.h b/src/emu/machine/z80sti.h
index 0a413a31cfc..e316949c038 100644
--- a/src/emu/machine/z80sti.h
+++ b/src/emu/machine/z80sti.h
@@ -61,54 +61,31 @@ struct z80sti_interface
int m_tx_clock; // serial transmit clock
// this gets called on each change of the _INT pin (pin 17)
- devcb_write_line m_out_int_func;
+ devcb_write_line m_out_int_cb;
// this is called on each read of the GPIO pins
- devcb_read8 m_in_gpio_func;
+ devcb_read8 m_in_gpio_cb;
// this is called on each write of the GPIO pins
- devcb_write8 m_out_gpio_func;
+ devcb_write8 m_out_gpio_cb;
// this gets called for each read of the SI pin (pin 38)
- devcb_read_line m_in_si_func;
+ devcb_read_line m_in_si_cb;
// this gets called for each change of the SO pin (pin 37)
- devcb_write_line m_out_so_func;
+ devcb_write_line m_out_so_cb;
// this gets called for each change of the TAO pin (pin 1)
- devcb_write_line m_out_tao_func;
+ devcb_write_line m_out_tao_cb;
// this gets called for each change of the TBO pin (pin 2)
- devcb_write_line m_out_tbo_func;
+ devcb_write_line m_out_tbo_cb;
// this gets called for each change of the TCO pin (pin 3)
- devcb_write_line m_out_tco_func;
+ devcb_write_line m_out_tco_cb;
// this gets called for each change of the TDO pin (pin 4)
- devcb_write_line m_out_tdo_func;
-};
-
-
-
-// ======================> z80sti_device_config
-
-class z80sti_device_config : public device_config,
- public device_config_z80daisy_interface,
- public z80sti_interface
-{
- friend class z80sti_device;
-
- // construction/destruction
- z80sti_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line m_out_tdo_cb;
};
@@ -116,14 +93,13 @@ protected:
// ======================> z80sti_device
class z80sti_device : public device_t,
- public device_z80daisy_interface
+ public device_z80daisy_interface,
+ public z80sti_interface
{
- friend class z80sti_device_config;
-
+public:
// construction/destruction
- z80sti_device(running_machine &_machine, const z80sti_device_config &config);
+ z80sti_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
// I/O accessors
UINT8 read(offs_t offset);
void write(offs_t offset, UINT8 data);
@@ -135,6 +111,7 @@ public:
private:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
@@ -154,9 +131,6 @@ private:
static TIMER_CALLBACK( static_timer_count ) { reinterpret_cast<z80sti_device *>(ptr)->timer_count(param); }
- // internal state
- const z80sti_device_config &m_config;
-
// device callbacks
devcb_resolved_read8 m_in_gpio_func;
devcb_resolved_write8 m_out_gpio_func;
diff --git a/src/emu/machine/z8536.c b/src/emu/machine/z8536.c
index 322d764ada2..aa779c6f9ec 100644
--- a/src/emu/machine/z8536.c
+++ b/src/emu/machine/z8536.c
@@ -12,6 +12,9 @@
#include "machine/devhelpr.h"
+// device type definition
+const device_type Z8536 = &device_creator<z8536_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -234,49 +237,6 @@ enum
//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-const device_type Z8536 = z8536_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(z8536, "Zilog Z8536")
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void z8536_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const z8536_interface *intf = reinterpret_cast<const z8536_interface *>(static_config());
- if (intf != NULL)
- *static_cast<z8536_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_int_func, 0, sizeof(m_out_int_func));
- memset(&m_in_pa_func, 0, sizeof(m_in_pa_func));
- memset(&m_out_pa_func, 0, sizeof(m_out_pa_func));
- memset(&m_in_pb_func, 0, sizeof(m_in_pb_func));
- memset(&m_out_pb_func, 0, sizeof(m_out_pb_func));
- memset(&m_in_pc_func, 0, sizeof(m_in_pc_func));
- memset(&m_out_pc_func, 0, sizeof(m_out_pc_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -415,14 +375,40 @@ inline void z8536_device::gate(device_timer_id id)
// z8536_device - constructor
//-------------------------------------------------
-z8536_device::z8536_device(running_machine &_machine, const z8536_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+z8536_device::z8536_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, Z8536, "Zilog Z8536", tag, owner, clock)
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void z8536_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const z8536_interface *intf = reinterpret_cast<const z8536_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<z8536_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
+ memset(&m_in_pa_cb, 0, sizeof(m_in_pa_cb));
+ memset(&m_out_pa_cb, 0, sizeof(m_out_pa_cb));
+ memset(&m_in_pb_cb, 0, sizeof(m_in_pb_cb));
+ memset(&m_out_pb_cb, 0, sizeof(m_out_pb_cb));
+ memset(&m_in_pc_cb, 0, sizeof(m_in_pc_cb));
+ memset(&m_out_pc_cb, 0, sizeof(m_out_pc_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -434,13 +420,13 @@ void z8536_device::device_start()
m_timer[TIMER_3] = timer_alloc(TIMER_3);
// resolve callbacks
- devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
- devcb_resolve_read8(&m_in_pa_func, &m_config.m_in_pa_func, this);
- devcb_resolve_write8(&m_out_pa_func, &m_config.m_out_pa_func, this);
- devcb_resolve_read8(&m_in_pb_func, &m_config.m_in_pb_func, this);
- devcb_resolve_write8(&m_out_pb_func, &m_config.m_out_pb_func, this);
- devcb_resolve_read8(&m_in_pc_func, &m_config.m_in_pc_func, this);
- devcb_resolve_write8(&m_out_pc_func, &m_config.m_out_pc_func, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
+ devcb_resolve_read8(&m_in_pa_func, &m_in_pa_cb, this);
+ devcb_resolve_write8(&m_out_pa_func, &m_out_pa_cb, this);
+ devcb_resolve_read8(&m_in_pb_func, &m_in_pb_cb, this);
+ devcb_resolve_write8(&m_out_pb_func, &m_out_pb_cb, this);
+ devcb_resolve_read8(&m_in_pc_func, &m_in_pc_cb, this);
+ devcb_resolve_write8(&m_out_pc_func, &m_out_pc_cb, this);
}
diff --git a/src/emu/machine/z8536.h b/src/emu/machine/z8536.h
index 9a71eafa92f..10862269ade 100644
--- a/src/emu/machine/z8536.h
+++ b/src/emu/machine/z8536.h
@@ -67,50 +67,28 @@
struct z8536_interface
{
- devcb_write_line m_out_int_func;
+ devcb_write_line m_out_int_cb;
- devcb_read8 m_in_pa_func;
- devcb_write8 m_out_pa_func;
+ devcb_read8 m_in_pa_cb;
+ devcb_write8 m_out_pa_cb;
- devcb_read8 m_in_pb_func;
- devcb_write8 m_out_pb_func;
+ devcb_read8 m_in_pb_cb;
+ devcb_write8 m_out_pb_cb;
- devcb_read8 m_in_pc_func;
- devcb_write8 m_out_pc_func;
-};
-
-
-// ======================> z8536_device_config
-
-class z8536_device_config : public device_config,
- public z8536_interface
-{
- friend class z8536_device;
-
- // construction/destruction
- z8536_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read8 m_in_pc_cb;
+ devcb_write8 m_out_pc_cb;
};
// ======================> z8536_device
-class z8536_device : public device_t
+class z8536_device : public device_t,
+ public z8536_interface
{
- friend class z8536_device_config;
-
+public:
// construction/destruction
- z8536_device(running_machine &_machine, const z8536_device_config &_config);
+ z8536_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -131,6 +109,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -169,8 +148,6 @@ private:
// timers
emu_timer *m_timer[3];
-
- const z8536_device_config &m_config;
};
diff --git a/src/emu/mconfig.c b/src/emu/mconfig.c
index 4986d569234..4bb0fbdeab7 100644
--- a/src/emu/mconfig.c
+++ b/src/emu/mconfig.c
@@ -67,27 +67,24 @@ machine_config::machine_config(const game_driver &gamedrv, emu_options &options)
(*gamedrv.machine_config)(*this, NULL);
// when finished, set the game driver
- device_config *config = m_devicelist.find("root");
- if (config == NULL)
+ device_t *root = m_devicelist.find("root");
+ if (root == NULL)
throw emu_fatalerror("Machine configuration missing driver_device");
- driver_device_config_base::static_set_game(config, &gamedrv);
+ driver_device::static_set_game(*root, gamedrv);
// process any device-specific machine configurations
- for (device_config *devconfig = m_devicelist.first(); devconfig != NULL; devconfig = devconfig->next())
- if (!devconfig->m_config_complete)
+ for (device_t *device = m_devicelist.first(); device != NULL; device = device->next())
+ if (!device->configured())
{
- machine_config_constructor additions = devconfig->machine_config_additions();
+ machine_config_constructor additions = device->machine_config_additions();
if (additions != NULL)
- (*additions)(*this, devconfig);
+ (*additions)(*this, device);
}
// then notify all devices that their configuration is complete
- for (device_config *devconfig = m_devicelist.first(); devconfig != NULL; devconfig = devconfig->next())
- if (!devconfig->m_config_complete)
- {
- devconfig->config_complete();
- devconfig->m_config_complete = true;
- }
+ for (device_t *device = m_devicelist.first(); device != NULL; device = device->next())
+ if (!device->configured())
+ device->config_complete();
}
@@ -105,9 +102,9 @@ machine_config::~machine_config()
// screen device
//-------------------------------------------------
-screen_device_config *machine_config::first_screen() const
+screen_device *machine_config::first_screen() const
{
- return downcast<screen_device_config *>(m_devicelist.first(SCREEN));
+ return downcast<screen_device *>(m_devicelist.first(SCREEN));
}
@@ -116,7 +113,7 @@ screen_device_config *machine_config::first_screen() const
// new device
//-------------------------------------------------
-device_config *machine_config::device_add(device_config *owner, const char *tag, device_type type, UINT32 clock)
+device_t *machine_config::device_add(device_t *owner, const char *tag, device_type type, UINT32 clock)
{
astring tempstring;
const char *fulltag = owner->subtag(tempstring, tag);
@@ -129,7 +126,7 @@ device_config *machine_config::device_add(device_config *owner, const char *tag,
// replace one device with a new device
//-------------------------------------------------
-device_config *machine_config::device_replace(device_config *owner, const char *tag, device_type type, UINT32 clock)
+device_t *machine_config::device_replace(device_t *owner, const char *tag, device_type type, UINT32 clock)
{
astring tempstring;
const char *fulltag = owner->subtag(tempstring, tag);
@@ -142,7 +139,7 @@ device_config *machine_config::device_replace(device_config *owner, const char *
// remove a device
//-------------------------------------------------
-device_config *machine_config::device_remove(device_config *owner, const char *tag)
+device_t *machine_config::device_remove(device_t *owner, const char *tag)
{
astring tempstring;
const char *fulltag = owner->subtag(tempstring, tag);
@@ -156,11 +153,11 @@ device_config *machine_config::device_remove(device_config *owner, const char *t
// locate a device
//-------------------------------------------------
-device_config *machine_config::device_find(device_config *owner, const char *tag)
+device_t *machine_config::device_find(device_t *owner, const char *tag)
{
astring tempstring;
const char *fulltag = owner->subtag(tempstring, tag);
- device_config *device = m_devicelist.find(fulltag);
+ device_t *device = m_devicelist.find(fulltag);
if (device == NULL)
throw emu_fatalerror("Unable to find device: tag=%s\n", fulltag);
return device;
diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h
index 0aa8914d648..672c70ea39c 100644
--- a/src/emu/mconfig.h
+++ b/src/emu/mconfig.h
@@ -105,7 +105,7 @@
// forward references
struct gfx_decode_entry;
class driver_device;
-class screen_device_config;
+class screen_device;
@@ -131,8 +131,9 @@ public:
// getters
const game_driver &gamedrv() const { return m_gamedrv; }
- const device_config *first_device() const { return m_devicelist.first(); }
- screen_device_config *first_screen() const;
+ const device_list &devicelist() const { return m_devicelist; }
+ const device_t *first_device() const { return m_devicelist.first(); }
+ screen_device *first_screen() const;
emu_options &options() const { return m_options; }
// public state
@@ -149,17 +150,16 @@ public:
UINT32 m_total_colors; // total number of colors in the palette
const char * m_default_layout; // default layout for this machine
- device_config_list m_devicelist; // list of device configs
-
// helpers during configuration; not for general use
- device_config *device_add(device_config *owner, const char *tag, device_type type, UINT32 clock);
- device_config *device_replace(device_config *owner, const char *tag, device_type type, UINT32 clock);
- device_config *device_remove(device_config *owner, const char *tag);
- device_config *device_find(device_config *owner, const char *tag);
+ device_t *device_add(device_t *owner, const char *tag, device_type type, UINT32 clock);
+ device_t *device_replace(device_t *owner, const char *tag, device_type type, UINT32 clock);
+ device_t *device_remove(device_t *owner, const char *tag);
+ device_t *device_find(device_t *owner, const char *tag);
private:
const game_driver & m_gamedrv;
emu_options & m_options;
+ device_list m_devicelist; // list of device configs
};
@@ -172,19 +172,19 @@ private:
#define MACHINE_CONFIG_NAME(_name) construct_machine_config_##_name
#define MACHINE_CONFIG_START(_name, _class) \
-device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \
+device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \
{ \
- device_config *device = NULL; \
+ device_t *device = NULL; \
const char *tag; \
astring tempstring; \
(void)device; \
(void)tag; \
- if (owner == NULL) owner = config.device_add(NULL, "root", &driver_device_config<_class>::static_alloc_device_config, 0); \
+ if (owner == NULL) owner = config.device_add(NULL, "root", &driver_device_creator<_class>, 0); \
#define MACHINE_CONFIG_FRAGMENT(_name) \
-device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \
+device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \
{ \
- device_config *device = NULL; \
+ device_t *device = NULL; \
const char *tag; \
astring tempstring; \
(void)device; \
@@ -192,9 +192,9 @@ device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config
assert(owner != NULL); \
#define MACHINE_CONFIG_DERIVED(_name, _base) \
-device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \
+device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \
{ \
- device_config *device = NULL; \
+ device_t *device = NULL; \
const char *tag; \
astring tempstring; \
(void)device; \
@@ -203,14 +203,14 @@ device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config
assert(owner != NULL); \
#define MACHINE_CONFIG_DERIVED_CLASS(_name, _base, _class) \
-device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \
+device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner) \
{ \
- device_config *device = NULL; \
+ device_t *device = NULL; \
const char *tag; \
astring tempstring; \
(void)device; \
(void)tag; \
- if (owner == NULL) owner = config.device_add(NULL, "root", &driver_device_config<_class>::static_alloc_device_config, 0); \
+ if (owner == NULL) owner = config.device_add(NULL, "root", &driver_device_creator<_class>, 0); \
owner = MACHINE_CONFIG_NAME(_base)(config, owner); \
#define MACHINE_CONFIG_END \
@@ -219,7 +219,7 @@ device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config
// use this to declare external references to a machine driver
#define MACHINE_CONFIG_EXTERN(_name) \
- extern device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner)
+ extern device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t *owner)
// importing data from other machine drivers
@@ -265,29 +265,29 @@ device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config
// core machine functions
#define MCFG_MACHINE_START(_func) \
- driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_MACHINE_START, MACHINE_START_NAME(_func)); \
+ driver_device::static_set_callback(*owner, driver_device::CB_MACHINE_START, MACHINE_START_NAME(_func)); \
#define MCFG_MACHINE_RESET(_func) \
- driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_MACHINE_RESET, MACHINE_RESET_NAME(_func)); \
+ driver_device::static_set_callback(*owner, driver_device::CB_MACHINE_RESET, MACHINE_RESET_NAME(_func)); \
// core sound functions
#define MCFG_SOUND_START(_func) \
- driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_SOUND_START, SOUND_START_NAME(_func)); \
+ driver_device::static_set_callback(*owner, driver_device::CB_SOUND_START, SOUND_START_NAME(_func)); \
#define MCFG_SOUND_RESET(_func) \
- driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_SOUND_RESET, SOUND_RESET_NAME(_func)); \
+ driver_device::static_set_callback(*owner, driver_device::CB_SOUND_RESET, SOUND_RESET_NAME(_func)); \
// core video functions
#define MCFG_PALETTE_INIT(_func) \
- driver_device_config_base::static_set_palette_init(owner, PALETTE_INIT_NAME(_func)); \
+ driver_device::static_set_palette_init(*owner, PALETTE_INIT_NAME(_func)); \
#define MCFG_VIDEO_START(_func) \
- driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_VIDEO_START, VIDEO_START_NAME(_func)); \
+ driver_device::static_set_callback(*owner, driver_device::CB_VIDEO_START, VIDEO_START_NAME(_func)); \
#define MCFG_VIDEO_RESET(_func) \
- driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_VIDEO_RESET, VIDEO_RESET_NAME(_func)); \
+ driver_device::static_set_callback(*owner, driver_device::CB_VIDEO_RESET, VIDEO_RESET_NAME(_func)); \
// add/remove devices
diff --git a/src/emu/memory.c b/src/emu/memory.c
index ea05fc5bb3f..868b7ede6e3 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -1564,7 +1564,7 @@ void memory_init(running_machine &machine)
// loop over devices and spaces within each device
device_memory_interface *memory = NULL;
- for (bool gotone = machine.m_devicelist.first(memory); gotone; gotone = memory->next(memory))
+ for (bool gotone = machine.devicelist().first(memory); gotone; gotone = memory->next(memory))
for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
{
// if there is a configuration for this space, we need an address space
@@ -1940,7 +1940,7 @@ void address_space::prepare_map()
UINT32 devregionsize = (devregion != NULL) ? devregion->bytes() : 0;
// allocate the address map
- m_map = global_alloc(address_map(m_device.baseconfig(), m_spacenum));
+ m_map = global_alloc(address_map(m_device, m_spacenum));
// extract global parameters specified by the map
m_unmap = (m_map->m_unmapval == 0) ? 0 : ~0;
diff --git a/src/emu/memory.h b/src/emu/memory.h
index 4af8347f701..81f6b50fd65 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -84,7 +84,6 @@ enum read_or_write
// referenced types from other classes
class device_memory_interface;
-class device_config;
class device_t;
struct game_driver;
@@ -103,7 +102,7 @@ class address_table_write;
typedef UINT32 offs_t;
// address map constructors are functions that build up an address_map
-typedef void (*address_map_constructor)(address_map &map, const device_config &devconfig);
+typedef void (*address_map_constructor)(address_map &map, const device_t &devconfig);
// legacy space read/write handlers
diff --git a/src/emu/profiler.c b/src/emu/profiler.c
index 507b31c09ed..c4c6e49a4e1 100644
--- a/src/emu/profiler.c
+++ b/src/emu/profiler.c
@@ -252,7 +252,7 @@ const char *real_profiler_state::text(running_machine &machine, astring &string)
// and then the text
if (curtype >= PROFILER_DEVICE_FIRST && curtype <= PROFILER_DEVICE_MAX)
- string.catprintf("'%s'", machine.m_devicelist.find(curtype - PROFILER_DEVICE_FIRST)->tag());
+ string.catprintf("'%s'", machine.devicelist().find(curtype - PROFILER_DEVICE_FIRST)->tag());
else
for (int 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 dd3291466c9..d6e8c2d875f 100644
--- a/src/emu/render.c
+++ b/src/emu/render.c
@@ -1199,7 +1199,7 @@ int render_target::configured_view(const char *viewname, int targetindex, int nu
}
// if we don't have a match, default to the nth view
- int scrcount = m_manager.machine().m_devicelist.count(SCREEN);
+ int scrcount = m_manager.machine().devicelist().count(SCREEN);
if (view == NULL && scrcount > 0)
{
// if we have enough targets to be one per screen, assign in order
@@ -1334,7 +1334,7 @@ void render_target::compute_minimum_size(INT32 &minwidth, INT32 &minheight)
int screens_considered = 0;
// early exit in case we are called between device teardown and render teardown
- if (m_manager.machine().m_devicelist.count() == 0)
+ if (m_manager.machine().devicelist().count() == 0)
{
minwidth = 640;
minheight = 480;
@@ -1651,7 +1651,7 @@ void render_target::load_layout_files(const char *layoutfile, bool singlefile)
load_layout_file(driver_list::driver(cloneof).name, "default");
// now do the built-in layouts for single-screen games
- if (m_manager.machine().m_devicelist.count(SCREEN) == 1)
+ if (m_manager.machine().devicelist().count(SCREEN) == 1)
{
if (system.flags & ORIENTATION_SWAP_XY)
load_layout_file(NULL, layout_vertical);
diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c
index a42d58c8e6b..1501dae86f7 100644
--- a/src/emu/rendlay.c
+++ b/src/emu/rendlay.c
@@ -200,16 +200,16 @@ static int get_variable_value(running_machine &machine, const char *string, char
char temp[100];
// screen 0 parameters
- for (const screen_device_config *devconfig = machine.config().first_screen(); devconfig != NULL; devconfig = devconfig->next_screen())
+ for (const screen_device *device = machine.first_screen(); device != NULL; device = device->next_screen())
{
- int scrnum = machine.config().m_devicelist.indexof(SCREEN, devconfig->tag());
+ int scrnum = machine.devicelist().indexof(SCREEN, device->tag());
// native X aspect factor
sprintf(temp, "~scr%dnativexaspect~", scrnum);
if (!strncmp(string, temp, strlen(temp)))
{
- int num = devconfig->visible_area().max_x + 1 - devconfig->visible_area().min_x;
- int den = devconfig->visible_area().max_y + 1 - devconfig->visible_area().min_y;
+ int num = device->visible_area().max_x + 1 - device->visible_area().min_x;
+ int den = device->visible_area().max_y + 1 - device->visible_area().min_y;
reduce_fraction(num, den);
*outputptr += sprintf(*outputptr, "%d", num);
return strlen(temp);
@@ -219,8 +219,8 @@ static int get_variable_value(running_machine &machine, const char *string, char
sprintf(temp, "~scr%dnativeyaspect~", scrnum);
if (!strncmp(string, temp, strlen(temp)))
{
- int num = devconfig->visible_area().max_x + 1 - devconfig->visible_area().min_x;
- int den = devconfig->visible_area().max_y + 1 - devconfig->visible_area().min_y;
+ int num = device->visible_area().max_x + 1 - device->visible_area().min_x;
+ int den = device->visible_area().max_y + 1 - device->visible_area().min_y;
reduce_fraction(num, den);
*outputptr += sprintf(*outputptr, "%d", den);
return strlen(temp);
@@ -230,7 +230,7 @@ static int get_variable_value(running_machine &machine, const char *string, char
sprintf(temp, "~scr%dwidth~", scrnum);
if (!strncmp(string, temp, strlen(temp)))
{
- *outputptr += sprintf(*outputptr, "%d", devconfig->visible_area().max_x + 1 - devconfig->visible_area().min_x);
+ *outputptr += sprintf(*outputptr, "%d", device->visible_area().max_x + 1 - device->visible_area().min_x);
return strlen(temp);
}
@@ -238,7 +238,7 @@ static int get_variable_value(running_machine &machine, const char *string, char
sprintf(temp, "~scr%dheight~", scrnum);
if (!strncmp(string, temp, strlen(temp)))
{
- *outputptr += sprintf(*outputptr, "%d", devconfig->visible_area().max_y + 1 - devconfig->visible_area().min_y);
+ *outputptr += sprintf(*outputptr, "%d", device->visible_area().max_y + 1 - device->visible_area().min_y);
return strlen(temp);
}
}
@@ -1868,7 +1868,7 @@ layout_view::item::item(running_machine &machine, xml_data_node &itemnode, simpl
// fetch common data
int index = xml_get_attribute_int_with_subst(machine, itemnode, "index", -1);
if (index != -1)
- m_screen = downcast<screen_device *>(machine.m_devicelist.find(SCREEN, index));
+ m_screen = downcast<screen_device *>(machine.devicelist().find(SCREEN, index));
m_input_mask = xml_get_attribute_int_with_subst(machine, itemnode, "inputmask", 0);
if (m_output_name[0] != 0 && m_element != NULL)
output_set_value(m_output_name, m_element->default_state());
diff --git a/src/emu/romload.c b/src/emu/romload.c
index 46cf9c09d81..8c1875c2920 100644
--- a/src/emu/romload.c
+++ b/src/emu/romload.c
@@ -187,9 +187,9 @@ void set_disk_handle(running_machine &machine, const char *region, emu_file &fil
const rom_source *rom_first_source(const machine_config &config)
{
/* look through devices */
- for (const device_config *devconfig = config.m_devicelist.first(); devconfig != NULL; devconfig = devconfig->next())
- if (devconfig->rom_region() != NULL)
- return devconfig;
+ for (const device_t *device = config.devicelist().first(); device != NULL; device = device->next())
+ if (device->rom_region() != NULL)
+ return device;
return NULL;
}
@@ -203,9 +203,9 @@ const rom_source *rom_first_source(const machine_config &config)
const rom_source *rom_next_source(const rom_source &previous)
{
/* look for further devices with ROM definitions */
- for (const device_config *devconfig = previous.next(); devconfig != NULL; devconfig = devconfig->next())
- if (devconfig->rom_region() != NULL)
- return (rom_source *)devconfig;
+ for (const device_t *device = previous.next(); device != NULL; device = device->next())
+ if (device->rom_region() != NULL)
+ return (rom_source *)device;
return NULL;
}
diff --git a/src/emu/romload.h b/src/emu/romload.h
index 65451683ec7..7025ddcfa17 100644
--- a/src/emu/romload.h
+++ b/src/emu/romload.h
@@ -126,7 +126,7 @@ enum
class machine_config;
class emu_options;
-typedef device_config rom_source;
+typedef device_t rom_source;
struct rom_entry
diff --git a/src/emu/schedule.c b/src/emu/schedule.c
index 1285082e5b6..c3eccffe635 100644
--- a/src/emu/schedule.c
+++ b/src/emu/schedule.c
@@ -756,7 +756,7 @@ void device_scheduler::rebuild_execute_list()
// iterate over all devices
device_execute_interface *exec = NULL;
- for (bool gotone = machine().m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine().devicelist().first(exec); gotone; gotone = exec->next(exec))
{
// append to the appropriate list
exec->m_nextexec = NULL;
diff --git a/src/emu/screen.c b/src/emu/screen.c
index df7b37627af..896e47c62f4 100644
--- a/src/emu/screen.c
+++ b/src/emu/screen.c
@@ -57,25 +57,24 @@
// GLOBAL VARIABLES
//**************************************************************************
-const device_type SCREEN = screen_device_config::static_alloc_device_config;
+// device type definition
+const device_type SCREEN = &device_creator<screen_device>;
const attotime screen_device::DEFAULT_FRAME_PERIOD(attotime::from_hz(DEFAULT_FRAME_RATE));
//**************************************************************************
-// SCREEN DEVICE CONFIGURATION
+// SCREEN DEVICE
//**************************************************************************
//-------------------------------------------------
-// screen_device_config - constructor
+// screen_device - constructor
//-------------------------------------------------
-screen_device_config::screen_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Video Screen", tag, owner, clock),
+screen_device::screen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SCREEN, "Video Screen", tag, owner, clock),
m_type(SCREEN_TYPE_RASTER),
- m_width(0),
- m_height(0),
m_oldstyle_vblank_supplied(false),
m_refresh(0),
m_vblank(0),
@@ -85,29 +84,45 @@ screen_device_config::screen_device_config(const machine_config &mconfig, const
m_xscale(1.0f),
m_yscale(1.0f),
m_screen_update(NULL),
- m_screen_eof(NULL)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *screen_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
+ m_screen_eof(NULL),
+ m_container(NULL),
+ m_width(100),
+ m_height(100),
+ m_burnin(NULL),
+ m_curbitmap(0),
+ m_curtexture(0),
+ m_texture_format(0),
+ m_changed(true),
+ m_last_partial_scan(0),
+ m_screen_overlay_bitmap(NULL),
+ m_frame_period(DEFAULT_FRAME_PERIOD.as_attoseconds()),
+ m_scantime(1),
+ m_pixeltime(1),
+ m_vblank_period(0),
+ m_vblank_start_time(attotime::zero),
+ m_vblank_end_time(attotime::zero),
+ m_vblank_begin_timer(NULL),
+ m_vblank_end_timer(NULL),
+ m_scanline0_timer(NULL),
+ m_scanline_timer(NULL),
+ m_frame_number(0),
+ m_partial_updates_this_frame(0),
+ m_callback_list(NULL)
{
- return global_alloc(screen_device_config(mconfig, tag, owner, clock));
+ m_visarea.min_x = m_visarea.min_y = 0;
+ m_visarea.max_x = m_width - 1;
+ m_visarea.max_y = m_height - 1;
+ memset(m_texture, 0, sizeof(m_texture));
+ memset(m_bitmap, 0, sizeof(m_bitmap));
}
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// ~screen_device - destructor
//-------------------------------------------------
-device_t *screen_device_config::alloc_device(running_machine &machine) const
+screen_device::~screen_device()
{
- return auto_alloc(machine, screen_device(machine, *this));
}
@@ -116,10 +131,10 @@ device_t *screen_device_config::alloc_device(running_machine &machine) const
// to set the bitmap format
//-------------------------------------------------
-void screen_device_config::static_set_format(device_config *device, bitmap_format format)
+void screen_device::static_set_format(device_t &device, bitmap_format format)
{
- screen_device_config *screen = downcast<screen_device_config *>(device);
- screen->m_format = format;
+ screen_device &screen = downcast<screen_device &>(device);
+ screen.m_format = format;
}
@@ -128,10 +143,10 @@ void screen_device_config::static_set_format(device_config *device, bitmap_forma
// to set the screen type
//-------------------------------------------------
-void screen_device_config::static_set_type(device_config *device, screen_type_enum type)
+void screen_device::static_set_type(device_t &device, screen_type_enum type)
{
- screen_device_config *screen = downcast<screen_device_config *>(device);
- screen->m_type = type;
+ screen_device &screen = downcast<screen_device &>(device);
+ screen.m_type = type;
}
@@ -140,17 +155,17 @@ void screen_device_config::static_set_type(device_config *device, screen_type_en
// to set the raw screen parameters
//-------------------------------------------------
-void screen_device_config::static_set_raw(device_config *device, UINT32 pixclock, UINT16 htotal, UINT16 hbend, UINT16 hbstart, UINT16 vtotal, UINT16 vbend, UINT16 vbstart)
+void screen_device::static_set_raw(device_t &device, UINT32 pixclock, UINT16 htotal, UINT16 hbend, UINT16 hbstart, UINT16 vtotal, UINT16 vbend, UINT16 vbstart)
{
- screen_device_config *screen = downcast<screen_device_config *>(device);
- screen->m_refresh = HZ_TO_ATTOSECONDS(pixclock) * htotal * vtotal;
- screen->m_vblank = screen->m_refresh / vtotal * (vtotal - (vbstart - vbend));
- screen->m_width = htotal;
- screen->m_height = vtotal;
- screen->m_visarea.min_x = hbend;
- screen->m_visarea.max_x = hbstart - 1;
- screen->m_visarea.min_y = vbend;
- screen->m_visarea.max_y = vbstart - 1;
+ screen_device &screen = downcast<screen_device &>(device);
+ screen.m_refresh = HZ_TO_ATTOSECONDS(pixclock) * htotal * vtotal;
+ screen.m_vblank = screen.m_refresh / vtotal * (vtotal - (vbstart - vbend));
+ screen.m_width = htotal;
+ screen.m_height = vtotal;
+ screen.m_visarea.min_x = hbend;
+ screen.m_visarea.max_x = hbstart - 1;
+ screen.m_visarea.min_y = vbend;
+ screen.m_visarea.max_y = vbstart - 1;
}
@@ -159,10 +174,10 @@ void screen_device_config::static_set_raw(device_config *device, UINT32 pixclock
// to set the refresh rate
//-------------------------------------------------
-void screen_device_config::static_set_refresh(device_config *device, attoseconds_t rate)
+void screen_device::static_set_refresh(device_t &device, attoseconds_t rate)
{
- screen_device_config *screen = downcast<screen_device_config *>(device);
- screen->m_refresh = rate;
+ screen_device &screen = downcast<screen_device &>(device);
+ screen.m_refresh = rate;
}
@@ -171,11 +186,11 @@ void screen_device_config::static_set_refresh(device_config *device, attoseconds
// to set the VBLANK duration
//-------------------------------------------------
-void screen_device_config::static_set_vblank_time(device_config *device, attoseconds_t time)
+void screen_device::static_set_vblank_time(device_t &device, attoseconds_t time)
{
- screen_device_config *screen = downcast<screen_device_config *>(device);
- screen->m_vblank = time;
- screen->m_oldstyle_vblank_supplied = true;
+ screen_device &screen = downcast<screen_device &>(device);
+ screen.m_vblank = time;
+ screen.m_oldstyle_vblank_supplied = true;
}
@@ -184,11 +199,11 @@ void screen_device_config::static_set_vblank_time(device_config *device, attosec
// the width/height of the screen
//-------------------------------------------------
-void screen_device_config::static_set_size(device_config *device, UINT16 width, UINT16 height)
+void screen_device::static_set_size(device_t &device, UINT16 width, UINT16 height)
{
- screen_device_config *screen = downcast<screen_device_config *>(device);
- screen->m_width = width;
- screen->m_height = height;
+ screen_device &screen = downcast<screen_device &>(device);
+ screen.m_width = width;
+ screen.m_height = height;
}
@@ -197,13 +212,13 @@ void screen_device_config::static_set_size(device_config *device, UINT16 width,
// set the visible area of the screen
//-------------------------------------------------
-void screen_device_config::static_set_visarea(device_config *device, INT16 minx, INT16 maxx, INT16 miny, INT16 maxy)
+void screen_device::static_set_visarea(device_t &device, INT16 minx, INT16 maxx, INT16 miny, INT16 maxy)
{
- screen_device_config *screen = downcast<screen_device_config *>(device);
- screen->m_visarea.min_x = minx;
- screen->m_visarea.max_x = maxx;
- screen->m_visarea.min_y = miny;
- screen->m_visarea.max_y = maxy;
+ screen_device &screen = downcast<screen_device &>(device);
+ screen.m_visarea.min_x = minx;
+ screen.m_visarea.max_x = maxx;
+ screen.m_visarea.min_y = miny;
+ screen.m_visarea.max_y = maxy;
}
@@ -213,13 +228,37 @@ void screen_device_config::static_set_visarea(device_config *device, INT16 minx,
// factors for the screen
//-------------------------------------------------
-void screen_device_config::static_set_default_position(device_config *device, double xscale, double xoffs, double yscale, double yoffs)
+void screen_device::static_set_default_position(device_t &device, double xscale, double xoffs, double yscale, double yoffs)
+{
+ screen_device &screen = downcast<screen_device &>(device);
+ screen.m_xscale = xscale;
+ screen.m_xoffset = xoffs;
+ screen.m_yscale = yscale;
+ screen.m_yoffset = yoffs;
+}
+
+
+//-------------------------------------------------
+// static_set_screen_update - set the legacy
+// screen update callback in the device
+// configuration
+//-------------------------------------------------
+
+void screen_device::static_set_screen_update(device_t &device, screen_update_func callback)
+{
+ downcast<screen_device &>(device).m_screen_update = callback;
+}
+
+
+//-------------------------------------------------
+// static_set_screen_eof - set the legacy
+// screen eof callback in the device
+// configuration
+//-------------------------------------------------
+
+void screen_device::static_set_screen_eof(device_t &device, screen_eof_func callback)
{
- screen_device_config *screen = downcast<screen_device_config *>(device);
- screen->m_xscale = xscale;
- screen->m_xoffset = xoffs;
- screen->m_yscale = yscale;
- screen->m_yoffset = yoffs;
+ downcast<screen_device &>(device).m_screen_eof = callback;
}
@@ -228,7 +267,7 @@ void screen_device_config::static_set_default_position(device_config *device, do
// configuration
//-------------------------------------------------
-bool screen_device_config::device_validity_check(emu_options &options, const game_driver &driver) const
+bool screen_device::device_validity_check(emu_options &options, const game_driver &driver) const
{
bool error = false;
@@ -271,90 +310,6 @@ bool screen_device_config::device_validity_check(emu_options &options, const gam
}
-
-
-//-------------------------------------------------
-// static_set_screen_update - set the legacy
-// screen update callback in the device
-// configuration
-//-------------------------------------------------
-
-void screen_device_config::static_set_screen_update(device_config *device, screen_update_func callback)
-{
- assert(device != NULL);
- downcast<screen_device_config *>(device)->m_screen_update = callback;
-}
-
-
-//-------------------------------------------------
-// static_set_screen_eof - set the legacy
-// screen eof callback in the device
-// configuration
-//-------------------------------------------------
-
-void screen_device_config::static_set_screen_eof(device_config *device, screen_eof_func callback)
-{
- assert(device != NULL);
- downcast<screen_device_config *>(device)->m_screen_eof = callback;
-}
-
-
-
-//**************************************************************************
-// SCREEN DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// screen_device - constructor
-//-------------------------------------------------
-
-screen_device::screen_device(running_machine &_machine, const screen_device_config &config)
- : device_t(_machine, config),
- m_config(config),
- m_container(NULL),
- m_width(m_config.m_width),
- m_height(m_config.m_height),
- m_visarea(m_config.m_visarea),
- m_burnin(NULL),
- m_curbitmap(0),
- m_curtexture(0),
- m_texture_format(0),
- m_changed(true),
- m_last_partial_scan(0),
- m_screen_overlay_bitmap(NULL),
- m_frame_period(m_config.m_refresh),
- m_scantime(1),
- m_pixeltime(1),
- m_vblank_period(0),
- m_vblank_start_time(attotime::zero),
- m_vblank_end_time(attotime::zero),
- m_vblank_begin_timer(NULL),
- m_vblank_end_timer(NULL),
- m_scanline0_timer(NULL),
- m_scanline_timer(NULL),
- m_frame_number(0),
- m_partial_updates_this_frame(0),
- m_callback_list(NULL)
-{
- memset(m_texture, 0, sizeof(m_texture));
- memset(m_bitmap, 0, sizeof(m_bitmap));
-}
-
-
-//-------------------------------------------------
-// ~screen_device - destructor
-//-------------------------------------------------
-
-screen_device::~screen_device()
-{
- machine().render().texture_free(m_texture[0]);
- machine().render().texture_free(m_texture[1]);
- if (m_burnin != NULL)
- finalize_burnin();
- global_free(m_screen_overlay_bitmap);
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -364,10 +319,10 @@ void screen_device::device_start()
// configure the default cliparea
render_container::user_settings settings;
m_container->get_user_settings(settings);
- settings.m_xoffset = m_config.m_xoffset;
- settings.m_yoffset = m_config.m_yoffset;
- settings.m_xscale = m_config.m_xscale;
- settings.m_yscale = m_config.m_yscale;
+ settings.m_xoffset = m_xoffset;
+ settings.m_yoffset = m_yoffset;
+ settings.m_xscale = m_xscale;
+ settings.m_yscale = m_yscale;
m_container->set_user_settings(settings);
// allocate the VBLANK timers
@@ -382,7 +337,7 @@ void screen_device::device_start()
m_scanline_timer = machine().scheduler().timer_alloc(FUNC(static_scanline_update_callback), (void *)this);
// configure the screen with the default parameters
- configure(m_config.m_width, m_config.m_height, m_config.m_visarea, m_config.m_refresh);
+ configure(m_width, m_height, m_visarea, m_refresh);
// reset VBLANK timing
m_vblank_start_time = attotime::zero;
@@ -428,6 +383,21 @@ void screen_device::device_start()
//-------------------------------------------------
+// device_stop - clean up before the machine goes
+// away
+//-------------------------------------------------
+
+void screen_device::device_stop()
+{
+ machine().render().texture_free(m_texture[0]);
+ machine().render().texture_free(m_texture[1]);
+ if (m_burnin != NULL)
+ finalize_burnin();
+ global_free(m_screen_overlay_bitmap);
+}
+
+
+//-------------------------------------------------
// device_post_load - device-specific update
// after a save state is loaded
//-------------------------------------------------
@@ -449,8 +419,8 @@ void screen_device::configure(int width, int height, const rectangle &visarea, a
assert(height > 0);
assert(visarea.min_x >= 0);
assert(visarea.min_y >= 0);
- assert(m_config.m_type == SCREEN_TYPE_VECTOR || visarea.min_x < width);
- assert(m_config.m_type == SCREEN_TYPE_VECTOR || visarea.min_y < height);
+ assert(m_type == SCREEN_TYPE_VECTOR || visarea.min_x < width);
+ assert(m_type == SCREEN_TYPE_VECTOR || visarea.min_y < height);
assert(frame_period > 0);
// fill in the new parameters
@@ -468,10 +438,10 @@ void screen_device::configure(int width, int height, const rectangle &visarea, a
// if there has been no VBLANK time specified in the MACHINE_DRIVER, compute it now
// from the visible area, otherwise just used the supplied value
- if (m_config.m_vblank == 0 && !m_config.m_oldstyle_vblank_supplied)
+ if (m_vblank == 0 && !m_oldstyle_vblank_supplied)
m_vblank_period = m_scantime * (height - (visarea.max_y + 1 - visarea.min_y));
else
- m_vblank_period = m_config.m_vblank;
+ m_vblank_period = m_vblank;
// if we are on scanline 0 already, reset the update timer immediately
// otherwise, defer until the next scanline 0
@@ -523,7 +493,7 @@ void screen_device::reset_origin(int beamy, int beamx)
void screen_device::realloc_screen_bitmaps()
{
- if (m_config.m_type == SCREEN_TYPE_VECTOR)
+ if (m_type == SCREEN_TYPE_VECTOR)
return;
int curwidth = 0, curheight = 0;
@@ -550,7 +520,7 @@ void screen_device::realloc_screen_bitmaps()
// choose the texture format - convert the screen format to a texture format
palette_t *palette = NULL;
- switch (m_config.m_format)
+ switch (m_format)
{
case BITMAP_FORMAT_INDEXED16: m_texture_format = TEXFORMAT_PALETTE16; palette = machine().palette; break;
case BITMAP_FORMAT_RGB15: m_texture_format = TEXFORMAT_RGB15; palette = NULL; break;
@@ -559,9 +529,9 @@ void screen_device::realloc_screen_bitmaps()
}
// allocate bitmaps
- m_bitmap[0] = auto_alloc(machine(), bitmap_t(curwidth, curheight, m_config.m_format));
+ m_bitmap[0] = auto_alloc(machine(), bitmap_t(curwidth, curheight, m_format));
bitmap_set_palette(m_bitmap[0], machine().palette);
- m_bitmap[1] = auto_alloc(machine(), bitmap_t(curwidth, curheight, m_config.m_format));
+ m_bitmap[1] = auto_alloc(machine(), bitmap_t(curwidth, curheight, m_format));
bitmap_set_palette(m_bitmap[1], machine().palette);
// allocate textures
@@ -902,7 +872,7 @@ bool screen_device::update_quads()
if (machine().render().is_live(*this))
{
// only update if empty and not a vector game; otherwise assume the driver did it directly
- if (m_config.m_type != SCREEN_TYPE_VECTOR && (machine().config().m_video_attributes & VIDEO_SELF_RENDER) == 0)
+ if (m_type != SCREEN_TYPE_VECTOR && (machine().config().m_video_attributes & VIDEO_SELF_RENDER) == 0)
{
// if we're not skipping the frame and if the screen actually changed, then update the texture
if (!machine().video().skip_this_frame() && m_changed)
@@ -1109,8 +1079,8 @@ void screen_device::load_effect_overlay(const char *filename)
bool screen_device::screen_update(bitmap_t &bitmap, const rectangle &cliprect)
{
- if (m_config.m_screen_update != NULL) {
- return (*m_config.m_screen_update)(this, &bitmap, &cliprect);
+ if (m_screen_update != NULL) {
+ return (*m_screen_update)(this, &bitmap, &cliprect);
} else {
machine().driver_data<driver_device>()->screen_update(*this, bitmap, cliprect);
}
@@ -1124,8 +1094,8 @@ bool screen_device::screen_update(bitmap_t &bitmap, const rectangle &cliprect)
void screen_device::screen_eof()
{
- if (m_config.m_screen_eof != NULL) {
- return (*m_config.m_screen_eof)(this, machine());
+ if (m_screen_eof != NULL) {
+ return (*m_screen_eof)(this, machine());
} else {
machine().driver_data<driver_device>()->screen_eof();
}
diff --git a/src/emu/screen.h b/src/emu/screen.h
index 28df0a4b524..c5cc935accd 100644
--- a/src/emu/screen.h
+++ b/src/emu/screen.h
@@ -71,39 +71,31 @@ class render_texture;
class screen_device;
-// device type definition
-extern const device_type SCREEN;
-
-
// callback that is called to notify of a change in the VBLANK state
typedef void (*vblank_state_changed_func)(screen_device &device, void *param, bool vblank_state);
typedef UINT32 (*screen_update_func)(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect);
typedef void (*screen_eof_func)(screen_device *screen, running_machine &machine);
-// ======================> screen_device_config
+// ======================> screen_device
-class screen_device_config : public device_config
+class screen_device : public device_t
{
- friend class screen_device;
-
- // construction/destruction
- screen_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
+ friend class render_manager;
+
public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
+ // construction/destruction
+ screen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~screen_device();
// configuration readers
- screen_device_config *next_screen() const { return downcast<screen_device_config *>(typenext()); }
screen_type_enum screen_type() const { return m_type; }
int width() const { return m_width; }
int height() const { return m_height; }
const rectangle &visible_area() const { return m_visarea; }
bool oldstyle_vblank_supplied() const { return m_oldstyle_vblank_supplied; }
- attoseconds_t refresh() const { return m_refresh; }
- attoseconds_t vblank() const { return m_vblank; }
+ attoseconds_t refresh_attoseconds() const { return m_refresh; }
+ attoseconds_t vblank_attoseconds() const { return m_vblank; }
bitmap_format format() const { return m_format; }
float xoffset() const { return m_xoffset; }
float yoffset() const { return m_yoffset; }
@@ -112,57 +104,19 @@ public:
bool have_screen_update() const { return m_screen_update != NULL; }
// inline configuration helpers
- static void static_set_format(device_config *device, bitmap_format format);
- static void static_set_type(device_config *device, screen_type_enum type);
- static void static_set_raw(device_config *device, UINT32 pixclock, UINT16 htotal, UINT16 hbend, UINT16 hbstart, UINT16 vtotal, UINT16 vbend, UINT16 vbstart);
- static void static_set_refresh(device_config *device, attoseconds_t rate);
- static void static_set_vblank_time(device_config *device, attoseconds_t time);
- static void static_set_size(device_config *device, UINT16 width, UINT16 height);
- static void static_set_visarea(device_config *device, INT16 minx, INT16 maxx, INT16 miny, INT16 maxy);
- static void static_set_default_position(device_config *device, double xscale, double xoffs, double yscale, double yoffs);
- static void static_set_screen_update(device_config *device, screen_update_func callback);
- static void static_set_screen_eof(device_config *device, screen_eof_func callback);
-
-private:
- // device_config overrides
- virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
-
- // inline configuration data
- screen_type_enum m_type; // type of screen
- int m_width, m_height; // default total width/height (HTOTAL, VTOTAL)
- rectangle m_visarea; // default visible area (HBLANK end/start, VBLANK end/start)
- bool m_oldstyle_vblank_supplied; // MCFG_SCREEN_VBLANK_TIME macro used
- attoseconds_t m_refresh; // default refresh period
- attoseconds_t m_vblank; // duration of a VBLANK
- bitmap_format m_format; // bitmap format
- float m_xoffset, m_yoffset; // default X/Y offsets
- float m_xscale, m_yscale; // default X/Y scale factor
- screen_update_func m_screen_update; // screen update callback
- screen_eof_func m_screen_eof; // screen eof callback
-};
-
-
-// ======================> screen_device
-
-class screen_device : public device_t
-{
- friend class screen_device_config;
- friend class render_manager;
- friend resource_pool_object<screen_device>::~resource_pool_object();
-
- // construction/destruction
- screen_device(running_machine &_machine, const screen_device_config &config);
- virtual ~screen_device();
+ static void static_set_format(device_t &device, bitmap_format format);
+ static void static_set_type(device_t &device, screen_type_enum type);
+ static void static_set_raw(device_t &device, UINT32 pixclock, UINT16 htotal, UINT16 hbend, UINT16 hbstart, UINT16 vtotal, UINT16 vbend, UINT16 vbstart);
+ static void static_set_refresh(device_t &device, attoseconds_t rate);
+ static void static_set_vblank_time(device_t &device, attoseconds_t time);
+ static void static_set_size(device_t &device, UINT16 width, UINT16 height);
+ static void static_set_visarea(device_t &device, INT16 minx, INT16 maxx, INT16 miny, INT16 maxy);
+ static void static_set_default_position(device_t &device, double xscale, double xoffs, double yscale, double yoffs);
+ static void static_set_screen_update(device_t &device, screen_update_func callback);
+ static void static_set_screen_eof(device_t &device, screen_eof_func callback);
-public:
// information getters
- const screen_device_config &config() const { return m_config; }
screen_device *next_screen() const { return downcast<screen_device *>(typenext()); }
- screen_type_enum screen_type() const { return m_config.m_type; }
- int width() const { return m_width; }
- int height() const { return m_height; }
- const rectangle &visible_area() const { return m_visarea; }
- bitmap_format format() const { return m_config.m_format; }
render_container &container() const { assert(m_container != NULL); return *m_container; }
bool screen_update(bitmap_t &bitmap, const rectangle &cliprect);
void screen_eof();
@@ -194,7 +148,7 @@ public:
// additional helpers
void register_vblank_callback(vblank_state_changed_func vblank_callback, void *param);
- bitmap_t *alloc_compatible_bitmap(int width = 0, int height = 0) { return auto_bitmap_alloc(machine(), (width == 0) ? m_width : width, (height == 0) ? m_height : height, m_config.m_format); }
+ bitmap_t *alloc_compatible_bitmap(int width = 0, int height = 0) { return auto_bitmap_alloc(machine(), (width == 0) ? m_width : width, (height == 0) ? m_height : height, format()); }
// internal to the video system
bool update_quads();
@@ -206,7 +160,9 @@ public:
private:
// device-level overrides
+ virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
virtual void device_start();
+ virtual void device_stop();
virtual void device_post_load();
// internal helpers
@@ -230,39 +186,49 @@ private:
void finalize_burnin();
void load_effect_overlay(const char *filename);
+ // inline configuration data
+ screen_type_enum m_type; // type of screen
+ bool m_oldstyle_vblank_supplied; // MCFG_SCREEN_VBLANK_TIME macro used
+ attoseconds_t m_refresh; // default refresh period
+ attoseconds_t m_vblank; // duration of a VBLANK
+ bitmap_format m_format; // bitmap format
+ float m_xoffset, m_yoffset; // default X/Y offsets
+ float m_xscale, m_yscale; // default X/Y scale factor
+ screen_update_func m_screen_update; // screen update callback
+ screen_eof_func m_screen_eof; // screen eof callback
+
// internal state
- const screen_device_config &m_config;
- render_container * m_container; // pointer to our container
+ render_container * m_container; // pointer to our container
// dimensions
- int m_width; // current width (HTOTAL)
- int m_height; // current height (VTOTAL)
- rectangle m_visarea; // current visible area (HBLANK end/start, VBLANK end/start)
+ int m_width; // current width (HTOTAL)
+ int m_height; // current height (VTOTAL)
+ rectangle m_visarea; // current visible area (HBLANK end/start, VBLANK end/start)
// textures and bitmaps
- render_texture * m_texture[2]; // 2x textures for the screen bitmap
- bitmap_t * m_bitmap[2]; // 2x bitmaps for rendering
- bitmap_t * m_burnin; // burn-in bitmap
- UINT8 m_curbitmap; // current bitmap index
- UINT8 m_curtexture; // current texture index
- INT32 m_texture_format; // texture format of bitmap for this screen
- bool m_changed; // has this bitmap changed?
- INT32 m_last_partial_scan; // scanline of last partial update
- bitmap_t * m_screen_overlay_bitmap;// screen overlay bitmap
+ render_texture * m_texture[2]; // 2x textures for the screen bitmap
+ bitmap_t * m_bitmap[2]; // 2x bitmaps for rendering
+ bitmap_t * m_burnin; // burn-in bitmap
+ UINT8 m_curbitmap; // current bitmap index
+ UINT8 m_curtexture; // current texture index
+ INT32 m_texture_format; // texture format of bitmap for this screen
+ bool m_changed; // has this bitmap changed?
+ INT32 m_last_partial_scan; // scanline of last partial update
+ bitmap_t * m_screen_overlay_bitmap; // screen overlay bitmap
// screen timing
- attoseconds_t m_frame_period; // attoseconds per frame
- attoseconds_t m_scantime; // attoseconds per scanline
- attoseconds_t m_pixeltime; // attoseconds per pixel
- attoseconds_t m_vblank_period; // attoseconds per VBLANK period
- attotime m_vblank_start_time; // time of last VBLANK start
- attotime m_vblank_end_time; // time of last VBLANK end
- emu_timer * m_vblank_begin_timer; // timer to signal VBLANK start
- emu_timer * m_vblank_end_timer; // timer to signal VBLANK end
- emu_timer * m_scanline0_timer; // scanline 0 timer
- emu_timer * m_scanline_timer; // scanline timer
- UINT64 m_frame_number; // the current frame number
- UINT32 m_partial_updates_this_frame;// partial update counter this frame
+ attoseconds_t m_frame_period; // attoseconds per frame
+ attoseconds_t m_scantime; // attoseconds per scanline
+ attoseconds_t m_pixeltime; // attoseconds per pixel
+ attoseconds_t m_vblank_period; // attoseconds per VBLANK period
+ attotime m_vblank_start_time; // time of last VBLANK start
+ attotime m_vblank_end_time; // time of last VBLANK end
+ emu_timer * m_vblank_begin_timer; // timer to signal VBLANK start
+ emu_timer * m_vblank_end_timer; // timer to signal VBLANK end
+ emu_timer * m_scanline0_timer; // scanline 0 timer
+ emu_timer * m_scanline_timer; // scanline timer
+ UINT64 m_frame_number; // the current frame number
+ UINT32 m_partial_updates_this_frame;// partial update counter this frame
struct callback_item
{
@@ -270,14 +236,18 @@ private:
vblank_state_changed_func m_callback;
void * m_param;
};
- callback_item * m_callback_list; // list of VBLANK callbacks
+ callback_item * m_callback_list; // list of VBLANK callbacks
};
+// device type definition
+extern const device_type SCREEN;
+
//**************************************************************************
// SCREEN DEVICE CONFIGURATION MACROS
//**************************************************************************
+
#define SCREEN_UPDATE_NAME(name) screen_update_##name
#define SCREEN_UPDATE(name) UINT32 SCREEN_UPDATE_NAME(name)(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect)
#define SCREEN_UPDATE_CALL(name) SCREEN_UPDATE_NAME(name)(screen, bitmap, cliprect)
@@ -296,33 +266,34 @@ private:
MCFG_DEVICE_MODIFY(_tag)
#define MCFG_SCREEN_FORMAT(_format) \
- screen_device_config::static_set_format(device, _format); \
+ screen_device::static_set_format(*device, _format); \
#define MCFG_SCREEN_TYPE(_type) \
- screen_device_config::static_set_type(device, SCREEN_TYPE_##_type); \
+ screen_device::static_set_type(*device, SCREEN_TYPE_##_type); \
#define MCFG_SCREEN_RAW_PARAMS(_pixclock, _htotal, _hbend, _hbstart, _vtotal, _vbend, _vbstart) \
- screen_device_config::static_set_raw(device, _pixclock, _htotal, _hbend, _hbstart, _vtotal, _vbend, _vbstart);
+ screen_device::static_set_raw(*device, _pixclock, _htotal, _hbend, _hbstart, _vtotal, _vbend, _vbstart);
#define MCFG_SCREEN_REFRESH_RATE(_rate) \
- screen_device_config::static_set_refresh(device, HZ_TO_ATTOSECONDS(_rate)); \
+ screen_device::static_set_refresh(*device, HZ_TO_ATTOSECONDS(_rate)); \
#define MCFG_SCREEN_VBLANK_TIME(_time) \
- screen_device_config::static_set_vblank_time(device, _time); \
+ screen_device::static_set_vblank_time(*device, _time); \
#define MCFG_SCREEN_SIZE(_width, _height) \
- screen_device_config::static_set_size(device, _width, _height); \
+ screen_device::static_set_size(*device, _width, _height); \
#define MCFG_SCREEN_VISIBLE_AREA(_minx, _maxx, _miny, _maxy) \
- screen_device_config::static_set_visarea(device, _minx, _maxx, _miny, _maxy); \
+ screen_device::static_set_visarea(*device, _minx, _maxx, _miny, _maxy); \
#define MCFG_SCREEN_DEFAULT_POSITION(_xscale, _xoffs, _yscale, _yoffs) \
- screen_device_config::static_set_default_position(device, _xscale, _xoffs, _yscale, _yoffs); \
+ screen_device::static_set_default_position(*device, _xscale, _xoffs, _yscale, _yoffs); \
#define MCFG_SCREEN_UPDATE(_func) \
- screen_device_config::static_set_screen_update(device, SCREEN_UPDATE_NAME(_func)); \
+ screen_device::static_set_screen_update(*device, SCREEN_UPDATE_NAME(_func)); \
#define MCFG_SCREEN_EOF(_func) \
- screen_device_config::static_set_screen_eof(device, SCREEN_EOF_NAME(_func)); \
+ screen_device::static_set_screen_eof(*device, SCREEN_EOF_NAME(_func)); \
+
#endif /* __SCREEN_H__ */
diff --git a/src/emu/softlist.c b/src/emu/softlist.c
index 9d128c8b24f..adb85863c21 100644
--- a/src/emu/softlist.c
+++ b/src/emu/softlist.c
@@ -1343,7 +1343,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
software_name_split( image->device().machine(), path, &swlist_name, &swname, &swpart );
swname_bckp = swname;
- const char *interface = image->image_config().image_interface();
+ const char *interface = image->image_interface();
if ( swlist_name )
{
@@ -1363,12 +1363,12 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
else
{
/* Loop through all the software lists named in the driver */
- for (device_t *swlists = image->device().machine().m_devicelist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
+ for (device_t *swlists = image->device().machine().devicelist().first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
{
if ( swlists )
{
- software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(&swlists->baseconfig())->inline_config();
+ software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(swlists)->inline_config();
UINT32 i = DEVINFO_STR_SWLIST_0;
while ( ! software_part_ptr && i <= DEVINFO_STR_SWLIST_MAX )
@@ -1459,15 +1459,15 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
if (software_info_ptr == NULL)
{
// check if there is at least a software list
- if (image->device().machine().m_devicelist.first(SOFTWARE_LIST))
+ if (image->device().machine().devicelist().first(SOFTWARE_LIST))
{
mame_printf_error("\n\"%s\" approximately matches the following\n"
"supported software items (best match first):\n\n", swname_bckp);
}
- for (device_t *swlists = image->device().machine().m_devicelist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
+ for (device_t *swlists = image->device().machine().devicelist().first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
{
- software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(&swlists->baseconfig())->inline_config();
+ software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(swlists)->inline_config();
for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
{
@@ -1482,7 +1482,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
software_list_parse(list, list->error_proc, NULL);
// get the top 5 approximate matches for the selected device interface (i.e. only carts for cartslot, etc.)
- software_list_find_approx_matches(list, swname_bckp, ARRAY_LENGTH(matches), matches, image->image_config().image_interface());
+ software_list_find_approx_matches(list, swname_bckp, ARRAY_LENGTH(matches), matches, image->image_interface());
if (matches[0] != 0)
{
@@ -1609,7 +1609,7 @@ static DEVICE_START( software_list )
static DEVICE_VALIDITY_CHECK( software_list )
{
- software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(device)->inline_config();
+ software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(device)->inline_config();
int error = FALSE;
softlist_map names;
softlist_map descriptions;
@@ -1790,7 +1790,7 @@ DEVICE_GET_INFO( software_list )
if ( state >= DEVINFO_STR_SWLIST_0 && state <= DEVINFO_STR_SWLIST_MAX )
{
- software_list_config *config = (software_list_config *)downcast<const legacy_device_config_base *>(device)->inline_config();
+ software_list_config *config = (software_list_config *)downcast<const legacy_device_base *>(device)->inline_config();
if ( config->list_name[ state - DEVINFO_STR_SWLIST_0 ] )
strcpy(info->s, config->list_name[ state - DEVINFO_STR_SWLIST_0 ]);
diff --git a/src/emu/sound.c b/src/emu/sound.c
index a9cbea991f0..5b4f49295e2 100644
--- a/src/emu/sound.c
+++ b/src/emu/sound.c
@@ -788,7 +788,7 @@ sound_manager::sound_manager(running_machine &machine)
machine.m_sample_rate = 11025;
// count the speakers
- VPRINTF(("total speakers = %d\n", machine.m_devicelist.count(SPEAKER)));
+ VPRINTF(("total speakers = %d\n", machine.devicelist().count(SPEAKER)));
// allocate memory for mix buffers
m_leftmix = auto_alloc_array(machine, INT32, machine.sample_rate());
@@ -862,7 +862,7 @@ void sound_manager::set_attenuation(int attenuation)
bool sound_manager::indexed_speaker_input(int index, speaker_input &info) const
{
// scan through the speakers until we find the indexed input
- for (info.speaker = downcast<speaker_device *>(machine().m_devicelist.first(SPEAKER)); info.speaker != NULL; info.speaker = info.speaker->next_speaker())
+ for (info.speaker = downcast<speaker_device *>(machine().devicelist().first(SPEAKER)); info.speaker != NULL; info.speaker = info.speaker->next_speaker())
{
if (index < info.speaker->inputs())
{
@@ -900,7 +900,7 @@ void sound_manager::reset(running_machine &machine)
{
// reset all the sound chips
device_sound_interface *sound = NULL;
- for (bool gotone = machine.m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = machine.devicelist().first(sound); gotone; gotone = sound->next(sound))
sound->device().reset();
}
@@ -1003,7 +1003,7 @@ void sound_manager::update()
// force all the speaker streams to generate the proper number of samples
int samples_this_update = 0;
- for (speaker_device *speaker = downcast<speaker_device *>(machine().m_devicelist.first(SPEAKER)); speaker != NULL; speaker = speaker->next_speaker())
+ for (speaker_device *speaker = downcast<speaker_device *>(machine().devicelist().first(SPEAKER)); speaker != NULL; speaker = speaker->next_speaker())
speaker->mix(m_leftmix, m_rightmix, samples_this_update, (m_muted & MUTE_REASON_SYSTEM));
// now downmix the final result
diff --git a/src/emu/sound/2151intf.c b/src/emu/sound/2151intf.c
index cb1077129b7..fcf7a703820 100644
--- a/src/emu/sound/2151intf.c
+++ b/src/emu/sound/2151intf.c
@@ -51,7 +51,7 @@ static DEVICE_START( ym2151 )
ym2151_state *info = get_safe_token(device);
int rate;
- info->intf = device->baseconfig().static_config() ? (const ym2151_interface *)device->baseconfig().static_config() : &dummy;
+ info->intf = device->static_config() ? (const ym2151_interface *)device->static_config() : &dummy;
rate = device->clock()/64;
diff --git a/src/emu/sound/2203intf.c b/src/emu/sound/2203intf.c
index 48ad68975a5..6911fe32ba7 100644
--- a/src/emu/sound/2203intf.c
+++ b/src/emu/sound/2203intf.c
@@ -124,7 +124,7 @@ static DEVICE_START( ym2203 )
},
NULL
};
- const ym2203_interface *intf = device->baseconfig().static_config() ? (const ym2203_interface *)device->baseconfig().static_config() : &generic_2203;
+ const ym2203_interface *intf = device->static_config() ? (const ym2203_interface *)device->static_config() : &generic_2203;
ym2203_state *info = get_safe_token(device);
int rate = device->clock()/72; /* ??? */
diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c
index 2ff93a1d8b0..5ae97272cfe 100644
--- a/src/emu/sound/2608intf.c
+++ b/src/emu/sound/2608intf.c
@@ -137,7 +137,7 @@ static DEVICE_START( ym2608 )
},
NULL
};
- const ym2608_interface *intf = device->baseconfig().static_config() ? (const ym2608_interface *)device->baseconfig().static_config() : &generic_2608;
+ const ym2608_interface *intf = device->static_config() ? (const ym2608_interface *)device->static_config() : &generic_2608;
int rate = device->clock()/72;
void *pcmbufa;
int pcmsizea;
diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c
index 9002206ea9a..05d44e53694 100644
--- a/src/emu/sound/2610intf.c
+++ b/src/emu/sound/2610intf.c
@@ -142,7 +142,7 @@ static DEVICE_START( ym2610 )
AY8910_DEFAULT_LOADS,
DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
};
- const ym2610_interface *intf = device->baseconfig().static_config() ? (const ym2610_interface *)device->baseconfig().static_config() : &generic_2610;
+ const ym2610_interface *intf = device->static_config() ? (const ym2610_interface *)device->static_config() : &generic_2610;
int rate = device->clock()/72;
void *pcmbufa,*pcmbufb;
int pcmsizea,pcmsizeb;
diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c
index 114dac4f134..4e81f1675da 100644
--- a/src/emu/sound/2612intf.c
+++ b/src/emu/sound/2612intf.c
@@ -103,7 +103,7 @@ static DEVICE_START( ym2612 )
ym2612_state *info = get_safe_token(device);
int rate = device->clock()/72;
- info->intf = device->baseconfig().static_config() ? (const ym2612_interface *)device->baseconfig().static_config() : &dummy;
+ info->intf = device->static_config() ? (const ym2612_interface *)device->static_config() : &dummy;
info->device = device;
/* FM init */
diff --git a/src/emu/sound/262intf.c b/src/emu/sound/262intf.c
index 85b2853160f..de329c7eaf9 100644
--- a/src/emu/sound/262intf.c
+++ b/src/emu/sound/262intf.c
@@ -81,7 +81,7 @@ static DEVICE_START( ymf262 )
ymf262_state *info = get_safe_token(device);
int rate = device->clock()/288;
- info->intf = device->baseconfig().static_config() ? (const ymf262_interface *)device->baseconfig().static_config() : &dummy;
+ info->intf = device->static_config() ? (const ymf262_interface *)device->static_config() : &dummy;
info->device = device;
/* stream system initialize */
diff --git a/src/emu/sound/3526intf.c b/src/emu/sound/3526intf.c
index e97ec9069a1..861dbc78a40 100644
--- a/src/emu/sound/3526intf.c
+++ b/src/emu/sound/3526intf.c
@@ -92,7 +92,7 @@ static DEVICE_START( ym3526 )
ym3526_state *info = get_safe_token(device);
int rate = device->clock()/72;
- info->intf = device->baseconfig().static_config() ? (const ym3526_interface *)device->baseconfig().static_config() : &dummy;
+ info->intf = device->static_config() ? (const ym3526_interface *)device->static_config() : &dummy;
info->device = device;
/* stream system initialize */
diff --git a/src/emu/sound/3812intf.c b/src/emu/sound/3812intf.c
index 5379ae5ed63..25d97861131 100644
--- a/src/emu/sound/3812intf.c
+++ b/src/emu/sound/3812intf.c
@@ -92,7 +92,7 @@ static DEVICE_START( ym3812 )
ym3812_state *info = get_safe_token(device);
int rate = device->clock()/72;
- info->intf = device->baseconfig().static_config() ? (const ym3812_interface *)device->baseconfig().static_config() : &dummy;
+ info->intf = device->static_config() ? (const ym3812_interface *)device->static_config() : &dummy;
info->device = device;
/* stream system initialize */
diff --git a/src/emu/sound/8950intf.c b/src/emu/sound/8950intf.c
index 240f3e93bd5..aa75ef39a69 100644
--- a/src/emu/sound/8950intf.c
+++ b/src/emu/sound/8950intf.c
@@ -119,7 +119,7 @@ static DEVICE_START( y8950 )
y8950_state *info = get_safe_token(device);
int rate = device->clock()/72;
- info->intf = device->baseconfig().static_config() ? (const y8950_interface *)device->baseconfig().static_config() : &dummy;
+ info->intf = device->static_config() ? (const y8950_interface *)device->static_config() : &dummy;
info->device = device;
/* stream system initialize */
diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c
index 9dd5dbbecd4..2694452f00f 100644
--- a/src/emu/sound/aica.c
+++ b/src/emu/sound/aica.c
@@ -1274,7 +1274,7 @@ static DEVICE_START( aica )
aica_state *AICA = get_safe_token(device);
- intf = (const aica_interface *)device->baseconfig().static_config();
+ intf = (const aica_interface *)device->static_config();
// init the emulation
AICA_Init(device, AICA, intf);
diff --git a/src/emu/sound/asc.c b/src/emu/sound/asc.c
index 68445169e85..1b3309bf7db 100644
--- a/src/emu/sound/asc.c
+++ b/src/emu/sound/asc.c
@@ -32,97 +32,58 @@
#include "emu.h"
#include "asc.h"
-//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-const device_type ASC = asc_device_config::static_alloc_device_config;
+// device type definition
+const device_type ASC = &device_creator<asc_device>;
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// static_set_type - configuration helper to set
-// the chip type
-//-------------------------------------------------
-
-void asc_device_config::static_set_type(device_config *device, int type)
+// does nothing, this timer exists only to make MAME sync itself at our audio rate
+static TIMER_CALLBACK( sync_timer_cb )
{
- asc_device_config *asc = downcast<asc_device_config *>(device);
- asc->m_type = type;
-}
-
-//-------------------------------------------------
-// static_set_type - configuration helper to set
-// the IRQ callback
-//-------------------------------------------------
-
+ asc_device *pDevice = (asc_device *)ptr;
-void asc_device_config::static_set_irqf(device_config *device, void (*irqf)(device_t *device, int state))
-{
- asc_device_config *asc = downcast<asc_device_config *>(device);
- asc->m_irq_func = irqf;
+ pDevice->m_stream->update();
}
//-------------------------------------------------
-// asc_device_config - constructor
+// asc_device - constructor
//-------------------------------------------------
-asc_device_config::asc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "ASC", tag, owner, clock),
- device_config_sound_interface(mconfig, *this)
+asc_device::asc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ASC, "ASC", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ m_chip_type(0),
+ m_irq_cb(NULL)
{
}
//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
+// static_set_type - configuration helper to set
+// the chip type
//-------------------------------------------------
-device_config *asc_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
+void asc_device::static_set_type(device_t &device, int type)
{
- return global_alloc(asc_device_config(mconfig, tag, owner, clock));
+ asc_device &asc = downcast<asc_device &>(device);
+ asc.m_chip_type = type;
}
-
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// static_set_type - configuration helper to set
+// the IRQ callback
//-------------------------------------------------
-device_t *asc_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, asc_device(machine, *this));
-}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-// does nothing, this timer exists only to make MAME sync itself at our audio rate
-static TIMER_CALLBACK( sync_timer_cb )
+void asc_device::static_set_irqf(device_t &device, void (*irqf)(device_t *device, int state))
{
- asc_device *pDevice = (asc_device *)ptr;
-
- pDevice->m_stream->update();
+ asc_device &asc = downcast<asc_device &>(device);
+ asc.m_irq_cb = irqf;
}
//-------------------------------------------------
-// asc_device - constructor
-//-------------------------------------------------
-
-asc_device::asc_device(running_machine &_machine, const asc_device_config &config)
- : device_t(_machine, config),
- device_sound_interface(_machine, config, *this),
- m_config(config),
- m_chip_type(m_config.m_type),
- m_irq_cb(m_config.m_irq_func)
-{
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/emu/sound/asc.h b/src/emu/sound/asc.h
index 89a139c0230..09867d56039 100644
--- a/src/emu/sound/asc.h
+++ b/src/emu/sound/asc.h
@@ -49,52 +49,28 @@ enum
MCFG_IRQ_FUNC(_irqf)
#define MCFG_ASC_TYPE(_type) \
- asc_device_config::static_set_type(device, _type); \
+ asc_device::static_set_type(*device, _type); \
#define MCFG_IRQ_FUNC(_irqf) \
- asc_device_config::static_set_irqf(device, _irqf); \
+ asc_device::static_set_irqf(*device, _irqf); \
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> asc_device_config
-
-class asc_device_config : public device_config, public device_config_sound_interface
-{
- friend class asc_device;
-
- // construction/destruction
- asc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_type(device_config *device, int type);
- static void static_set_irqf(device_config *device, void (*irqf)(device_t *device, int state));
-
-protected:
- // inline data
- UINT8 m_type;
- void (*m_irq_func)(device_t *device, int state);
-};
-
-
-
// ======================> asc_device
class asc_device : public device_t, public device_sound_interface
{
- friend class asc_device_config;
-
+public:
// construction/destruction
- asc_device(running_machine &_machine, const asc_device_config &config);
+ asc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_type(device_t &device, int type);
+ static void static_set_irqf(device_t &device, void (*irqf)(device_t *device, int state));
-public:
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
@@ -127,9 +103,7 @@ protected:
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
- // internal state
- const asc_device_config &m_config;
-
+ // inline data
UINT8 m_chip_type;
void (*m_irq_cb)(device_t *device, int state);
diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c
index f9f57e326b9..6c872e3f9a9 100644
--- a/src/emu/sound/ay8910.c
+++ b/src/emu/sound/ay8910.c
@@ -929,7 +929,7 @@ static DEVICE_START( ay8910 )
AY8910_DEFAULT_LOADS,
DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
};
- const ay8910_interface *intf = (device->baseconfig().static_config() ? (const ay8910_interface *)device->baseconfig().static_config() : &generic_ay8910);
+ const ay8910_interface *intf = (device->static_config() ? (const ay8910_interface *)device->static_config() : &generic_ay8910);
ay8910_start_ym(get_safe_token(device), AY8910, device, device->clock(), intf);
}
@@ -941,7 +941,7 @@ static DEVICE_START( ym2149 )
AY8910_DEFAULT_LOADS,
DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL
};
- const ay8910_interface *intf = (device->baseconfig().static_config() ? (const ay8910_interface *)device->baseconfig().static_config() : &generic_ay8910);
+ const ay8910_interface *intf = (device->static_config() ? (const ay8910_interface *)device->static_config() : &generic_ay8910);
ay8910_start_ym(get_safe_token(device), YM2149, device, device->clock(), intf);
}
diff --git a/src/emu/sound/bsmt2000.c b/src/emu/sound/bsmt2000.c
index 11f790e5458..aad9de5c008 100644
--- a/src/emu/sound/bsmt2000.c
+++ b/src/emu/sound/bsmt2000.c
@@ -46,15 +46,14 @@
#include "bsmt2000.h"
+// device type definition
+const device_type BSMT2000 = &device_creator<bsmt2000_device>;
+
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
-// devices
-const device_type BSMT2000 = bsmt2000_device_config::static_alloc_device_config;
-
-
// program map for the DSP (points to internal ROM)
static ADDRESS_MAP_START( tms_program_map, AS_PROGRAM, 16 )
ADDRESS_MAP_UNMAP_HIGH
@@ -99,41 +98,34 @@ ROM_END
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
-// bsmt2000_device_config - constructor
-//-------------------------------------------------
-
-bsmt2000_device_config::bsmt2000_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "BSMT2000", "bsmt2000", tag, owner, clock),
- device_config_sound_interface(mconfig, *this),
- device_config_memory_interface(mconfig, *this),
- m_space_config("samples", ENDIANNESS_LITTLE, 8, 32, 0, NULL, *ADDRESS_MAP_NAME(bsmt2000)),
- m_ready_callback(NULL)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
+// bsmt2000_device - constructor
//-------------------------------------------------
-device_config *bsmt2000_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(bsmt2000_device_config(mconfig, tag, owner, clock));
-}
-
-
//-------------------------------------------------
-// alloc_device - allocate a new device object
+// bsmt2000_device - constructor
//-------------------------------------------------
-device_t *bsmt2000_device_config::alloc_device(running_machine &machine) const
+bsmt2000_device::bsmt2000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, BSMT2000, "BSMT2000", "bsmt2000", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ device_memory_interface(mconfig, *this),
+ m_space_config("samples", ENDIANNESS_LITTLE, 8, 32, 0, NULL, *ADDRESS_MAP_NAME(bsmt2000)),
+ m_ready_callback(NULL),
+ m_stream(NULL),
+ m_direct(NULL),
+ m_cpu(NULL),
+ m_register_select(0),
+ m_write_data(0),
+ m_rom_address(0),
+ m_rom_bank(0),
+ m_left_data(0),
+ m_right_data(0),
+ m_write_pending(false)
{
- return auto_alloc(machine, bsmt2000_device(machine, *this));
}
@@ -142,10 +134,10 @@ device_t *bsmt2000_device_config::alloc_device(running_machine &machine) const
// helper to set the ready callback
//-------------------------------------------------
-void bsmt2000_device_config::static_set_ready_callback(device_config *device, ready_callback callback)
+void bsmt2000_device::static_set_ready_callback(device_t &device, ready_callback callback)
{
- bsmt2000_device_config *bsmt = downcast<bsmt2000_device_config *>(device);
- bsmt->m_ready_callback = callback;
+ bsmt2000_device &bsmt = downcast<bsmt2000_device &>(device);
+ bsmt.m_ready_callback = callback;
}
@@ -154,7 +146,7 @@ void bsmt2000_device_config::static_set_ready_callback(device_config *device, re
// internal ROM region
//-------------------------------------------------
-const rom_entry *bsmt2000_device_config::device_rom_region() const
+const rom_entry *bsmt2000_device::device_rom_region() const
{
return ROM_NAME( bsmt2000 );
}
@@ -165,52 +157,13 @@ const rom_entry *bsmt2000_device_config::device_rom_region() const
// the device's machine fragment
//-------------------------------------------------
-machine_config_constructor bsmt2000_device_config::device_mconfig_additions() const
+machine_config_constructor bsmt2000_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( bsmt2000 );
}
//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *bsmt2000_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == 0) ? &m_space_config : NULL;
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// bsmt2000_device - constructor
-//-------------------------------------------------
-
-bsmt2000_device::bsmt2000_device(running_machine &_machine, const bsmt2000_device_config &config)
- : device_t(_machine, config),
- device_sound_interface(_machine, config, *this),
- device_memory_interface(_machine, config, *this),
- m_config(config),
- m_stream(NULL),
- m_direct(NULL),
- m_cpu(NULL),
- m_register_select(0),
- m_write_data(0),
- m_rom_address(0),
- m_rom_bank(0),
- m_left_data(0),
- m_right_data(0),
- m_write_pending(false)
-{
-}
-
-
-//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -250,6 +203,17 @@ void bsmt2000_device::device_reset()
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *bsmt2000_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == 0) ? &m_space_config : NULL;
+}
+
+
+//-------------------------------------------------
// device_timer - handle deferred writes and
// resets as a timer callback
//-------------------------------------------------
@@ -350,8 +314,8 @@ READ16_MEMBER( bsmt2000_device::tms_data_r )
{
// also implicitly clear the write pending flag
m_write_pending = false;
- if (m_config.m_ready_callback != NULL)
- (*m_config.m_ready_callback)(*this);
+ if (m_ready_callback != NULL)
+ (*m_ready_callback)(*this);
return m_write_data;
}
diff --git a/src/emu/sound/bsmt2000.h b/src/emu/sound/bsmt2000.h
index d6b0cb27965..33228c3bec4 100644
--- a/src/emu/sound/bsmt2000.h
+++ b/src/emu/sound/bsmt2000.h
@@ -56,7 +56,7 @@
MCFG_DEVICE_REPLACE(_tag, BSMT2000, _clock) \
#define MCFG_BSMT2000_READY_CALLBACK(_callback) \
- bsmt2000_device_config::static_set_ready_callback(device, _callback); \
+ bsmt2000_device::static_set_ready_callback(*device, _callback); \
@@ -67,67 +67,38 @@
class bsmt2000_device;
-// ======================> bsmt2000_device_config
-
-class bsmt2000_device_config : public device_config,
- public device_config_sound_interface,
- public device_config_memory_interface
-{
- friend class bsmt2000_device;
-
- typedef void (*ready_callback)(bsmt2000_device &device);
-
- // construction/destruction
- bsmt2000_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_ready_callback(device_config *device, ready_callback callback);
-
-protected:
- // optional information overrides
- virtual const rom_entry *device_rom_region() const;
- virtual machine_config_constructor device_mconfig_additions() const;
-
- // device_config overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // internal state
- const address_space_config m_space_config;
-
- // inline data
- ready_callback m_ready_callback;
-};
-
-
-
// ======================> bsmt2000_device
class bsmt2000_device : public device_t,
public device_sound_interface,
public device_memory_interface
{
- friend class bsmt2000_device_config;
+ typedef void (*ready_callback)(bsmt2000_device &device);
+public:
// construction/destruction
- bsmt2000_device(running_machine &_machine, const bsmt2000_device_config &config);
+ bsmt2000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
+ // inline configuration helpers
+ static void static_set_ready_callback(device_t &device, ready_callback callback);
+
+ // public interface
UINT16 read_status();
void write_reg(UINT16 data);
void write_data(UINT16 data);
protected:
// device-level overrides
+ const rom_entry *device_rom_region() const;
+ machine_config_constructor device_mconfig_additions() const;
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
- // sound interface overrides
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
+ // device_sound_interface overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
public:
@@ -150,8 +121,11 @@ private:
TIMER_ID_DATA_WRITE
};
+ // configuration state
+ const address_space_config m_space_config;
+ ready_callback m_ready_callback;
+
// internal state
- const bsmt2000_device_config &m_config;
sound_stream * m_stream;
direct_read_data * m_direct;
tms32015_device * m_cpu;
diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c
index cc5e5deeab9..8638635db0f 100644
--- a/src/emu/sound/c140.c
+++ b/src/emu/sound/c140.c
@@ -463,7 +463,7 @@ static STREAM_UPDATE( update_stereo )
static DEVICE_START( c140 )
{
- const c140_interface *intf = (const c140_interface *)device->baseconfig().static_config();
+ const c140_interface *intf = (const c140_interface *)device->static_config();
c140_state *info = get_safe_token(device);
info->sample_rate=info->baserate=device->clock();
diff --git a/src/emu/sound/c6280.c b/src/emu/sound/c6280.c
index 64a9a0dda10..27b6812aa6f 100644
--- a/src/emu/sound/c6280.c
+++ b/src/emu/sound/c6280.c
@@ -96,7 +96,7 @@ INLINE c6280_t *get_safe_token(device_t *device)
static void c6280_init(device_t *device, c6280_t *p, double clk, double rate)
{
- const c6280_interface *intf = (const c6280_interface *)device->baseconfig().static_config();
+ const c6280_interface *intf = (const c6280_interface *)device->static_config();
int i;
double step;
diff --git a/src/emu/sound/cdda.c b/src/emu/sound/cdda.c
index fdf102b050b..a6987051d63 100644
--- a/src/emu/sound/cdda.c
+++ b/src/emu/sound/cdda.c
@@ -56,7 +56,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->baseconfig().static_config();
+ //intf = (const struct CDDAinterface *)device->static_config();
info->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, info, cdda_update);
@@ -92,7 +92,7 @@ device_t *cdda_from_cdrom(running_machine &machine, void *file)
{
device_sound_interface *sound = NULL;
- for (bool gotone = machine.m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = machine.devicelist().first(sound); gotone; gotone = sound->next(sound))
if (sound->device().type() == CDDA)
{
cdda_info *info = get_safe_token(*sound);
diff --git a/src/emu/sound/cdp1863.c b/src/emu/sound/cdp1863.c
index 8fd1dd88f61..a89b7cb6c1f 100644
--- a/src/emu/sound/cdp1863.c
+++ b/src/emu/sound/cdp1863.c
@@ -35,43 +35,25 @@
//**************************************************************************
// devices
-const device_type CDP1863 = cdp1863_device_config::static_alloc_device_config;
+const device_type CDP1863 = &device_creator<cdp1863_device>;
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
-// cdp1863_device_config - constructor
-//-------------------------------------------------
-
-cdp1863_device_config::cdp1863_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "CDP1863", tag, owner, clock),
- device_config_sound_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *cdp1863_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(cdp1863_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
+// cdp1863_device - constructor
//-------------------------------------------------
-device_t *cdp1863_device_config::alloc_device(running_machine &machine) const
+cdp1863_device::cdp1863_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CDP1863, "CDP1863", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ m_stream(NULL),
+ m_clock1(clock),
+ m_clock2(0)
{
- return auto_alloc(machine, cdp1863_device(machine, *this));
}
@@ -79,31 +61,11 @@ device_t *cdp1863_device_config::alloc_device(running_machine &machine) const
// static_set_config - configuration helper
//-------------------------------------------------
-void cdp1863_device_config::static_set_config(device_config *device, int clock2)
+void cdp1863_device::static_set_config(device_t &device, int clock2)
{
- cdp1863_device_config *cdp1863 = downcast<cdp1863_device_config *>(device);
-
- cdp1863->m_clock2 = clock2;
-}
-
+ cdp1863_device &cdp1863 = downcast<cdp1863_device &>(device);
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// cdp1863_device - constructor
-//-------------------------------------------------
-
-cdp1863_device::cdp1863_device(running_machine &_machine, const cdp1863_device_config &config)
- : device_t(_machine, config),
- device_sound_interface(_machine, config, *this),
- m_stream(NULL),
- m_clock1(clock()),
- m_clock2(config.m_clock2),
- m_config(config)
-{
+ cdp1863.m_clock2 = clock2;
}
diff --git a/src/emu/sound/cdp1863.h b/src/emu/sound/cdp1863.h
index aa77586fedc..91d996664bb 100644
--- a/src/emu/sound/cdp1863.h
+++ b/src/emu/sound/cdp1863.h
@@ -33,7 +33,7 @@
#define MCFG_CDP1863_ADD(_tag, _clock, _clock2) \
MCFG_DEVICE_ADD(_tag, CDP1863, _clock) \
- cdp1863_device_config::static_set_config(device, _clock2);
+ cdp1863_device_config::static_set_config(*device, _clock2);
@@ -41,40 +41,18 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> cdp1863_device_config
-
-class cdp1863_device_config : public device_config,
- public device_config_sound_interface
-{
- friend class cdp1863_device;
-
- // construction/destruction
- cdp1863_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_config(device_config *device, int clock2);
-
-private:
- int m_clock2;
-};
-
-
// ======================> cdp1863_device
class cdp1863_device : public device_t,
public device_sound_interface
{
- friend class cdp1863_device_config;
-
+public:
// construction/destruction
- cdp1863_device(running_machine &_machine, const cdp1863_device_config &_config);
+ cdp1863_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_config(device_t &device, int clock2);
-public:
DECLARE_WRITE8_MEMBER( str_w );
void str_w(UINT8 data);
@@ -101,8 +79,6 @@ private:
int m_latch; // sound latch
INT16 m_signal; // current signal
int m_incr; // initial wave state
-
- const cdp1863_device_config &m_config;
};
diff --git a/src/emu/sound/cdp1864.c b/src/emu/sound/cdp1864.c
index eded7b7a363..c96cb0c08cc 100644
--- a/src/emu/sound/cdp1864.c
+++ b/src/emu/sound/cdp1864.c
@@ -47,73 +47,7 @@ static const int CDP1864_BACKGROUND_COLOR_SEQUENCE[] = { 2, 0, 1, 4 };
//**************************************************************************
// devices
-const device_type CDP1864 = cdp1864_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-
-//-------------------------------------------------
-// cdp1864_device_config - constructor
-//-------------------------------------------------
-
-cdp1864_device_config::cdp1864_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "CDP1864", tag, owner, clock),
- device_config_sound_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *cdp1864_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(cdp1864_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *cdp1864_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, cdp1864_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void cdp1864_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const cdp1864_interface *intf = reinterpret_cast<const cdp1864_interface *>(static_config());
- if (intf != NULL)
- *static_cast<cdp1864_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_in_inlace_func, 0, sizeof(m_in_inlace_func));
- memset(&m_in_rdata_func, 0, sizeof(m_in_rdata_func));
- memset(&m_in_bdata_func, 0, sizeof(m_in_bdata_func));
- memset(&m_in_gdata_func, 0, sizeof(m_in_gdata_func));
- memset(&m_out_int_func, 0, sizeof(m_out_int_func));
- memset(&m_out_dmao_func, 0, sizeof(m_out_dmao_func));
- memset(&m_out_efx_func, 0, sizeof(m_out_efx_func));
- memset(&m_out_hsync_func, 0, sizeof(m_out_hsync_func));
- }
-}
+const device_type CDP1864 = &device_creator<cdp1864_device>;
@@ -127,12 +61,12 @@ void cdp1864_device_config::device_config_complete()
inline void cdp1864_device::initialize_palette()
{
- double res_total = m_config.m_res_r + m_config.m_res_g + m_config.m_res_b + m_config.m_res_bkg;
+ double res_total = m_res_r + m_res_g + m_res_b + m_res_bkg;
- int weight_r = (m_config.m_res_r / res_total) * 100;
- int weight_g = (m_config.m_res_g / res_total) * 100;
- int weight_b = (m_config.m_res_b / res_total) * 100;
- int weight_bkg = (m_config.m_res_bkg / res_total) * 100;
+ int weight_r = (m_res_r / res_total) * 100;
+ int weight_g = (m_res_g / res_total) * 100;
+ int weight_b = (m_res_b / res_total) * 100;
+ int weight_bkg = (m_res_bkg / res_total) * 100;
for (int i = 0; i < 16; i++)
{
@@ -163,17 +97,44 @@ inline void cdp1864_device::initialize_palette()
// cdp1864_device - constructor
//-------------------------------------------------
-cdp1864_device::cdp1864_device(running_machine &_machine, const cdp1864_device_config &config)
- : device_t(_machine, config),
- device_sound_interface(_machine, config, *this),
+cdp1864_device::cdp1864_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CDP1864, "CDP1864", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
m_disp(0),
m_dmaout(0),
m_bgcolor(0),
m_con(0),
m_aoe(0),
- m_latch(CDP1864_DEFAULT_LATCH),
- m_config(config)
+ m_latch(CDP1864_DEFAULT_LATCH)
+{
+}
+
+
+//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void cdp1864_device::device_config_complete()
{
+ // inherit a copy of the static data
+ const cdp1864_interface *intf = reinterpret_cast<const cdp1864_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<cdp1864_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_in_inlace_cb, 0, sizeof(m_in_inlace_cb));
+ memset(&m_in_rdata_cb, 0, sizeof(m_in_rdata_cb));
+ memset(&m_in_bdata_cb, 0, sizeof(m_in_bdata_cb));
+ memset(&m_in_gdata_cb, 0, sizeof(m_in_gdata_cb));
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
+ memset(&m_out_dmao_cb, 0, sizeof(m_out_dmao_cb));
+ memset(&m_out_efx_cb, 0, sizeof(m_out_efx_cb));
+ memset(&m_out_hsync_cb, 0, sizeof(m_out_hsync_cb));
+ }
}
@@ -184,14 +145,14 @@ cdp1864_device::cdp1864_device(running_machine &_machine, const cdp1864_device_c
void cdp1864_device::device_start()
{
// resolve callbacks
- devcb_resolve_read_line(&m_in_inlace_func, &m_config.m_in_inlace_func, this);
- devcb_resolve_read_line(&m_in_rdata_func, &m_config.m_in_rdata_func, this);
- devcb_resolve_read_line(&m_in_bdata_func, &m_config.m_in_bdata_func, this);
- devcb_resolve_read_line(&m_in_gdata_func, &m_config.m_in_gdata_func, this);
- devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
- devcb_resolve_write_line(&m_out_dmao_func, &m_config.m_out_dmao_func, this);
- devcb_resolve_write_line(&m_out_efx_func, &m_config.m_out_efx_func, this);
- devcb_resolve_write_line(&m_out_hsync_func, &m_config.m_out_hsync_func, this);
+ devcb_resolve_read_line(&m_in_inlace_func, &m_in_inlace_cb, this);
+ devcb_resolve_read_line(&m_in_rdata_func, &m_in_rdata_cb, this);
+ devcb_resolve_read_line(&m_in_bdata_func, &m_in_bdata_cb, this);
+ devcb_resolve_read_line(&m_in_gdata_func, &m_in_gdata_cb, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
+ devcb_resolve_write_line(&m_out_dmao_func, &m_out_dmao_cb, this);
+ devcb_resolve_write_line(&m_out_efx_func, &m_out_efx_cb, this);
+ devcb_resolve_write_line(&m_out_hsync_func, &m_out_hsync_cb, this);
// initialize palette
initialize_palette();
@@ -206,8 +167,8 @@ void cdp1864_device::device_start()
m_hsync_timer = timer_alloc(TIMER_HSYNC);
// find devices
- m_cpu = machine().device<cpu_device>(m_config.m_cpu_tag);
- m_screen = machine().device<screen_device>(m_config.m_screen_tag);
+ m_cpu = machine().device<cpu_device>(m_cpu_tag);
+ m_screen = machine().device<screen_device>(m_screen_tag);
m_bitmap = auto_bitmap_alloc(machine(), m_screen->width(), m_screen->height(), m_screen->format());
// register for state saving
diff --git a/src/emu/sound/cdp1864.h b/src/emu/sound/cdp1864.h
index aa938c89c93..09d6d9d161f 100644
--- a/src/emu/sound/cdp1864.h
+++ b/src/emu/sound/cdp1864.h
@@ -115,16 +115,16 @@ struct cdp1864_interface
const char *m_cpu_tag;
const char *m_screen_tag;
- devcb_read_line m_in_inlace_func;
+ devcb_read_line m_in_inlace_cb;
- devcb_read_line m_in_rdata_func;
- devcb_read_line m_in_bdata_func;
- devcb_read_line m_in_gdata_func;
+ devcb_read_line m_in_rdata_cb;
+ devcb_read_line m_in_bdata_cb;
+ devcb_read_line m_in_gdata_cb;
- devcb_write_line m_out_int_func;
- devcb_write_line m_out_dmao_func;
- devcb_write_line m_out_efx_func;
- devcb_write_line m_out_hsync_func;
+ devcb_write_line m_out_int_cb;
+ devcb_write_line m_out_dmao_cb;
+ devcb_write_line m_out_efx_cb;
+ devcb_write_line m_out_hsync_cb;
double m_res_r; // red output resistor value
double m_res_g; // green output resistor value
@@ -134,40 +134,16 @@ struct cdp1864_interface
-// ======================> cdp1864_device_config
-
-class cdp1864_device_config : public device_config,
- public device_config_sound_interface,
- public cdp1864_interface
-{
- friend class cdp1864_device;
-
- // construction/destruction
- cdp1864_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
-
// ======================> cdp1864_device
class cdp1864_device : public device_t,
- public device_sound_interface
+ public device_sound_interface,
+ public cdp1864_interface
{
- friend class cdp1864_device_config;
-
+public:
// construction/destruction
- cdp1864_device(running_machine &_machine, const cdp1864_device_config &_config);
+ cdp1864_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( dispon_r );
DECLARE_READ8_MEMBER( dispoff_r );
@@ -184,6 +160,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -230,8 +207,6 @@ private:
emu_timer *m_efx_timer;
emu_timer *m_dma_timer;
emu_timer *m_hsync_timer;
-
- const cdp1864_device_config &m_config;
};
diff --git a/src/emu/sound/cdp1869.c b/src/emu/sound/cdp1869.c
index 16c54a4e07f..07417111c68 100644
--- a/src/emu/sound/cdp1869.c
+++ b/src/emu/sound/cdp1869.c
@@ -56,9 +56,8 @@ enum
// GLOBAL VARIABLES
//**************************************************************************
-// devices
-const device_type CDP1869 = cdp1869_device_config::static_alloc_device_config;
-
+// device type definition
+const device_type CDP1869 = &device_creator<cdp1869_device>;
// default address map
static ADDRESS_MAP_START( cdp1869, AS_0, 8 )
@@ -68,81 +67,6 @@ ADDRESS_MAP_END
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// cdp1869_device_config - constructor
-//-------------------------------------------------
-
-cdp1869_device_config::cdp1869_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "RCA CDP1869", tag, owner, clock),
- device_config_sound_interface(mconfig, *this),
- device_config_memory_interface(mconfig, *this),
- m_space_config("pageram", ENDIANNESS_LITTLE, 8, 11, 0, NULL, *ADDRESS_MAP_NAME(cdp1869))
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *cdp1869_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(cdp1869_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *cdp1869_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, cdp1869_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *cdp1869_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == 0) ? &m_space_config : NULL;
-}
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void cdp1869_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const cdp1869_interface *intf = reinterpret_cast<const cdp1869_interface *>(static_config());
- if (intf != NULL)
- *static_cast<cdp1869_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&in_pal_ntsc_func, 0, sizeof(in_pal_ntsc_func));
- memset(&out_prd_func, 0, sizeof(out_prd_func));
- in_pcb_func = NULL;
- in_char_ram_func = NULL;
- out_char_ram_func = NULL;
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -398,33 +322,58 @@ inline int cdp1869_device::get_pen(int ccb0, int ccb1, int pcb)
// cdp1869_device - constructor
//-------------------------------------------------
-cdp1869_device::cdp1869_device(running_machine &_machine, const cdp1869_device_config &config)
- : device_t(_machine, config),
- device_sound_interface(_machine, config, *this),
- device_memory_interface(_machine, config, *this),
+cdp1869_device::cdp1869_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CDP1869, "RCA CDP1869", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ device_memory_interface(mconfig, *this),
m_stream(NULL),
- m_config(config)
+ m_space_config("pageram", ENDIANNESS_LITTLE, 8, 11, 0, NULL, *ADDRESS_MAP_NAME(cdp1869))
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void cdp1869_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const cdp1869_interface *intf = reinterpret_cast<const cdp1869_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<cdp1869_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&in_pal_ntsc_cb, 0, sizeof(in_pal_ntsc_cb));
+ memset(&out_prd_cb, 0, sizeof(out_prd_cb));
+ in_pcb_cb = NULL;
+ in_char_ram_cb = NULL;
+ out_char_ram_cb = NULL;
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void cdp1869_device::device_start()
{
// get the screen device
- m_screen = machine().device<screen_device>(m_config.screen_tag);
+ m_screen = machine().device<screen_device>(screen_tag);
assert(m_screen != NULL);
// resolve callbacks
- devcb_resolve_read_line(&m_in_pal_ntsc_func, &m_config.in_pal_ntsc_func, this);
- devcb_resolve_write_line(&m_out_prd_func, &m_config.out_prd_func, this);
- m_in_pcb_func = m_config.in_pcb_func;
- m_in_char_ram_func = m_config.in_char_ram_func;
- m_out_char_ram_func = m_config.out_char_ram_func;
+ devcb_resolve_read_line(&m_in_pal_ntsc_func, &in_pal_ntsc_cb, this);
+ devcb_resolve_write_line(&m_out_prd_func, &out_prd_cb, this);
+ m_in_pcb_func = in_pcb_cb;
+ m_in_char_ram_func = in_char_ram_cb;
+ m_out_char_ram_func = out_char_ram_cb;
// allocate timers
m_prd_timer = timer_alloc();
@@ -486,6 +435,17 @@ void cdp1869_device::device_timer(emu_timer &timer, device_timer_id id, int para
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *cdp1869_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == 0) ? &m_space_config : NULL;
+}
+
+
+//-------------------------------------------------
// initialize_palette - initialize palette
//-------------------------------------------------
diff --git a/src/emu/sound/cdp1869.h b/src/emu/sound/cdp1869.h
index 743107b09de..6aacb0515fd 100644
--- a/src/emu/sound/cdp1869.h
+++ b/src/emu/sound/cdp1869.h
@@ -188,49 +188,19 @@ struct cdp1869_interface
int color_clock; // the chroma clock of the chip
// screen format
- devcb_read_line in_pal_ntsc_func;
+ devcb_read_line in_pal_ntsc_cb;
// page memory color bit read function
- cdp1869_pcb_read_func in_pcb_func;
+ cdp1869_pcb_read_func in_pcb_cb;
// character memory read function
- cdp1869_char_ram_read_func in_char_ram_func;
+ cdp1869_char_ram_read_func in_char_ram_cb;
// character memory write function
- cdp1869_char_ram_write_func out_char_ram_func;
+ cdp1869_char_ram_write_func out_char_ram_cb;
// if specified, this gets called for every change of the predisplay pin (CDP1870/76 pin 1)
- devcb_write_line out_prd_func;
-};
-
-
-
-// ======================> cdp1869_device_config
-
-class cdp1869_device_config : public device_config,
- public device_config_sound_interface,
- public device_config_memory_interface,
- public cdp1869_interface
-{
- friend class cdp1869_device;
-
- // construction/destruction
- cdp1869_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // address space configurations
- const address_space_config m_space_config;
+ devcb_write_line out_prd_cb;
};
@@ -239,14 +209,13 @@ protected:
class cdp1869_device : public device_t,
public device_sound_interface,
- public device_memory_interface
+ public device_memory_interface,
+ public cdp1869_interface
{
- friend class cdp1869_device_config;
-
+public:
// construction/destruction
- cdp1869_device(running_machine &_machine, const cdp1869_device_config &_config);
+ cdp1869_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_WRITE8_MEMBER( out3_w );
DECLARE_WRITE8_MEMBER( out4_w );
DECLARE_WRITE8_MEMBER( out5_w );
@@ -266,11 +235,15 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_post_load();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
- // internal callbacks
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
+ // device_sound_interface callbacks
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
inline bool is_ntsc();
@@ -328,7 +301,7 @@ private:
UINT8 m_wnfreq; // white noise range select
UINT8 m_wnamp; // white noise output amplitude
- const cdp1869_device_config &m_config;
+ const address_space_config m_space_config;
};
diff --git a/src/emu/sound/cem3394.c b/src/emu/sound/cem3394.c
index b15c2887312..c264bb8e614 100644
--- a/src/emu/sound/cem3394.c
+++ b/src/emu/sound/cem3394.c
@@ -324,7 +324,7 @@ static STREAM_UPDATE( cem3394_update )
static DEVICE_START( cem3394 )
{
- const cem3394_interface *intf = (const cem3394_interface *)device->baseconfig().static_config();
+ const cem3394_interface *intf = (const cem3394_interface *)device->static_config();
cem3394_state *chip = get_safe_token(device);
chip->device = device;
diff --git a/src/emu/sound/discrete.c b/src/emu/sound/discrete.c
index 4224700093a..09571d0b866 100644
--- a/src/emu/sound/discrete.c
+++ b/src/emu/sound/discrete.c
@@ -39,6 +39,9 @@
+// device type definition
+const device_type DISCRETE = &device_creator<discrete_sound_device>;
+
/*************************************
*
* Performance
@@ -805,12 +808,6 @@ int discrete_device::same_module_index(const discrete_base_node &node)
//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-const device_type DISCRETE = discrete_sound_device_config::static_alloc_device_config;
-
-//**************************************************************************
// DEVICE CONFIGURATION
//**************************************************************************
@@ -819,99 +816,39 @@ const device_type DISCRETE = discrete_sound_device_config::static_alloc_device_c
// the interface
//-------------------------------------------------
-void discrete_device_config::static_set_intf(device_config *device, const discrete_block *intf)
-{
- discrete_device_config *disc = downcast<discrete_device_config *>(device);
- disc->m_intf = intf;
-}
-
-//-------------------------------------------------
-// discrete_device_config - constructor
-//-------------------------------------------------
-discrete_device_config::discrete_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, type, name, tag, owner, clock), m_intf(NULL)
-{
-}
-
-discrete_sound_device_config::discrete_sound_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : discrete_device_config(mconfig, static_alloc_device_config, "DISCRETE", tag, owner, clock),
- device_config_sound_interface(mconfig, *this)
-{
-}
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *discrete_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(discrete_device_config(mconfig, static_alloc_device_config, "PUREDISC", tag, owner, clock));
-}
-
-device_config *discrete_sound_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(discrete_sound_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *discrete_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, discrete_device(machine, *this));
-}
-
-device_t *discrete_sound_device_config::alloc_device(running_machine &machine) const
+void discrete_device::static_set_intf(device_t &device, const discrete_block *intf)
{
- return auto_alloc(machine, discrete_sound_device(machine, *this));
+ discrete_device &disc = downcast<discrete_device &>(device);
+ disc.m_intf = intf;
}
-
//-------------------------------------------------
// discrete_device - constructor
//-------------------------------------------------
-discrete_device::discrete_device(running_machine &_machine, const discrete_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+discrete_device::discrete_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, type, name, tag, owner, clock),
+ m_intf(NULL),
+ m_sample_rate(0),
+ m_sample_time(0),
+ m_neg_sample_time(0),
+ m_indexed_node(NULL),
+ m_disclogfile(NULL),
+ m_queue(NULL),
+ m_profiling(0),
+ m_total_samples(0),
+ m_total_stream_updates(0)
{
}
-discrete_sound_device::discrete_sound_device(running_machine &_machine, const discrete_sound_device_config &config)
- : discrete_device(_machine, config),
- device_sound_interface(_machine, config, *this)
+discrete_sound_device::discrete_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : discrete_device(mconfig, DISCRETE, "DISCRETE", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
{
}
discrete_device::~discrete_device(void)
{
- if (m_queue)
- {
- osd_work_queue_free(m_queue);
- }
-
- if (m_profiling)
- {
- display_profiling();
- }
-
- /* Process nodes which have a stop func */
-
- for_each(discrete_base_node **, node, &m_node_list)
- {
- (*node)->stop();
- }
-
- if (DISCRETE_DEBUGLOG)
- {
- /* close the debug log */
- if (m_disclogfile)
- fclose(m_disclogfile);
- m_disclogfile = NULL;
- }
}
//-------------------------------------------------
@@ -923,7 +860,7 @@ void discrete_device::device_start()
// create the stream
//m_stream = machine().sound().stream_alloc(*this, 0, 2, 22257);
- const discrete_block *intf_start = (m_config.m_intf != NULL) ? m_config.m_intf : (discrete_block *) baseconfig().static_config();
+ const discrete_block *intf_start = (m_intf != NULL) ? m_intf : (discrete_block *) static_config();
char name[32];
/* If a clock is specified we will use it, otherwise run at the audio sample rate. */
@@ -989,6 +926,34 @@ void discrete_device::device_start()
}
}
+void discrete_device::device_stop()
+{
+ if (m_queue)
+ {
+ osd_work_queue_free(m_queue);
+ }
+
+ if (m_profiling)
+ {
+ display_profiling();
+ }
+
+ /* Process nodes which have a stop func */
+
+ for_each(discrete_base_node **, node, &m_node_list)
+ {
+ (*node)->stop();
+ }
+
+ if (DISCRETE_DEBUGLOG)
+ {
+ /* close the debug log */
+ if (m_disclogfile)
+ fclose(m_disclogfile);
+ m_disclogfile = NULL;
+ }
+}
+
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
diff --git a/src/emu/sound/discrete.h b/src/emu/sound/discrete.h
index 731bdef93e9..ecd150464c0 100644
--- a/src/emu/sound/discrete.h
+++ b/src/emu/sound/discrete.h
@@ -4287,7 +4287,7 @@ READ8_DEVICE_HANDLER( discrete_sound_r );
MCFG_DISCRETE_INTF(_intf)
#define MCFG_DISCRETE_INTF(_intf) \
- discrete_device_config::static_set_intf(device, (const discrete_block *)&(_intf##_discrete_interface)); \
+ discrete_device::static_set_intf(*device, (const discrete_block *)&(_intf##_discrete_interface)); \
#define MCFG_SOUND_CONFIG_DISCRETE(name) MCFG_SOUND_CONFIG(name##_discrete_interface)
@@ -4295,30 +4295,6 @@ READ8_DEVICE_HANDLER( discrete_sound_r );
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> discrete_device_config
-
-class discrete_device_config : public device_config
-{
- friend class discrete_device;
-
-protected:
- // construction/destruction
- discrete_device_config(const machine_config &mconfig, device_type type, const char *name, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_intf(device_config *device, const discrete_block *intf);
-
-protected:
- const discrete_block *m_intf;
- // inline data
-};
-
class discrete_sound_output_interface;
typedef dynamic_array_t<discrete_sound_output_interface *> node_output_list_t;
@@ -4327,14 +4303,16 @@ typedef dynamic_array_t<discrete_sound_output_interface *> node_output_list_t;
class discrete_device : public device_t
{
- friend class discrete_device_config;
//friend class discrete_base_node;
protected:
// construction/destruction
- discrete_device(running_machine &_machine, const discrete_device_config &config);
+ discrete_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
public:
+ // inline configuration helpers
+ static void static_set_intf(device_t &device, const discrete_block *intf);
+
DECLARE_READ8_MEMBER(read);
DECLARE_WRITE8_MEMBER(write);
virtual ~discrete_device(void);
@@ -4370,9 +4348,12 @@ protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
+ virtual void device_stop();
+
+ // configuration state
+ const discrete_block *m_intf;
// internal state
- const discrete_device_config &m_config;
/* --------------------------------- */
@@ -4408,33 +4389,14 @@ private:
UINT64 m_total_stream_updates;
};
-// ======================> discrete_sound_device_config
-
-class discrete_sound_device_config : public discrete_device_config,
- public device_config_sound_interface
-{
- friend class discrete_sound_device;
- // construction/destruction
- discrete_sound_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-};
-
// ======================> discrete_sound_device
class discrete_sound_device : public discrete_device,
public device_sound_interface
{
- friend class discrete_sound_device_config;
-
- // construction/destruction
- discrete_sound_device(running_machine &_machine, const discrete_sound_device_config &config);
-
public:
+ // construction/destruction
+ discrete_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~discrete_sound_device(void) { };
/* --------------------------------- */
@@ -4448,12 +4410,9 @@ protected:
virtual void device_start();
virtual void device_reset();
- // sound interface overrides
+ // device_sound_interface overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
- // internal state
- //const discrete_device_config &m_config;
-
private:
/* the output stream */
sound_stream *m_stream;
diff --git a/src/emu/sound/es5503.c b/src/emu/sound/es5503.c
index e029495926a..d23efe8ed70 100644
--- a/src/emu/sound/es5503.c
+++ b/src/emu/sound/es5503.c
@@ -232,7 +232,7 @@ static DEVICE_START( es5503 )
int osc;
ES5503Chip *chip = get_safe_token(device);
- intf = (const es5503_interface *)device->baseconfig().static_config();
+ intf = (const es5503_interface *)device->static_config();
chip->irq_callback = intf->irq_callback;
chip->adc_read = intf->adc_read;
diff --git a/src/emu/sound/es5506.c b/src/emu/sound/es5506.c
index 2f25bd7ead4..5b01857d306 100644
--- a/src/emu/sound/es5506.c
+++ b/src/emu/sound/es5506.c
@@ -989,7 +989,7 @@ static void es5506_start_common(device_t *device, const void *config, device_typ
static DEVICE_START( es5506 )
{
- es5506_start_common(device, device->baseconfig().static_config(), ES5506);
+ es5506_start_common(device, device->static_config(), ES5506);
}
@@ -1554,7 +1554,7 @@ void es5506_voice_bank_w(device_t *device, int voice, int bank)
static DEVICE_START( es5505 )
{
- const es5505_interface *intf = (const es5505_interface *)device->baseconfig().static_config();
+ const es5505_interface *intf = (const es5505_interface *)device->static_config();
es5506_interface es5506intf;
memset(&es5506intf, 0, sizeof(es5506intf));
diff --git a/src/emu/sound/flt_rc.c b/src/emu/sound/flt_rc.c
index ab831c234ed..f17005d34c5 100644
--- a/src/emu/sound/flt_rc.c
+++ b/src/emu/sound/flt_rc.c
@@ -90,7 +90,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->baseconfig().static_config();
+ const flt_rc_config *conf = (const flt_rc_config *)device->static_config();
info->device = device;
info->stream = device->machine().sound().stream_alloc(*device, 1, 1, device->machine().sample_rate(), info, filter_rc_update);
diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c
index 5823f3248e4..549d196d362 100644
--- a/src/emu/sound/gaelco.c
+++ b/src/emu/sound/gaelco.c
@@ -251,7 +251,7 @@ WRITE16_DEVICE_HANDLER( gaelcosnd_w )
static DEVICE_START( gaelco )
{
int j, vol;
- const gaelcosnd_interface *intf = (const gaelcosnd_interface *)device->baseconfig().static_config();
+ const gaelcosnd_interface *intf = (const gaelcosnd_interface *)device->static_config();
gaelco_sound_state *info = get_safe_token(device);
diff --git a/src/emu/sound/ics2115.c b/src/emu/sound/ics2115.c
index 33a39e95ea2..0ef07217ad5 100644
--- a/src/emu/sound/ics2115.c
+++ b/src/emu/sound/ics2115.c
@@ -12,35 +12,19 @@
//#define ICS2115_DEBUG
//#define ICS2115_ISOLATE 6
-const device_type ICS2115 = ics2115_device_config::static_alloc_device_config;
+// device type definition
+const device_type ICS2115 = &device_creator<ics2115_device>;
-void ics2115_device_config::static_set_irqf(device_config *device, void (*irqf)(device_t *device, int state))
+void ics2115_device::static_set_irqf(device_t &device, void (*irqf)(device_t *device, int state))
{
- ics2115_device_config *ics2115 = downcast<ics2115_device_config *>(device);
- ics2115->m_irq_func = irqf;
+ ics2115_device &ics2115 = downcast<ics2115_device &>(device);
+ ics2115.m_irq_cb = irqf;
}
-ics2115_device_config::ics2115_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "ICS2115", tag, owner, clock),
- device_config_sound_interface(mconfig, *this)
-{
-}
-
-device_config *ics2115_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(ics2115_device_config(mconfig, tag, owner, clock));
-}
-
-device_t *ics2115_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, ics2115_device(machine, *this));
-}
-
-ics2115_device::ics2115_device(running_machine &machine, const ics2115_device_config &config)
- : device_t(machine, config),
- device_sound_interface(machine, config, *this),
- m_config(config),
- m_irq_cb(m_config.m_irq_func)
+ics2115_device::ics2115_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ICS2115, "ICS2115", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ m_irq_cb(NULL)
{
}
diff --git a/src/emu/sound/ics2115.h b/src/emu/sound/ics2115.h
index 047f0009007..79fc0061276 100644
--- a/src/emu/sound/ics2115.h
+++ b/src/emu/sound/ics2115.h
@@ -17,7 +17,7 @@
MCFG_IRQ_FUNC(_irqf)
#define MCFG_IRQ_FUNC(_irqf) \
- ics2115_device_config::static_set_irqf(device, _irqf); \
+ ics2115_device::static_set_irqf(*device, _irqf); \
//**************************************************************************
// TYPE DEFINITIONS
@@ -87,38 +87,17 @@ struct ics2115_voice {
void update_ramp();
};
-// ======================> ics2115_device_config
-
-class ics2115_device_config : public device_config, public device_config_sound_interface
-{
- friend class ics2115_device;
-
- // construction/destruction
- ics2115_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_irqf(device_config *device, void (*irqf)(device_t *device, int state));
-
-protected:
- // inline data
- void (*m_irq_func)(device_t *device, int state);
-};
-
// ======================> ics2115_device
class ics2115_device : public device_t, public device_sound_interface
{
- friend class ics2115_device_config;
-
+public:
// construction/destruction
- ics2115_device(running_machine &_machine, const ics2115_device_config &config);
+ ics2115_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_irqf(device_t &device, void (*irqf)(device_t *device, int state));
-public:
static READ8_DEVICE_HANDLER(read);
static WRITE8_DEVICE_HANDLER(write);
//UINT8 read(offs_t offset);
@@ -140,8 +119,6 @@ protected:
void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
// internal state
- const ics2115_device_config &m_config;
-
void (*m_irq_cb)(device_t *device, int state);
UINT8 *m_rom;
diff --git a/src/emu/sound/k007232.c b/src/emu/sound/k007232.c
index 8a5de7ee2b4..bd0663a59f7 100644
--- a/src/emu/sound/k007232.c
+++ b/src/emu/sound/k007232.c
@@ -304,7 +304,7 @@ static DEVICE_START( k007232 )
int i;
KDAC_A_PCM *info = get_safe_token(device);
- info->intf = (device->baseconfig().static_config() != NULL) ? (const k007232_interface *)device->baseconfig().static_config() : &defintrf;
+ info->intf = (device->static_config() != NULL) ? (const k007232_interface *)device->static_config() : &defintrf;
/* Set up the chips */
diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c
index b95600891c5..61411651a89 100644
--- a/src/emu/sound/k053260.c
+++ b/src/emu/sound/k053260.c
@@ -217,7 +217,7 @@ static DEVICE_START( k053260 )
/* Initialize our chip structure */
ic->device = device;
- ic->intf = (device->baseconfig().static_config() != NULL) ? (const k053260_interface *)device->baseconfig().static_config() : &defintrf;
+ ic->intf = (device->static_config() != NULL) ? (const k053260_interface *)device->static_config() : &defintrf;
ic->mode = 0;
diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c
index fad5eea83ab..bf011cec5b3 100644
--- a/src/emu/sound/k054539.c
+++ b/src/emu/sound/k054539.c
@@ -648,7 +648,7 @@ static DEVICE_START( k054539 )
info->k054539_gain[i] = 1.0;
info->k054539_flags = K054539_RESET_FLAGS;
- info->intf = (device->baseconfig().static_config() != NULL) ? (const k054539_interface *)device->baseconfig().static_config() : &defintrf;
+ info->intf = (device->static_config() != NULL) ? (const k054539_interface *)device->static_config() : &defintrf;
/*
I've tried various equations on volume control but none worked consistently.
diff --git a/src/emu/sound/k056800.c b/src/emu/sound/k056800.c
index 758303edd11..6103f2f3208 100644
--- a/src/emu/sound/k056800.c
+++ b/src/emu/sound/k056800.c
@@ -36,7 +36,7 @@ INLINE const k056800_interface *k056800_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K056800));
- return (const k056800_interface *) device->baseconfig().static_config();
+ return (const k056800_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/emu/sound/lmc1992.c b/src/emu/sound/lmc1992.c
index bea1ff66d29..b42507b7fbc 100644
--- a/src/emu/sound/lmc1992.c
+++ b/src/emu/sound/lmc1992.c
@@ -64,44 +64,7 @@ enum
//**************************************************************************
// devices
-const device_type LMC1992 = lmc1992_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// lmc1992_device_config - constructor
-//-------------------------------------------------
-
-lmc1992_device_config::lmc1992_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "LMC1992", tag, owner, clock),
- device_config_sound_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *lmc1992_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(lmc1992_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *lmc1992_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, lmc1992_device(machine, *this));
-}
+const device_type LMC1992 = &device_creator<lmc1992_device>;
@@ -176,10 +139,9 @@ inline void lmc1992_device::execute_command(int addr, int data)
// lmc1992_device - constructor
//-------------------------------------------------
-lmc1992_device::lmc1992_device(running_machine &_machine, const lmc1992_device_config &config)
- : device_t(_machine, config),
- device_sound_interface(_machine, config, *this),
- m_config(config)
+lmc1992_device::lmc1992_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, LMC1992, "LMC1992", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
{
}
diff --git a/src/emu/sound/lmc1992.h b/src/emu/sound/lmc1992.h
index 82659382b44..fc67aa5cde9 100644
--- a/src/emu/sound/lmc1992.h
+++ b/src/emu/sound/lmc1992.h
@@ -65,37 +65,18 @@ enum
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> lmc1992_device_config
-
-class lmc1992_device_config : public device_config,
- public device_config_sound_interface
-{
- friend class lmc1992_device;
-
- // construction/destruction
- lmc1992_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_config(device_config *device, int clock2);
-};
-
-
// ======================> lmc1992_device
class lmc1992_device : public device_t,
public device_sound_interface
{
- friend class lmc1992_device_config;
-
+public:
// construction/destruction
- lmc1992_device(running_machine &_machine, const lmc1992_device_config &_config);
+ lmc1992_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_config(device_t &device, int clock2);
-public:
DECLARE_WRITE_LINE_MEMBER( clock_w );
DECLARE_WRITE_LINE_MEMBER( data_w );
DECLARE_WRITE_LINE_MEMBER( enable_w );
@@ -125,8 +106,6 @@ private:
int m_fader_lf; // left front fader
int m_fader_rr; // right rear fader
int m_fader_lr; // left rear fader
-
- const lmc1992_device_config &m_config;
};
diff --git a/src/emu/sound/mas3507d.c b/src/emu/sound/mas3507d.c
index 77fa947259d..3435d025450 100644
--- a/src/emu/sound/mas3507d.c
+++ b/src/emu/sound/mas3507d.c
@@ -5,29 +5,12 @@
#include "emu.h"
#include "mas3507d.h"
-const device_type MAS3507D = mas3507d_device_config::static_alloc_device_config;
+// device type definition
+const device_type MAS3507D = &device_creator<mas3507d_device>;
-
-mas3507d_device_config::mas3507d_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "MAS3507D", tag, owner, clock),
- device_config_sound_interface(mconfig, *this)
-{
-}
-
-device_config *mas3507d_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(mas3507d_device_config(mconfig, tag, owner, clock));
-}
-
-device_t *mas3507d_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, mas3507d_device(machine, *this));
-}
-
-mas3507d_device::mas3507d_device(running_machine &machine, const mas3507d_device_config &_config)
- : device_t(machine, _config),
- device_sound_interface(machine, _config, *this),
- config(_config)
+mas3507d_device::mas3507d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MAS3507D, "MAS3507D", tag, owner, clock),
+ device_sound_interface(mconfig, *this)
{
}
diff --git a/src/emu/sound/mas3507d.h b/src/emu/sound/mas3507d.h
index fcf33689355..b7e3bc69221 100644
--- a/src/emu/sound/mas3507d.h
+++ b/src/emu/sound/mas3507d.h
@@ -19,25 +19,12 @@
// TYPE DEFINITIONS
//**************************************************************************
-class mas3507d_device_config : public device_config, public device_config_sound_interface
-{
- friend class mas3507d_device;
-
- mas3507d_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
class mas3507d_device : public device_t, public device_sound_interface
{
- friend class mas3507d_device_config;
-
+public:
// construction/destruction
- mas3507d_device(running_machine &_machine, const mas3507d_device_config &config);
+ mas3507d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
int i2c_scl_r();
int i2c_sda_r();
void i2c_scl_w(bool line);
@@ -48,8 +35,6 @@ protected:
virtual void device_reset();
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
- const mas3507d_device_config &config;
-
private:
enum { IDLE, STARTED, NAK, ACK, ACK2 } i2c_bus_state;
enum { UNKNOWN, VALIDATED, WRONG } i2c_bus_address;
diff --git a/src/emu/sound/mos6560.c b/src/emu/sound/mos6560.c
index 061fe8a957a..a2f62c9e1e5 100644
--- a/src/emu/sound/mos6560.c
+++ b/src/emu/sound/mos6560.c
@@ -132,7 +132,7 @@ INLINE const mos6560_interface *get_interface( device_t *device )
assert(device != NULL);
assert((device->type() == MOS656X));
- return (const mos6560_interface *) device->baseconfig().static_config();
+ return (const mos6560_interface *) device->static_config();
}
/*****************************************************************************
@@ -799,7 +799,7 @@ static void mos6560_sound_start( device_t *device )
static DEVICE_START( mos6560 )
{
mos6560_state *mos6560 = get_safe_token(device);
- const mos6560_interface *intf = (mos6560_interface *)device->baseconfig().static_config();
+ const mos6560_interface *intf = (mos6560_interface *)device->static_config();
int width, height;
mos6560->screen = downcast<screen_device *>(device->machine().device(intf->screen));
diff --git a/src/emu/sound/msm5205.c b/src/emu/sound/msm5205.c
index 3414804e91f..8fa868f30b3 100644
--- a/src/emu/sound/msm5205.c
+++ b/src/emu/sound/msm5205.c
@@ -179,7 +179,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->baseconfig().static_config();
+ voice->intf = (const msm5205_interface *)device->static_config();
voice->device = device;
voice->clock = device->clock();
diff --git a/src/emu/sound/msm5232.c b/src/emu/sound/msm5232.c
index b7bd3d3a88c..414c9284c93 100644
--- a/src/emu/sound/msm5232.c
+++ b/src/emu/sound/msm5232.c
@@ -787,7 +787,7 @@ static STATE_POSTLOAD( msm5232_postload )
static DEVICE_START( msm5232 )
{
- const msm5232_interface *intf = (const msm5232_interface *)device->baseconfig().static_config();
+ const msm5232_interface *intf = (const msm5232_interface *)device->static_config();
int rate = device->clock()/CLOCK_RATE_DIVIDER;
msm5232_state *chip = get_safe_token(device);
int voicenum;
diff --git a/src/emu/sound/namco.c b/src/emu/sound/namco.c
index eae14998f21..48f0f049eac 100644
--- a/src/emu/sound/namco.c
+++ b/src/emu/sound/namco.c
@@ -360,7 +360,7 @@ static STREAM_UPDATE( namco_update_stereo )
static DEVICE_START( namco )
{
sound_channel *voice;
- const namco_interface *intf = (const namco_interface *)device->baseconfig().static_config();
+ const namco_interface *intf = (const namco_interface *)device->static_config();
int clock_multiple;
namco_sound *chip = get_safe_token(device);
diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c
index 7f78d42b53d..da1576fd5d0 100644
--- a/src/emu/sound/nes_apu.c
+++ b/src/emu/sound/nes_apu.c
@@ -684,7 +684,7 @@ static STREAM_UPDATE( nes_psg_update_sound )
/* INITIALIZE APU SYSTEM */
static DEVICE_START( nesapu )
{
- const nes_interface *intf = (const nes_interface *)device->baseconfig().static_config();
+ const nes_interface *intf = (const nes_interface *)device->static_config();
nesapu_state *info = get_safe_token(device);
int rate = device->clock() / 4;
int i;
diff --git a/src/emu/sound/okim6258.c b/src/emu/sound/okim6258.c
index 15dd49a9eb1..aa939cc3fe2 100644
--- a/src/emu/sound/okim6258.c
+++ b/src/emu/sound/okim6258.c
@@ -189,7 +189,7 @@ static void okim6258_state_save_register(okim6258_state *info, device_t *device)
static DEVICE_START( okim6258 )
{
- const okim6258_interface *intf = (const okim6258_interface *)device->baseconfig().static_config();
+ const okim6258_interface *intf = (const okim6258_interface *)device->static_config();
okim6258_state *info = get_safe_token(device);
compute_tables();
diff --git a/src/emu/sound/okim6295.c b/src/emu/sound/okim6295.c
index c316038f74e..f423942a673 100644
--- a/src/emu/sound/okim6295.c
+++ b/src/emu/sound/okim6295.c
@@ -43,8 +43,8 @@
// GLOBAL VARIABLES
//**************************************************************************
-// devices
-const device_type OKIM6295 = okim6295_device_config::static_alloc_device_config;
+// device type definition
+const device_type OKIM6295 = &device_creator<okim6295_device>;
// ADPCM state and tables
bool adpcm_state::s_tables_computed = false;
@@ -82,40 +82,25 @@ ADDRESS_MAP_END
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
-// okim6295_device_config - constructor
-//-------------------------------------------------
-
-okim6295_device_config::okim6295_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "OKI6295", tag, owner, clock),
- device_config_sound_interface(mconfig, *this),
- device_config_memory_interface(mconfig, *this),
- m_space_config("samples", ENDIANNESS_LITTLE, 8, 18, 0, NULL, *ADDRESS_MAP_NAME(okim6295))
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *okim6295_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(okim6295_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
+// okim6295_device - constructor
//-------------------------------------------------
-device_t *okim6295_device_config::alloc_device(running_machine &machine) const
+okim6295_device::okim6295_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, OKIM6295, "OKI6295", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ device_memory_interface(mconfig, *this),
+ m_space_config("samples", ENDIANNESS_LITTLE, 8, 18, 0, NULL, *ADDRESS_MAP_NAME(okim6295)),
+ m_command(-1),
+ m_bank_installed(false),
+ m_bank_offs(0),
+ m_stream(NULL),
+ m_pin7_state(0),
+ m_direct(NULL)
{
- return auto_alloc(machine, okim6295_device(machine, *this));
}
@@ -124,45 +109,10 @@ device_t *okim6295_device_config::alloc_device(running_machine &machine) const
// the pin 7 state
//-------------------------------------------------
-void okim6295_device_config::static_set_pin7(device_config *device, int pin7)
-{
- okim6295_device_config *okim6295 = downcast<okim6295_device_config *>(device);
- okim6295->m_pin7 = pin7;
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *okim6295_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == 0) ? &m_space_config : NULL;
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// okim6295_device - constructor
-//-------------------------------------------------
-
-okim6295_device::okim6295_device(running_machine &_machine, const okim6295_device_config &config)
- : device_t(_machine, config),
- device_sound_interface(_machine, config, *this),
- device_memory_interface(_machine, config, *this),
- m_config(config),
- m_command(-1),
- m_bank_installed(false),
- m_bank_offs(0),
- m_stream(NULL),
- m_pin7_state(m_config.m_pin7),
- m_direct(NULL)
+void okim6295_device::static_set_pin7(device_t &device, int pin7)
{
+ okim6295_device &okim6295 = downcast<okim6295_device &>(device);
+ okim6295.m_pin7_state = pin7;
}
@@ -176,7 +126,7 @@ void okim6295_device::device_start()
m_direct = &space()->direct();
// create the stream
- int divisor = m_config.m_pin7 ? 132 : 165;
+ int divisor = m_pin7_state ? 132 : 165;
m_stream = machine().sound().stream_alloc(*this, 0, 1, clock() / divisor);
save_item(NAME(m_command));
@@ -229,6 +179,17 @@ void okim6295_device::device_clock_changed()
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *okim6295_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == 0) ? &m_space_config : NULL;
+}
+
+
+//-------------------------------------------------
// stream_generate - handle update requests for
// our sound stream
//-------------------------------------------------
diff --git a/src/emu/sound/okim6295.h b/src/emu/sound/okim6295.h
index 539efa79dc7..64687c15435 100644
--- a/src/emu/sound/okim6295.h
+++ b/src/emu/sound/okim6295.h
@@ -39,7 +39,7 @@ enum
MCFG_OKIM6295_PIN7(_pin7)
#define MCFG_OKIM6295_PIN7(_pin7) \
- okim6295_device_config::static_set_pin7(device, _pin7); \
+ okim6295_device::static_set_pin7(*device, _pin7); \
@@ -72,50 +72,20 @@ private:
-// ======================> okim6295_device_config
-
-class okim6295_device_config : public device_config,
- public device_config_sound_interface,
- public device_config_memory_interface
-{
- friend class okim6295_device;
-
- // construction/destruction
- okim6295_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_pin7(device_config *device, int pin7);
-
-protected:
- // device_config overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // internal state
- const address_space_config m_space_config;
-
- // inline data
- UINT8 m_pin7;
-};
-
-
-
// ======================> okim6295_device
class okim6295_device : public device_t,
public device_sound_interface,
public device_memory_interface
{
- friend class okim6295_device_config;
-
+public:
// construction/destruction
- okim6295_device(running_machine &_machine, const okim6295_device_config &config);
+ okim6295_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
+ // inline configuration helpers
+ static void static_set_pin7(device_t &device, int pin7);
+
+ // runtime configuration
void set_bank_base(offs_t base);
void set_pin7(int pin7);
@@ -132,7 +102,10 @@ protected:
virtual void device_post_load();
virtual void device_clock_changed();
- // sound interface overrides
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
+ // device_sound_interface overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
// a single voice
@@ -150,11 +123,12 @@ protected:
INT8 m_volume; // output volume
};
+ // configuration state
+ const address_space_config m_space_config;
+
// internal state
static const int OKIM6295_VOICES = 4;
- const okim6295_device_config &m_config;
-
okim_voice m_voice[OKIM6295_VOICES];
INT32 m_command;
bool m_bank_installed;
diff --git a/src/emu/sound/okim9810.c b/src/emu/sound/okim9810.c
index 8704f05490c..e9fa9bbd763 100644
--- a/src/emu/sound/okim9810.c
+++ b/src/emu/sound/okim9810.c
@@ -14,9 +14,8 @@
// GLOBAL VARIABLES
//**************************************************************************
-// devices
-const device_type OKIM9810 = okim9810_device_config::static_alloc_device_config;
-
+// device type definition
+const device_type OKIM9810 = &device_creator<okim9810_device>;
// volume lookup table. The manual lists a full 16 steps, 2dB per step.
// Given the dB values, that seems to map to a 7-bit volume control.
@@ -67,55 +66,6 @@ static ADDRESS_MAP_START( okim9810, AS_0, 8 )
ADDRESS_MAP_END
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// okim9810_device_config - constructor
-//-------------------------------------------------
-
-okim9810_device_config::okim9810_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "OKI9810", tag, owner, clock),
- device_config_sound_interface(mconfig, *this),
- device_config_memory_interface(mconfig, *this),
- m_space_config("samples", ENDIANNESS_BIG, 8, 24, 0, NULL, *ADDRESS_MAP_NAME(okim9810))
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *okim9810_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(okim9810_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *okim9810_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, okim9810_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *okim9810_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == 0) ? &m_space_config : NULL;
-}
-
-
//**************************************************************************
// LIVE DEVICE
@@ -125,11 +75,11 @@ const address_space_config *okim9810_device_config::memory_space_config(address_
// okim9810_device - constructor
//-------------------------------------------------
-okim9810_device::okim9810_device(running_machine &_machine, const okim9810_device_config &config)
- : device_t(_machine, config),
- device_sound_interface(_machine, config, *this),
- device_memory_interface(_machine, config, *this),
- m_config(config),
+okim9810_device::okim9810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, OKIM9810, "OKI9810", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ device_memory_interface(mconfig, *this),
+ m_space_config("samples", ENDIANNESS_BIG, 8, 24, 0, NULL, *ADDRESS_MAP_NAME(okim9810)),
m_stream(NULL),
m_TMP_register(0x00),
m_global_volume(0x00),
@@ -149,7 +99,7 @@ void okim9810_device::device_start()
m_direct = &space()->direct();
// create the stream
- //int divisor = m_config.m_pin7 ? 132 : 165;
+ //int divisor = m_pin7 ? 132 : 165;
m_stream = machine().sound().stream_alloc(*this, 0, 2, clock());
// save state stuff
@@ -190,6 +140,17 @@ void okim9810_device::device_clock_changed()
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *okim9810_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == 0) ? &m_space_config : NULL;
+}
+
+
+//-------------------------------------------------
// stream_generate - handle update requests for
// our sound stream
//-------------------------------------------------
diff --git a/src/emu/sound/okim9810.h b/src/emu/sound/okim9810.h
index 7cf55c1ecd4..459c4edc046 100644
--- a/src/emu/sound/okim9810.h
+++ b/src/emu/sound/okim9810.h
@@ -62,44 +62,15 @@ enum
//**************************************************************************
-// ======================> okim9810_device_config
-
-class okim9810_device_config : public device_config,
- public device_config_sound_interface,
- public device_config_memory_interface
-{
- friend class okim9810_device;
-
- // construction/destruction
- okim9810_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // internal state
- const address_space_config m_space_config;
-};
-
-
-
// ======================> okim9810_device
class okim9810_device : public device_t,
public device_sound_interface,
public device_memory_interface
{
- friend class okim9810_device_config;
-
- // construction/destruction
- okim9810_device(running_machine &_machine, const okim9810_device_config &config);
-
public:
+ // construction/destruction
+ okim9810_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
UINT8 read_status();
void write_TMP_register(UINT8 command);
@@ -116,7 +87,10 @@ protected:
virtual void device_post_load();
virtual void device_clock_changed();
- // sound interface overrides
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
+ // device_sound_interface overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
// a single voice
@@ -162,7 +136,7 @@ protected:
// internal state
- const okim9810_device_config &m_config;
+ const address_space_config m_space_config;
sound_stream* m_stream;
direct_read_data* m_direct;
diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c
index 740f9395548..3d24de83aae 100644
--- a/src/emu/sound/pokey.c
+++ b/src/emu/sound/pokey.c
@@ -615,8 +615,8 @@ static DEVICE_START( pokey )
int sample_rate = device->clock();
int i;
- if (device->baseconfig().static_config())
- memcpy(&chip->intf, device->baseconfig().static_config(), sizeof(pokey_interface));
+ if (device->static_config())
+ memcpy(&chip->intf, device->static_config(), sizeof(pokey_interface));
chip->device = device;
chip->clock_period = attotime::from_hz(device->clock());
diff --git a/src/emu/sound/rf5c68.c b/src/emu/sound/rf5c68.c
index 56f60f4e7a7..0bc2be6c979 100644
--- a/src/emu/sound/rf5c68.c
+++ b/src/emu/sound/rf5c68.c
@@ -139,7 +139,7 @@ static STREAM_UPDATE( rf5c68_update )
static DEVICE_START( rf5c68 )
{
- const rf5c68_interface* intf = (const rf5c68_interface*)device->baseconfig().static_config();
+ const rf5c68_interface* intf = (const rf5c68_interface*)device->static_config();
/* allocate memory for the chip */
rf5c68_state *chip = get_safe_token(device);
diff --git a/src/emu/sound/samples.c b/src/emu/sound/samples.c
index 7a1afb85cd1..67f3a6c94c3 100644
--- a/src/emu/sound/samples.c
+++ b/src/emu/sound/samples.c
@@ -461,7 +461,7 @@ static STATE_POSTLOAD( samples_postload )
static DEVICE_START( samples )
{
int i;
- const samples_interface *intf = (const samples_interface *)device->baseconfig().static_config();
+ const samples_interface *intf = (const samples_interface *)device->static_config();
samples_info *info = get_safe_token(device);
info->device = device;
diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c
index 486f473ee33..a211fe147a0 100644
--- a/src/emu/sound/scsp.c
+++ b/src/emu/sound/scsp.c
@@ -1240,7 +1240,7 @@ static DEVICE_START( scsp )
scsp_state *scsp = get_safe_token(device);
- intf = (const scsp_interface *)device->baseconfig().static_config();
+ intf = (const scsp_interface *)device->static_config();
// init the emulation
SCSP_Init(device, scsp, intf);
diff --git a/src/emu/sound/segapcm.c b/src/emu/sound/segapcm.c
index 4df96f9d9b6..7f6f7054748 100644
--- a/src/emu/sound/segapcm.c
+++ b/src/emu/sound/segapcm.c
@@ -104,7 +104,7 @@ static STREAM_UPDATE( SEGAPCM_update )
static DEVICE_START( segapcm )
{
- const sega_pcm_interface *intf = (const sega_pcm_interface *)device->baseconfig().static_config();
+ const sega_pcm_interface *intf = (const sega_pcm_interface *)device->static_config();
int mask, rom_mask, len;
segapcm_state *spcm = get_safe_token(device);
diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c
index 49b99579078..9e7732755c0 100644
--- a/src/emu/sound/sid6581.c
+++ b/src/emu/sound/sid6581.c
@@ -32,7 +32,7 @@ static STREAM_UPDATE( sid_update )
static void sid_start(device_t *device, SIDTYPE sidtype)
{
_SID6581 *sid = get_sid(device);
- const sid6581_interface *iface = (const sid6581_interface*) device->baseconfig().static_config();
+ const sid6581_interface *iface = (const sid6581_interface*) device->static_config();
sid->device = device;
sid->mixer_channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), (void *) sid, sid_update);
diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c
index 1c62f699fa9..1fd82bc3de5 100644
--- a/src/emu/sound/sn76477.c
+++ b/src/emu/sound/sn76477.c
@@ -2398,7 +2398,7 @@ static DEVICE_START( sn76477 )
#if TEST_MODE == 0
- intf = (sn76477_interface *)device->baseconfig().static_config();
+ intf = (sn76477_interface *)device->static_config();
#else
intf = &test_interface;
#endif
diff --git a/src/emu/sound/snkwave.c b/src/emu/sound/snkwave.c
index 20efad91663..32d09bc167a 100644
--- a/src/emu/sound/snkwave.c
+++ b/src/emu/sound/snkwave.c
@@ -110,7 +110,7 @@ static DEVICE_START( snkwave )
{
snkwave_state *chip = get_safe_token(device);
- assert(device->baseconfig().static_config() == 0);
+ assert(device->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 9c5f6367869..32b9d06d47e 100644
--- a/src/emu/sound/sp0250.c
+++ b/src/emu/sound/sp0250.c
@@ -199,7 +199,7 @@ static STREAM_UPDATE( sp0250_update )
static DEVICE_START( sp0250 )
{
- const struct sp0250_interface *intf = (const struct sp0250_interface *)device->baseconfig().static_config();
+ const struct sp0250_interface *intf = (const struct sp0250_interface *)device->static_config();
sp0250_state *sp = get_safe_token(device);
sp->device = device;
diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c
index 914a601a9e5..acdf69dc78a 100644
--- a/src/emu/sound/sp0256.c
+++ b/src/emu/sound/sp0256.c
@@ -1177,7 +1177,7 @@ static STREAM_UPDATE( sp0256_update )
static DEVICE_START( sp0256 )
{
- const sp0256_interface *intf = (const sp0256_interface *)device->baseconfig().static_config();
+ const sp0256_interface *intf = (const sp0256_interface *)device->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 54f13bfa9f2..fb365c5b4c5 100644
--- a/src/emu/sound/speaker.c
+++ b/src/emu/sound/speaker.c
@@ -136,7 +136,7 @@ INLINE speaker_state *get_safe_token(device_t *device)
static DEVICE_START( speaker )
{
speaker_state *sp = get_safe_token(device);
- const speaker_interface *intf = (const speaker_interface *) device->baseconfig().static_config();
+ const speaker_interface *intf = (const speaker_interface *) device->static_config();
int i;
double x;
diff --git a/src/emu/sound/spu.c b/src/emu/sound/spu.c
index 65a05dd6ff0..8745bf8510e 100644
--- a/src/emu/sound/spu.c
+++ b/src/emu/sound/spu.c
@@ -32,6 +32,9 @@
#define debug_xa if (0)
#endif
+// device type definition
+const device_type SPU = &device_creator<spu_device>;
+
//
//
//
@@ -236,8 +239,6 @@ static const int filter_coef[5][2]=
// GLOBAL VARIABLES
//**************************************************************************
-const device_type SPU = spu_device_config::static_alloc_device_config;
-
reverb_params *spu_reverb_cfg=NULL;
float spu_device::freq_multiplier=1.0f;
@@ -246,48 +247,6 @@ float spu_device::freq_multiplier=1.0f;
// DEVICE CONFIGURATION
//**************************************************************************
-//-------------------------------------------------
-// static_set_irqf - configuration helper to set
-// the IRQ callback
-//-------------------------------------------------
-
-void spu_device_config::static_set_irqf(device_config *device, void (*irqf)(device_t *device, UINT32 state))
-{
- spu_device_config *spu = downcast<spu_device_config *>(device);
- spu->m_irq_func = irqf;
-}
-
-//-------------------------------------------------
-// spu_device_config - constructor
-//-------------------------------------------------
-
-spu_device_config::spu_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "SPU", tag, owner, clock),
- device_config_sound_interface(mconfig, *this)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *spu_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(spu_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *spu_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, spu_device(machine, *this));
-}
-
class adpcm_decoder
{
int l0,l1;
@@ -995,11 +954,10 @@ static int shift_register15(int &shift)
// spu_device - constructor
//-------------------------------------------------
-spu_device::spu_device(running_machine &_machine, const spu_device_config &config)
- : device_t(_machine, config),
- device_sound_interface(_machine, config, *this),
- m_config(config),
- m_irq_cb(m_config.m_irq_func),
+spu_device::spu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SPU, "SPU", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ m_irq_cb(NULL),
dirty_flags(-1),
status_enabled(false),
xa_voll(0x8000),
@@ -1009,6 +967,17 @@ spu_device::spu_device(running_machine &_machine, const spu_device_config &confi
{
}
+//-------------------------------------------------
+// static_set_irqf - configuration helper to set
+// the IRQ callback
+//-------------------------------------------------
+
+void spu_device::static_set_irqf(device_t &device, void (*irqf)(device_t *device, UINT32 state))
+{
+ spu_device &spu = downcast<spu_device &>(device);
+ spu.m_irq_cb = irqf;
+}
+
void spu_device::device_start()
{
voice=new voiceinfo [24];
diff --git a/src/emu/sound/spu.h b/src/emu/sound/spu.h
index 07a11f1e91e..a0aec5943d4 100644
--- a/src/emu/sound/spu.h
+++ b/src/emu/sound/spu.h
@@ -18,29 +18,7 @@
MCFG_IRQ_FUNC(_irqf)
#define MCFG_IRQ_FUNC(_irqf) \
- spu_device_config::static_set_irqf(device, _irqf); \
-
-// ======================> spu_device_config
-
-class spu_device_config : public device_config, public device_config_sound_interface
-{
- friend class spu_device;
-
- // construction/destruction
- spu_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_irqf(device_config *device, void (*irqf)(device_t *device, UINT32 state));
-
-protected:
- // inline data
- void (*m_irq_func)(device_t *device, UINT32 state);
-};
+ spu_device::static_set_irqf(*device, _irqf); \
// ======================> spu_device
@@ -50,8 +28,6 @@ class stream_buffer;
class spu_device : public device_t, public device_sound_interface
{
- friend class spu_device_config;
-
struct sample_cache;
struct sample_loop_cache;
struct cache_pointer;
@@ -75,8 +51,6 @@ protected:
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
// internal state
- const spu_device_config &m_config;
-
void (*m_irq_cb)(device_t *device, UINT32 state);
unsigned char *spu_ram;
@@ -243,7 +217,10 @@ protected:
static reverb_preset *find_reverb_preset(const unsigned short *param);
public:
- spu_device(running_machine &_machine, const spu_device_config &config);
+ spu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_irqf(device_t &device, void (*irqf)(device_t *device, UINT32 state));
void reinit_sound();
void kill_sound();
diff --git a/src/emu/sound/st0016.c b/src/emu/sound/st0016.c
index dd9e41ed651..e67e235f9d5 100644
--- a/src/emu/sound/st0016.c
+++ b/src/emu/sound/st0016.c
@@ -137,7 +137,7 @@ static STREAM_UPDATE( st0016_update )
static DEVICE_START( st0016 )
{
- const st0016_interface *intf = (const st0016_interface *)device->baseconfig().static_config();
+ const st0016_interface *intf = (const st0016_interface *)device->static_config();
st0016_state *info = get_safe_token(device);
info->sound_ram = intf->p_soundram;
diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c
index e9c70baacdc..bf84ecb0a52 100644
--- a/src/emu/sound/tms36xx.c
+++ b/src/emu/sound/tms36xx.c
@@ -498,7 +498,7 @@ static DEVICE_START( tms36xx )
tms_state *tms = get_safe_token(device);
int enable;
- tms->intf = (const tms36xx_interface *)device->baseconfig().static_config();
+ tms->intf = (const tms36xx_interface *)device->static_config();
tms->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() * 64, tms, tms36xx_sound_update);
tms->samplerate = device->clock() * 64;
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index 11b04ad2998..0bf70e8d298 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -1015,9 +1015,9 @@ static DEVICE_START( tms5110 )
assert_always(tms != NULL, "Error creating TMS5110 chip");
- assert_always(device->baseconfig().static_config() != NULL, "No config");
+ assert_always(device->static_config() != NULL, "No config");
- tms->intf = device->baseconfig().static_config() ? (const tms5110_interface *)device->baseconfig().static_config() : &dummy;
+ tms->intf = device->static_config() ? (const tms5110_interface *)device->static_config() : &dummy;
tms->table = *device->region();
tms->device = device;
@@ -1406,7 +1406,7 @@ static DEVICE_START( tmsprom )
assert_always(tms != NULL, "Error creating TMSPROM chip");
- tms->intf = (const tmsprom_interface *) device->baseconfig().static_config();
+ tms->intf = (const tmsprom_interface *) device->static_config();
assert_always(tms->intf != NULL, "Error creating TMSPROM chip: No configuration");
/* resolve lines */
diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c
index cb0fef2986a..a1cbda636c3 100644
--- a/src/emu/sound/tms5220.c
+++ b/src/emu/sound/tms5220.c
@@ -1573,7 +1573,7 @@ static DEVICE_START( tms5220 )
static const tms5220_interface dummy = { DEVCB_NULL };
tms5220_state *tms = get_safe_token(device);
- tms->intf = device->baseconfig().static_config() ? (const tms5220_interface *)device->baseconfig().static_config() : &dummy;
+ tms->intf = device->static_config() ? (const tms5220_interface *)device->static_config() : &dummy;
//tms->table = *device->region();
tms->device = device;
diff --git a/src/emu/sound/upd7759.c b/src/emu/sound/upd7759.c
index 6a50bba8f24..f965257125c 100644
--- a/src/emu/sound/upd7759.c
+++ b/src/emu/sound/upd7759.c
@@ -635,7 +635,7 @@ static void register_for_save(upd7759_state *chip, device_t *device)
static DEVICE_START( upd7759 )
{
static const upd7759_interface defintrf = { 0 };
- const upd7759_interface *intf = (device->baseconfig().static_config() != NULL) ? (const upd7759_interface *)device->baseconfig().static_config() : &defintrf;
+ const upd7759_interface *intf = (device->static_config() != NULL) ? (const upd7759_interface *)device->static_config() : &defintrf;
upd7759_state *chip = get_safe_token(device);
chip->device = device;
diff --git a/src/emu/sound/vlm5030.c b/src/emu/sound/vlm5030.c
index 15b57cce1a4..229039e15cb 100644
--- a/src/emu/sound/vlm5030.c
+++ b/src/emu/sound/vlm5030.c
@@ -685,7 +685,7 @@ static DEVICE_START( vlm5030 )
vlm5030_state *chip = get_safe_token(device);
chip->device = device;
- chip->intf = (device->baseconfig().static_config() != NULL) ? (const vlm5030_interface *)device->baseconfig().static_config() : &defintrf;
+ chip->intf = (device->static_config() != NULL) ? (const vlm5030_interface *)device->static_config() : &defintrf;
emulation_rate = device->clock() / 440;
diff --git a/src/emu/sound/vrender0.c b/src/emu/sound/vrender0.c
index e39d049fc26..1584507703c 100644
--- a/src/emu/sound/vrender0.c
+++ b/src/emu/sound/vrender0.c
@@ -105,7 +105,7 @@ static DEVICE_START( vrender0 )
const vr0_interface *intf;
vr0_state *VR0 = get_safe_token(device);
- intf = (const vr0_interface *)device->baseconfig().static_config();
+ intf = (const vr0_interface *)device->static_config();
memcpy(&(VR0->Intf),intf,sizeof(vr0_interface));
memset(VR0->SOUNDREGS,0,sizeof(VR0->SOUNDREGS));
diff --git a/src/emu/sound/wave.c b/src/emu/sound/wave.c
index 4526863ef7f..0da43bb9abe 100644
--- a/src/emu/sound/wave.c
+++ b/src/emu/sound/wave.c
@@ -22,7 +22,7 @@
static STREAM_UPDATE( wave_sound_update )
{
device_image_interface *image = (device_image_interface *)param;
- int speakers = image->device().machine().m_devicelist.count(SPEAKER);
+ int speakers = image->device().machine().devicelist().count(SPEAKER);
cassette_image *cassette;
cassette_state state;
double time_index;
@@ -70,9 +70,9 @@ static DEVICE_START( wave )
device_image_interface *image = NULL;
assert( device != NULL );
- assert( device->baseconfig().static_config() != NULL );
- int speakers = device->machine().config().m_devicelist.count(SPEAKER);
- image = dynamic_cast<device_image_interface *>(device->machine().device( (const char *)device->baseconfig().static_config()));
+ assert( device->static_config() != NULL );
+ int speakers = device->machine().config().devicelist().count(SPEAKER);
+ image = dynamic_cast<device_image_interface *>(device->machine().device( (const char *)device->static_config()));
if (speakers > 1)
device->machine().sound().stream_alloc(*device, 0, 2, device->machine().sample_rate(), (void *)image, wave_sound_update);
else
diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c
index c4d446e0173..73b78f263eb 100644
--- a/src/emu/sound/x1_010.c
+++ b/src/emu/sound/x1_010.c
@@ -200,7 +200,7 @@ static STREAM_UPDATE( seta_update )
static DEVICE_START( x1_010 )
{
int i;
- const x1_010_interface *intf = (const x1_010_interface *)device->baseconfig().static_config();
+ const x1_010_interface *intf = (const x1_010_interface *)device->static_config();
x1_010_state *info = get_safe_token(device);
info->region = *device->region();
diff --git a/src/emu/sound/ymf271.c b/src/emu/sound/ymf271.c
index 043fb6f60c4..dcfe3a2fe53 100644
--- a/src/emu/sound/ymf271.c
+++ b/src/emu/sound/ymf271.c
@@ -1775,7 +1775,7 @@ static DEVICE_START( ymf271 )
chip->device = device;
chip->clock = device->clock();
- intf = (device->baseconfig().static_config() != NULL) ? (const ymf271_interface *)device->baseconfig().static_config() : &defintrf;
+ intf = (device->static_config() != NULL) ? (const ymf271_interface *)device->static_config() : &defintrf;
ymf271_init(device, chip, *device->region(), intf->irq_callback, &intf->ext_read, &intf->ext_write);
chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/384, chip, ymf271_update);
diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c
index c0a116b1854..7d2e6171dbe 100644
--- a/src/emu/sound/ymf278b.c
+++ b/src/emu/sound/ymf278b.c
@@ -738,7 +738,7 @@ static DEVICE_START( ymf278b )
YMF278BChip *chip = get_safe_token(device);
chip->device = device;
- intf = (device->baseconfig().static_config() != NULL) ? (const ymf278b_interface *)device->baseconfig().static_config() : &defintrf;
+ intf = (device->static_config() != NULL) ? (const ymf278b_interface *)device->static_config() : &defintrf;
ymf278b_init(device, chip, intf->irq_callback);
chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/768, chip, ymf278b_pcm_update);
diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c
index cb5db4a7424..6330745caa4 100644
--- a/src/emu/sound/ymz280b.c
+++ b/src/emu/sound/ymz280b.c
@@ -635,7 +635,7 @@ static STREAM_UPDATE( ymz280b_update )
static DEVICE_START( ymz280b )
{
static const ymz280b_interface defintrf = { 0 };
- const ymz280b_interface *intf = (device->baseconfig().static_config() != NULL) ? (const ymz280b_interface *)device->baseconfig().static_config() : &defintrf;
+ const ymz280b_interface *intf = (device->static_config() != NULL) ? (const ymz280b_interface *)device->static_config() : &defintrf;
ymz280b_state *chip = get_safe_token(device);
chip->device = device;
diff --git a/src/emu/sound/zsg2.c b/src/emu/sound/zsg2.c
index 28be392d6aa..856fe49ecfe 100644
--- a/src/emu/sound/zsg2.c
+++ b/src/emu/sound/zsg2.c
@@ -218,7 +218,7 @@ READ16_DEVICE_HANDLER( zsg2_r )
static DEVICE_START( zsg2 )
{
- const zsg2_interface *intf = (const zsg2_interface *)device->baseconfig().static_config();
+ const zsg2_interface *intf = (const zsg2_interface *)device->static_config();
zsg2_state *info = get_safe_token(device);
info->sample_rate = device->clock();
diff --git a/src/emu/speaker.c b/src/emu/speaker.c
index 1151fb8306f..edaaa280f01 100644
--- a/src/emu/speaker.c
+++ b/src/emu/speaker.c
@@ -56,80 +56,23 @@
-/***************************************************************************
- DEVICE DEFINITIONS
-***************************************************************************/
-
-const device_type SPEAKER = speaker_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// SPEAKER DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// speaker_device_config - constructor
-//-------------------------------------------------
-
-speaker_device_config::speaker_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Speaker", tag, owner, clock),
- device_config_sound_interface(mconfig, *this),
- m_x(0.0),
- m_y(0.0),
- m_z(0.0)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *speaker_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(speaker_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *speaker_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, speaker_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// static_set_position - configuration helper to
-// set the speaker position
-//-------------------------------------------------
-
-void speaker_device_config::static_set_position(device_config *device, double x, double y, double z)
-{
- speaker_device_config *speaker = downcast<speaker_device_config *>(device);
- speaker->m_x = x;
- speaker->m_y = y;
- speaker->m_z = z;
-}
-
-
-
//**************************************************************************
// LIVE SPEAKER DEVICE
//**************************************************************************
+// device type definition
+const device_type SPEAKER = &device_creator<speaker_device>;
+
//-------------------------------------------------
// speaker_device - constructor
//-------------------------------------------------
-speaker_device::speaker_device(running_machine &_machine, const speaker_device_config &config)
- : device_t(_machine, config),
- device_sound_interface(_machine, config, *this),
- m_config(config),
+speaker_device::speaker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SPEAKER, "Speaker", tag, owner, clock),
+ device_sound_interface(mconfig, *this),
+ m_x(0.0),
+ m_y(0.0),
+ m_z(0.0),
m_mixer_stream(NULL)
#ifdef MAME_DEBUG
,
@@ -156,6 +99,20 @@ speaker_device::~speaker_device()
//-------------------------------------------------
+// static_set_position - configuration helper to
+// set the speaker position
+//-------------------------------------------------
+
+void speaker_device::static_set_position(device_t &device, double x, double y, double z)
+{
+ speaker_device &speaker = downcast<speaker_device &>(device);
+ speaker.m_x = x;
+ speaker.m_y = y;
+ speaker.m_z = z;
+}
+
+
+//-------------------------------------------------
// device_start - perform device-specific
// startup
//-------------------------------------------------
@@ -249,7 +206,7 @@ void speaker_device::mix(INT32 *leftmix, INT32 *rightmix, int &samples_this_upda
if (!suppress)
{
// if the speaker is centered, send to both left and right
- if (m_config.m_x == 0)
+ if (m_x == 0)
for (int sample = 0; sample < samples_this_update; sample++)
{
leftmix[sample] += stream_buf[sample];
@@ -257,7 +214,7 @@ void speaker_device::mix(INT32 *leftmix, INT32 *rightmix, int &samples_this_upda
}
// if the speaker is to the left, send only to the left
- else if (m_config.m_x < 0)
+ else if (m_x < 0)
for (int sample = 0; sample < samples_this_update; sample++)
leftmix[sample] += stream_buf[sample];
diff --git a/src/emu/speaker.h b/src/emu/speaker.h
index 12bdcca501e..31b6f4696c7 100644
--- a/src/emu/speaker.h
+++ b/src/emu/speaker.h
@@ -54,7 +54,7 @@
// add/remove speakers
#define MCFG_SPEAKER_ADD(_tag, _x, _y, _z) \
MCFG_DEVICE_ADD(_tag, SPEAKER, 0) \
- speaker_device_config::static_set_position(device, _x, _y, _z); \
+ speaker_device::static_set_position(*device, _x, _y, _z); \
#define MCFG_SPEAKER_STANDARD_MONO(_tag) \
MCFG_SPEAKER_ADD(_tag, 0.0, 0.0, 1.0)
@@ -69,47 +69,21 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> speaker_device_config
-
-class speaker_device_config : public device_config,
- public device_config_sound_interface
-{
- friend class speaker_device;
-
- // construction/destruction
- speaker_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- speaker_device_config *next_speaker() const { return downcast<speaker_device_config *>(typenext()); }
- static void static_set_position(device_config *device, double x, double y, double z);
-
-protected:
- // inline configuration state
- double m_x;
- double m_y;
- double m_z;
-};
-
-
-
// ======================> speaker_device
class speaker_device : public device_t,
public device_sound_interface
{
- friend class speaker_device_config;
friend resource_pool_object<speaker_device>::~resource_pool_object();
+public:
// construction/destruction
- speaker_device(running_machine &_machine, const speaker_device_config &config);
+ speaker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~speaker_device();
-public:
+ // inline configuration helpers
+ static void static_set_position(device_t &device, double x, double y, double z);
+
// getters
speaker_device *next_speaker() const { return downcast<speaker_device *>(typenext()); }
@@ -124,8 +98,12 @@ protected:
// sound interface overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+ // inline configuration state
+ double m_x;
+ double m_y;
+ double m_z;
+
// internal state
- const speaker_device_config &m_config;
sound_stream * m_mixer_stream; // mixing stream
#ifdef MAME_DEBUG
INT32 m_max_sample; // largest sample value we've seen
diff --git a/src/emu/timer.c b/src/emu/timer.c
index a2b0c781ebd..28ed940c93b 100644
--- a/src/emu/timer.c
+++ b/src/emu/timer.c
@@ -51,56 +51,32 @@
-/***************************************************************************
-// DEVICE DEFINITIONS
-***************************************************************************/
-
-const device_type TIMER = timer_device_config::static_alloc_device_config;
-
-
-
//**************************************************************************
-// TIMER DEVICE CONFIGURATION
+// LIVE TIMER DEVICE
//**************************************************************************
+const device_type TIMER = &device_creator<timer_device>;
+
//-------------------------------------------------
-// timer_device_config - constructor
+// timer_device - constructor
//-------------------------------------------------
-timer_device_config::timer_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Timer", tag, owner, clock),
+timer_device::timer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, TIMER, "Timer", tag, owner, clock),
m_type(TIMER_TYPE_GENERIC),
m_callback(NULL),
m_ptr(NULL),
m_start_delay(attotime::zero),
m_period(attotime::zero),
m_param(0),
+ m_screen_tag(NULL),
m_screen(NULL),
m_first_vpos(0),
- m_increment(0)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *timer_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(timer_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *timer_device_config::alloc_device(running_machine &machine) const
+ m_increment(0),
+ m_timer(NULL),
+ m_first_time(true)
{
- return auto_alloc(machine, timer_device(machine, *this));
}
@@ -109,11 +85,11 @@ device_t *timer_device_config::alloc_device(running_machine &machine) const
// helper to set up a generic timer
//-------------------------------------------------
-void timer_device_config::static_configure_generic(device_config *device, timer_device_fired_func callback)
+void timer_device::static_configure_generic(device_t &device, timer_device_fired_func callback)
{
- timer_device_config *timer = downcast<timer_device_config *>(device);
- timer->m_type = TIMER_TYPE_GENERIC;
- timer->m_callback = callback;
+ timer_device &timer = downcast<timer_device &>(device);
+ timer.m_type = TIMER_TYPE_GENERIC;
+ timer.m_callback = callback;
}
@@ -122,12 +98,12 @@ void timer_device_config::static_configure_generic(device_config *device, timer_
// helper to set up a periodic timer
//-------------------------------------------------
-void timer_device_config::static_configure_periodic(device_config *device, timer_device_fired_func callback, attotime period)
+void timer_device::static_configure_periodic(device_t &device, timer_device_fired_func callback, attotime period)
{
- timer_device_config *timer = downcast<timer_device_config *>(device);
- timer->m_type = TIMER_TYPE_PERIODIC;
- timer->m_callback = callback;
- timer->m_period = period;
+ timer_device &timer = downcast<timer_device &>(device);
+ timer.m_type = TIMER_TYPE_PERIODIC;
+ timer.m_callback = callback;
+ timer.m_period = period;
}
@@ -136,14 +112,14 @@ void timer_device_config::static_configure_periodic(device_config *device, timer
// helper to set up a scanline timer
//-------------------------------------------------
-void timer_device_config::static_configure_scanline(device_config *device, timer_device_fired_func callback, const char *screen, int first_vpos, int increment)
+void timer_device::static_configure_scanline(device_t &device, timer_device_fired_func callback, const char *screen, int first_vpos, int increment)
{
- timer_device_config *timer = downcast<timer_device_config *>(device);
- timer->m_type = TIMER_TYPE_SCANLINE;
- timer->m_callback = callback;
- timer->m_screen = screen;
- timer->m_first_vpos = first_vpos;
- timer->m_increment = increment;
+ timer_device &timer = downcast<timer_device &>(device);
+ timer.m_type = TIMER_TYPE_SCANLINE;
+ timer.m_callback = callback;
+ timer.m_screen_tag = screen;
+ timer.m_first_vpos = first_vpos;
+ timer.m_increment = increment;
}
@@ -152,10 +128,10 @@ void timer_device_config::static_configure_scanline(device_config *device, timer
// to set the callback
//-------------------------------------------------
-void timer_device_config::static_set_callback(device_config *device, timer_device_fired_func callback)
+void timer_device::static_set_callback(device_t &device, timer_device_fired_func callback)
{
- timer_device_config *timer = downcast<timer_device_config *>(device);
- timer->m_callback = callback;
+ timer_device &timer = downcast<timer_device &>(device);
+ timer.m_callback = callback;
}
@@ -164,10 +140,10 @@ void timer_device_config::static_set_callback(device_config *device, timer_devic
// to set the starting delay
//-------------------------------------------------
-void timer_device_config::static_set_start_delay(device_config *device, attotime delay)
+void timer_device::static_set_start_delay(device_t &device, attotime delay)
{
- timer_device_config *timer = downcast<timer_device_config *>(device);
- timer->m_start_delay = delay;
+ timer_device &timer = downcast<timer_device &>(device);
+ timer.m_start_delay = delay;
}
@@ -176,10 +152,10 @@ void timer_device_config::static_set_start_delay(device_config *device, attotime
// the integer parameter
//-------------------------------------------------
-void timer_device_config::static_set_param(device_config *device, int param)
+void timer_device::static_set_param(device_t &device, int param)
{
- timer_device_config *timer = downcast<timer_device_config *>(device);
- timer->m_param = param;
+ timer_device &timer = downcast<timer_device &>(device);
+ timer.m_param = param;
}
@@ -188,10 +164,10 @@ void timer_device_config::static_set_param(device_config *device, int param)
// the pointer parameter
//-------------------------------------------------
-void timer_device_config::static_set_ptr(device_config *device, void *ptr)
+void timer_device::static_set_ptr(device_t &device, void *ptr)
{
- timer_device_config *timer = downcast<timer_device_config *>(device);
- timer->m_ptr = ptr;
+ timer_device &timer = downcast<timer_device &>(device);
+ timer.m_ptr = ptr;
}
@@ -200,7 +176,7 @@ void timer_device_config::static_set_ptr(device_config *device, void *ptr)
// configuration
//-------------------------------------------------
-bool timer_device_config::device_validity_check(emu_options &options, const game_driver &driver) const
+bool timer_device::device_validity_check(emu_options &options, const game_driver &driver) const
{
bool error = false;
@@ -208,14 +184,14 @@ bool timer_device_config::device_validity_check(emu_options &options, const game
switch (m_type)
{
case TIMER_TYPE_GENERIC:
- if (m_screen != NULL || m_first_vpos != 0 || m_start_delay != attotime::zero)
+ if (m_screen_tag != NULL || m_first_vpos != 0 || m_start_delay != attotime::zero)
mame_printf_warning("%s: %s generic timer '%s' specified parameters for a scanline timer\n", driver.source_file, driver.name, tag());
if (m_period != attotime::zero || m_start_delay != attotime::zero)
mame_printf_warning("%s: %s generic timer '%s' specified parameters for a periodic timer\n", driver.source_file, driver.name, tag());
break;
case TIMER_TYPE_PERIODIC:
- if (m_screen != NULL || m_first_vpos != 0)
+ if (m_screen_tag != NULL || m_first_vpos != 0)
mame_printf_warning("%s: %s periodic timer '%s' specified parameters for a scanline timer\n", driver.source_file, driver.name, tag());
if (m_period <= attotime::zero)
{
@@ -251,26 +227,6 @@ bool timer_device_config::device_validity_check(emu_options &options, const game
}
-
-//**************************************************************************
-// LIVE TIMER DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// timer_device - constructor
-//-------------------------------------------------
-
-timer_device::timer_device(running_machine &_machine, const timer_device_config &config)
- : device_t(_machine, config),
- m_config(config),
- m_timer(NULL),
- m_ptr(m_config.m_ptr),
- m_screen(NULL),
- m_first_time(true)
-{
-}
-
-
//-------------------------------------------------
// device_start - perform device-specific
// startup
@@ -279,8 +235,8 @@ timer_device::timer_device(running_machine &_machine, const timer_device_config
void timer_device::device_start()
{
// fetch the screen
- if (m_config.m_screen != NULL)
- m_screen = downcast<screen_device *>(machine().device(m_config.m_screen));
+ if (m_screen_tag != NULL)
+ m_screen = machine().device<screen_device>(m_screen_tag);
// allocate the timer
m_timer = timer_alloc();
@@ -297,35 +253,35 @@ void timer_device::device_start()
void timer_device::device_reset()
{
// type based configuration
- switch (m_config.m_type)
+ switch (m_type)
{
- case timer_device_config::TIMER_TYPE_GENERIC:
- case timer_device_config::TIMER_TYPE_PERIODIC:
+ case TIMER_TYPE_GENERIC:
+ case TIMER_TYPE_PERIODIC:
{
// convert the period into attotime
attotime period = attotime::never;
- if (m_config.m_period > attotime::zero)
+ if (m_period > attotime::zero)
{
- period = m_config.m_period;
+ period = m_period;
// convert the start_delay into attotime
attotime start_delay = attotime::zero;
- if (m_config.m_start_delay > attotime::zero)
- start_delay = m_config.m_start_delay;
+ if (m_start_delay > attotime::zero)
+ start_delay = m_start_delay;
// allocate and start the backing timer
- m_timer->adjust(start_delay, m_config.m_param, period);
+ m_timer->adjust(start_delay, m_param, period);
}
break;
}
- case timer_device_config::TIMER_TYPE_SCANLINE:
+ case TIMER_TYPE_SCANLINE:
if (m_screen == NULL)
- fatalerror("timer '%s': unable to find screen '%s'\n", tag(), m_config.m_screen);
+ fatalerror("timer '%s': unable to find screen '%s'\n", tag(), m_screen_tag);
// set the timer to to fire immediately
m_first_time = true;
- m_timer->adjust(attotime::zero, m_config.m_param);
+ m_timer->adjust(attotime::zero, m_param);
break;
}
}
@@ -337,35 +293,32 @@ void timer_device::device_reset()
void timer_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- switch (m_config.m_type)
+ switch (m_type)
{
// general periodic timers just call through
- case timer_device_config::TIMER_TYPE_GENERIC:
- case timer_device_config::TIMER_TYPE_PERIODIC:
- if (m_config.m_type != timer_device_config::TIMER_TYPE_SCANLINE)
- {
- if (m_config.m_callback != NULL)
- (*m_config.m_callback)(*this, m_ptr, param);
- }
+ case TIMER_TYPE_GENERIC:
+ case TIMER_TYPE_PERIODIC:
+ if (m_callback != NULL)
+ (*m_callback)(*this, m_ptr, param);
break;
// scanline timers have to do some additiona bookkeeping
- case timer_device_config::TIMER_TYPE_SCANLINE:
+ case TIMER_TYPE_SCANLINE:
{
// by default, we fire at the first position
- int next_vpos = m_config.m_first_vpos;
+ int next_vpos = m_first_vpos;
// the first time through we just go with the default position
if (!m_first_time)
{
// call the real callback
int vpos = m_screen->vpos();
- (*m_config.m_callback)(*this, m_ptr, vpos);
+ (*m_callback)(*this, m_ptr, vpos);
// advance by the increment only if we will still be within the screen bounds
- if (m_config.m_increment != 0 && (vpos + m_config.m_increment) < m_screen->height())
- next_vpos = vpos + m_config.m_increment;
+ if (m_increment != 0 && (vpos + m_increment) < m_screen->height())
+ next_vpos = vpos + m_increment;
}
m_first_time = false;
diff --git a/src/emu/timer.h b/src/emu/timer.h
index c8c38152031..fff33be5ad4 100644
--- a/src/emu/timer.h
+++ b/src/emu/timer.h
@@ -64,30 +64,30 @@
#define MCFG_TIMER_ADD(_tag, _callback) \
MCFG_DEVICE_ADD(_tag, TIMER, 0) \
- timer_device_config::static_configure_generic(device, _callback); \
+ timer_device::static_configure_generic(*device, _callback); \
#define MCFG_TIMER_ADD_PERIODIC(_tag, _callback, _period) \
MCFG_DEVICE_ADD(_tag, TIMER, 0) \
- timer_device_config::static_configure_periodic(device, _callback, _period); \
+ timer_device::static_configure_periodic(*device, _callback, _period); \
#define MCFG_TIMER_ADD_SCANLINE(_tag, _callback, _screen, _first_vpos, _increment) \
MCFG_DEVICE_ADD(_tag, TIMER, 0) \
- timer_device_config::static_configure_scanline(device, _callback, _screen, _first_vpos, _increment); \
+ timer_device::static_configure_scanline(*device, _callback, _screen, _first_vpos, _increment); \
#define MCFG_TIMER_MODIFY(_tag) \
MCFG_DEVICE_MODIFY(_tag)
#define MCFG_TIMER_CALLBACK(_callback) \
- timer_device_config::static_set_callback(device, _callback); \
+ timer_device::static_set_callback(*device, _callback); \
#define MCFG_TIMER_START_DELAY(_start_delay) \
- timer_device_config::static_set_start_delay(device, _start_delay); \
+ timer_device::static_set_start_delay(*device, _start_delay); \
#define MCFG_TIMER_PARAM(_param) \
- timer_device_config::static_set_param(device, _param); \
+ timer_device::static_set_param(*device, _param); \
#define MCFG_TIMER_PTR(_ptr) \
- timer_device_config::static_set_ptr(device, (void *)(_ptr)); \
+ timer_device::static_set_ptr(*device, (void *)(_ptr)); \
@@ -103,81 +103,36 @@ class timer_device;
typedef void (*timer_device_fired_func)(timer_device &timer, void *ptr, INT32 param);
-// ======================> timer_device_config
-
-class timer_device_config : public device_config
-{
- friend class timer_device;
-
- // construction/destruction
- timer_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_configure_generic(device_config *device, timer_device_fired_func callback);
- static void static_configure_periodic(device_config *device, timer_device_fired_func callback, attotime period);
- static void static_configure_scanline(device_config *device, timer_device_fired_func callback, const char *screen, int first_vpos, int increment);
- static void static_set_callback(device_config *device, timer_device_fired_func callback);
- static void static_set_start_delay(device_config *device, attotime delay);
- static void static_set_param(device_config *device, int param);
- static void static_set_ptr(device_config *device, void *ptr);
-
-private:
- // device_config overrides
- virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
-
- // timer types
- enum timer_type
- {
- TIMER_TYPE_PERIODIC,
- TIMER_TYPE_SCANLINE,
- TIMER_TYPE_GENERIC
- };
-
- // configuration data
- timer_type m_type; // type of timer
- timer_device_fired_func m_callback; // the timer's callback function
- void * m_ptr; // the pointer parameter passed to the timer callback
-
- // periodic timers only
- attotime m_start_delay; // delay before the timer fires for the first time
- attotime m_period; // period of repeated timer firings
- INT32 m_param; // the integer parameter passed to the timer callback
-
- // scanline timers only
- const char * m_screen; // the name of the screen this timer tracks
- UINT32 m_first_vpos; // the first vertical scanline position the timer fires on
- UINT32 m_increment; // the number of scanlines between firings
-};
-
-
// ======================> timer_device
class timer_device : public device_t
{
- friend class timer_device_config;
-
+public:
// construction/destruction
- timer_device(running_machine &_machine, const timer_device_config &config);
+ timer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_configure_generic(device_t &device, timer_device_fired_func callback);
+ static void static_configure_periodic(device_t &device, timer_device_fired_func callback, attotime period);
+ static void static_configure_scanline(device_t &device, timer_device_fired_func callback, const char *screen, int first_vpos, int increment);
+ static void static_set_callback(device_t &device, timer_device_fired_func callback);
+ static void static_set_start_delay(device_t &device, attotime delay);
+ static void static_set_param(device_t &device, int param);
+ static void static_set_ptr(device_t &device, void *ptr);
-public:
// property getters
int param() const { return m_timer->param(); }
void *ptr() const { return m_ptr; }
bool enabled() const { return m_timer->enabled(); }
// property setters
- void set_param(int param) { assert(m_config.m_type == timer_device_config::TIMER_TYPE_GENERIC); m_timer->set_param(param); }
+ void set_param(int param) { assert(m_type == TIMER_TYPE_GENERIC); m_timer->set_param(param); }
void set_ptr(void *ptr) { m_ptr = ptr; }
void enable(bool enable = true) { m_timer->enable(enable); }
// adjustments
void reset() { adjust(attotime::never, 0, attotime::never); }
- void adjust(attotime duration, INT32 param = 0, attotime period = attotime::never) { assert(m_config.m_type == timer_device_config::TIMER_TYPE_GENERIC); m_timer->adjust(duration, param, period); }
+ void adjust(attotime duration, INT32 param = 0, attotime period = attotime::never) { assert(m_type == TIMER_TYPE_GENERIC); m_timer->adjust(duration, param, period); }
// timing information
attotime time_elapsed() const { return m_timer->elapsed(); }
@@ -187,18 +142,38 @@ public:
private:
// device-level overrides
+ virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
- // internal state
- const timer_device_config & m_config;
- emu_timer * m_timer; // the backing timer
- void * m_ptr; // the pointer parameter passed to the timer callback
+ // timer types
+ enum timer_type
+ {
+ TIMER_TYPE_PERIODIC,
+ TIMER_TYPE_SCANLINE,
+ TIMER_TYPE_GENERIC
+ };
+
+ // configuration data
+ timer_type m_type; // type of timer
+ timer_device_fired_func m_callback; // the timer's callback function
+ void * m_ptr; // the pointer parameter passed to the timer callback
+
+ // periodic timers only
+ attotime m_start_delay; // delay before the timer fires for the first time
+ attotime m_period; // period of repeated timer firings
+ INT32 m_param; // the integer parameter passed to the timer callback
// scanline timers only
- screen_device * m_screen; // pointer to the screen
- bool m_first_time; // indicates that the system is starting
+ const char * m_screen_tag; // the tag of the screen this timer tracks
+ screen_device * m_screen; // pointer to the screen device
+ UINT32 m_first_vpos; // the first vertical scanline position the timer fires on
+ UINT32 m_increment; // the number of scanlines between firings
+
+ // internal state
+ emu_timer * m_timer; // the backing timer
+ bool m_first_time; // indicates that the system is starting (scanline timers only)
};
diff --git a/src/emu/ui.c b/src/emu/ui.c
index b29ebddc89d..e5ce63026fd 100644
--- a/src/emu/ui.c
+++ b/src/emu/ui.c
@@ -1003,7 +1003,7 @@ static astring &warnings_string(running_machine &machine, astring &string)
astring &game_info_astring(running_machine &machine, astring &string)
{
- int scrcount = machine.m_devicelist.count(SCREEN);
+ int scrcount = machine.devicelist().count(SCREEN);
int found_sound = FALSE;
/* print description, manufacturer, and CPU: */
@@ -1011,7 +1011,7 @@ astring &game_info_astring(running_machine &machine, astring &string)
/* loop over all CPUs */
device_execute_interface *exec = NULL;
- for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.devicelist().first(exec); gotone; gotone = exec->next(exec))
{
/* get cpu specific clock that takes internal multiplier/dividers into account */
int clock = exec->device().clock();
@@ -1041,7 +1041,7 @@ astring &game_info_astring(running_machine &machine, astring &string)
/* loop over all sound chips */
device_sound_interface *sound = NULL;
- for (bool gotone = machine.m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = machine.devicelist().first(sound); gotone; gotone = sound->next(sound))
{
/* append the Sound: string */
if (!found_sound)
@@ -1262,7 +1262,7 @@ void ui_image_handler_ingame(running_machine &machine)
/* run display routine for devices */
if (machine.phase() == MACHINE_PHASE_RUNNING)
{
- for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
{
image->call_display();
}
@@ -1637,7 +1637,7 @@ static slider_state *slider_init(running_machine &machine)
if (machine.options().cheat())
{
device_execute_interface *exec = NULL;
- for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.devicelist().first(exec); gotone; gotone = exec->next(exec))
{
void *param = (void *)&exec->device();
string.printf("Overclock CPU %s", exec->device().tag());
@@ -1649,10 +1649,10 @@ static slider_state *slider_init(running_machine &machine)
/* add screen parameters */
for (screen_device *screen = machine.first_screen(); screen != NULL; screen = screen->next_screen())
{
- int defxscale = floor(screen->config().xscale() * 1000.0f + 0.5f);
- int defyscale = floor(screen->config().yscale() * 1000.0f + 0.5f);
- int defxoffset = floor(screen->config().xoffset() * 1000.0f + 0.5f);
- int defyoffset = floor(screen->config().yoffset() * 1000.0f + 0.5f);
+ int defxscale = floor(screen->xscale() * 1000.0f + 0.5f);
+ int defyscale = floor(screen->yscale() * 1000.0f + 0.5f);
+ int defxoffset = floor(screen->xoffset() * 1000.0f + 0.5f);
+ int defyoffset = floor(screen->yoffset() * 1000.0f + 0.5f);
void *param = (void *)screen;
/* add refresh rate tweaker */
@@ -1689,9 +1689,9 @@ static slider_state *slider_init(running_machine &machine)
tailptr = &(*tailptr)->next;
}
- for (device = machine.m_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 *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ const laserdisc_config *config = (const laserdisc_config *)downcast<const legacy_device_base *>(device)->inline_config();
if (config->overupdate != NULL)
{
int defxscale = floor(config->overscalex * 1000.0f + 0.5f);
@@ -1828,7 +1828,7 @@ static INT32 slider_overclock(running_machine &machine, void *arg, astring *stri
static INT32 slider_refresh(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
- double defrefresh = ATTOSECONDS_TO_HZ(screen->config().refresh());
+ double defrefresh = ATTOSECONDS_TO_HZ(screen->refresh_attoseconds());
double refresh;
if (newval != SLIDER_NOCHANGE)
@@ -2123,7 +2123,7 @@ static INT32 slider_beam(running_machine &machine, void *arg, astring *string, I
static char *slider_get_screen_desc(screen_device &screen)
{
- int scrcount = screen.machine().m_devicelist.count(SCREEN);
+ int scrcount = screen.machine().devicelist().count(SCREEN);
static char descbuf[256];
if (scrcount > 1)
@@ -2142,7 +2142,7 @@ static char *slider_get_screen_desc(screen_device &screen)
static char *slider_get_laserdisc_desc(device_t *laserdisc)
{
- int ldcount = laserdisc->machine().m_devicelist.count(LASERDISC);
+ int ldcount = laserdisc->machine().devicelist().count(LASERDISC);
static char descbuf[256];
if (ldcount > 1)
diff --git a/src/emu/uiimage.c b/src/emu/uiimage.c
index f7a74e36529..b55641ac276 100644
--- a/src/emu/uiimage.c
+++ b/src/emu/uiimage.c
@@ -700,7 +700,7 @@ static file_error menu_file_selector_populate(running_machine &machine, ui_menu
/* add the "[empty slot]" entry */
append_file_selector_entry(menu, menustate, SELECTOR_ENTRY_TYPE_EMPTY, NULL, NULL);
- if (device->image_config().is_creatable() && !zippath_is_zip(directory))
+ if (device->is_creatable() && !zippath_is_zip(directory))
{
/* add the "[create]" entry */
append_file_selector_entry(menu, menustate, SELECTOR_ENTRY_TYPE_CREATE, NULL, NULL);
@@ -992,12 +992,12 @@ static void menu_file_manager_populate(running_machine &machine, ui_menu *menu,
astring tmp_name;
/* cycle through all devices for this system */
- for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.devicelist().first(image); gotone; gotone = image->next(image))
{
/* get the image type/id */
snprintf(buffer, ARRAY_LENGTH(buffer),
"%s (%s)",
- image->image_config().devconfig().name(), image->image_config().brief_instance_name());
+ image->device().name(), image->brief_instance_name());
/* get the base name */
if (image->basename() != NULL)
@@ -1174,7 +1174,7 @@ struct _bitbanger_control_menu_state
INLINE int cassette_count( running_machine &machine )
{
int count = 0;
- device_t *device = machine.m_devicelist.first(CASSETTE);
+ device_t *device = machine.devicelist().first(CASSETTE);
while ( device )
{
@@ -1192,7 +1192,7 @@ INLINE int cassette_count( running_machine &machine )
INLINE int bitbanger_count( running_machine &machine )
{
int count = 0;
- device_t *device = machine.m_devicelist.first(BITBANGER);
+ device_t *device = machine.devicelist().first(BITBANGER);
while ( device )
{
@@ -1266,7 +1266,7 @@ static void menu_tape_control_populate(running_machine &machine, ui_menu *menu,
}
/* name of tape */
- ui_menu_item_append(menu, menustate->device->image_config().devconfig().name(), menustate->device->filename(), flags, TAPECMD_SELECT);
+ ui_menu_item_append(menu, menustate->device->device().name(), menustate->device->filename(), flags, TAPECMD_SELECT);
/* state */
tapecontrol_gettime(&timepos, &menustate->device->device(), NULL, NULL);
@@ -1346,7 +1346,7 @@ static void menu_bitbanger_control_populate(running_machine &machine, ui_menu *m
if (menustate->device->exists())
{
/* name of bitbanger file */
- ui_menu_item_append(menu, menustate->device->image_config().devconfig().name(), menustate->device->filename(), flags, BITBANGERCMD_SELECT);
+ ui_menu_item_append(menu, menustate->device->device().name(), menustate->device->filename(), flags, BITBANGERCMD_SELECT);
ui_menu_item_append(menu, "Device Mode:", bitbanger_mode_string(&menustate->device->device()), mode_flags, BITBANGERCMD_MODE);
ui_menu_item_append(menu, "Baud:", bitbanger_baud_string(&menustate->device->device()), baud_flags, BITBANGERCMD_BAUD);
ui_menu_item_append(menu, "Baud Tune:", bitbanger_tune_string(&menustate->device->device()), tune_flags, BITBANGERCMD_TUNE);
@@ -1379,7 +1379,7 @@ void ui_mess_menu_tape_control(running_machine &machine, ui_menu *menu, void *pa
{
int index = menustate->index;
device_image_interface *device = NULL;
- for (bool gotone = machine.m_devicelist.first(device); gotone; gotone = device->next(device))
+ for (bool gotone = machine.devicelist().first(device); gotone; gotone = device->next(device))
{
if(device->device().type() == CASSETTE) {
if (index==0) break;
@@ -1476,7 +1476,7 @@ void ui_mess_menu_bitbanger_control(running_machine &machine, ui_menu *menu, voi
{
int index = menustate->index;
device_image_interface *device = NULL;
- for (bool gotone = machine.m_devicelist.first(device); gotone; gotone = device->next(device))
+ for (bool gotone = machine.devicelist().first(device); gotone; gotone = device->next(device))
{
if(device->device().type() == BITBANGER) {
if (index==0) break;
diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c
index 78f03b02760..575a21015cb 100644
--- a/src/emu/uimenu.c
+++ b/src/emu/uimenu.c
@@ -1548,7 +1548,7 @@ static void menu_main_populate(running_machine &machine, ui_menu *menu, void *st
ui_menu_item_append(menu, CAPSTARTGAMENOUN " Information", NULL, 0, (void *)menu_game_info);
device_image_interface *image = NULL;
- if (machine.m_devicelist.first(image))
+ if (machine.devicelist().first(image))
{
/* add image info menu */
ui_menu_item_append(menu, "Image Information", NULL, 0, (void*)ui_image_menu_image_info);
@@ -1557,11 +1557,11 @@ static void menu_main_populate(running_machine &machine, ui_menu *menu, void *st
ui_menu_item_append(menu, "File Manager", NULL, 0, (void*)ui_image_menu_file_manager);
/* add tape control menu */
- if (machine.m_devicelist.first(CASSETTE))
+ if (machine.devicelist().first(CASSETTE))
ui_menu_item_append(menu, "Tape Control", NULL, 0, (void*)ui_mess_menu_tape_control);
/* add bitbanger control menu */
- if (machine.m_devicelist.first(BITBANGER))
+ if (machine.devicelist().first(BITBANGER))
ui_menu_item_append(menu, "Bitbanger Control", NULL, 0, (void*)ui_mess_menu_bitbanger_control);
}
/* add keyboard mode menu */
diff --git a/src/emu/uiswlist.c b/src/emu/uiswlist.c
index dfcd92d0dfa..ce42b3ac7d5 100644
--- a/src/emu/uiswlist.c
+++ b/src/emu/uiswlist.c
@@ -170,7 +170,7 @@ static software_entry_state *append_software_entry(ui_menu *menu, software_menu_
{
software_entry_state *entry = NULL;
software_entry_state **entryptr;
- const char *interface = image->image_config().image_interface();
+ const char *interface = image->image_interface();
// check if at least one of the parts has the correct interface and add a menu entry only in this case
for (software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart))
@@ -280,12 +280,12 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
software_info *tmp_info = software_list_find(tmp_list, entry->short_name, NULL);
// if the selected software has multiple parts that can be loaded, open the submenu
- if (swinfo_has_multiple_parts(tmp_info, image->image_config().image_interface()))
+ if (swinfo_has_multiple_parts(tmp_info, image->image_interface()))
{
ui_menu *child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), ui_mess_menu_software_parts, entry);
software_entry_state *child_menustate = (software_entry_state *)ui_menu_alloc_state(child_menu, sizeof(*child_menustate), NULL);
child_menustate->short_name = entry->short_name;
- child_menustate->interface = image->image_config().image_interface();
+ child_menustate->interface = image->image_interface();
child_menustate->list_name = sw_state->list_name;
child_menustate->image = image;
ui_menu_stack_push(child_menu);
@@ -401,12 +401,12 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
static void ui_mess_menu_populate_software_list(running_machine &machine, ui_menu *menu, device_image_interface* image)
{
bool haveCompatible = FALSE;
- const char *interface = image->image_config().image_interface();
+ const char *interface = image->image_interface();
// Add original software lists for this system
- for (const device_config *dev = machine.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
+ for (const device_t *dev = machine.config().devicelist().first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
- software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
+ software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config();
for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
{
@@ -435,9 +435,9 @@ static void ui_mess_menu_populate_software_list(running_machine &machine, ui_men
}
// Add compatible software lists for this system
- for (const device_config *dev = machine.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
+ for (const device_t *dev = machine.config().devicelist().first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
- software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
+ software_list_config *swlist = (software_list_config *)downcast<const legacy_device_base *>(dev)->inline_config();
for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
{
diff --git a/src/emu/validity.c b/src/emu/validity.c
index 2e0fbbb84d1..5af753c818f 100644
--- a/src/emu/validity.c
+++ b/src/emu/validity.c
@@ -416,8 +416,8 @@ static bool validate_driver(driver_enumerator &drivlist, game_driver_map &names,
}
/* make sure sound-less drivers are flagged */
- const device_config_sound_interface *sound;
- if ((driver.flags & GAME_IS_BIOS_ROOT) == 0 && !config.m_devicelist.first(sound) && (driver.flags & GAME_NO_SOUND) == 0 && (driver.flags & GAME_NO_SOUND_HW) == 0)
+ const device_sound_interface *sound;
+ if ((driver.flags & GAME_IS_BIOS_ROOT) == 0 && !config.devicelist().first(sound) && (driver.flags & GAME_NO_SOUND) == 0 && (driver.flags & GAME_NO_SOUND_HW) == 0)
{
mame_printf_error("%s: %s missing GAME_NO_SOUND flag\n", driver.source_file, driver.name);
error = true;
@@ -586,7 +586,7 @@ static bool validate_display(driver_enumerator &drivlist)
bool palette_modes = false;
bool error = false;
- for (const screen_device_config *scrconfig = config.first_screen(); scrconfig != NULL; scrconfig = scrconfig->next_screen())
+ for (const screen_device *scrconfig = config.first_screen(); scrconfig != NULL; scrconfig = scrconfig->next_screen())
if (scrconfig->format() == BITMAP_FORMAT_INDEXED16)
palette_modes = true;
@@ -963,7 +963,7 @@ static bool validate_inputs(driver_enumerator &drivlist, int_map &defstr_map, io
mame_printf_error("%s: %s has input port errors:\n%s\n", driver.source_file, driver.name, errorbuf);
error = true;
}
- for (device_config *cfg = config.m_devicelist.first(); cfg != NULL; cfg = cfg->next())
+ for (device_t *cfg = config.devicelist().first(); cfg != NULL; cfg = cfg->next())
{
if (cfg->input_ports() != NULL)
{
@@ -1097,25 +1097,25 @@ static bool validate_devices(driver_enumerator &drivlist, const ioport_list &por
const game_driver &driver = drivlist.driver();
const machine_config &config = drivlist.config();
- for (const device_config *devconfig = config.m_devicelist.first(); devconfig != NULL; devconfig = devconfig->next())
+ for (const device_t *device = config.devicelist().first(); device != NULL; device = device->next())
{
/* validate the device tag */
- if (!validate_tag(driver, devconfig->name(), devconfig->tag()))
+ if (!validate_tag(driver, device->name(), device->tag()))
error = true;
/* look for duplicates */
- for (const device_config *scanconfig = config.m_devicelist.first(); scanconfig != devconfig; scanconfig = scanconfig->next())
- if (strcmp(scanconfig->tag(), devconfig->tag()) == 0)
+ for (const device_t *scandevice = config.devicelist().first(); scandevice != device; scandevice = scandevice->next())
+ if (strcmp(scandevice->tag(), device->tag()) == 0)
{
- mame_printf_warning("%s: %s has multiple devices with the tag '%s'\n", driver.source_file, driver.name, devconfig->tag());
+ mame_printf_warning("%s: %s has multiple devices with the tag '%s'\n", driver.source_file, driver.name, device->tag());
break;
}
- if (devconfig->rom_region() != NULL && (strcmp(devconfig->shortname(),"") == 0)) {
- mame_printf_warning("Device %s does not have short name defined\n", devconfig->name());
+ if (device->rom_region() != NULL && (strcmp(device->shortname(),"") == 0)) {
+ mame_printf_warning("Device %s does not have short name defined\n", device->name());
}
/* check for device-specific validity check */
- if (devconfig->validity_check(config.options(), driver))
+ if (device->validity_check(config.options(), driver))
error = true;
}
diff --git a/src/emu/video.c b/src/emu/video.c
index edacdf98844..975149ed561 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -1066,7 +1066,7 @@ void video_manager::create_snapshot_bitmap(device_t *screen)
// select the appropriate view in our dummy target
if (m_snap_native && screen != NULL)
{
- int view_index = machine().m_devicelist.indexof(SCREEN, screen->tag());
+ int view_index = machine().devicelist().indexof(SCREEN, screen->tag());
assert(view_index != -1);
m_snap_target->set_view(view_index);
}
@@ -1154,10 +1154,10 @@ file_error video_manager::open_next(emu_file &file, const char *extension)
// verify that there is such a device for this system
device_image_interface *image = NULL;
- for (bool gotone = machine().m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine().devicelist().first(image); gotone; gotone = image->next(image))
{
// get the device name
- astring tempdevname(image->image_config().brief_instance_name());
+ astring tempdevname(image->brief_instance_name());
//printf("check device: %s\n", tempdevname.cstr());
if (snapdevname.cmp(tempdevname) == 0)
diff --git a/src/emu/video/cdp1861.c b/src/emu/video/cdp1861.c
index 1c275d89df6..dffa37af41b 100644
--- a/src/emu/video/cdp1861.c
+++ b/src/emu/video/cdp1861.c
@@ -24,19 +24,20 @@
//**************************************************************************
-// GLOBAL VARIABLES
+// LIVE DEVICE
//**************************************************************************
-// devices
-const device_type CDP1861 = cdp1861_device_config::static_alloc_device_config;
-
-
+// device type definition
+const device_type CDP1861 = &device_creator<cdp1861_device>;
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
+//-------------------------------------------------
+// cdp1861_device - constructor
+//-------------------------------------------------
-GENERIC_DEVICE_CONFIG_SETUP(cdp1861, "CDP1861")
+cdp1861_device::cdp1861_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CDP1861, "CDP1861", tag, owner, clock)
+{
+}
//-------------------------------------------------
@@ -45,7 +46,7 @@ GENERIC_DEVICE_CONFIG_SETUP(cdp1861, "CDP1861")
// complete
//-------------------------------------------------
-void cdp1861_device_config::device_config_complete()
+void cdp1861_device::device_config_complete()
{
// inherit a copy of the static data
const cdp1861_interface *intf = reinterpret_cast<const cdp1861_interface *>(static_config());
@@ -55,29 +56,13 @@ void cdp1861_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_out_int_func, 0, sizeof(m_out_int_func));
- memset(&m_out_dmao_func, 0, sizeof(m_out_dmao_func));
- memset(&m_out_efx_func, 0, sizeof(m_out_efx_func));
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
+ memset(&m_out_dmao_cb, 0, sizeof(m_out_dmao_cb));
+ memset(&m_out_efx_cb, 0, sizeof(m_out_efx_cb));
}
}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// cdp1861_device - constructor
-//-------------------------------------------------
-
-cdp1861_device::cdp1861_device(running_machine &_machine, const cdp1861_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -85,9 +70,9 @@ cdp1861_device::cdp1861_device(running_machine &_machine, const cdp1861_device_c
void cdp1861_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
- devcb_resolve_write_line(&m_out_dmao_func, &m_config.m_out_dmao_func, this);
- devcb_resolve_write_line(&m_out_efx_func, &m_config.m_out_efx_func, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
+ devcb_resolve_write_line(&m_out_dmao_func, &m_out_dmao_cb, this);
+ devcb_resolve_write_line(&m_out_efx_func, &m_out_efx_cb, this);
// allocate timers
m_int_timer = timer_alloc(TIMER_INT);
@@ -95,8 +80,8 @@ void cdp1861_device::device_start()
m_dma_timer = timer_alloc(TIMER_DMA);
// find devices
- m_cpu = machine().device<cpu_device>(m_config.m_cpu_tag);
- m_screen = machine().device<screen_device>(m_config.m_screen_tag);
+ m_cpu = machine().device<cpu_device>(m_cpu_tag);
+ m_screen = machine().device<screen_device>(m_screen_tag);
m_bitmap = auto_bitmap_alloc(machine(), m_screen->width(), m_screen->height(), m_screen->format());
// register for state saving
diff --git a/src/emu/video/cdp1861.h b/src/emu/video/cdp1861.h
index 0bce7e8d497..d03b88148a8 100644
--- a/src/emu/video/cdp1861.h
+++ b/src/emu/video/cdp1861.h
@@ -93,45 +93,22 @@ struct cdp1861_interface
const char *m_cpu_tag;
const char *m_screen_tag;
- devcb_write_line m_out_int_func;
- devcb_write_line m_out_dmao_func;
- devcb_write_line m_out_efx_func;
-};
-
-
-
-// ======================> cdp1861_device_config
-
-class cdp1861_device_config : public device_config,
- public cdp1861_interface
-{
- friend class cdp1861_device;
-
- // construction/destruction
- cdp1861_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line m_out_int_cb;
+ devcb_write_line m_out_dmao_cb;
+ devcb_write_line m_out_efx_cb;
};
// ======================> cdp1861_device
-class cdp1861_device : public device_t
+class cdp1861_device : public device_t,
+ public cdp1861_interface
{
- friend class cdp1861_device_config;
-
+public:
// construction/destruction
- cdp1861_device(running_machine &_machine, const cdp1861_device_config &_config);
+ cdp1861_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_WRITE8_MEMBER( dma_w );
DECLARE_WRITE_LINE_MEMBER( disp_on_w );
DECLARE_WRITE_LINE_MEMBER( disp_off_w );
@@ -140,6 +117,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -167,8 +145,6 @@ private:
emu_timer *m_dma_timer; // DMA timer
cpu_device *m_cpu;
-
- const cdp1861_device_config &m_config;
};
diff --git a/src/emu/video/cdp1862.c b/src/emu/video/cdp1862.c
index bdc4dab6cd8..5f8d8cfe139 100644
--- a/src/emu/video/cdp1862.c
+++ b/src/emu/video/cdp1862.c
@@ -20,6 +20,9 @@
#include "machine/devhelpr.h"
+// device type definition
+const device_type CDP1862 = &device_creator<cdp1862_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -30,46 +33,6 @@ static const int CDP1862_BACKGROUND_COLOR_SEQUENCE[] = { 2, 0, 1, 4 };
//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// devices
-const device_type CDP1862 = cdp1862_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(cdp1862, "CDP1862")
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void cdp1862_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const cdp1862_interface *intf = reinterpret_cast<const cdp1862_interface *>(static_config());
- if (intf != NULL)
- *static_cast<cdp1862_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_in_rd_func, 0, sizeof(m_in_rd_func));
- memset(&m_in_bd_func, 0, sizeof(m_in_bd_func));
- memset(&m_in_gd_func, 0, sizeof(m_in_gd_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -81,12 +44,12 @@ inline void cdp1862_device::initialize_palette()
{
int i;
- double res_total = m_config.m_chr_r + m_config.m_chr_g + m_config.m_chr_b + m_config.m_chr_bkg;
+ double res_total = m_chr_r + m_chr_g + m_chr_b + m_chr_bkg;
- int weight_r = (m_config.m_chr_r / res_total) * 100;
- int weight_g = (m_config.m_chr_g / res_total) * 100;
- int weight_b = (m_config.m_chr_b / res_total) * 100;
- int weight_bkg = (m_config.m_chr_bkg / res_total) * 100;
+ int weight_r = (m_chr_r / res_total) * 100;
+ int weight_g = (m_chr_g / res_total) * 100;
+ int weight_b = (m_chr_b / res_total) * 100;
+ int weight_bkg = (m_chr_bkg / res_total) * 100;
for (i = 0; i < 16; i++)
{
@@ -117,26 +80,48 @@ inline void cdp1862_device::initialize_palette()
// cdp1862_device - constructor
//-------------------------------------------------
-cdp1862_device::cdp1862_device(running_machine &_machine, const cdp1862_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+cdp1862_device::cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CDP1862, "CDP1862", tag, owner, clock)
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void cdp1862_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const cdp1862_interface *intf = reinterpret_cast<const cdp1862_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<cdp1862_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_in_rd_cb, 0, sizeof(m_in_rd_cb));
+ memset(&m_in_bd_cb, 0, sizeof(m_in_bd_cb));
+ memset(&m_in_gd_cb, 0, sizeof(m_in_gd_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void cdp1862_device::device_start()
{
// resolve callbacks
- devcb_resolve_read_line(&m_in_rd_func, &m_config.m_in_rd_func, this);
- devcb_resolve_read_line(&m_in_bd_func, &m_config.m_in_bd_func, this);
- devcb_resolve_read_line(&m_in_gd_func, &m_config.m_in_gd_func, this);
+ devcb_resolve_read_line(&m_in_rd_func, &m_in_rd_cb, this);
+ devcb_resolve_read_line(&m_in_bd_func, &m_in_bd_cb, this);
+ devcb_resolve_read_line(&m_in_gd_func, &m_in_gd_cb, this);
// find devices
- m_screen = machine().device<screen_device>(m_config.m_screen_tag);
+ m_screen = machine().device<screen_device>(m_screen_tag);
m_bitmap = auto_bitmap_alloc(machine(), m_screen->width(), m_screen->height(), m_screen->format());
// init palette
diff --git a/src/emu/video/cdp1862.h b/src/emu/video/cdp1862.h
index a43c7d892c5..b95dee24cbc 100644
--- a/src/emu/video/cdp1862.h
+++ b/src/emu/video/cdp1862.h
@@ -64,9 +64,9 @@ struct cdp1862_interface
{
const char *m_screen_tag;
- devcb_read_line m_in_rd_func;
- devcb_read_line m_in_bd_func;
- devcb_read_line m_in_gd_func;
+ devcb_read_line m_in_rd_cb;
+ devcb_read_line m_in_bd_cb;
+ devcb_read_line m_in_gd_cb;
double m_lum_r; // red luminance resistor value
double m_lum_b; // blue luminance resistor value
@@ -81,38 +81,15 @@ struct cdp1862_interface
-// ======================> cdp1862_device_config
-
-class cdp1862_device_config : public device_config,
- public cdp1862_interface
-{
- friend class cdp1862_device;
-
- // construction/destruction
- cdp1862_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-};
-
-
-
// ======================> cdp1862_device
-class cdp1862_device : public device_t
+class cdp1862_device : public device_t,
+ public cdp1862_interface
{
- friend class cdp1862_device_config;
-
+public:
// construction/destruction
- cdp1862_device(running_machine &_machine, const cdp1862_device_config &_config);
+ cdp1862_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_WRITE8_MEMBER( dma_w );
DECLARE_WRITE_LINE_MEMBER( bkg_w );
DECLARE_WRITE_LINE_MEMBER( con_w );
@@ -121,6 +98,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
@@ -136,8 +114,6 @@ private:
int m_bgcolor; // background color
int m_con; // color on
-
- const cdp1862_device_config &m_config;
};
diff --git a/src/emu/video/crt9007.c b/src/emu/video/crt9007.c
index be7632ef461..0a2b68c2582 100644
--- a/src/emu/video/crt9007.c
+++ b/src/emu/video/crt9007.c
@@ -36,6 +36,9 @@
#include "crt9007.h"
+// device type definition
+const device_type CRT9007 = &device_creator<crt9007_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -211,10 +214,6 @@ const int STATUS_FRAME_TIMER_OCCURRED = 0x01;
// GLOBAL VARIABLES
//**************************************************************************
-// devices
-const device_type CRT9007 = crt9007_device_config::static_alloc_device_config;
-
-
// default address map
static ADDRESS_MAP_START( crt9007, AS_0, 8 )
AM_RANGE(0x0000, 0x3fff) AM_RAM
@@ -223,85 +222,6 @@ ADDRESS_MAP_END
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// crt9007_device_config - constructor
-//-------------------------------------------------
-
-crt9007_device_config::crt9007_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "SMC CRT9007", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- m_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(crt9007))
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *crt9007_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(crt9007_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *crt9007_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, crt9007_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *crt9007_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_0) ? &m_space_config : NULL;
-}
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void crt9007_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const crt9007_interface *intf = reinterpret_cast<const crt9007_interface *>(static_config());
- if (intf != NULL)
- *static_cast<crt9007_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&out_int_func, 0, sizeof(out_int_func));
- memset(&out_dmar_func, 0, sizeof(out_dmar_func));
- memset(&out_vs_func, 0, sizeof(out_vs_func));
- memset(&out_hs_func, 0, sizeof(out_hs_func));
- memset(&out_vlt_func, 0, sizeof(out_vlt_func));
- memset(&out_curs_func, 0, sizeof(out_curs_func));
- memset(&out_drb_func, 0, sizeof(out_drb_func));
- memset(&out_cblank_func, 0, sizeof(out_cblank_func));
- memset(&out_slg_func, 0, sizeof(out_slg_func));
- memset(&out_sld_func, 0, sizeof(out_sld_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -529,10 +449,10 @@ inline void crt9007_device::recompute_parameters()
// crt9007_device - constructor
//-------------------------------------------------
-crt9007_device::crt9007_device(running_machine &_machine, const crt9007_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
- m_config(config)
+crt9007_device::crt9007_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CRT9007, "SMC CRT9007", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ m_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(crt9007))
{
for (int i = 0; i < 0x3d; i++)
m_reg[i] = 0;
@@ -540,6 +460,36 @@ crt9007_device::crt9007_device(running_machine &_machine, const crt9007_device_c
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void crt9007_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const crt9007_interface *intf = reinterpret_cast<const crt9007_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<crt9007_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
+ memset(&m_out_dmar_cb, 0, sizeof(m_out_dmar_cb));
+ memset(&m_out_vs_cb, 0, sizeof(m_out_vs_cb));
+ memset(&m_out_hs_cb, 0, sizeof(m_out_hs_cb));
+ memset(&m_out_vlt_cb, 0, sizeof(m_out_vlt_cb));
+ memset(&m_out_curs_cb, 0, sizeof(m_out_curs_cb));
+ memset(&m_out_drb_cb, 0, sizeof(m_out_drb_cb));
+ memset(&m_out_cblank_cb, 0, sizeof(m_out_cblank_cb));
+ memset(&m_out_slg_cb, 0, sizeof(m_out_slg_cb));
+ memset(&m_out_sld_cb, 0, sizeof(m_out_sld_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -554,23 +504,23 @@ void crt9007_device::device_start()
m_dma_timer = timer_alloc(TIMER_DMA);
// resolve callbacks
- devcb_resolve_write_line(&m_out_int_func, &m_config.out_int_func, this);
- devcb_resolve_write_line(&m_out_dmar_func, &m_config.out_dmar_func, this);
- devcb_resolve_write_line(&m_out_hs_func, &m_config.out_hs_func, this);
- devcb_resolve_write_line(&m_out_vs_func, &m_config.out_vs_func, this);
- devcb_resolve_write_line(&m_out_vlt_func, &m_config.out_vlt_func, this);
- devcb_resolve_write_line(&m_out_curs_func, &m_config.out_curs_func, this);
- devcb_resolve_write_line(&m_out_drb_func, &m_config.out_drb_func, this);
- devcb_resolve_write_line(&m_out_cblank_func, &m_config.out_cblank_func, this);
- devcb_resolve_write_line(&m_out_slg_func, &m_config.out_slg_func, this);
- devcb_resolve_write_line(&m_out_sld_func, &m_config.out_sld_func, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
+ devcb_resolve_write_line(&m_out_dmar_func, &m_out_dmar_cb, this);
+ devcb_resolve_write_line(&m_out_hs_func, &m_out_hs_cb, this);
+ devcb_resolve_write_line(&m_out_vs_func, &m_out_vs_cb, this);
+ devcb_resolve_write_line(&m_out_vlt_func, &m_out_vlt_cb, this);
+ devcb_resolve_write_line(&m_out_curs_func, &m_out_curs_cb, this);
+ devcb_resolve_write_line(&m_out_drb_func, &m_out_drb_cb, this);
+ devcb_resolve_write_line(&m_out_cblank_func, &m_out_cblank_cb, this);
+ devcb_resolve_write_line(&m_out_slg_func, &m_out_slg_cb, this);
+ devcb_resolve_write_line(&m_out_sld_func, &m_out_sld_cb, this);
// get the screen device
- m_screen = machine().device<screen_device>(m_config.screen_tag);
+ m_screen = machine().device<screen_device>(m_screen_tag);
assert(m_screen != NULL);
// set horizontal pixels per column
- m_hpixels_per_column = m_config.hpixels_per_column;
+ m_hpixels_per_column = m_hpixels_per_column;
// register for state saving
// state_save_register_device_item(this, 0, );
@@ -726,6 +676,17 @@ void crt9007_device::device_timer(emu_timer &timer, device_timer_id id, int para
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *crt9007_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_0) ? &m_space_config : NULL;
+}
+
+
+//-------------------------------------------------
// read - register read
//-------------------------------------------------
diff --git a/src/emu/video/crt9007.h b/src/emu/video/crt9007.h
index 36aefa043cb..5ad55924861 100644
--- a/src/emu/video/crt9007.h
+++ b/src/emu/video/crt9007.h
@@ -70,51 +70,21 @@
struct crt9007_interface
{
- const char *screen_tag; /* screen we are acting on */
- int hpixels_per_column; /* number of pixels per video memory address */
+ const char *m_screen_tag; /* screen we are acting on */
- devcb_write_line out_int_func;
- devcb_write_line out_dmar_func;
+ devcb_write_line m_out_int_cb;
+ devcb_write_line m_out_dmar_cb;
- devcb_write_line out_vs_func;
- devcb_write_line out_hs_func;
+ devcb_write_line m_out_vs_cb;
+ devcb_write_line m_out_hs_cb;
- devcb_write_line out_vlt_func;
- devcb_write_line out_curs_func;
- devcb_write_line out_drb_func;
- devcb_write_line out_cblank_func;
+ devcb_write_line m_out_vlt_cb;
+ devcb_write_line m_out_curs_cb;
+ devcb_write_line m_out_drb_cb;
+ devcb_write_line m_out_cblank_cb;
- devcb_write_line out_slg_func;
- devcb_write_line out_sld_func;
-};
-
-
-
-// ======================> crt9007_device_config
-
-class crt9007_device_config : public device_config,
- public device_config_memory_interface,
- public crt9007_interface
-{
- friend class crt9007_device;
-
- // construction/destruction
- crt9007_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // address space configurations
- const address_space_config m_space_config;
+ devcb_write_line m_out_slg_cb;
+ devcb_write_line m_out_sld_cb;
};
@@ -122,14 +92,13 @@ protected:
// ======================> crt9007_device
class crt9007_device : public device_t,
- public device_memory_interface
+ public device_memory_interface,
+ public crt9007_interface
{
- friend class crt9007_device_config;
-
+public:
// construction/destruction
- crt9007_device(running_machine &_machine, const crt9007_device_config &_config);
+ crt9007_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
DECLARE_WRITE_LINE_MEMBER( ack_w );
@@ -141,11 +110,15 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_clock_changed();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
private:
static const device_timer_id TIMER_HSYNC = 0;
static const device_timer_id TIMER_VSYNC = 1;
@@ -221,7 +194,8 @@ private:
emu_timer *m_drb_timer;
emu_timer *m_dma_timer;
- const crt9007_device_config &m_config;
+ // address space configurations
+ const address_space_config m_space_config;
};
diff --git a/src/emu/video/crt9021.c b/src/emu/video/crt9021.c
index 66fad0b45b5..5f82c8579e2 100644
--- a/src/emu/video/crt9021.c
+++ b/src/emu/video/crt9021.c
@@ -41,6 +41,9 @@
#include "crt9021.h"
+// device type definition
+const device_type CRT9021 = &device_creator<crt9021_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -63,47 +66,24 @@ enum
};
+
//**************************************************************************
-// GLOBAL VARIABLES
+// INLINE HELPERS
//**************************************************************************
-// devices
-const device_type CRT9021 = crt9021_device_config::static_alloc_device_config;
-
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
-// crt9021_device_config - constructor
-//-------------------------------------------------
-
-crt9021_device_config::crt9021_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "SMC CRT9021", tag, owner, clock)
-{
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *crt9021_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(crt9021_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
+// crt9021_device - constructor
//-------------------------------------------------
-device_t *crt9021_device_config::alloc_device(running_machine &machine) const
+crt9021_device::crt9021_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CRT9021, "SMC CRT9021", tag, owner, clock)
{
- return auto_alloc(machine, crt9021_device(machine, *this));
}
@@ -113,7 +93,7 @@ device_t *crt9021_device_config::alloc_device(running_machine &machine) const
// complete
//-------------------------------------------------
-void crt9021_device_config::device_config_complete()
+void crt9021_device::device_config_complete()
{
// inherit a copy of the static data
const crt9021_interface *intf = reinterpret_cast<const crt9021_interface *>(static_config());
@@ -123,35 +103,13 @@ void crt9021_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&in_data_func, 0, sizeof(in_data_func));
- memset(&in_attr_func, 0, sizeof(in_attr_func));
- memset(&in_atten_func, 0, sizeof(in_atten_func));
+ memset(&in_data_cb, 0, sizeof(in_data_cb));
+ memset(&in_attr_cb, 0, sizeof(in_attr_cb));
+ memset(&in_atten_cb, 0, sizeof(in_atten_cb));
}
}
-
-//**************************************************************************
-// INLINE HELPERS
-//**************************************************************************
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// crt9021_device - constructor
-//-------------------------------------------------
-
-crt9021_device::crt9021_device(running_machine &_machine, const crt9021_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -161,12 +119,12 @@ void crt9021_device::device_start()
// allocate timers
// resolve callbacks
- devcb_resolve_read8(&m_in_data_func, &m_config.in_data_func, this);
- devcb_resolve_read8(&m_in_attr_func, &m_config.in_attr_func, this);
- devcb_resolve_read_line(&m_in_atten_func, &m_config.in_atten_func, this);
+ devcb_resolve_read8(&m_in_data_func, &in_data_cb, this);
+ devcb_resolve_read8(&m_in_attr_func, &in_attr_cb, this);
+ devcb_resolve_read_line(&m_in_atten_func, &in_atten_cb, this);
// get the screen device
- m_screen = machine().device<screen_device>(m_config.screen_tag);
+ m_screen = machine().device<screen_device>(screen_tag);
assert(m_screen != NULL);
// register for state saving
diff --git a/src/emu/video/crt9021.h b/src/emu/video/crt9021.h
index 20ff301f914..da8418fd72f 100644
--- a/src/emu/video/crt9021.h
+++ b/src/emu/video/crt9021.h
@@ -65,46 +65,23 @@ struct crt9021_interface
{
const char *screen_tag; /* screen we are acting on */
- devcb_read8 in_data_func;
- devcb_read8 in_attr_func;
+ devcb_read8 in_data_cb;
+ devcb_read8 in_attr_cb;
- devcb_read_line in_atten_func;
-};
-
-
-
-// ======================> crt9021_device_config
-
-class crt9021_device_config : public device_config,
- public crt9021_interface
-{
- friend class crt9021_device;
-
- // construction/destruction
- crt9021_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read_line in_atten_cb;
};
// ======================> crt9021_device
-class crt9021_device : public device_t
+class crt9021_device : public device_t,
+ public crt9021_interface
{
- friend class crt9021_device_config;
-
+public:
// construction/destruction
- crt9021_device(running_machine &_machine, const crt9021_device_config &_config);
+ crt9021_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_WRITE_LINE_MEMBER( slg_w );
DECLARE_WRITE_LINE_MEMBER( sld_w );
DECLARE_WRITE_LINE_MEMBER( cursor_w );
@@ -115,6 +92,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_clock_changed();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -131,8 +109,6 @@ private:
int m_cursor;
int m_retbl;
int m_vsync;
-
- const crt9021_device_config &m_config;
};
diff --git a/src/emu/video/crt9212.c b/src/emu/video/crt9212.c
index 8b6e75e5766..6ee7f95ea5a 100644
--- a/src/emu/video/crt9212.c
+++ b/src/emu/video/crt9212.c
@@ -37,46 +37,24 @@
//**************************************************************************
-// GLOBAL VARIABLES
+// INLINE HELPERS
//**************************************************************************
-// devices
-const device_type CRT9212 = crt9212_device_config::static_alloc_device_config;
-
-
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-//-------------------------------------------------
-// crt9212_device_config - constructor
-//-------------------------------------------------
-
-crt9212_device_config::crt9212_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "SMC CRT9212", tag, owner, clock)
-{
-}
-
+// device type definition
+const device_type CRT9212 = &device_creator<crt9212_device>;
//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *crt9212_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(crt9212_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
+// crt9212_device - constructor
//-------------------------------------------------
-device_t *crt9212_device_config::alloc_device(running_machine &machine) const
+crt9212_device::crt9212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, CRT9212, "SMC CRT9212", tag, owner, clock)
{
- return auto_alloc(machine, crt9212_device(machine, *this));
}
@@ -86,7 +64,7 @@ device_t *crt9212_device_config::alloc_device(running_machine &machine) const
// complete
//-------------------------------------------------
-void crt9212_device_config::device_config_complete()
+void crt9212_device::device_config_complete()
{
// inherit a copy of the static data
const crt9212_interface *intf = reinterpret_cast<const crt9212_interface *>(static_config());
@@ -96,36 +74,15 @@ void crt9212_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&out_rof_func, 0, sizeof(out_rof_func));
- memset(&out_wof_func, 0, sizeof(out_wof_func));
- memset(&in_ren_func, 0, sizeof(in_ren_func));
- memset(&in_wen_func, 0, sizeof(in_wen_func));
- memset(&in_wen2_func, 0, sizeof(in_wen2_func));
+ memset(&m_out_rof_cb, 0, sizeof(m_out_rof_cb));
+ memset(&m_out_wof_cb, 0, sizeof(m_out_wof_cb));
+ memset(&m_in_ren_cb, 0, sizeof(m_in_ren_cb));
+ memset(&m_in_wen_cb, 0, sizeof(m_in_wen_cb));
+ memset(&m_in_wen2_cb, 0, sizeof(m_in_wen2_cb));
}
}
-
-//**************************************************************************
-// INLINE HELPERS
-//**************************************************************************
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// crt9212_device - constructor
-//-------------------------------------------------
-
-crt9212_device::crt9212_device(running_machine &_machine, const crt9212_device_config &config)
- : device_t(_machine, config),
- m_config(config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -133,11 +90,11 @@ crt9212_device::crt9212_device(running_machine &_machine, const crt9212_device_c
void crt9212_device::device_start()
{
// resolve callbacks
- devcb_resolve_write_line(&m_out_rof_func, &m_config.out_rof_func, this);
- devcb_resolve_write_line(&m_out_wof_func, &m_config.out_wof_func, this);
- devcb_resolve_read_line(&m_in_ren_func, &m_config.in_ren_func, this);
- devcb_resolve_read_line(&m_in_wen_func, &m_config.in_wen_func, this);
- devcb_resolve_read_line(&m_in_wen2_func, &m_config.in_wen2_func, this);
+ devcb_resolve_write_line(&m_out_rof_func, &m_out_rof_cb, this);
+ devcb_resolve_write_line(&m_out_wof_func, &m_out_wof_cb, this);
+ devcb_resolve_read_line(&m_in_ren_func, &m_in_ren_cb, this);
+ devcb_resolve_read_line(&m_in_wen_func, &m_in_wen_cb, this);
+ devcb_resolve_read_line(&m_in_wen2_func, &m_in_wen2_cb, this);
// register for state saving
save_item(NAME(m_input));
diff --git a/src/emu/video/crt9212.h b/src/emu/video/crt9212.h
index e89432176ae..f9b0e3a535e 100644
--- a/src/emu/video/crt9212.h
+++ b/src/emu/video/crt9212.h
@@ -64,47 +64,24 @@ const int CRT9212_RAM_SIZE = 135;
struct crt9212_interface
{
- devcb_write_line out_rof_func;
- devcb_write_line out_wof_func;
- devcb_read_line in_ren_func;
- devcb_read_line in_wen_func;
- devcb_read_line in_wen2_func;
-};
-
-
-
-// ======================> crt9212_device_config
-
-class crt9212_device_config : public device_config,
- public crt9212_interface
-{
- friend class crt9212_device;
-
- // construction/destruction
- crt9212_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line m_out_rof_cb;
+ devcb_write_line m_out_wof_cb;
+ devcb_read_line m_in_ren_cb;
+ devcb_read_line m_in_wen_cb;
+ devcb_read_line m_in_wen2_cb;
};
// ======================> crt9212_device
-class crt9212_device : public device_t
+class crt9212_device : public device_t,
+ public crt9212_interface
{
- friend class crt9212_device_config;
-
+public:
// construction/destruction
- crt9212_device(running_machine &_machine, const crt9212_device_config &_config);
+ crt9212_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
DECLARE_WRITE_LINE_MEMBER( clrcnt_w );
@@ -114,6 +91,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
private:
@@ -135,8 +113,6 @@ private:
int m_clrcnt;
int m_rclk;
int m_wclk;
-
- const crt9212_device_config &m_config;
};
diff --git a/src/emu/video/dm9368.c b/src/emu/video/dm9368.c
index 1e4073b8593..604c291d091 100644
--- a/src/emu/video/dm9368.c
+++ b/src/emu/video/dm9368.c
@@ -19,6 +19,9 @@
#define LOG 1
+// device type definition
+const device_type DM9368 = &device_creator<dm9368_device>;
+
static const UINT8 OUTPUT[16] =
{
@@ -28,45 +31,6 @@ static const UINT8 OUTPUT[16] =
//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// devices
-const device_type DM9368 = dm9368_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(dm9368, "DM9368")
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void dm9368_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const dm9368_interface *intf = reinterpret_cast<const dm9368_interface *>(static_config());
- if (intf != NULL)
- *static_cast<dm9368_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_in_rbi_func, 0, sizeof(m_in_rbi_func));
- memset(&m_out_rbo_func, 0, sizeof(m_out_rbo_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -106,24 +70,45 @@ inline void dm9368_device::set_rbo(int state)
// dm9368_device - constructor
//-------------------------------------------------
-dm9368_device::dm9368_device(running_machine &_machine, const dm9368_device_config &config)
- : device_t(_machine, config),
+dm9368_device::dm9368_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DM9368, "DM9368", tag, owner, clock),
m_rbi(1),
- m_rbo(1),
- m_config(config)
+ m_rbo(1)
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void dm9368_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const dm9368_interface *intf = reinterpret_cast<const dm9368_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<dm9368_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_in_rbi_cb, 0, sizeof(m_in_rbi_cb));
+ memset(&m_out_rbo_cb, 0, sizeof(m_out_rbo_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void dm9368_device::device_start()
{
// resolve callbacks
- devcb_resolve_read_line(&m_in_rbi_func, &m_config.m_in_rbi_func, this);
- devcb_resolve_write_line(&m_out_rbo_func, &m_config.m_out_rbo_func, this);
+ devcb_resolve_read_line(&m_in_rbi_func, &m_in_rbi_cb, this);
+ devcb_resolve_write_line(&m_out_rbo_func, &m_out_rbo_cb, this);
// register for state saving
save_item(NAME(m_rbi));
@@ -143,7 +128,7 @@ void dm9368_device::a_w(UINT8 data)
if (LOG) logerror("DM9368 '%s' Blanked Rippling Zero\n", tag());
// blank rippling 0
- output_set_digit_value(m_config.m_digit, 0);
+ output_set_digit_value(m_digit, 0);
set_rbo(0);
}
@@ -151,7 +136,7 @@ void dm9368_device::a_w(UINT8 data)
{
if (LOG) logerror("DM9368 '%s' Output Data: %u = %02x\n", tag(), a, OUTPUT[a]);
- output_set_digit_value(m_config.m_digit, OUTPUT[a]);
+ output_set_digit_value(m_digit, OUTPUT[a]);
set_rbo(1);
}
diff --git a/src/emu/video/dm9368.h b/src/emu/video/dm9368.h
index 693ec783009..aa5278198cd 100644
--- a/src/emu/video/dm9368.h
+++ b/src/emu/video/dm9368.h
@@ -52,50 +52,28 @@ struct dm9368_interface
{
int m_digit;
- devcb_read_line m_in_rbi_func;
- devcb_write_line m_out_rbo_func;
-};
-
-
-
-// ======================> dm9368_device_config
-
-class dm9368_device_config : public device_config,
- public dm9368_interface
-{
- friend class dm9368_device;
-
- // construction/destruction
- dm9368_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_read_line m_in_rbi_cb;
+ devcb_write_line m_out_rbo_cb;
};
// ======================> dm9368_device
-class dm9368_device : public device_t
+class dm9368_device : public device_t,
+ public dm9368_interface
{
- friend class dm9368_device_config;
-
+public:
// construction/destruction
- dm9368_device(running_machine &_machine, const dm9368_device_config &_config);
+ dm9368_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
void a_w(UINT8 data);
DECLARE_WRITE_LINE_MEMBER( rbi_w );
DECLARE_READ_LINE_MEMBER( rbo_r );
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
private:
@@ -107,8 +85,6 @@ private:
int m_rbi;
int m_rbo;
-
- const dm9368_device_config &m_config;
};
diff --git a/src/emu/video/hd44102.c b/src/emu/video/hd44102.c
index 73fb8d6e710..0caccd1bd5b 100644
--- a/src/emu/video/hd44102.c
+++ b/src/emu/video/hd44102.c
@@ -35,38 +35,8 @@
#define STATUS_RESET 0x10 /* not supported */
-
-//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// devices
-const device_type HD44102 = hd44102_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(hd44102, "HD44102")
-
-
-//-------------------------------------------------
-// static_set_config - configuration helper
-//-------------------------------------------------
-
-void hd44102_device_config::static_set_config(device_config *device, const char *screen_tag, int sx, int sy)
-{
- hd44102_device_config *hd44102 = downcast<hd44102_device_config *>(device);
-
- assert(screen_tag != NULL);
-
- hd44102->m_screen_tag = screen_tag;
- hd44102->m_sx = sx;
- hd44102->m_sy = sy;
-}
-
+// device type definition
+const device_type HD44102 = &device_creator<hd44102_device>;
//**************************************************************************
@@ -99,14 +69,29 @@ inline void hd44102_device::count_up_or_down()
// hd44102_device - constructor
//-------------------------------------------------
-hd44102_device::hd44102_device(running_machine &_machine, const hd44102_device_config &config)
- : device_t(_machine, config),
+hd44102_device::hd44102_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, HD44102, "HD44102", tag, owner, clock),
m_cs2(0),
m_page(0),
m_x(0),
- m_y(0),
- m_config(config)
+ m_y(0)
+{
+}
+
+
+//-------------------------------------------------
+// static_set_config - configuration helper
+//-------------------------------------------------
+
+void hd44102_device::static_set_config(device_t &device, const char *screen_tag, int sx, int sy)
{
+ hd44102_device &hd44102 = downcast<hd44102_device &>(device);
+
+ assert(screen_tag != NULL);
+
+ hd44102.m_screen_tag = screen_tag;
+ hd44102.m_sx = sx;
+ hd44102.m_sy = sy;
}
@@ -117,7 +102,7 @@ hd44102_device::hd44102_device(running_machine &_machine, const hd44102_device_c
void hd44102_device::device_start()
{
// find screen
- m_screen = machine().device<screen_device>(m_config.m_screen_tag);
+ m_screen = machine().device<screen_device>(m_screen_tag);
// register for state saving
save_item(NAME(m_ram[0]));
@@ -296,8 +281,8 @@ void hd44102_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
{
UINT8 data = m_ram[z / 8][y];
- int sy = m_config.m_sy + z;
- int sx = m_config.m_sx + y;
+ int sy = m_sy + z;
+ int sx = m_sx + y;
if ((sy >= cliprect->min_y) && (sy <= cliprect->max_y) && (sx >= cliprect->min_x) && (sx <= cliprect->max_x))
{
diff --git a/src/emu/video/hd44102.h b/src/emu/video/hd44102.h
index 82c0b12ce9e..ed76a10f0c5 100644
--- a/src/emu/video/hd44102.h
+++ b/src/emu/video/hd44102.h
@@ -22,7 +22,7 @@
#define MCFG_HD44102_ADD(_tag, _screen_tag, _sx, _sy) \
MCFG_DEVICE_ADD(_tag, HD44102, 0) \
- hd44102_device_config::static_set_config(device, _screen_tag, _sx, _sy);
+ hd44102_device::static_set_config(*device, _screen_tag, _sx, _sy);
@@ -30,40 +30,17 @@
// TYPE DEFINITIONS
///*************************************************************************
-// ======================> hd44102_device_config
-
-class hd44102_device_config : public device_config
-{
- friend class hd44102_device;
-
- // construction/destruction
- hd44102_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_config(device_config *device, const char *screen_tag, int sx, int sy);
-
-private:
- const char *m_screen_tag;
- int m_sx;
- int m_sy;
-};
-
-
// ======================> hd44102_device
class hd44102_device : public device_t
{
- friend class hd44102_device_config;
-
+public:
// construction/destruction
- hd44102_device(running_machine &_machine, const hd44102_device_config &_config);
+ hd44102_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_config(device_t &device, const char *screen_tag, int sx, int sy);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -97,7 +74,9 @@ private:
int m_x; // X address
int m_y; // Y address
- const hd44102_device_config &m_config;
+ const char *m_screen_tag;
+ int m_sx;
+ int m_sy;
};
diff --git a/src/emu/video/hd61830.c b/src/emu/video/hd61830.c
index 94c8e59ce98..b4c8155030b 100644
--- a/src/emu/video/hd61830.c
+++ b/src/emu/video/hd61830.c
@@ -53,8 +53,8 @@ const int MODE_DISPLAY_ON = 0x20;
// GLOBAL VARIABLES
//**************************************************************************
-// devices
-const device_type HD61830 = hd61830_device_config::static_alloc_device_config;
+// device type definition
+const device_type HD61830 = &device_creator<hd61830_device>;
// default address map
@@ -71,60 +71,56 @@ ROM_END
+
//**************************************************************************
-// DEVICE CONFIGURATION
+// INLINE HELPERS
//**************************************************************************
//-------------------------------------------------
-// hd61830_device_config - constructor
+// readbyte - read a byte at the given address
//-------------------------------------------------
-hd61830_device_config::hd61830_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Hitachi HD61830", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- m_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, NULL, *ADDRESS_MAP_NAME(hd61830))
+inline UINT8 hd61830_device::readbyte(offs_t address)
{
- m_shortname = "hd61830";
+ return space()->read_byte(address);
}
//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
+// writebyte - write a byte at the given address
//-------------------------------------------------
-device_config *hd61830_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
+inline void hd61830_device::writebyte(offs_t address, UINT8 data)
{
- return global_alloc(hd61830_device_config(mconfig, tag, owner, clock));
+ space()->write_byte(address, data);
}
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *hd61830_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, hd61830_device(machine, *this));
-}
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
+// hd61830_device - constructor
//-------------------------------------------------
-const address_space_config *hd61830_device_config::memory_space_config(address_spacenum spacenum) const
+hd61830_device::hd61830_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, HD61830, "Hitachi HD61830", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ m_bf(false),
+ m_blink(0),
+ m_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, NULL, *ADDRESS_MAP_NAME(hd61830))
{
- return (spacenum == AS_0) ? &m_space_config : NULL;
+ m_shortname = "hd61830";
}
//-------------------------------------------------
-// rom_region - device-specific ROM region
+// device_rom_region - device-specific ROM region
//-------------------------------------------------
-const rom_entry *hd61830_device_config::device_rom_region() const
+const rom_entry *hd61830_device::device_rom_region() const
{
return ROM_NAME(hd61830);
}
@@ -136,7 +132,7 @@ const rom_entry *hd61830_device_config::device_rom_region() const
// complete
//-------------------------------------------------
-void hd61830_device_config::device_config_complete()
+void hd61830_device::device_config_complete()
{
// inherit a copy of the static data
const hd61830_interface *intf = reinterpret_cast<const hd61830_interface *>(static_config());
@@ -146,56 +142,11 @@ void hd61830_device_config::device_config_complete()
// or initialize to defaults if none provided
else
{
- memset(&m_in_rd_func, 0, sizeof(m_in_rd_func));
+ memset(&m_in_rd_cb, 0, sizeof(m_in_rd_cb));
}
}
-
-//**************************************************************************
-// INLINE HELPERS
-//**************************************************************************
-
-//-------------------------------------------------
-// readbyte - read a byte at the given address
-//-------------------------------------------------
-
-inline UINT8 hd61830_device::readbyte(offs_t address)
-{
- return space()->read_byte(address);
-}
-
-
-//-------------------------------------------------
-// writebyte - write a byte at the given address
-//-------------------------------------------------
-
-inline void hd61830_device::writebyte(offs_t address, UINT8 data)
-{
- space()->write_byte(address, data);
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// hd61830_device - constructor
-//-------------------------------------------------
-
-hd61830_device::hd61830_device(running_machine &_machine, const hd61830_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
- m_bf(false),
- m_blink(0),
- m_config(config)
-{
-
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -206,9 +157,9 @@ void hd61830_device::device_start()
m_busy_timer = timer_alloc();
// resolve callbacks
- devcb_resolve_read8(&m_in_rd_func, &m_config.m_in_rd_func, this);
+ devcb_resolve_read8(&m_in_rd_func, &m_in_rd_cb, this);
- m_screen = machine().device<screen_device>(m_config.screen_tag);
+ m_screen = machine().device<screen_device>(screen_tag);
// register for state saving
save_item(NAME(m_bf));
@@ -252,6 +203,17 @@ void hd61830_device::device_timer(emu_timer &timer, device_timer_id id, int para
}
+//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *hd61830_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_0) ? &m_space_config : NULL;
+}
+
+
/*-------------------------------------------------
set_busy_flag - set busy flag and arm timer
to clear it later
diff --git a/src/emu/video/hd61830.h b/src/emu/video/hd61830.h
index a49daee5467..54723e07271 100644
--- a/src/emu/video/hd61830.h
+++ b/src/emu/video/hd61830.h
@@ -47,39 +47,7 @@ struct hd61830_interface
{
const char *screen_tag;
- devcb_read8 m_in_rd_func;
-};
-
-
-
-// ======================> hd61830_device_config
-
-class hd61830_device_config : public device_config,
- public device_config_memory_interface,
- public hd61830_interface
-{
- friend class hd61830_device;
-
- // construction/destruction
- hd61830_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-
- // optional information overrides
- virtual const rom_entry *device_rom_region() const;
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // address space configurations
- const address_space_config m_space_config;
+ devcb_read8 m_in_rd_cb;
};
@@ -87,14 +55,13 @@ protected:
// ======================> hd61830_device
class hd61830_device : public device_t,
- public device_memory_interface
+ public device_memory_interface,
+ public hd61830_interface
{
- friend class hd61830_device_config;
-
+public:
// construction/destruction
- hd61830_device(running_machine &_machine, const hd61830_device_config &_config);
+ hd61830_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( status_r );
DECLARE_WRITE8_MEMBER( control_w );
@@ -105,10 +72,15 @@ public:
protected:
// device-level overrides
+ virtual const rom_entry *device_rom_region() const;
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
inline UINT8 readbyte(offs_t address);
inline void writebyte(offs_t address, UINT8 data);
@@ -144,7 +116,8 @@ private:
int m_blink; // blink counter
int m_cursor; // cursor visible
- const hd61830_device_config &m_config;
+ // address space configurations
+ const address_space_config m_space_config;
};
diff --git a/src/emu/video/hd63484.c b/src/emu/video/hd63484.c
index 1142175b235..67aa9679455 100644
--- a/src/emu/video/hd63484.c
+++ b/src/emu/video/hd63484.c
@@ -64,7 +64,7 @@ INLINE const hd63484_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert(device->type() == HD63484);
- return (const hd63484_interface *) device->baseconfig().static_config();
+ return (const hd63484_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c
index 7f38e7fc234..0dc170c9490 100644
--- a/src/emu/video/mc6845.c
+++ b/src/emu/video/mc6845.c
@@ -872,7 +872,7 @@ static void common_start(device_t *device, int device_type)
/* validate arguments */
assert(device != NULL);
- mc6845->intf = (const mc6845_interface *)device->baseconfig().static_config();
+ mc6845->intf = (const mc6845_interface *)device->static_config();
mc6845->device_type = device_type;
if (mc6845->intf != NULL)
diff --git a/src/emu/video/msm6255.c b/src/emu/video/msm6255.c
index 0b85e56cf8b..2c67e7c2a52 100644
--- a/src/emu/video/msm6255.c
+++ b/src/emu/video/msm6255.c
@@ -65,19 +65,36 @@ enum
//**************************************************************************
-// GLOBAL VARIABLES
+// INLINE HELPERS
//**************************************************************************
-// devices
-const device_type MSM6255 = msm6255_device_config::static_alloc_device_config;
+//-------------------------------------------------
+// read_video_data - read video ROM/RAM
+//-------------------------------------------------
+
+inline UINT8 msm6255_device::read_video_data(UINT16 ma, UINT8 ra)
+{
+ return m_char_ram_r(this, ma, ra);
+}
//**************************************************************************
-// DEVICE CONFIGURATION
+// LIVE DEVICE
//**************************************************************************
-GENERIC_DEVICE_CONFIG_SETUP(msm6255, "MSM6255")
+// device type definition
+const device_type MSM6255 = &device_creator<msm6255_device>;
+
+//-------------------------------------------------
+// msm6255_device - constructor
+//-------------------------------------------------
+
+msm6255_device::msm6255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MSM6255, "MSM6255", tag, owner, clock),
+ m_cursor(0)
+{
+}
//-------------------------------------------------
@@ -86,7 +103,7 @@ GENERIC_DEVICE_CONFIG_SETUP(msm6255, "MSM6255")
// complete
//-------------------------------------------------
-void msm6255_device_config::device_config_complete()
+void msm6255_device::device_config_complete()
{
// inherit a copy of the static data
const msm6255_interface *intf = reinterpret_cast<const msm6255_interface *>(static_config());
@@ -104,38 +121,6 @@ void msm6255_device_config::device_config_complete()
}
-
-//**************************************************************************
-// INLINE HELPERS
-//**************************************************************************
-
-//-------------------------------------------------
-// read_video_data - read video ROM/RAM
-//-------------------------------------------------
-
-inline UINT8 msm6255_device::read_video_data(UINT16 ma, UINT8 ra)
-{
- return m_config.m_char_ram_r(this, ma, ra);
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// msm6255_device - constructor
-//-------------------------------------------------
-
-msm6255_device::msm6255_device(running_machine &_machine, const msm6255_device_config &config)
- : device_t(_machine, config),
- m_cursor(0),
- m_config(config)
-{
-}
-
-
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -143,7 +128,7 @@ msm6255_device::msm6255_device(running_machine &_machine, const msm6255_device_c
void msm6255_device::device_start()
{
// find screen
- m_screen = machine().device<screen_device>(m_config.m_screen_tag);
+ m_screen = machine().device<screen_device>(m_screen_tag);
// register for state saving
save_item(NAME(m_ir));
diff --git a/src/emu/video/msm6255.h b/src/emu/video/msm6255.h
index a627a188538..92af37f2d56 100644
--- a/src/emu/video/msm6255.h
+++ b/src/emu/video/msm6255.h
@@ -56,39 +56,15 @@ struct msm6255_interface
};
-// ======================> msm6255_device_config
-
-class msm6255_device_config : public device_config,
- public msm6255_interface
-{
- friend class msm6255_device;
-
- // construction/destruction
- msm6255_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
-
- msm6255_char_ram_read_func m_char_ram_r;
-};
-
-
// ======================> msm6255_device
-class msm6255_device : public device_t
+class msm6255_device : public device_t,
+ public msm6255_interface
{
- friend class msm6255_device_config;
-
+public:
// construction/destruction
- msm6255_device(running_machine &_machine, const msm6255_device_config &_config);
+ msm6255_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
@@ -96,6 +72,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
@@ -121,8 +98,6 @@ private:
int m_cursor; // is cursor displayed
int m_frame; // frame counter
-
- const msm6255_device_config &m_config;
};
diff --git a/src/emu/video/s2636.c b/src/emu/video/s2636.c
index f261e1f36db..fa20ac6c4a2 100644
--- a/src/emu/video/s2636.c
+++ b/src/emu/video/s2636.c
@@ -126,7 +126,7 @@ INLINE const s2636_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == S2636));
- return (const s2636_interface *) device->baseconfig().static_config();
+ return (const s2636_interface *) device->static_config();
}
diff --git a/src/emu/video/saa5050.c b/src/emu/video/saa5050.c
index d62f7ae3edd..fe301457bf7 100644
--- a/src/emu/video/saa5050.c
+++ b/src/emu/video/saa5050.c
@@ -68,7 +68,7 @@ INLINE const saa5050_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == SAA5050));
- return (const saa5050_interface *) device->baseconfig().static_config();
+ return (const saa5050_interface *) device->static_config();
}
/*************************************
diff --git a/src/emu/video/sed1330.c b/src/emu/video/sed1330.c
index 5d82a914092..efc85354f7f 100644
--- a/src/emu/video/sed1330.c
+++ b/src/emu/video/sed1330.c
@@ -61,8 +61,8 @@
// GLOBAL VARIABLES
//**************************************************************************
-// devices
-const device_type SED1330 = sed1330_device_config::static_alloc_device_config;
+// device type definition
+const device_type SED1330 = &device_creator<sed1330_device>;
// default address map
@@ -80,80 +80,6 @@ ROM_END
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// sed1330_device_config - constructor
-//-------------------------------------------------
-
-sed1330_device_config::sed1330_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "Seiko-Epson SED1330", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- m_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, NULL, *ADDRESS_MAP_NAME(sed1330))
-{
- m_shortname = "sed1330";
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *sed1330_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(sed1330_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *sed1330_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, sed1330_device(machine, *this));
-}
-
-
-//-------------------------------------------------
-// static_set_config - configuration helper
-//-------------------------------------------------
-
-void sed1330_device_config::static_set_config(device_config *device, const char *screen_tag)
-{
- sed1330_device_config *sed1330 = downcast<sed1330_device_config *>(device);
-
- assert(screen_tag != NULL);
-
- sed1330->m_screen_tag = screen_tag;
-}
-
-
-//-------------------------------------------------
-// memory_space_config - return a description of
-// any address spaces owned by this device
-//-------------------------------------------------
-
-const address_space_config *sed1330_device_config::memory_space_config(address_spacenum spacenum) const
-{
- return (spacenum == AS_0) ? &m_space_config : NULL;
-}
-
-
-//-------------------------------------------------
-// rom_region - device-specific ROM region
-//-------------------------------------------------
-
-const rom_entry *sed1330_device_config::device_rom_region() const
-{
- return ROM_NAME( sed1330 );
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -213,12 +139,37 @@ inline void sed1330_device::increment_csr()
// sed1330_device - constructor
//-------------------------------------------------
-sed1330_device::sed1330_device(running_machine &_machine, const sed1330_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
+sed1330_device::sed1330_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SED1330, "Seiko-Epson SED1330", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
m_bf(0),
- m_config(config)
+ m_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, NULL, *ADDRESS_MAP_NAME(sed1330))
+{
+ m_shortname = "sed1330";
+}
+
+
+//-------------------------------------------------
+// static_set_config - configuration helper
+//-------------------------------------------------
+
+void sed1330_device::static_set_config(device_t &device, const char *screen_tag)
{
+ sed1330_device &sed1330 = downcast<sed1330_device &>(device);
+
+ assert(screen_tag != NULL);
+
+ sed1330.m_screen_tag = screen_tag;
+}
+
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *sed1330_device::device_rom_region() const
+{
+ return ROM_NAME( sed1330 );
}
@@ -278,6 +229,17 @@ void sed1330_device::device_reset()
//-------------------------------------------------
+// memory_space_config - return a description of
+// any address spaces owned by this device
+//-------------------------------------------------
+
+const address_space_config *sed1330_device::memory_space_config(address_spacenum spacenum) const
+{
+ return (spacenum == AS_0) ? &m_space_config : NULL;
+}
+
+
+//-------------------------------------------------
// status_r -
//-------------------------------------------------
diff --git a/src/emu/video/sed1330.h b/src/emu/video/sed1330.h
index 4bc7dd0d37a..2925545ab58 100644
--- a/src/emu/video/sed1330.h
+++ b/src/emu/video/sed1330.h
@@ -23,7 +23,7 @@
#define MCFG_SED1330_ADD(_tag, _clock, _screen_tag, _map) \
MCFG_DEVICE_ADD(_tag, SED1330, _clock) \
MCFG_DEVICE_ADDRESS_MAP(AS_0, _map) \
- sed1330_device_config::static_set_config(device, _screen_tag);
+ sed1330_device::static_set_config(*device, _screen_tag);
@@ -31,51 +31,18 @@
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> sed1330_device_config
-
-class sed1330_device_config : public device_config,
- public device_config_memory_interface
-{
- friend class sed1330_device;
-
- // construction/destruction
- sed1330_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration helpers
- static void static_set_config(device_config *device, const char *screen_tag);
-
-protected:
- // optional information overrides
- virtual const rom_entry *device_rom_region() const;
-
- // device_config_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
-
- // address space configurations
- const address_space_config m_space_config;
-
-private:
- const char *m_screen_tag;
-};
-
-
-
// ======================> sed1330_device
class sed1330_device : public device_t,
public device_memory_interface
{
- friend class sed1330_device_config;
-
+public:
// construction/destruction
- sed1330_device(running_machine &_machine, const sed1330_device_config &_config);
+ sed1330_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_config(device_t &device, const char *screen_tag);
-public:
DECLARE_READ8_MEMBER( status_r );
DECLARE_WRITE8_MEMBER( command_w );
@@ -86,9 +53,13 @@ public:
protected:
// device-level overrides
+ virtual const rom_entry *device_rom_region() const;
virtual void device_start();
virtual void device_reset();
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
inline UINT8 readbyte(offs_t address);
inline void writebyte(offs_t address, UINT8 m_data);
inline void increment_csr();
@@ -146,7 +117,9 @@ private:
// devices
screen_device *m_screen;
- const sed1330_device_config &m_config;
+ // address space configurations
+ const address_space_config m_space_config;
+ const char *m_screen_tag;
};
diff --git a/src/emu/video/tlc34076.c b/src/emu/video/tlc34076.c
index cbc5d5ae148..fea2408f96c 100644
--- a/src/emu/video/tlc34076.c
+++ b/src/emu/video/tlc34076.c
@@ -262,7 +262,7 @@ WRITE8_DEVICE_HANDLER( tlc34076_w )
static DEVICE_START( tlc34076 )
{
- tlc34076_config *config = (tlc34076_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ tlc34076_config *config = (tlc34076_config *)downcast<const legacy_device_base *>(device)->inline_config();
tlc34076_state *state = get_safe_token(device);
state->dacbits = config->res_sel ? 8 : 6;
diff --git a/src/emu/video/tms9927.c b/src/emu/video/tms9927.c
index 9d93cbe80eb..96e6105bc39 100644
--- a/src/emu/video/tms9927.c
+++ b/src/emu/video/tms9927.c
@@ -259,7 +259,7 @@ static DEVICE_START( tms9927 )
/* validate arguments */
assert(device != NULL);
- tms->intf = (const tms9927_interface *)device->baseconfig().static_config();
+ tms->intf = (const tms9927_interface *)device->static_config();
if (tms->intf != NULL)
{
diff --git a/src/emu/video/upd3301.c b/src/emu/video/upd3301.c
index 99c7fcf4d27..37d2b408694 100644
--- a/src/emu/video/upd3301.c
+++ b/src/emu/video/upd3301.c
@@ -25,6 +25,9 @@
#include "machine/devhelpr.h"
+// device type definition
+const device_type UPD3301 = &device_creator<upd3301_device>;
+
//**************************************************************************
// MACROS / CONSTANTS
@@ -62,47 +65,6 @@ enum
//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// devices
-const device_type UPD3301 = upd3301_device_config::static_alloc_device_config;
-
-
-
-//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-GENERIC_DEVICE_CONFIG_SETUP(upd3301, "UPD3301")
-
-
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void upd3301_device_config::device_config_complete()
-{
- // inherit a copy of the static data
- const upd3301_interface *intf = reinterpret_cast<const upd3301_interface *>(static_config());
- if (intf != NULL)
- *static_cast<upd3301_interface *>(this) = *intf;
-
- // or initialize to defaults if none provided
- else
- {
- memset(&m_out_int_func, 0, sizeof(m_out_int_func));
- memset(&m_out_drq_func, 0, sizeof(m_out_drq_func));
- memset(&m_out_hrtc_func, 0, sizeof(m_out_hrtc_func));
- memset(&m_out_vrtc_func, 0, sizeof(m_out_vrtc_func));
- }
-}
-
-
-
-//**************************************************************************
// INLINE HELPERS
//**************************************************************************
@@ -172,7 +134,7 @@ inline void upd3301_device::update_hrtc_timer(int state)
int y = m_screen->vpos();
int next_x = state ? m_h : 0;
- int next_y = state ? y : ((y + 1) % ((m_l + m_v) * m_config.m_width));
+ int next_y = state ? y : ((y + 1) % ((m_l + m_v) * m_width));
attotime duration = m_screen->time_until_pos(next_y, next_x);
@@ -200,7 +162,7 @@ inline void upd3301_device::update_vrtc_timer(int state)
inline void upd3301_device::recompute_parameters()
{
- int horiz_pix_total = (m_h + m_z) * m_config.m_width;
+ int horiz_pix_total = (m_h + m_z) * m_width;
int vert_pix_total = (m_l + m_v) * m_r;
attoseconds_t refresh = HZ_TO_ATTOSECONDS(clock()) * horiz_pix_total * vert_pix_total;
@@ -209,7 +171,7 @@ inline void upd3301_device::recompute_parameters()
visarea.min_x = 0;
visarea.min_y = 0;
- visarea.max_x = (m_h * m_config.m_width) - 1;
+ visarea.max_x = (m_h * m_width) - 1;
visarea.max_y = (m_l * m_r) - 1;
if (LOG)
@@ -234,8 +196,8 @@ inline void upd3301_device::recompute_parameters()
// upd3301_device - constructor
//-------------------------------------------------
-upd3301_device::upd3301_device(running_machine &_machine, const upd3301_device_config &config)
- : device_t(_machine, config),
+upd3301_device::upd3301_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, UPD3301, "UPD3301", tag, owner, clock),
m_status(0),
m_param_count(0),
m_data_fifo_pos(0),
@@ -245,13 +207,36 @@ upd3301_device::upd3301_device(running_machine &_machine, const upd3301_device_c
m_l(20),
m_r(10),
m_v(6),
- m_z(32),
- m_config(config)
+ m_z(32)
{
}
//-------------------------------------------------
+// device_config_complete - perform any
+// operations now that the configuration is
+// complete
+//-------------------------------------------------
+
+void upd3301_device::device_config_complete()
+{
+ // inherit a copy of the static data
+ const upd3301_interface *intf = reinterpret_cast<const upd3301_interface *>(static_config());
+ if (intf != NULL)
+ *static_cast<upd3301_interface *>(this) = *intf;
+
+ // or initialize to defaults if none provided
+ else
+ {
+ memset(&m_out_int_cb, 0, sizeof(m_out_int_cb));
+ memset(&m_out_drq_cb, 0, sizeof(m_out_drq_cb));
+ memset(&m_out_hrtc_cb, 0, sizeof(m_out_hrtc_cb));
+ memset(&m_out_vrtc_cb, 0, sizeof(m_out_vrtc_cb));
+ }
+}
+
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -263,13 +248,13 @@ void upd3301_device::device_start()
m_drq_timer = timer_alloc(TIMER_DRQ);
// resolve callbacks
- devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
- devcb_resolve_write_line(&m_out_drq_func, &m_config.m_out_drq_func, this);
- devcb_resolve_write_line(&m_out_hrtc_func, &m_config.m_out_hrtc_func, this);
- devcb_resolve_write_line(&m_out_vrtc_func, &m_config.m_out_vrtc_func, this);
+ devcb_resolve_write_line(&m_out_int_func, &m_out_int_cb, this);
+ devcb_resolve_write_line(&m_out_drq_func, &m_out_drq_cb, this);
+ devcb_resolve_write_line(&m_out_hrtc_func, &m_out_hrtc_cb, this);
+ devcb_resolve_write_line(&m_out_vrtc_func, &m_out_vrtc_cb, this);
// get the screen device
- m_screen = machine().device<screen_device>(m_config.m_screen_tag);
+ m_screen = machine().device<screen_device>(m_screen_tag);
assert(m_screen != NULL);
// state saving
@@ -621,7 +606,7 @@ void upd3301_device::draw_scanline()
int csr = m_cm && m_cursor_blink && ((y / m_r) == m_cy) && (sx == m_cx);
int gpa = 0; // TODO
- m_config.m_display_func(this, m_bitmap, y, sx, cc, lc, hlgt, rvv, vsp, sl0, sl12, csr, gpa);
+ m_display_cb(this, m_bitmap, y, sx, cc, lc, hlgt, rvv, vsp, sl0, sl12, csr, gpa);
}
}
diff --git a/src/emu/video/upd3301.h b/src/emu/video/upd3301.h
index fbc522adaac..f12d5f5e763 100644
--- a/src/emu/video/upd3301.h
+++ b/src/emu/video/upd3301.h
@@ -77,48 +77,25 @@ struct upd3301_interface
const char *m_screen_tag; // screen we are acting on
int m_width; // char width in pixels
- upd3301_display_pixels_func m_display_func;
+ upd3301_display_pixels_func m_display_cb;
- devcb_write_line m_out_int_func;
- devcb_write_line m_out_drq_func;
- devcb_write_line m_out_hrtc_func;
- devcb_write_line m_out_vrtc_func;
-};
-
-
-
-// ======================> upd3301_device_config
-
-class upd3301_device_config : public device_config,
- public upd3301_interface
-{
- friend class upd3301_device;
-
- // construction/destruction
- upd3301_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // device_config overrides
- virtual void device_config_complete();
+ devcb_write_line m_out_int_cb;
+ devcb_write_line m_out_drq_cb;
+ devcb_write_line m_out_hrtc_cb;
+ devcb_write_line m_out_vrtc_cb;
};
// ======================> upd3301_device
-class upd3301_device : public device_t
+class upd3301_device : public device_t,
+ public upd3301_interface
{
- friend class upd3301_device_config;
-
+public:
// construction/destruction
- upd3301_device(running_machine &_machine, const upd3301_device_config &_config);
+ upd3301_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
DECLARE_WRITE8_MEMBER( dack_w );
@@ -130,6 +107,7 @@ public:
protected:
// device-level overrides
+ virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_clock_changed();
@@ -209,8 +187,6 @@ private:
emu_timer *m_hrtc_timer;
emu_timer *m_vrtc_timer;
emu_timer *m_drq_timer;
-
- const upd3301_device_config &m_config;
};
diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c
index 25fdbff7380..d878361b1af 100644
--- a/src/emu/video/voodoo.c
+++ b/src/emu/video/voodoo.c
@@ -4477,7 +4477,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
static DEVICE_START( voodoo )
{
- const voodoo_config *config = (const voodoo_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ const voodoo_config *config = (const voodoo_config *)downcast<const legacy_device_base *>(device)->inline_config();
voodoo_state *v = get_safe_token(device);
const raster_info *info;
void *fbmem, *tmumem[2];
@@ -4485,8 +4485,8 @@ static DEVICE_START( voodoo )
int val;
/* validate some basic stuff */
- assert(device->baseconfig().static_config() == NULL);
- assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
+ assert(device->static_config() == NULL);
+ assert(downcast<const legacy_device_base *>(device)->inline_config() != NULL);
/* validate configuration */
assert(config->screen != NULL);
@@ -4573,7 +4573,7 @@ static DEVICE_START( voodoo )
}
/* set the type, and initialize the chip mask */
- v->index = device->machine().m_devicelist.indexof(device->type(), device->tag());
+ v->index = device->machine().devicelist().indexof(device->type(), device->tag());
v->screen = downcast<screen_device *>(device->machine().device(config->screen));
assert_always(v->screen != NULL, "Unable to find screen attached to voodoo");
v->cpu = device->machine().device(config->cputag);
@@ -4680,9 +4680,9 @@ static DEVICE_RESET( voodoo )
device definition
-------------------------------------------------*/
-INLINE const char *get_voodoo_name(const device_config *devconfig)
+INLINE const char *get_voodoo_name(const device_t *device)
{
- const voodoo_config *config = (devconfig != NULL) ? (const voodoo_config *)downcast<const legacy_device_config_base *>(devconfig)->inline_config() : NULL;
+ const voodoo_config *config = (device != NULL) ? (const voodoo_config *)downcast<const legacy_device_base *>(device)->inline_config() : NULL;
switch (config->type)
{
default:
diff --git a/src/ldplayer/ldplayer.c b/src/ldplayer/ldplayer.c
index 758b68e722a..21d6bd5058d 100644
--- a/src/ldplayer/ldplayer.c
+++ b/src/ldplayer/ldplayer.c
@@ -36,8 +36,8 @@ class ldplayer_state : public driver_device
{
public:
// construction/destruction
- ldplayer_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ ldplayer_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_last_controls(0),
m_playing(false),
m_laserdisc(*this, "laserdisc") { }
@@ -107,7 +107,7 @@ class pr8210_state : public ldplayer_state
{
public:
// construction/destruction
- pr8210_state(running_machine &machine, const driver_device_config_base &config)
+ pr8210_state(const machine_config &mconfig, device_type type, const char *tag)
: ldplayer_state(machine, config),
m_bit_timer(timer_alloc(TIMER_ID_BIT)),
m_command_buffer_in(0),
@@ -143,7 +143,7 @@ class ldv1000_state : public ldplayer_state
{
public:
// construction/destruction
- ldv1000_state(running_machine &machine, const driver_device_config_base &config)
+ ldv1000_state(const machine_config &mconfig, device_type type, const char *tag)
: ldplayer_state(machine, config) { }
protected:
diff --git a/src/mame/audio/namco52.c b/src/mame/audio/namco52.c
index a56704e9f54..0997cbf5cae 100644
--- a/src/mame/audio/namco52.c
+++ b/src/mame/audio/namco52.c
@@ -200,7 +200,7 @@ ROM_END
static DEVICE_START( namco_52xx )
{
- namco_52xx_interface *intf = (namco_52xx_interface *)device->baseconfig().static_config();
+ namco_52xx_interface *intf = (namco_52xx_interface *)device->static_config();
namco_52xx_state *state = get_safe_token(device);
astring tempstring;
diff --git a/src/mame/audio/namco54.c b/src/mame/audio/namco54.c
index 8732498dfec..91d8a57212e 100644
--- a/src/mame/audio/namco54.c
+++ b/src/mame/audio/namco54.c
@@ -164,7 +164,7 @@ ROM_END
static DEVICE_START( namco_54xx )
{
- namco_54xx_config *config = (namco_54xx_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ namco_54xx_config *config = (namco_54xx_config *)downcast<const legacy_device_base *>(device)->inline_config();
namco_54xx_state *state = get_safe_token(device);
astring tempstring;
diff --git a/src/mame/audio/taitosnd.c b/src/mame/audio/taitosnd.c
index 3431ec2ac1a..47d9a540647 100644
--- a/src/mame/audio/taitosnd.c
+++ b/src/mame/audio/taitosnd.c
@@ -54,7 +54,7 @@ INLINE const tc0140syt_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == TC0140SYT));
- return (const tc0140syt_interface *) device->baseconfig().static_config();
+ return (const tc0140syt_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/mame/drivers/1945kiii.c b/src/mame/drivers/1945kiii.c
index fb471dce4af..783d7e5add2 100644
--- a/src/mame/drivers/1945kiii.c
+++ b/src/mame/drivers/1945kiii.c
@@ -50,8 +50,8 @@ Notes:
class k3_state : public driver_device
{
public:
- k3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ k3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_oki1(*this, "oki1"),
m_oki2(*this, "oki2") { }
diff --git a/src/mame/drivers/2mindril.c b/src/mame/drivers/2mindril.c
index 4df1d4f08d1..f7c20e54634 100644
--- a/src/mame/drivers/2mindril.c
+++ b/src/mame/drivers/2mindril.c
@@ -41,8 +41,8 @@ DAC -26.6860Mhz
class _2mindril_state : public taito_f3_state
{
public:
- _2mindril_state(running_machine &machine, const driver_device_config_base &config)
- : taito_f3_state(machine, config) { }
+ _2mindril_state(const machine_config &mconfig, device_type type, const char *tag)
+ : taito_f3_state(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_iodata;
diff --git a/src/mame/drivers/39in1.c b/src/mame/drivers/39in1.c
index 84cf69b6788..4da0d85272a 100644
--- a/src/mame/drivers/39in1.c
+++ b/src/mame/drivers/39in1.c
@@ -30,8 +30,8 @@
class _39in1_state : public driver_device
{
public:
- _39in1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ _39in1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 m_seed;
UINT32 m_magic;
diff --git a/src/mame/drivers/4roses.c b/src/mame/drivers/4roses.c
index ab52c97a572..1f0dd47cd81 100644
--- a/src/mame/drivers/4roses.c
+++ b/src/mame/drivers/4roses.c
@@ -183,8 +183,8 @@
class _4roses_state : public funworld_state
{
public:
- _4roses_state(running_machine &machine, const driver_device_config_base &config)
- : funworld_state(machine, config) { }
+ _4roses_state(const machine_config &mconfig, device_type type, const char *tag)
+ : funworld_state(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/5clown.c b/src/mame/drivers/5clown.c
index 25fa89f167f..f1cbba949f9 100644
--- a/src/mame/drivers/5clown.c
+++ b/src/mame/drivers/5clown.c
@@ -454,8 +454,8 @@
class _5clown_state : public driver_device
{
public:
- _5clown_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ _5clown_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_main_latch_d800;
UINT8 m_snd_latch_0800;
diff --git a/src/mame/drivers/ace.c b/src/mame/drivers/ace.c
index 57251146f24..89057ce0fe3 100644
--- a/src/mame/drivers/ace.c
+++ b/src/mame/drivers/ace.c
@@ -46,8 +46,8 @@ A1 2101 2101
class ace_state : public driver_device
{
public:
- ace_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ace_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
UINT8 * m_ram2;
diff --git a/src/mame/drivers/acefruit.c b/src/mame/drivers/acefruit.c
index 9affe28e6b2..2e7500b6dd4 100644
--- a/src/mame/drivers/acefruit.c
+++ b/src/mame/drivers/acefruit.c
@@ -18,8 +18,8 @@ Inputs and Dip Switches by Stephh
class acefruit_state : public driver_device
{
public:
- acefruit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ acefruit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_spriteram;
UINT8 *m_colorram;
diff --git a/src/mame/drivers/acommand.c b/src/mame/drivers/acommand.c
index 3f35317f13b..cc86e5d1786 100644
--- a/src/mame/drivers/acommand.c
+++ b/src/mame/drivers/acommand.c
@@ -63,8 +63,8 @@ JALCF1 BIN 1,048,576 02-07-99 1:11a JALCF1.BIN
class acommand_state : public driver_device
{
public:
- acommand_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ acommand_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_tx_tilemap;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/drivers/actfancr.c b/src/mame/drivers/actfancr.c
index 6593173febf..2f5d596cd9c 100644
--- a/src/mame/drivers/actfancr.c
+++ b/src/mame/drivers/actfancr.c
@@ -355,13 +355,13 @@ static MACHINE_CONFIG_START( actfancr, actfancr_state )
MCFG_GFXDECODE(actfan)
MCFG_PALETTE_LENGTH(768)
- MCFG_DEVICE_ADD("tilegen1", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 2,2,1);
- MCFG_DEVICE_ADD("tilegen2", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 0,0,0);
+ MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 2,2,1);
+ MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
- MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
- deco_mxc06_device_config::set_gfx_region(device, 1);
+ MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
+ deco_mxc06_device::set_gfx_region(*device, 1);
MCFG_VIDEO_START(actfancr)
@@ -409,13 +409,13 @@ static MACHINE_CONFIG_START( triothep, actfancr_state )
MCFG_GFXDECODE(triothep)
MCFG_PALETTE_LENGTH(768)
- MCFG_DEVICE_ADD("tilegen1", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 2,2,0);
- MCFG_DEVICE_ADD("tilegen2", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 0,0,0);
+ MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 2,2,0);
+ MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
- MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
- deco_mxc06_device_config::set_gfx_region(device, 1);
+ MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
+ deco_mxc06_device::set_gfx_region(*device, 1);
MCFG_VIDEO_START(actfancr)
diff --git a/src/mame/drivers/adp.c b/src/mame/drivers/adp.c
index 6a7f57d389f..92782b7f7c8 100644
--- a/src/mame/drivers/adp.c
+++ b/src/mame/drivers/adp.c
@@ -155,8 +155,8 @@ Video board has additional chips:
class adp_state : public driver_device
{
public:
- adp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ adp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* misc */
UINT8 m_mux_data;
diff --git a/src/mame/drivers/albazc.c b/src/mame/drivers/albazc.c
index a27fda2d427..2bb95e1fc5c 100644
--- a/src/mame/drivers/albazc.c
+++ b/src/mame/drivers/albazc.c
@@ -17,8 +17,8 @@ TODO:
class albazc_state : public driver_device
{
public:
- albazc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ albazc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
UINT8 * m_spriteram1;
diff --git a/src/mame/drivers/albazg.c b/src/mame/drivers/albazg.c
index 113e030389b..17875e7986b 100644
--- a/src/mame/drivers/albazg.c
+++ b/src/mame/drivers/albazg.c
@@ -64,8 +64,8 @@ Code disassembling
class albazg_state : public driver_device
{
public:
- albazg_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ albazg_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_cus_ram;
diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c
index 5efc00a25d9..4589baf11e4 100644
--- a/src/mame/drivers/alg.c
+++ b/src/mame/drivers/alg.c
@@ -32,8 +32,8 @@
class alg_state : public amiga_state
{
public:
- alg_state(running_machine &machine, const driver_device_config_base &config)
- : amiga_state(machine, config) { }
+ alg_state(const machine_config &mconfig, device_type type, const char *tag)
+ : amiga_state(mconfig, type, tag) { }
device_t *m_laserdisc;
diff --git a/src/mame/drivers/alien.c b/src/mame/drivers/alien.c
index a47f54fbee5..b83d863db52 100644
--- a/src/mame/drivers/alien.c
+++ b/src/mame/drivers/alien.c
@@ -21,8 +21,8 @@
class alien_state : public driver_device
{
public:
- alien_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ alien_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/allied.c b/src/mame/drivers/allied.c
index 023a11b836c..53f599f8691 100644
--- a/src/mame/drivers/allied.c
+++ b/src/mame/drivers/allied.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class allied_state : public driver_device
{
public:
- allied_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ allied_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( allied_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/alvg.c b/src/mame/drivers/alvg.c
index 27639bd9ec0..0f9ae29d844 100644
--- a/src/mame/drivers/alvg.c
+++ b/src/mame/drivers/alvg.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class alvg_state : public driver_device
{
public:
- alvg_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ alvg_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/amaticmg.c b/src/mame/drivers/amaticmg.c
index b70e09a6f96..0b0f47367a4 100644
--- a/src/mame/drivers/amaticmg.c
+++ b/src/mame/drivers/amaticmg.c
@@ -392,8 +392,8 @@
class amaticmg_state : public driver_device
{
public:
- amaticmg_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ amaticmg_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/arcadia.c b/src/mame/drivers/arcadia.c
index f06c6e148f9..f1e8a5374f6 100644
--- a/src/mame/drivers/arcadia.c
+++ b/src/mame/drivers/arcadia.c
@@ -58,8 +58,8 @@
class arcadia_state : public amiga_state
{
public:
- arcadia_state(running_machine &machine, const driver_device_config_base &config)
- : amiga_state(machine, config) { }
+ arcadia_state(const machine_config &mconfig, device_type type, const char *tag)
+ : amiga_state(mconfig, type, tag) { }
UINT8 coin_counter[2];
};
diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c
index 14db7201bf5..f68bb254d4c 100644
--- a/src/mame/drivers/aristmk4.c
+++ b/src/mame/drivers/aristmk4.c
@@ -194,8 +194,8 @@ UINT8 crtc_reg = 0;
class aristmk4_state : public driver_device
{
public:
- aristmk4_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ aristmk4_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_rtc_address_strobe;
int m_rtc_data_strobe;
diff --git a/src/mame/drivers/aristmk5.c b/src/mame/drivers/aristmk5.c
index a8fa1a28983..3e63b9d871f 100644
--- a/src/mame/drivers/aristmk5.c
+++ b/src/mame/drivers/aristmk5.c
@@ -67,8 +67,8 @@
class aristmk5_state : public driver_device
{
public:
- aristmk5_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ aristmk5_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
emu_timer *m_mk5_2KHz_timer;
UINT8 m_ext_latch;
diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c
index 474cc01b608..bb59d2fd4d6 100644
--- a/src/mame/drivers/astinvad.c
+++ b/src/mame/drivers/astinvad.c
@@ -44,8 +44,8 @@ enum
class astinvad_state : public driver_device
{
public:
- astinvad_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ astinvad_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 * m_colorram;
UINT8 * m_videoram;
diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c
index 92b5e4709ac..b8fe5610f8f 100644
--- a/src/mame/drivers/astrocorp.c
+++ b/src/mame/drivers/astrocorp.c
@@ -40,8 +40,8 @@ To do:
class astrocorp_state : public driver_device
{
public:
- astrocorp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ astrocorp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram;
diff --git a/src/mame/drivers/atari_s1.c b/src/mame/drivers/atari_s1.c
index ca268affb07..5a07d12e490 100644
--- a/src/mame/drivers/atari_s1.c
+++ b/src/mame/drivers/atari_s1.c
@@ -8,8 +8,8 @@ extern const char layout_pinball[];
class atari_s1_state : public driver_device
{
public:
- atari_s1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ atari_s1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( atari_s1_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/atari_s2.c b/src/mame/drivers/atari_s2.c
index f7b6731b885..4a72728164a 100644
--- a/src/mame/drivers/atari_s2.c
+++ b/src/mame/drivers/atari_s2.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class atari_s2_state : public driver_device
{
public:
- atari_s2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ atari_s2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/atari_s3.c b/src/mame/drivers/atari_s3.c
index 4ca8212e97a..94ba60bda87 100644
--- a/src/mame/drivers/atari_s3.c
+++ b/src/mame/drivers/atari_s3.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class atari_s3_state : public driver_device
{
public:
- atari_s3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ atari_s3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/atarisy4.c b/src/mame/drivers/atarisy4.c
index 6777c50f62f..28016f80bd2 100644
--- a/src/mame/drivers/atarisy4.c
+++ b/src/mame/drivers/atarisy4.c
@@ -23,8 +23,8 @@
class atarisy4_state : public driver_device
{
public:
- atarisy4_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ atarisy4_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_r_color_table[256];
UINT8 m_g_color_table[256];
diff --git a/src/mame/drivers/attckufo.c b/src/mame/drivers/attckufo.c
index 3288927f308..10256ada093 100644
--- a/src/mame/drivers/attckufo.c
+++ b/src/mame/drivers/attckufo.c
@@ -49,8 +49,8 @@ LOIPOIO-B
class attckufo_state : public driver_device
{
public:
- attckufo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ attckufo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_mos6560(*this, "mos6560") { }
diff --git a/src/mame/drivers/atvtrack.c b/src/mame/drivers/atvtrack.c
index 6f9ef5dd076..70decf11f3e 100644
--- a/src/mame/drivers/atvtrack.c
+++ b/src/mame/drivers/atvtrack.c
@@ -63,8 +63,8 @@ Notes:
class atvtrack_state : public driver_device
{
public:
- atvtrack_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ atvtrack_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/avt.c b/src/mame/drivers/avt.c
index cfb1fbfc730..0dc602d25cd 100644
--- a/src/mame/drivers/avt.c
+++ b/src/mame/drivers/avt.c
@@ -417,8 +417,8 @@
class avt_state : public driver_device
{
public:
- avt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ avt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c
index 95a5f8c99c6..ae83a451d03 100644
--- a/src/mame/drivers/backfire.c
+++ b/src/mame/drivers/backfire.c
@@ -24,8 +24,8 @@
class backfire_state : public driver_device
{
public:
- backfire_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ backfire_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram_1;
@@ -499,13 +499,13 @@ static MACHINE_CONFIG_START( backfire, backfire_state )
MCFG_DECO16IC_ADD("tilegen1", backfire_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", backfire_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 4);
- decospr_device_config::set_pri_callback(device, backfire_pri_callback);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 4);
+ decospr_device::set_pri_callback(*device, backfire_pri_callback);
- MCFG_DEVICE_ADD("spritegen2", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 5);
- decospr_device_config::set_pri_callback(device, backfire_pri_callback);
+ MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 5);
+ decospr_device::set_pri_callback(*device, backfire_pri_callback);
/* sound hardware */
diff --git a/src/mame/drivers/bartop52.c b/src/mame/drivers/bartop52.c
index 3e94051e8ab..35644c992fb 100644
--- a/src/mame/drivers/bartop52.c
+++ b/src/mame/drivers/bartop52.c
@@ -27,8 +27,8 @@
class bartop52_state : public driver_device
{
public:
- bartop52_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bartop52_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/beaminv.c b/src/mame/drivers/beaminv.c
index 58a78e15c90..a5b9f615cf5 100644
--- a/src/mame/drivers/beaminv.c
+++ b/src/mame/drivers/beaminv.c
@@ -58,8 +58,8 @@ Stephh's notes (based on the games Z80 code and some tests) :
class beaminv_state : public driver_device
{
public:
- beaminv_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ beaminv_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c
index 52fd40ab5fe..232a2c852e9 100644
--- a/src/mame/drivers/berzerk.c
+++ b/src/mame/drivers/berzerk.c
@@ -20,8 +20,8 @@
class berzerk_state : public driver_device
{
public:
- berzerk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ berzerk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
size_t m_videoram_size;
diff --git a/src/mame/drivers/bestleag.c b/src/mame/drivers/bestleag.c
index bc1c6661891..9c006b98cb2 100644
--- a/src/mame/drivers/bestleag.c
+++ b/src/mame/drivers/bestleag.c
@@ -26,8 +26,8 @@ Dip Locations added according to Service Mode
class bestleag_state : public driver_device
{
public:
- bestleag_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bestleag_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_txram;
UINT16 *m_bgram;
diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c
index 3dfd44fc298..dd193f6cced 100644
--- a/src/mame/drivers/bfcobra.c
+++ b/src/mame/drivers/bfcobra.c
@@ -239,8 +239,8 @@ struct fdc_t
class bfcobra_state : public driver_device
{
public:
- bfcobra_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bfcobra_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_bank_data[4];
UINT8 *m_work_ram;
diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c
index e7c110a8868..d0c4cc19ef1 100644
--- a/src/mame/drivers/bfm_sc1.c
+++ b/src/mame/drivers/bfm_sc1.c
@@ -98,8 +98,8 @@ Optional (on expansion card) (Viper)
class bfm_sc1_state : public driver_device
{
public:
- bfm_sc1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bfm_sc1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_mmtr_latch;
int m_triac_latch;
diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c
index 57214f90f07..a1837ff275d 100644
--- a/src/mame/drivers/bfm_sc2.c
+++ b/src/mame/drivers/bfm_sc2.c
@@ -166,8 +166,8 @@ Adder hardware:
class bfm_sc2_state : public driver_device
{
public:
- bfm_sc2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bfm_sc2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_sc2gui_update_mmtr;
UINT8 *m_nvram;
diff --git a/src/mame/drivers/bfmsys85.c b/src/mame/drivers/bfmsys85.c
index a942d98bc13..99516777124 100644
--- a/src/mame/drivers/bfmsys85.c
+++ b/src/mame/drivers/bfmsys85.c
@@ -71,8 +71,8 @@ ___________________________________________________________________________
class bfmsys85_state : public driver_device
{
public:
- bfmsys85_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bfmsys85_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_mmtr_latch;
int m_triac_latch;
diff --git a/src/mame/drivers/big10.c b/src/mame/drivers/big10.c
index 1f4f63ab553..bf45340399a 100644
--- a/src/mame/drivers/big10.c
+++ b/src/mame/drivers/big10.c
@@ -67,8 +67,8 @@
class big10_state : public driver_device
{
public:
- big10_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ big10_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_mux_data;
};
diff --git a/src/mame/drivers/bingo.c b/src/mame/drivers/bingo.c
index 0e63133c1dc..6dd62531f02 100644
--- a/src/mame/drivers/bingo.c
+++ b/src/mame/drivers/bingo.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class bingo_state : public driver_device
{
public:
- bingo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bingo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/bingoc.c b/src/mame/drivers/bingoc.c
index 0972e29d26f..6f0874cb610 100644
--- a/src/mame/drivers/bingoc.c
+++ b/src/mame/drivers/bingoc.c
@@ -37,8 +37,8 @@ SOUND : YM2151 uPD7759C
class bingoc_state : public driver_device
{
public:
- bingoc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bingoc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_x;
};
diff --git a/src/mame/drivers/bingor.c b/src/mame/drivers/bingor.c
index 7229b71c173..7ed629ab245 100644
--- a/src/mame/drivers/bingor.c
+++ b/src/mame/drivers/bingor.c
@@ -446,8 +446,8 @@
class bingor_state : public driver_device
{
public:
- bingor_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bingor_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_blit_ram;
};
diff --git a/src/mame/drivers/blackt96.c b/src/mame/drivers/blackt96.c
index 75ff83e1002..984f84ec1a2 100644
--- a/src/mame/drivers/blackt96.c
+++ b/src/mame/drivers/blackt96.c
@@ -56,8 +56,8 @@ Is this based on some Seta / Taito HW design, the sprite-tilemaps look familiar
class blackt96_state : public driver_device
{
public:
- blackt96_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ blackt96_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16* m_tilemapram;
UINT16* m_tilemapram2;
diff --git a/src/mame/drivers/blitz.c b/src/mame/drivers/blitz.c
index 2d2aa0eaa2e..a4c73618f66 100644
--- a/src/mame/drivers/blitz.c
+++ b/src/mame/drivers/blitz.c
@@ -295,8 +295,8 @@
class blitz_state : public driver_device
{
public:
- blitz_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ blitz_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/drivers/blitz68k.c b/src/mame/drivers/blitz68k.c
index 79de2eae9ed..c99e901f989 100644
--- a/src/mame/drivers/blitz68k.c
+++ b/src/mame/drivers/blitz68k.c
@@ -39,8 +39,8 @@ To Do:
class blitz68k_state : public driver_device
{
public:
- blitz68k_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ blitz68k_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
optional_shared_ptr<UINT16> m_nvram;
diff --git a/src/mame/drivers/bmcbowl.c b/src/mame/drivers/bmcbowl.c
index d210d01904e..417e6687d0f 100644
--- a/src/mame/drivers/bmcbowl.c
+++ b/src/mame/drivers/bmcbowl.c
@@ -111,8 +111,8 @@ Main board:
class bmcbowl_state : public driver_device
{
public:
- bmcbowl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bmcbowl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_vid1;
UINT16 *m_vid2;
diff --git a/src/mame/drivers/bnstars.c b/src/mame/drivers/bnstars.c
index 4ada29a615a..84a3da598af 100644
--- a/src/mame/drivers/bnstars.c
+++ b/src/mame/drivers/bnstars.c
@@ -98,8 +98,8 @@ ROMs : MR96004-10.1 [125661cd] (IC5 - Samples)
class bnstars_state : public driver_device
{
public:
- bnstars_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bnstars_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_ms32_tx_tilemap[2];
tilemap_t *m_ms32_bg_tilemap[2];
diff --git a/src/mame/drivers/boxer.c b/src/mame/drivers/boxer.c
index 0b1327b56fe..6bf813964cf 100644
--- a/src/mame/drivers/boxer.c
+++ b/src/mame/drivers/boxer.c
@@ -23,8 +23,8 @@
class boxer_state : public driver_device
{
public:
- boxer_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ boxer_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_tile_ram;
diff --git a/src/mame/drivers/buster.c b/src/mame/drivers/buster.c
index 74c30151093..59282d22e99 100644
--- a/src/mame/drivers/buster.c
+++ b/src/mame/drivers/buster.c
@@ -15,8 +15,8 @@ Video Fruit Machine
class buster_state : public driver_device
{
public:
- buster_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ buster_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_vram;
};
diff --git a/src/mame/drivers/bwidow.c b/src/mame/drivers/bwidow.c
index 410c202b567..b16079cc968 100644
--- a/src/mame/drivers/bwidow.c
+++ b/src/mame/drivers/bwidow.c
@@ -227,8 +227,8 @@
class bwidow_state : public driver_device
{
public:
- bwidow_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bwidow_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_lastdata;
};
diff --git a/src/mame/drivers/by17.c b/src/mame/drivers/by17.c
index 54160e38afc..ff863f48411 100644
--- a/src/mame/drivers/by17.c
+++ b/src/mame/drivers/by17.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class by17_state : public driver_device
{
public:
- by17_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ by17_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/by35.c b/src/mame/drivers/by35.c
index 20bbe6da8f5..58fd6429ed4 100644
--- a/src/mame/drivers/by35.c
+++ b/src/mame/drivers/by35.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class by35_state : public driver_device
{
public:
- by35_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ by35_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/by6803.c b/src/mame/drivers/by6803.c
index ebb01f68f7f..f190590f4d9 100644
--- a/src/mame/drivers/by6803.c
+++ b/src/mame/drivers/by6803.c
@@ -10,8 +10,8 @@ extern const char layout_pinball[];
class by6803_state : public driver_device
{
public:
- by6803_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ by6803_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/by68701.c b/src/mame/drivers/by68701.c
index 4a9af51cc1a..b4cc4bc98b0 100644
--- a/src/mame/drivers/by68701.c
+++ b/src/mame/drivers/by68701.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class by68701_state : public driver_device
{
public:
- by68701_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ by68701_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/byvid.c b/src/mame/drivers/byvid.c
index 3d98bd5e2d2..89b8c5d14ec 100644
--- a/src/mame/drivers/byvid.c
+++ b/src/mame/drivers/byvid.c
@@ -11,8 +11,8 @@ extern const char layout_pinball[];
class by133_state : public driver_device
{
public:
- by133_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ by133_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( by133_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/cabaret.c b/src/mame/drivers/cabaret.c
index d5fb9447a96..be69189d0aa 100644
--- a/src/mame/drivers/cabaret.c
+++ b/src/mame/drivers/cabaret.c
@@ -29,8 +29,8 @@ are the same of IGS. AMT may be previous IGS name.
class cabaret_state : public driver_device
{
public:
- cabaret_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cabaret_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_bg_tile_ram;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c
index 9f901d68edf..4eff5ab8000 100644
--- a/src/mame/drivers/calchase.c
+++ b/src/mame/drivers/calchase.c
@@ -101,8 +101,8 @@ all files across to new HDD, boots up fine.
class calchase_state : public driver_device
{
public:
- calchase_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ calchase_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_bios_ram;
UINT32 *m_vga_vram;
diff --git a/src/mame/drivers/calorie.c b/src/mame/drivers/calorie.c
index 2c85bb0ef6e..fb1b425c4bd 100644
--- a/src/mame/drivers/calorie.c
+++ b/src/mame/drivers/calorie.c
@@ -86,8 +86,8 @@ Notes:
class calorie_state : public driver_device
{
public:
- calorie_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ calorie_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_fg_ram;
diff --git a/src/mame/drivers/capcom.c b/src/mame/drivers/capcom.c
index 5c761a27466..363b5d15387 100644
--- a/src/mame/drivers/capcom.c
+++ b/src/mame/drivers/capcom.c
@@ -10,8 +10,8 @@ extern const char layout_pinball[];
class capcom_state : public driver_device
{
public:
- capcom_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ capcom_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/cardline.c b/src/mame/drivers/cardline.c
index 53d31195ac8..80fa9258143 100644
--- a/src/mame/drivers/cardline.c
+++ b/src/mame/drivers/cardline.c
@@ -26,8 +26,8 @@
class cardline_state : public driver_device
{
public:
- cardline_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cardline_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_video;
UINT8 *m_videoram;
diff --git a/src/mame/drivers/carrera.c b/src/mame/drivers/carrera.c
index d8b94730919..d4c191e41e5 100644
--- a/src/mame/drivers/carrera.c
+++ b/src/mame/drivers/carrera.c
@@ -55,8 +55,8 @@ TODO:
class carrera_state : public driver_device
{
public:
- carrera_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ carrera_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8* m_tileram;
};
diff --git a/src/mame/drivers/caswin.c b/src/mame/drivers/caswin.c
index fe94779a96b..afccbc33e40 100644
--- a/src/mame/drivers/caswin.c
+++ b/src/mame/drivers/caswin.c
@@ -50,8 +50,8 @@ TODO:
class caswin_state : public driver_device
{
public:
- caswin_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ caswin_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_sc0_vram;
UINT8 *m_sc0_attr;
diff --git a/src/mame/drivers/cb2001.c b/src/mame/drivers/cb2001.c
index 139fc9bdebd..c6a1686b88e 100644
--- a/src/mame/drivers/cb2001.c
+++ b/src/mame/drivers/cb2001.c
@@ -49,8 +49,8 @@ this seems more like 8-bit hardware, maybe it should be v25, not v35...
class cb2001_state : public driver_device
{
public:
- cb2001_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cb2001_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_vram_fg;
UINT16* m_vram_bg;
diff --git a/src/mame/drivers/cball.c b/src/mame/drivers/cball.c
index 54182a7bd35..608bb2e175b 100644
--- a/src/mame/drivers/cball.c
+++ b/src/mame/drivers/cball.c
@@ -11,8 +11,8 @@
class cball_state : public driver_device
{
public:
- cball_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cball_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_video_ram;
diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c
index 8b8c506715e..eb571e6cdde 100644
--- a/src/mame/drivers/cbuster.c
+++ b/src/mame/drivers/cbuster.c
@@ -354,8 +354,8 @@ static MACHINE_CONFIG_START( twocrude, cbuster_state )
MCFG_DECO16IC_ADD("tilegen1", twocrude_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", twocrude_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 3);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 3);
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/cchance.c b/src/mame/drivers/cchance.c
index 4050ee83c8b..7127cc01974 100644
--- a/src/mame/drivers/cchance.c
+++ b/src/mame/drivers/cchance.c
@@ -41,8 +41,8 @@ cha3 $10d8
class cchance_state : public tnzs_state
{
public:
- cchance_state(running_machine &machine, const driver_device_config_base &config)
- : tnzs_state(machine, config) { }
+ cchance_state(const machine_config &mconfig, device_type type, const char *tag)
+ : tnzs_state(mconfig, type, tag) { }
UINT8 m_hop_io;
UINT8 m_bell_io;
diff --git a/src/mame/drivers/cesclass.c b/src/mame/drivers/cesclass.c
index d7d2e5b2ed4..31e61810658 100644
--- a/src/mame/drivers/cesclass.c
+++ b/src/mame/drivers/cesclass.c
@@ -10,8 +10,8 @@
class cesclassic_state : public driver_device
{
public:
- cesclassic_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) {}
+ cesclassic_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) {}
};
static VIDEO_START( cesclassic )
diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c
index 08fcb283a1c..31638c77f8c 100644
--- a/src/mame/drivers/cham24.c
+++ b/src/mame/drivers/cham24.c
@@ -64,8 +64,8 @@ Notes:
class cham24_state : public driver_device
{
public:
- cham24_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cham24_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8* m_nt_ram;
UINT8* m_nt_page[4];
diff --git a/src/mame/drivers/champbwl.c b/src/mame/drivers/champbwl.c
index 3060786962b..eda66e51339 100644
--- a/src/mame/drivers/champbwl.c
+++ b/src/mame/drivers/champbwl.c
@@ -160,8 +160,8 @@ Notes:
class champbwl_state : public tnzs_state
{
public:
- champbwl_state(running_machine &machine, const driver_device_config_base &config)
- : tnzs_state(machine, config) { }
+ champbwl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : tnzs_state(mconfig, type, tag) { }
UINT8 m_last_trackball_val[2];
// UINT8 * m_nvram; // currently this uses generic_nvram
diff --git a/src/mame/drivers/chanbara.c b/src/mame/drivers/chanbara.c
index 6a50cc4beda..732cbb3e758 100644
--- a/src/mame/drivers/chanbara.c
+++ b/src/mame/drivers/chanbara.c
@@ -54,8 +54,8 @@ ToDo:
class chanbara_state : public driver_device
{
public:
- chanbara_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ chanbara_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c
index 61f2c2d637b..fbb157af74d 100644
--- a/src/mame/drivers/chihiro.c
+++ b/src/mame/drivers/chihiro.c
@@ -464,13 +464,13 @@ static READ32_HANDLER( chihiro_jamtable )
static UINT32 dummy_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
{
- logerror(" bus:%d function:%d register:%d mask:%08X\n",((pci_bus_config *)downcast<const legacy_device_config_base &>(busdevice->baseconfig()).inline_config())->busnum,function,reg,mem_mask);
+ logerror(" bus:%d function:%d register:%d mask:%08X\n",((pci_bus_config *)downcast<const legacy_device_base *>(busdevice)->inline_config())->busnum,function,reg,mem_mask);
return 0;
}
static void dummy_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask)
{
- logerror(" bus:%d function:%d register:%d data:%08X mask:%08X\n",((pci_bus_config *)downcast<const legacy_device_config_base &>(busdevice->baseconfig()).inline_config())->busnum,function,reg,data,mem_mask);
+ logerror(" bus:%d function:%d register:%d data:%08X mask:%08X\n",((pci_bus_config *)downcast<const legacy_device_base *>(busdevice)->inline_config())->busnum,function,reg,data,mem_mask);
}
static READ32_HANDLER( dummy_r )
diff --git a/src/mame/drivers/chinsan.c b/src/mame/drivers/chinsan.c
index cf602fbdf45..eb34d53f448 100644
--- a/src/mame/drivers/chinsan.c
+++ b/src/mame/drivers/chinsan.c
@@ -50,8 +50,8 @@ MM63.10N
class chinsan_state : public driver_device
{
public:
- chinsan_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ chinsan_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_video;
diff --git a/src/mame/drivers/chsuper.c b/src/mame/drivers/chsuper.c
index def206b8c54..b1fbcc84aba 100644
--- a/src/mame/drivers/chsuper.c
+++ b/src/mame/drivers/chsuper.c
@@ -19,8 +19,8 @@ TODO:
class chsuper_state : public driver_device
{
public:
- chsuper_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ chsuper_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_tilexor;
struct { int r,g,b,offs,offs_internal; } m_pal;
diff --git a/src/mame/drivers/clayshoo.c b/src/mame/drivers/clayshoo.c
index fa4ff2ab0a8..564dcd700c0 100644
--- a/src/mame/drivers/clayshoo.c
+++ b/src/mame/drivers/clayshoo.c
@@ -20,8 +20,8 @@
class clayshoo_state : public driver_device
{
public:
- clayshoo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ clayshoo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/cmmb.c b/src/mame/drivers/cmmb.c
index c8db465b362..3e660dc9efc 100644
--- a/src/mame/drivers/cmmb.c
+++ b/src/mame/drivers/cmmb.c
@@ -45,8 +45,8 @@ CYC1399
class cmmb_state : public driver_device
{
public:
- cmmb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cmmb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_irq_mask;
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index f7ecb5c523c..c45b1d2bd2d 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -946,9 +946,9 @@ static MACHINE_CONFIG_START( cninja, cninja_state )
MCFG_DECO16IC_ADD("tilegen1", cninja_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", cninja_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 3);
- decospr_device_config::set_pri_callback(device, cninja_pri_callback);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 3);
+ decospr_device::set_pri_callback(*device, cninja_pri_callback);
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -1003,9 +1003,9 @@ static MACHINE_CONFIG_START( stoneage, cninja_state )
MCFG_DECO16IC_ADD("tilegen1", cninja_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", cninja_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 3);
- decospr_device_config::set_pri_callback(device, cninja_pri_callback);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 3);
+ decospr_device::set_pri_callback(*device, cninja_pri_callback);
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -1102,9 +1102,9 @@ static MACHINE_CONFIG_START( edrandy, cninja_state )
MCFG_DECO16IC_ADD("tilegen1", edrandy_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", edrandy_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 3);
- decospr_device_config::set_pri_callback(device, cninja_pri_callback);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 3);
+ decospr_device::set_pri_callback(*device, cninja_pri_callback);
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -1157,9 +1157,9 @@ static MACHINE_CONFIG_START( robocop2, cninja_state )
MCFG_DECO16IC_ADD("tilegen1", robocop2_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", robocop2_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 3);
- decospr_device_config::set_pri_callback(device, cninja_pri_callback);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 3);
+ decospr_device::set_pri_callback(*device, cninja_pri_callback);
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -1215,11 +1215,11 @@ static MACHINE_CONFIG_START( mutantf, cninja_state )
MCFG_DECO16IC_ADD("tilegen1", mutantf_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", mutantf_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen1", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 3);
+ MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 3);
- MCFG_DEVICE_ADD("spritegen2", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 4);
+ MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 4);
/* sound hardware */
diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c
index 42b3fb1d7e2..0ee37b8648f 100644
--- a/src/mame/drivers/cntsteer.c
+++ b/src/mame/drivers/cntsteer.c
@@ -32,8 +32,8 @@
class cntsteer_state : public driver_device
{
public:
- cntsteer_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cntsteer_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/coinmstr.c b/src/mame/drivers/coinmstr.c
index 36bbb38995c..16041673c66 100644
--- a/src/mame/drivers/coinmstr.c
+++ b/src/mame/drivers/coinmstr.c
@@ -32,8 +32,8 @@ x
class coinmstr_state : public driver_device
{
public:
- coinmstr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ coinmstr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_attr_ram1;
diff --git a/src/mame/drivers/coinmvga.c b/src/mame/drivers/coinmvga.c
index 91fa347210a..c03bd6ea5d6 100644
--- a/src/mame/drivers/coinmvga.c
+++ b/src/mame/drivers/coinmvga.c
@@ -222,8 +222,8 @@
class coinmvga_state : public driver_device
{
public:
- coinmvga_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ coinmvga_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_vram;
struct { int r,g,b,offs,offs_internal; } m_bgpal, m_fgpal;
diff --git a/src/mame/drivers/comebaby.c b/src/mame/drivers/comebaby.c
index b61d136b0ee..2cdd75de9ca 100644
--- a/src/mame/drivers/comebaby.c
+++ b/src/mame/drivers/comebaby.c
@@ -63,8 +63,8 @@
class comebaby_state : public driver_device
{
public:
- comebaby_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ comebaby_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/coolridr.c b/src/mame/drivers/coolridr.c
index 05fd1d09783..dd1206609b4 100644
--- a/src/mame/drivers/coolridr.c
+++ b/src/mame/drivers/coolridr.c
@@ -255,8 +255,8 @@ Note: This hardware appears to have been designed as a test-bed for a new RLE ba
class coolridr_state : public driver_device
{
public:
- coolridr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ coolridr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32* m_sysh1_workram_h;
UINT32* m_framebuffer_vram;
diff --git a/src/mame/drivers/corona.c b/src/mame/drivers/corona.c
index 58a098ef882..51f99595784 100644
--- a/src/mame/drivers/corona.c
+++ b/src/mame/drivers/corona.c
@@ -320,8 +320,8 @@
class corona_state : public driver_device
{
public:
- corona_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ corona_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_blitter_x_reg;
UINT8 m_blitter_y_reg;
diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c
index 942d67a2ffa..264542b5665 100644
--- a/src/mame/drivers/crystal.c
+++ b/src/mame/drivers/crystal.c
@@ -128,8 +128,8 @@ Notes:
class crystal_state : public driver_device
{
public:
- crystal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ crystal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT32 * m_workram;
diff --git a/src/mame/drivers/cshooter.c b/src/mame/drivers/cshooter.c
index 105b35ba916..f1c7783226c 100644
--- a/src/mame/drivers/cshooter.c
+++ b/src/mame/drivers/cshooter.c
@@ -92,8 +92,8 @@ Stephh's notes (based on the game Z80 code and some tests) :
class cshooter_state : public driver_device
{
public:
- cshooter_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cshooter_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8* m_txram;
tilemap_t *m_txtilemap;
diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c
index bb909d81afe..9f0570fa5dc 100644
--- a/src/mame/drivers/csplayh5.c
+++ b/src/mame/drivers/csplayh5.c
@@ -29,8 +29,8 @@
class csplayh5_state : public driver_device
{
public:
- csplayh5_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ csplayh5_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
bitmap_t *m_vdp0_bitmap;
UINT16 m_mux_data;
diff --git a/src/mame/drivers/cubeqst.c b/src/mame/drivers/cubeqst.c
index 7b9915bb4c2..6289bb211d0 100644
--- a/src/mame/drivers/cubeqst.c
+++ b/src/mame/drivers/cubeqst.c
@@ -28,8 +28,8 @@
class cubeqst_state : public driver_device
{
public:
- cubeqst_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cubeqst_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_depth_buffer;
int m_video_field;
diff --git a/src/mame/drivers/cultures.c b/src/mame/drivers/cultures.c
index 84524c358ae..df75815c746 100644
--- a/src/mame/drivers/cultures.c
+++ b/src/mame/drivers/cultures.c
@@ -17,8 +17,8 @@
class cultures_state : public driver_device
{
public:
- cultures_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cultures_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bg0_videoram;
diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c
index 7c9b598caab..eecb1025881 100644
--- a/src/mame/drivers/cybertnk.c
+++ b/src/mame/drivers/cybertnk.c
@@ -169,8 +169,8 @@ lev 7 : 0x7c : 0000 07e0 - input device clear?
class cybertnk_state : public driver_device
{
public:
- cybertnk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cybertnk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_tx_tilemap;
UINT16 *m_tx_vram;
diff --git a/src/mame/drivers/cyclemb.c b/src/mame/drivers/cyclemb.c
index c4d3c14459c..f181dd3d574 100644
--- a/src/mame/drivers/cyclemb.c
+++ b/src/mame/drivers/cyclemb.c
@@ -78,8 +78,8 @@ Dumped by Chack'n
class cyclemb_state : public driver_device
{
public:
- cyclemb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cyclemb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_vram;
UINT8 *m_cram;
diff --git a/src/mame/drivers/d9final.c b/src/mame/drivers/d9final.c
index 3675c3b59b4..0db84abc201 100644
--- a/src/mame/drivers/d9final.c
+++ b/src/mame/drivers/d9final.c
@@ -27,8 +27,8 @@
class d9final_state : public driver_device
{
public:
- d9final_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ d9final_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_lo_vram;
UINT8 *m_hi_vram;
diff --git a/src/mame/drivers/dacholer.c b/src/mame/drivers/dacholer.c
index 299f45c3855..bf2aa16e784 100644
--- a/src/mame/drivers/dacholer.c
+++ b/src/mame/drivers/dacholer.c
@@ -28,8 +28,8 @@
class dacholer_state : public driver_device
{
public:
- dacholer_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dacholer_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bgvideoram;
diff --git a/src/mame/drivers/dai3wksi.c b/src/mame/drivers/dai3wksi.c
index 65ff1da769f..0725fafc407 100644
--- a/src/mame/drivers/dai3wksi.c
+++ b/src/mame/drivers/dai3wksi.c
@@ -47,8 +47,8 @@ Driver Notes:
class dai3wksi_state : public driver_device
{
public:
- dai3wksi_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dai3wksi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video */
UINT8 * m_dai3wksi_videoram;
diff --git a/src/mame/drivers/dambustr.c b/src/mame/drivers/dambustr.c
index 9b016b01667..c3bbc7845e8 100644
--- a/src/mame/drivers/dambustr.c
+++ b/src/mame/drivers/dambustr.c
@@ -57,8 +57,8 @@ Stephh's notes (based on the games Z80 code and some tests) :
class dambustr_state : public galaxold_state
{
public:
- dambustr_state(running_machine &machine, const driver_device_config_base &config)
- : galaxold_state(machine, config) { }
+ dambustr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : galaxold_state(mconfig, type, tag) { }
int m_noise_data;
};
diff --git a/src/mame/drivers/darkhors.c b/src/mame/drivers/darkhors.c
index 8fbfda8cedb..809078f1edc 100644
--- a/src/mame/drivers/darkhors.c
+++ b/src/mame/drivers/darkhors.c
@@ -67,8 +67,8 @@ To do:
class darkhors_state : public driver_device
{
public:
- darkhors_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ darkhors_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_tmap;
tilemap_t *m_tmap2;
diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c
index 4fd4ca08184..b3eb26fee04 100644
--- a/src/mame/drivers/darkseal.c
+++ b/src/mame/drivers/darkseal.c
@@ -286,8 +286,8 @@ static MACHINE_CONFIG_START( darkseal, darkseal_state )
MCFG_DECO16IC_ADD("tilegen2", darkseal_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 4);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 4);
diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c
index e5c9b750348..5fc8a6cbfe1 100644
--- a/src/mame/drivers/dblewing.c
+++ b/src/mame/drivers/dblewing.c
@@ -29,8 +29,8 @@ Protection TODO:
class dblewing_state : public driver_device
{
public:
- dblewing_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dblewing_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_pf1_rowscroll;
@@ -661,9 +661,9 @@ static MACHINE_CONFIG_START( dblewing, dblewing_state )
MCFG_GFXDECODE(dblewing)
MCFG_DECO16IC_ADD("tilegen1", dblewing_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
- decospr_device_config::set_pri_callback(device, dblwings_pri_callback);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
+ decospr_device::set_pri_callback(*device, dblwings_pri_callback);
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/ddayjlc.c b/src/mame/drivers/ddayjlc.c
index 649f5b5dea2..e1cdb8afa85 100644
--- a/src/mame/drivers/ddayjlc.c
+++ b/src/mame/drivers/ddayjlc.c
@@ -59,8 +59,8 @@ $842f = lives
class ddayjlc_state : public driver_device
{
public:
- ddayjlc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ddayjlc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bgram;
diff --git a/src/mame/drivers/ddealer.c b/src/mame/drivers/ddealer.c
index abaedac0a3f..3e81e0225a3 100644
--- a/src/mame/drivers/ddealer.c
+++ b/src/mame/drivers/ddealer.c
@@ -116,8 +116,8 @@ Few words about protection:
class ddealer_state : public driver_device
{
public:
- ddealer_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ddealer_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_mcu_shared_ram;
diff --git a/src/mame/drivers/ddz.c b/src/mame/drivers/ddz.c
index b5df7663af3..3671d7ec724 100644
--- a/src/mame/drivers/ddz.c
+++ b/src/mame/drivers/ddz.c
@@ -19,8 +19,8 @@
class ddz_state : public driver_device
{
public:
- ddz_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ddz_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/de_1.c b/src/mame/drivers/de_1.c
index e7ef1fcada7..ccee575c405 100644
--- a/src/mame/drivers/de_1.c
+++ b/src/mame/drivers/de_1.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class de_1_state : public driver_device
{
public:
- de_1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ de_1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/de_2.c b/src/mame/drivers/de_2.c
index fd4c10c26d5..d55687e473d 100644
--- a/src/mame/drivers/de_2.c
+++ b/src/mame/drivers/de_2.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class de_2_state : public driver_device
{
public:
- de_2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ de_2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/de_3.c b/src/mame/drivers/de_3.c
index 980bff6bc51..e51230968e4 100644
--- a/src/mame/drivers/de_3.c
+++ b/src/mame/drivers/de_3.c
@@ -8,8 +8,8 @@ extern const char layout_pinball[];
class de_3_state : public driver_device
{
public:
- de_3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ de_3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/de_3b.c b/src/mame/drivers/de_3b.c
index 71ebbc1d6cb..089b71d2a24 100644
--- a/src/mame/drivers/de_3b.c
+++ b/src/mame/drivers/de_3b.c
@@ -8,8 +8,8 @@ extern const char layout_pinball[];
class de_3b_state : public driver_device
{
public:
- de_3b_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ de_3b_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/dec0.c b/src/mame/drivers/dec0.c
index 2c349cf984e..acadf82b895 100644
--- a/src/mame/drivers/dec0.c
+++ b/src/mame/drivers/dec0.c
@@ -1309,15 +1309,15 @@ static MACHINE_CONFIG_START( dec0_base, dec0_state )
MCFG_GFXDECODE(dec0)
MCFG_PALETTE_LENGTH(1024)
- MCFG_DEVICE_ADD("tilegen1", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 0,0,0);
- MCFG_DEVICE_ADD("tilegen2", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 0,1,0);
- MCFG_DEVICE_ADD("tilegen3", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 0,2,0);
-
- MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
- deco_mxc06_device_config::set_gfx_region(device, 3);
+ MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
+ MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 0,1,0);
+ MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 0,2,0);
+
+ MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
+ deco_mxc06_device::set_gfx_region(*device, 3);
MCFG_VIDEO_START(dec0)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c
index 1d6c25c22f6..8d623394142 100644
--- a/src/mame/drivers/dec8.c
+++ b/src/mame/drivers/dec8.c
@@ -2008,13 +2008,13 @@ static MACHINE_CONFIG_START( cobracom, dec8_state )
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
- MCFG_DEVICE_ADD("tilegen1", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 2,2,0);
- MCFG_DEVICE_ADD("tilegen2", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 3,3,0);
+ MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 2,2,0);
+ MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 3,3,0);
- MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
- deco_mxc06_device_config::set_gfx_region(device, 1);
+ MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
+ deco_mxc06_device::set_gfx_region(*device, 1);
MCFG_SCREEN_ADD("screen", RASTER)
@@ -2064,11 +2064,11 @@ static MACHINE_CONFIG_START( ghostb, dec8_state )
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
- MCFG_DEVICE_ADD("tilegen1", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 2,2,0);
+ MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 2,2,0);
- MCFG_DEVICE_ADD("spritegen", deco_karnovsprites_, 0)
- deco_karnovsprites_device_config::set_gfx_region(device, 1);
+ MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
+ deco_karnovsprites_device::set_gfx_region(*device, 1);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(58)
@@ -2121,11 +2121,11 @@ static MACHINE_CONFIG_START( oscar, dec8_state )
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
- MCFG_DEVICE_ADD("tilegen1", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 2,2,0);
+ MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 2,2,0);
- MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
- deco_mxc06_device_config::set_gfx_region(device, 1);
+ MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
+ deco_mxc06_device::set_gfx_region(*device, 1);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(58)
@@ -2219,8 +2219,8 @@ static MACHINE_CONFIG_START( gondo, dec8_state )
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
- MCFG_DEVICE_ADD("spritegen", deco_karnovsprites_, 0)
- deco_karnovsprites_device_config::set_gfx_region(device, 1);
+ MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
+ deco_karnovsprites_device::set_gfx_region(*device, 1);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(58)
@@ -2270,8 +2270,8 @@ static MACHINE_CONFIG_START( lastmisn, dec8_state )
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
- MCFG_DEVICE_ADD("spritegen", deco_karnovsprites_, 0)
- deco_karnovsprites_device_config::set_gfx_region(device, 1);
+ MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
+ deco_karnovsprites_device::set_gfx_region(*device, 1);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(58)
@@ -2320,8 +2320,8 @@ static MACHINE_CONFIG_START( shackled, dec8_state )
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
- MCFG_DEVICE_ADD("spritegen", deco_karnovsprites_, 0)
- deco_karnovsprites_device_config::set_gfx_region(device, 1);
+ MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
+ deco_karnovsprites_device::set_gfx_region(*device, 1);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(58)
@@ -2371,8 +2371,8 @@ static MACHINE_CONFIG_START( csilver, dec8_state )
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
- MCFG_DEVICE_ADD("spritegen", deco_karnovsprites_, 0)
- deco_karnovsprites_device_config::set_gfx_region(device, 1);
+ MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
+ deco_karnovsprites_device::set_gfx_region(*device, 1);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(58)
@@ -2422,8 +2422,8 @@ static MACHINE_CONFIG_START( garyoret, dec8_state )
/* video hardware */
MCFG_VIDEO_ATTRIBUTES(VIDEO_BUFFERS_SPRITERAM)
- MCFG_DEVICE_ADD("spritegen", deco_karnovsprites_, 0)
- deco_karnovsprites_device_config::set_gfx_region(device, 1);
+ MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
+ deco_karnovsprites_device::set_gfx_region(*device, 1);
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(58)
diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c
index aaded3a97f8..736c73291c1 100644
--- a/src/mame/drivers/deco156.c
+++ b/src/mame/drivers/deco156.c
@@ -26,8 +26,8 @@
class deco156_state : public driver_device
{
public:
- deco156_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ deco156_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_deco_tilegen1(*this, "tilegen1"),
m_oki2(*this, "oki2") { }
@@ -361,9 +361,9 @@ static MACHINE_CONFIG_START( hvysmsh, deco156_state )
MCFG_VIDEO_START(wcvol95)
MCFG_DECO16IC_ADD("tilegen1", deco156_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
- decospr_device_config::set_pri_callback(device, deco156_pri_callback);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
+ decospr_device::set_pri_callback(*device, deco156_pri_callback);
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -400,9 +400,9 @@ static MACHINE_CONFIG_START( wcvol95, deco156_state )
MCFG_VIDEO_START(wcvol95)
MCFG_DECO16IC_ADD("tilegen1", deco156_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
- decospr_device_config::set_pri_callback(device, deco156_pri_callback);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
+ decospr_device::set_pri_callback(*device, deco156_pri_callback);
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index 0ad3ece6fb0..96f9610d127 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -1830,9 +1830,9 @@ static MACHINE_CONFIG_START( captaven, deco32_state )
MCFG_DECO16IC_ADD("tilegen1", captaven_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", captaven_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 3);
- decospr_device_config::set_pri_callback(device, captaven_pri_callback);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 3);
+ decospr_device::set_pri_callback(*device, captaven_pri_callback);
MCFG_VIDEO_START(captaven)
@@ -1881,8 +1881,8 @@ static MACHINE_CONFIG_START( fghthist, deco32_state )
MCFG_DECO16IC_ADD("tilegen1", fghthist_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", fghthist_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 3);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 3);
MCFG_VIDEO_START(fghthist)
@@ -1928,8 +1928,8 @@ static MACHINE_CONFIG_START( fghthsta, deco32_state )
MCFG_DECO16IC_ADD("tilegen1", fghthist_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", fghthist_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 3);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 3);
MCFG_VIDEO_START(fghthist)
@@ -2180,11 +2180,11 @@ static MACHINE_CONFIG_START( tattass, deco32_state )
MCFG_DECO16IC_ADD("tilegen1", tattass_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", tattass_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen1", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 3);
+ MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 3);
- MCFG_DEVICE_ADD("spritegen2", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 4);
+ MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 4);
MCFG_GFXDECODE(tattass)
@@ -2226,11 +2226,11 @@ static MACHINE_CONFIG_START( nslasher, deco32_state )
MCFG_DECO16IC_ADD("tilegen1", tattass_deco16ic_tilegen1_intf)
MCFG_DECO16IC_ADD("tilegen2", tattass_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen1", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 3);
+ MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 3);
- MCFG_DEVICE_ADD("spritegen2", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 4);
+ MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 4);
MCFG_GFXDECODE(nslasher)
MCFG_PALETTE_LENGTH(2048)
diff --git a/src/mame/drivers/deco_ld.c b/src/mame/drivers/deco_ld.c
index 0a1ff9ec9a0..b9caf2d412b 100644
--- a/src/mame/drivers/deco_ld.c
+++ b/src/mame/drivers/deco_ld.c
@@ -110,8 +110,8 @@ Sound processor - 6502
class deco_ld_state : public driver_device
{
public:
- deco_ld_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ deco_ld_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_vram_bank;
diff --git a/src/mame/drivers/deshoros.c b/src/mame/drivers/deshoros.c
index 6d3ed560262..c9fb4eee0a6 100644
--- a/src/mame/drivers/deshoros.c
+++ b/src/mame/drivers/deshoros.c
@@ -19,8 +19,8 @@ TODO:
class deshoros_state : public driver_device
{
public:
- deshoros_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ deshoros_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_io_ram;
char m_led_array[21];
diff --git a/src/mame/drivers/destroyr.c b/src/mame/drivers/destroyr.c
index 2009c666302..a9501a40b5d 100644
--- a/src/mame/drivers/destroyr.c
+++ b/src/mame/drivers/destroyr.c
@@ -11,8 +11,8 @@ Atari Destroyer Driver
class destroyr_state : public driver_device
{
public:
- destroyr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ destroyr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_major_obj_ram;
diff --git a/src/mame/drivers/dfruit.c b/src/mame/drivers/dfruit.c
index 9a5543ef058..35aa5a5534c 100644
--- a/src/mame/drivers/dfruit.c
+++ b/src/mame/drivers/dfruit.c
@@ -16,8 +16,8 @@
class dfruit_state : public driver_device
{
public:
- dfruit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dfruit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static VIDEO_START( dfruit )
diff --git a/src/mame/drivers/dgpix.c b/src/mame/drivers/dgpix.c
index e1774d8bbf3..a62ac083e26 100644
--- a/src/mame/drivers/dgpix.c
+++ b/src/mame/drivers/dgpix.c
@@ -56,8 +56,8 @@
class dgpix_state : public driver_device
{
public:
- dgpix_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dgpix_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_vram;
int m_vbuffer;
diff --git a/src/mame/drivers/dietgo.c b/src/mame/drivers/dietgo.c
index 6cc1060f06f..02e9d5367af 100644
--- a/src/mame/drivers/dietgo.c
+++ b/src/mame/drivers/dietgo.c
@@ -232,8 +232,8 @@ static MACHINE_CONFIG_START( dietgo, dietgo_state )
MCFG_DECO16IC_ADD("tilegen1", dietgo_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/discoboy.c b/src/mame/drivers/discoboy.c
index c955aab456f..6b5aa5f638d 100644
--- a/src/mame/drivers/discoboy.c
+++ b/src/mame/drivers/discoboy.c
@@ -45,8 +45,8 @@ Notes:
class discoboy_state : public driver_device
{
public:
- discoboy_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ discoboy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
UINT8 m_ram_bank;
diff --git a/src/mame/drivers/diverboy.c b/src/mame/drivers/diverboy.c
index 739f65bca69..b63c02c6da0 100644
--- a/src/mame/drivers/diverboy.c
+++ b/src/mame/drivers/diverboy.c
@@ -56,8 +56,8 @@
class diverboy_state : public driver_device
{
public:
- diverboy_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ diverboy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram;
diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c
index 4ea2f8f1c64..41afa24f2f2 100644
--- a/src/mame/drivers/dlair.c
+++ b/src/mame/drivers/dlair.c
@@ -47,8 +47,8 @@
class dlair_state : public driver_device
{
public:
- dlair_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dlair_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
laserdisc_device *m_laserdisc;
diff --git a/src/mame/drivers/dmndrby.c b/src/mame/drivers/dmndrby.c
index 6e6f5ececa1..098c927f6bb 100644
--- a/src/mame/drivers/dmndrby.c
+++ b/src/mame/drivers/dmndrby.c
@@ -59,8 +59,8 @@ DD10 DD14 DD18 H5 DD21
class dmndrby_state : public driver_device
{
public:
- dmndrby_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dmndrby_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8* m_dderby_vidchars;
UINT8* m_scroll_ram;
diff --git a/src/mame/drivers/dominob.c b/src/mame/drivers/dominob.c
index 6510b6c88fc..51c4bd9067e 100644
--- a/src/mame/drivers/dominob.c
+++ b/src/mame/drivers/dominob.c
@@ -67,8 +67,8 @@ Notes:
class dominob_state : public driver_device
{
public:
- dominob_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dominob_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_spriteram;
diff --git a/src/mame/drivers/dorachan.c b/src/mame/drivers/dorachan.c
index d232a271666..27634a1c144 100644
--- a/src/mame/drivers/dorachan.c
+++ b/src/mame/drivers/dorachan.c
@@ -18,8 +18,8 @@ Todo:
class dorachan_state : public driver_device
{
public:
- dorachan_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dorachan_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/dotrikun.c b/src/mame/drivers/dotrikun.c
index 638f3936e1c..e6fe476c01b 100644
--- a/src/mame/drivers/dotrikun.c
+++ b/src/mame/drivers/dotrikun.c
@@ -27,8 +27,8 @@ SOUND : (none)
class dotrikun_state : public driver_device
{
public:
- dotrikun_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dotrikun_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_dotrikun_bitmap;
diff --git a/src/mame/drivers/dreamwld.c b/src/mame/drivers/dreamwld.c
index a7aa5b0ed10..66591b7b8ba 100644
--- a/src/mame/drivers/dreamwld.c
+++ b/src/mame/drivers/dreamwld.c
@@ -93,8 +93,8 @@ Stephh's notes (based on the game M68EC020 code and some tests) :
class dreamwld_state : public driver_device
{
public:
- dreamwld_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dreamwld_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT32 * m_bg_videoram;
diff --git a/src/mame/drivers/drtomy.c b/src/mame/drivers/drtomy.c
index 27f514291df..7624f0f1dd4 100644
--- a/src/mame/drivers/drtomy.c
+++ b/src/mame/drivers/drtomy.c
@@ -14,8 +14,8 @@ similar hardware.
class drtomy_state : public driver_device
{
public:
- drtomy_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ drtomy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram;
diff --git a/src/mame/drivers/drw80pkr.c b/src/mame/drivers/drw80pkr.c
index 82a9d225477..9804a811be4 100644
--- a/src/mame/drivers/drw80pkr.c
+++ b/src/mame/drivers/drw80pkr.c
@@ -34,8 +34,8 @@
class drw80pkr_state : public driver_device
{
public:
- drw80pkr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ drw80pkr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_bg_tilemap;
UINT8 m_t0;
diff --git a/src/mame/drivers/dunhuang.c b/src/mame/drivers/dunhuang.c
index dbef3166ac6..a4c48a1fe4e 100644
--- a/src/mame/drivers/dunhuang.c
+++ b/src/mame/drivers/dunhuang.c
@@ -61,8 +61,8 @@ Notes:
class dunhuang_state : public driver_device
{
public:
- dunhuang_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dunhuang_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
tilemap_t *m_tmap;
diff --git a/src/mame/drivers/dwarfd.c b/src/mame/drivers/dwarfd.c
index ee555dc3a03..09780a94111 100644
--- a/src/mame/drivers/dwarfd.c
+++ b/src/mame/drivers/dwarfd.c
@@ -281,8 +281,8 @@ uPC1352C @ N3
class dwarfd_state : public driver_device
{
public:
- dwarfd_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dwarfd_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
int m_bank;
diff --git a/src/mame/drivers/dynadice.c b/src/mame/drivers/dynadice.c
index 652ba8f5018..499b81d2602 100644
--- a/src/mame/drivers/dynadice.c
+++ b/src/mame/drivers/dynadice.c
@@ -41,8 +41,8 @@ dy_6.bin (near Z80)
class dynadice_state : public driver_device
{
public:
- dynadice_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dynadice_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/egghunt.c b/src/mame/drivers/egghunt.c
index 0a7cf7847ca..42d9c3a2115 100644
--- a/src/mame/drivers/egghunt.c
+++ b/src/mame/drivers/egghunt.c
@@ -48,8 +48,8 @@ I dumped it with this configuration. In case I'll redump it desoldering pin 16 f
class egghunt_state : public driver_device
{
public:
- egghunt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ egghunt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/drivers/embargo.c b/src/mame/drivers/embargo.c
index 2fbafb9c807..a75eb6e759f 100644
--- a/src/mame/drivers/embargo.c
+++ b/src/mame/drivers/embargo.c
@@ -11,8 +11,8 @@
class embargo_state : public driver_device
{
public:
- embargo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ embargo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c
index 6407747150d..cac3719696b 100644
--- a/src/mame/drivers/enigma2.c
+++ b/src/mame/drivers/enigma2.c
@@ -59,8 +59,8 @@ TODO:
class enigma2_state : public driver_device
{
public:
- enigma2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ enigma2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/eolith16.c b/src/mame/drivers/eolith16.c
index 44f21be9206..ed6755fd69e 100644
--- a/src/mame/drivers/eolith16.c
+++ b/src/mame/drivers/eolith16.c
@@ -20,8 +20,8 @@
class eolith16_state : public driver_device
{
public:
- eolith16_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ eolith16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_vram;
int m_vbuffer;
diff --git a/src/mame/drivers/ertictac.c b/src/mame/drivers/ertictac.c
index 21c7c93e5a5..bf5108ee4d4 100644
--- a/src/mame/drivers/ertictac.c
+++ b/src/mame/drivers/ertictac.c
@@ -29,8 +29,8 @@
class ertictac_state : public driver_device
{
public:
- ertictac_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ertictac_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/esh.c b/src/mame/drivers/esh.c
index 5ce237044c1..39142cf3e7b 100644
--- a/src/mame/drivers/esh.c
+++ b/src/mame/drivers/esh.c
@@ -31,8 +31,8 @@ Todo:
class esh_state : public driver_device
{
public:
- esh_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ esh_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
device_t *m_laserdisc;
UINT8 *m_tile_ram;
diff --git a/src/mame/drivers/ettrivia.c b/src/mame/drivers/ettrivia.c
index bff8b899d41..bb089257e23 100644
--- a/src/mame/drivers/ettrivia.c
+++ b/src/mame/drivers/ettrivia.c
@@ -34,8 +34,8 @@ Notes:
class ettrivia_state : public driver_device
{
public:
- ettrivia_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ettrivia_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_palreg;
int m_gfx_bank;
diff --git a/src/mame/drivers/expro02.c b/src/mame/drivers/expro02.c
index fcf2899420a..3ab0e9c11d6 100644
--- a/src/mame/drivers/expro02.c
+++ b/src/mame/drivers/expro02.c
@@ -156,8 +156,8 @@ the layer is misplaced however, different scroll regs?
class expro02_state : public kaneko16_state
{
public:
- expro02_state(running_machine &machine, const driver_device_config_base &config)
- : kaneko16_state(machine, config) { }
+ expro02_state(const machine_config &mconfig, device_type type, const char *tag)
+ : kaneko16_state(mconfig, type, tag) { }
UINT16 m_vram_0_bank_num;
UINT16 m_vram_1_bank_num;
diff --git a/src/mame/drivers/f-32.c b/src/mame/drivers/f-32.c
index ab2d4c437ae..ee7a31d4406 100644
--- a/src/mame/drivers/f-32.c
+++ b/src/mame/drivers/f-32.c
@@ -20,8 +20,8 @@
class mosaicf2_state : public driver_device
{
public:
- mosaicf2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ mosaicf2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu") { }
/* memory pointers */
diff --git a/src/mame/drivers/famibox.c b/src/mame/drivers/famibox.c
index 794c34b1edc..4c516e830e1 100644
--- a/src/mame/drivers/famibox.c
+++ b/src/mame/drivers/famibox.c
@@ -55,8 +55,8 @@ Takahashi Meijin no Boukenjima; Tennis; Wild Gunman; Wrecking Crew.
class famibox_state : public driver_device
{
public:
- famibox_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ famibox_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/feversoc.c b/src/mame/drivers/feversoc.c
index df2cb04fb7f..27121bc5841 100644
--- a/src/mame/drivers/feversoc.c
+++ b/src/mame/drivers/feversoc.c
@@ -67,8 +67,8 @@ U0564 LH28F800SU OBJ4-1
class feversoc_state : public driver_device
{
public:
- feversoc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ feversoc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_x;
UINT32 *m_spriteram;
diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c
index 3937a3cb6fd..06f91283341 100644
--- a/src/mame/drivers/firebeat.c
+++ b/src/mame/drivers/firebeat.c
@@ -146,8 +146,8 @@ typedef struct
class firebeat_state : public driver_device
{
public:
- firebeat_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ firebeat_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_extend_board_irq_enable;
UINT8 m_extend_board_irq_active;
@@ -518,7 +518,7 @@ static SCREEN_UPDATE(firebeat)
firebeat_state *state = screen->machine().driver_data<firebeat_state>();
int chip;
- if (screen == screen->machine().m_devicelist.find(SCREEN, 0))
+ if (screen == screen->machine().devicelist().find(SCREEN, 0))
chip = 0;
else
chip = 1;
@@ -649,7 +649,7 @@ static void GCU_w(running_machine &machine, int chip, UINT32 offset, UINT32 data
COMBINE_DATA( &state->m_gcu[chip].visible_area );
if (ACCESSING_BITS_0_15)
{
- screen_device *screen = downcast<screen_device *>(machine.m_devicelist.find(SCREEN, chip));
+ screen_device *screen = downcast<screen_device *>(machine.devicelist().find(SCREEN, chip));
if (screen != NULL)
{
diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c
index fc6196e1b5d..f3bcaf499f5 100644
--- a/src/mame/drivers/firefox.c
+++ b/src/mame/drivers/firefox.c
@@ -38,8 +38,8 @@ but requires a special level III player for proper control. Video: CAV. Audio: A
class firefox_state : public driver_device
{
public:
- firefox_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ firefox_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
device_t *m_laserdisc;
int m_n_disc_lock;
diff --git a/src/mame/drivers/flicker.c b/src/mame/drivers/flicker.c
index 0aa0868735b..77d20e58a86 100644
--- a/src/mame/drivers/flicker.c
+++ b/src/mame/drivers/flicker.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class flicker_state : public driver_device
{
public:
- flicker_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ flicker_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/flyball.c b/src/mame/drivers/flyball.c
index 0a7c673b31a..0554ed59e36 100644
--- a/src/mame/drivers/flyball.c
+++ b/src/mame/drivers/flyball.c
@@ -14,8 +14,8 @@ Atari Flyball Driver
class flyball_state : public driver_device
{
public:
- flyball_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ flyball_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_rombase;
diff --git a/src/mame/drivers/forte2.c b/src/mame/drivers/forte2.c
index 65de163a12d..9c88c5c92f8 100644
--- a/src/mame/drivers/forte2.c
+++ b/src/mame/drivers/forte2.c
@@ -29,8 +29,8 @@ found/dumped yet. */
class forte2_state : public driver_device
{
public:
- forte2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ forte2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_input_mask;
};
diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c
index 9442014f251..91b1eecd0fe 100644
--- a/src/mame/drivers/fortecar.c
+++ b/src/mame/drivers/fortecar.c
@@ -35,8 +35,8 @@ dip 1X8
class fortecar_state : public driver_device
{
public:
- fortecar_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ fortecar_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_ram;
int m_bank;
diff --git a/src/mame/drivers/funkball.c b/src/mame/drivers/funkball.c
index cb72831f53c..890c28771fb 100644
--- a/src/mame/drivers/funkball.c
+++ b/src/mame/drivers/funkball.c
@@ -69,8 +69,8 @@ Notes:
class funkball_state : public driver_device
{
public:
- funkball_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ funkball_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/funkyjet.c b/src/mame/drivers/funkyjet.c
index 339fbf5be06..440b8c878c1 100644
--- a/src/mame/drivers/funkyjet.c
+++ b/src/mame/drivers/funkyjet.c
@@ -331,8 +331,8 @@ static MACHINE_CONFIG_START( funkyjet, funkyjet_state )
MCFG_PALETTE_LENGTH(1024)
MCFG_DECO16IC_ADD("tilegen1", funkyjet_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/g627.c b/src/mame/drivers/g627.c
index 908556c3159..7dcaf4a2782 100644
--- a/src/mame/drivers/g627.c
+++ b/src/mame/drivers/g627.c
@@ -13,8 +13,8 @@ extern const char layout_pinball[];
class g627_state : public driver_device
{
public:
- g627_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ g627_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/gal3.c b/src/mame/drivers/gal3.c
index 7cd9adfc726..c6ae9f1f945 100644
--- a/src/mame/drivers/gal3.c
+++ b/src/mame/drivers/gal3.c
@@ -136,8 +136,8 @@ better notes (complete chip lists) for each board still needed
class gal3_state : public driver_device
{
public:
- gal3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gal3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_mpSharedRAM0;
//UINT32 *m_mpSharedRAM1;
diff --git a/src/mame/drivers/galaxi.c b/src/mame/drivers/galaxi.c
index fdedd143f91..5b491c7738f 100644
--- a/src/mame/drivers/galaxi.c
+++ b/src/mame/drivers/galaxi.c
@@ -48,8 +48,8 @@ Notes:
class galaxi_state : public driver_device
{
public:
- galaxi_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ galaxi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bg1_ram;
diff --git a/src/mame/drivers/galaxia.c b/src/mame/drivers/galaxia.c
index 2596e3f03eb..18f0ff98025 100644
--- a/src/mame/drivers/galaxia.c
+++ b/src/mame/drivers/galaxia.c
@@ -32,8 +32,8 @@ TS 2008.08.12:
class galaxia_state : public driver_device
{
public:
- galaxia_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ galaxia_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_video;
UINT8 *m_color;
diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c
index 96db48b387f..19180f6d081 100644
--- a/src/mame/drivers/galpani3.c
+++ b/src/mame/drivers/galpani3.c
@@ -71,8 +71,8 @@ Dumped by Uki
class galpani3_state : public kaneko16_state
{
public:
- galpani3_state(running_machine &machine, const driver_device_config_base &config)
- : kaneko16_state(machine, config) { }
+ galpani3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : kaneko16_state(mconfig, type, tag) { }
UINT16* m_priority_buffer;
UINT16* m_framebuffer1;
@@ -964,7 +964,7 @@ static MACHINE_CONFIG_START( galpani3, galpani3_state )
MCFG_VIDEO_START(galpani3)
- MCFG_DEVICE_ADD("spritegen", sknsspr_, 0)
+ MCFG_DEVICE_ADD("spritegen", SKNS_SPRITE, 0)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c
index 9dbdc5b40ff..8123bbd381c 100644
--- a/src/mame/drivers/gamecstl.c
+++ b/src/mame/drivers/gamecstl.c
@@ -77,8 +77,8 @@
class gamecstl_state : public driver_device
{
public:
- gamecstl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gamecstl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_cga_ram;
UINT32 *m_bios_ram;
diff --git a/src/mame/drivers/gei.c b/src/mame/drivers/gei.c
index 681a06f7685..a5c86c16b13 100644
--- a/src/mame/drivers/gei.c
+++ b/src/mame/drivers/gei.c
@@ -76,8 +76,8 @@ U.S.A. Trivia New Sports General Facts
class gei_state : public driver_device
{
public:
- gei_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gei_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_drawctrl[3];
UINT8 m_color[8];
diff --git a/src/mame/drivers/ggconnie.c b/src/mame/drivers/ggconnie.c
index 8a243a35309..e44ce72f629 100644
--- a/src/mame/drivers/ggconnie.c
+++ b/src/mame/drivers/ggconnie.c
@@ -27,8 +27,8 @@
class ggconnie_state : public driver_device
{
public:
- ggconnie_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ggconnie_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c
index 9d6150955e0..5e511d1f387 100644
--- a/src/mame/drivers/ghosteo.c
+++ b/src/mame/drivers/ghosteo.c
@@ -77,8 +77,8 @@ struct nand_t
class ghosteo_state : public driver_device
{
public:
- ghosteo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ghosteo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_system_memory;
UINT32 *m_steppingstone;
diff --git a/src/mame/drivers/go2000.c b/src/mame/drivers/go2000.c
index c0b36cfc58a..d729e4db146 100644
--- a/src/mame/drivers/go2000.c
+++ b/src/mame/drivers/go2000.c
@@ -37,8 +37,8 @@ Notes:
class go2000_state : public driver_device
{
public:
- go2000_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ go2000_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/drivers/goldngam.c b/src/mame/drivers/goldngam.c
index 6d208d8fad6..e1401e19586 100644
--- a/src/mame/drivers/goldngam.c
+++ b/src/mame/drivers/goldngam.c
@@ -240,8 +240,8 @@
class goldngam_state : public driver_device
{
public:
- goldngam_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ goldngam_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
};
diff --git a/src/mame/drivers/goldnpkr.c b/src/mame/drivers/goldnpkr.c
index dea476e57f6..b50edc40ef8 100644
--- a/src/mame/drivers/goldnpkr.c
+++ b/src/mame/drivers/goldnpkr.c
@@ -702,8 +702,8 @@
class goldnpkr_state : public driver_device
{
public:
- goldnpkr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ goldnpkr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/drivers/good.c b/src/mame/drivers/good.c
index 20ad6f266af..8f273c147f3 100644
--- a/src/mame/drivers/good.c
+++ b/src/mame/drivers/good.c
@@ -38,8 +38,8 @@ voice.rom - VOICE ROM
class good_state : public driver_device
{
public:
- good_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ good_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bg_tilemapram;
diff --git a/src/mame/drivers/goodejan.c b/src/mame/drivers/goodejan.c
index a985adcf38d..65c7f5373d5 100644
--- a/src/mame/drivers/goodejan.c
+++ b/src/mame/drivers/goodejan.c
@@ -60,8 +60,8 @@ Notes:
class goodejan_state : public driver_device
{
public:
- goodejan_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ goodejan_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_mux_data;
};
diff --git a/src/mame/drivers/gottlieb.c b/src/mame/drivers/gottlieb.c
index 0bf074cb2c8..34eb1bba034 100644
--- a/src/mame/drivers/gottlieb.c
+++ b/src/mame/drivers/gottlieb.c
@@ -244,7 +244,7 @@ static MACHINE_START( gottlieb )
state_save_register_global_array(machine, state->m_track);
/* see if we have a laserdisc */
- state->m_laserdisc = machine.m_devicelist.first(LASERDISC);
+ state->m_laserdisc = machine.devicelist().first(LASERDISC);
if (state->m_laserdisc != NULL)
{
/* attach to the I/O ports */
diff --git a/src/mame/drivers/gp_1.c b/src/mame/drivers/gp_1.c
index e5b255881d9..3f557779517 100644
--- a/src/mame/drivers/gp_1.c
+++ b/src/mame/drivers/gp_1.c
@@ -10,8 +10,8 @@ extern const char layout_pinball[];
class gp_1_state : public driver_device
{
public:
- gp_1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gp_1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/gp_2.c b/src/mame/drivers/gp_2.c
index 82da6ae9fb2..7f343426f17 100644
--- a/src/mame/drivers/gp_2.c
+++ b/src/mame/drivers/gp_2.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class gp_2_state : public driver_device
{
public:
- gp_2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gp_2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/gpworld.c b/src/mame/drivers/gpworld.c
index a1172cfb65e..7bf254f4804 100644
--- a/src/mame/drivers/gpworld.c
+++ b/src/mame/drivers/gpworld.c
@@ -47,8 +47,8 @@ Dumping Notes:
class gpworld_state : public driver_device
{
public:
- gpworld_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gpworld_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_nmi_enable;
UINT8 m_start_lamp;
diff --git a/src/mame/drivers/gstream.c b/src/mame/drivers/gstream.c
index b8a066fb632..d506503afb9 100644
--- a/src/mame/drivers/gstream.c
+++ b/src/mame/drivers/gstream.c
@@ -128,8 +128,8 @@ RAM4 is HMC HM6264LP-70
class gstream_state : public driver_device
{
public:
- gstream_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ gstream_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_oki_1(*this, "oki1"),
m_oki_2(*this, "oki2") { }
diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c
index 0e6f7f02c56..8815416b46c 100644
--- a/src/mame/drivers/gticlub.c
+++ b/src/mame/drivers/gticlub.c
@@ -238,8 +238,8 @@ Hang Pilot (uses an unknown but similar video board) 12W
class gticlub_state : public driver_device
{
public:
- gticlub_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gticlub_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_work_ram;
UINT32 *m_sharc_dataram_0;
diff --git a/src/mame/drivers/gts1.c b/src/mame/drivers/gts1.c
index 327d05e7a7b..b9be83d3cdc 100644
--- a/src/mame/drivers/gts1.c
+++ b/src/mame/drivers/gts1.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class gts1_state : public driver_device
{
public:
- gts1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gts1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/gts3.c b/src/mame/drivers/gts3.c
index d5a2426a584..2f4bb5d330a 100644
--- a/src/mame/drivers/gts3.c
+++ b/src/mame/drivers/gts3.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class gts3_state : public driver_device
{
public:
- gts3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gts3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/gts80.c b/src/mame/drivers/gts80.c
index 6e210ca32c5..dc9ffcc5eb9 100644
--- a/src/mame/drivers/gts80.c
+++ b/src/mame/drivers/gts80.c
@@ -12,8 +12,8 @@ extern const char layout_pinball[];
class gts80_state : public driver_device
{
public:
- gts80_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gts80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( gts80_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/gts80a.c b/src/mame/drivers/gts80a.c
index 6a31ecb7b64..82c958849a0 100644
--- a/src/mame/drivers/gts80a.c
+++ b/src/mame/drivers/gts80a.c
@@ -13,8 +13,8 @@ extern const char layout_pinball[];
class gts80a_state : public driver_device
{
public:
- gts80a_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gts80a_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( gts80a_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/gts80b.c b/src/mame/drivers/gts80b.c
index 7b40b7405d0..fc318c854d1 100644
--- a/src/mame/drivers/gts80b.c
+++ b/src/mame/drivers/gts80b.c
@@ -12,8 +12,8 @@ extern const char layout_pinball[];
class gts80b_state : public driver_device
{
public:
- gts80b_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gts80b_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( gts80b_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c
index cb50b71a1c9..24a1d258712 100644
--- a/src/mame/drivers/guab.c
+++ b/src/mame/drivers/guab.c
@@ -75,8 +75,8 @@ struct wd1770
class guab_state : public driver_device
{
public:
- guab_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ guab_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
struct ef9369 m_pal;
emu_timer *m_fdc_timer;
diff --git a/src/mame/drivers/gunpey.c b/src/mame/drivers/gunpey.c
index f3355e525d4..6d00f41a4fc 100644
--- a/src/mame/drivers/gunpey.c
+++ b/src/mame/drivers/gunpey.c
@@ -54,8 +54,8 @@ Notes:
class gunpey_state : public driver_device
{
public:
- gunpey_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gunpey_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_blit_buffer;
UINT16 m_blit_ram[0x10];
diff --git a/src/mame/drivers/halleys.c b/src/mame/drivers/halleys.c
index c35c0c283b2..4c8d22303af 100644
--- a/src/mame/drivers/halleys.c
+++ b/src/mame/drivers/halleys.c
@@ -208,8 +208,8 @@ Video sync 6 F Video sync Post 6 F Post
class halleys_state : public driver_device
{
public:
- halleys_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ halleys_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_render_layer[MAX_LAYERS];
UINT8 m_sound_fifo[MAX_SOUNDS];
diff --git a/src/mame/drivers/hankin.c b/src/mame/drivers/hankin.c
index 151f61d2819..b2dc3c81e09 100644
--- a/src/mame/drivers/hankin.c
+++ b/src/mame/drivers/hankin.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class hankin_state : public driver_device
{
public:
- hankin_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hankin_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/highvdeo.c b/src/mame/drivers/highvdeo.c
index da6097257a6..c53181aca83 100644
--- a/src/mame/drivers/highvdeo.c
+++ b/src/mame/drivers/highvdeo.c
@@ -93,8 +93,8 @@ Game is V30 based, with rom banking (2Mb)
class highvdeo_state : public driver_device
{
public:
- highvdeo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ highvdeo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_blit_ram;
UINT16 m_vblank_bit;
diff --git a/src/mame/drivers/hitpoker.c b/src/mame/drivers/hitpoker.c
index bf36f9bdeb4..952591ddd6f 100644
--- a/src/mame/drivers/hitpoker.c
+++ b/src/mame/drivers/hitpoker.c
@@ -51,8 +51,8 @@ Some debug tricks (let's test this CPU as more as possible):
class hitpoker_state : public driver_device
{
public:
- hitpoker_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hitpoker_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_sys_regs;
UINT8 m_pic_data;
diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c
index 6394e1d1372..eda64285063 100644
--- a/src/mame/drivers/hornet.c
+++ b/src/mame/drivers/hornet.c
@@ -326,8 +326,8 @@
class hornet_state : public driver_device
{
public:
- hornet_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hornet_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_led_reg0;
UINT8 m_led_reg1;
diff --git a/src/mame/drivers/hotblock.c b/src/mame/drivers/hotblock.c
index c4026f1352f..3ca8165d8ff 100644
--- a/src/mame/drivers/hotblock.c
+++ b/src/mame/drivers/hotblock.c
@@ -48,8 +48,8 @@ so it could be by them instead
class hotblock_state : public driver_device
{
public:
- hotblock_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hotblock_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_vram;
diff --git a/src/mame/drivers/hotstuff.c b/src/mame/drivers/hotstuff.c
index f75582e291e..17ddf65cafc 100644
--- a/src/mame/drivers/hotstuff.c
+++ b/src/mame/drivers/hotstuff.c
@@ -7,8 +7,8 @@
class hotstuff_state : public driver_device
{
public:
- hotstuff_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hotstuff_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16* m_bitmapram;
};
diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c
index b7f0d4909de..856701c62c6 100644
--- a/src/mame/drivers/hvyunit.c
+++ b/src/mame/drivers/hvyunit.c
@@ -75,8 +75,8 @@ To Do:
class hvyunit_state : public driver_device
{
public:
- hvyunit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hvyunit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* Video */
UINT8 *m_videoram;
diff --git a/src/mame/drivers/icecold.c b/src/mame/drivers/icecold.c
index ca67be4bb98..29e3bfcc3e0 100644
--- a/src/mame/drivers/icecold.c
+++ b/src/mame/drivers/icecold.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class icecold_state : public driver_device
{
public:
- icecold_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ icecold_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/igs009.c b/src/mame/drivers/igs009.c
index 8fb555f3050..31db6fbd458 100644
--- a/src/mame/drivers/igs009.c
+++ b/src/mame/drivers/igs009.c
@@ -26,8 +26,8 @@ NVRAM : Battery for main RAM
class igs009_state : public driver_device
{
public:
- igs009_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ igs009_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_gp98_reel1_tilemap;
UINT8 *m_gp98_reel1_ram;
diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c
index 05c2e3c9310..51aaede3507 100644
--- a/src/mame/drivers/igs011.c
+++ b/src/mame/drivers/igs011.c
@@ -84,8 +84,8 @@ struct blitter_t
class igs011_state : public driver_device
{
public:
- igs011_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ igs011_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_layer[8];
UINT16 m_priority;
diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c
index bb0a24c1cd7..e7365615f68 100644
--- a/src/mame/drivers/igs017.c
+++ b/src/mame/drivers/igs017.c
@@ -54,8 +54,8 @@ Notes:
class igs017_state : public driver_device
{
public:
- igs017_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ igs017_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_toggle;
int m_debug_addr;
diff --git a/src/mame/drivers/igs_m027.c b/src/mame/drivers/igs_m027.c
index f8d19959f3a..8076770e61a 100644
--- a/src/mame/drivers/igs_m027.c
+++ b/src/mame/drivers/igs_m027.c
@@ -23,8 +23,8 @@
class igs_m027_state : public driver_device
{
public:
- igs_m027_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ igs_m027_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_igs_mainram;
UINT32 *m_igs_cg_videoram;
diff --git a/src/mame/drivers/igspoker.c b/src/mame/drivers/igspoker.c
index e07fc31a682..bfcf5bb7e22 100644
--- a/src/mame/drivers/igspoker.c
+++ b/src/mame/drivers/igspoker.c
@@ -75,8 +75,8 @@ FIX: PK Tetris have an input named AMUSE which I couldn't map. Maybe it is
class igspoker_state : public driver_device
{
public:
- igspoker_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ igspoker_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_nmi_enable;
int m_bg_enable;
diff --git a/src/mame/drivers/imolagp.c b/src/mame/drivers/imolagp.c
index 0fd2b627f49..01fd4f280cc 100644
--- a/src/mame/drivers/imolagp.c
+++ b/src/mame/drivers/imolagp.c
@@ -86,8 +86,8 @@ Known issues:
class imolagp_state : public driver_device
{
public:
- imolagp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ imolagp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_slave_workram; // used only ifdef HLE_COM
diff --git a/src/mame/drivers/inder.c b/src/mame/drivers/inder.c
index b414f42e54c..555034c6101 100644
--- a/src/mame/drivers/inder.c
+++ b/src/mame/drivers/inder.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class inder_state : public driver_device
{
public:
- inder_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ inder_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( inder_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/intrscti.c b/src/mame/drivers/intrscti.c
index afc769100f5..eda85942b30 100644
--- a/src/mame/drivers/intrscti.c
+++ b/src/mame/drivers/intrscti.c
@@ -18,8 +18,8 @@ I've not had a chance to wire up the board yet, but it might be possible to writ
class intrscti_state : public driver_device
{
public:
- intrscti_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ intrscti_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_ram;
};
diff --git a/src/mame/drivers/istellar.c b/src/mame/drivers/istellar.c
index 8a28e29ed52..aa9b8d8ad2a 100644
--- a/src/mame/drivers/istellar.c
+++ b/src/mame/drivers/istellar.c
@@ -28,8 +28,8 @@ Todo:
class istellar_state : public driver_device
{
public:
- istellar_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ istellar_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
device_t *m_laserdisc;
UINT8 *m_tile_ram;
diff --git a/src/mame/drivers/itgambl2.c b/src/mame/drivers/itgambl2.c
index 0ae8d1ba5a9..ad07c1e4edb 100644
--- a/src/mame/drivers/itgambl2.c
+++ b/src/mame/drivers/itgambl2.c
@@ -60,8 +60,8 @@
class itgambl2_state : public driver_device
{
public:
- itgambl2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ itgambl2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_test_x;
int m_test_y;
diff --git a/src/mame/drivers/itgambl3.c b/src/mame/drivers/itgambl3.c
index 7f6c22a9218..a6ec26a75f0 100644
--- a/src/mame/drivers/itgambl3.c
+++ b/src/mame/drivers/itgambl3.c
@@ -48,8 +48,8 @@
class itgambl3_state : public driver_device
{
public:
- itgambl3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ itgambl3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_test_x;
int m_test_y;
diff --git a/src/mame/drivers/itgamble.c b/src/mame/drivers/itgamble.c
index 2c2e1fd3ed7..c25c3c7fe3d 100644
--- a/src/mame/drivers/itgamble.c
+++ b/src/mame/drivers/itgamble.c
@@ -61,8 +61,8 @@
class itgamble_state : public driver_device
{
public:
- itgamble_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ itgamble_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/jackie.c b/src/mame/drivers/jackie.c
index 2d7549fb79e..be867cf61a9 100644
--- a/src/mame/drivers/jackie.c
+++ b/src/mame/drivers/jackie.c
@@ -52,8 +52,8 @@ Note
class jackie_state : public driver_device
{
public:
- jackie_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jackie_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_exp_bank;
UINT8 *m_fg_tile_ram;
diff --git a/src/mame/drivers/jackpool.c b/src/mame/drivers/jackpool.c
index e833bffb410..d279af6bf71 100644
--- a/src/mame/drivers/jackpool.c
+++ b/src/mame/drivers/jackpool.c
@@ -24,8 +24,8 @@ TODO:
class jackpool_state : public driver_device
{
public:
- jackpool_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jackpool_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_vram;
UINT8 m_map_vreg;
diff --git a/src/mame/drivers/jaguar.c b/src/mame/drivers/jaguar.c
index fa28d240da0..d1c24ca7800 100644
--- a/src/mame/drivers/jaguar.c
+++ b/src/mame/drivers/jaguar.c
@@ -356,8 +356,8 @@ static DEVICE_IMAGE_LOAD( jaguar );
class cojag_state : public driver_device
{
public:
- cojag_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ cojag_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT32> m_nvram;
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index 789e50f8e1f..76620891aa4 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -117,8 +117,8 @@ OSC: 12.000MHz
class jalmah_state : public driver_device
{
public:
- jalmah_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jalmah_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_sc0_tilemap_0;
tilemap_t *m_sc0_tilemap_1;
diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c
index d74844699a9..ddc4cd22d2f 100644
--- a/src/mame/drivers/jangou.c
+++ b/src/mame/drivers/jangou.c
@@ -37,8 +37,8 @@ $c088-$c095 player tiles
class jangou_state : public driver_device
{
public:
- jangou_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jangou_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* sound-related */
// Jangou CVSD Sound
diff --git a/src/mame/drivers/jantotsu.c b/src/mame/drivers/jantotsu.c
index 39501255a79..43683cfdd20 100644
--- a/src/mame/drivers/jantotsu.c
+++ b/src/mame/drivers/jantotsu.c
@@ -100,8 +100,8 @@ dumped by sayu
class jantotsu_state : public driver_device
{
public:
- jantotsu_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jantotsu_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* sound-related */
UINT32 m_adpcm_pos;
diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c
index 665fb9de2ec..aa3f3e42d58 100644
--- a/src/mame/drivers/jchan.c
+++ b/src/mame/drivers/jchan.c
@@ -178,8 +178,8 @@ there are 9 PALS on the pcb (not dumped)
class jchan_state : public kaneko16_state
{
public:
- jchan_state(running_machine &machine, const driver_device_config_base &config)
- : kaneko16_state(machine, config) { }
+ jchan_state(const machine_config &mconfig, device_type type, const char *tag)
+ : kaneko16_state(mconfig, type, tag) { }
bitmap_t *m_sprite_bitmap_1;
bitmap_t *m_sprite_bitmap_2;
@@ -688,8 +688,8 @@ static MACHINE_CONFIG_START( jchan, jchan_state )
MCFG_VIDEO_START(jchan)
- MCFG_DEVICE_ADD("spritegen1", sknsspr_, 0)
- MCFG_DEVICE_ADD("spritegen2", sknsspr_, 0)
+ MCFG_DEVICE_ADD("spritegen1", SKNS_SPRITE, 0)
+ MCFG_DEVICE_ADD("spritegen2", SKNS_SPRITE, 0)
MCFG_NVRAM_ADD_0FILL("nvram")
diff --git a/src/mame/drivers/jokrwild.c b/src/mame/drivers/jokrwild.c
index fb71cb99dd0..1d3b55c89dc 100644
--- a/src/mame/drivers/jokrwild.c
+++ b/src/mame/drivers/jokrwild.c
@@ -100,8 +100,8 @@
class jokrwild_state : public driver_device
{
public:
- jokrwild_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jokrwild_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/drivers/jollyjgr.c b/src/mame/drivers/jollyjgr.c
index 7cea548f5db..c07c3ef4b50 100644
--- a/src/mame/drivers/jollyjgr.c
+++ b/src/mame/drivers/jollyjgr.c
@@ -105,8 +105,8 @@ Notes:
class jollyjgr_state : public driver_device
{
public:
- jollyjgr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jollyjgr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/jongkyo.c b/src/mame/drivers/jongkyo.c
index 9d6b2d43297..4339acdd5ec 100644
--- a/src/mame/drivers/jongkyo.c
+++ b/src/mame/drivers/jongkyo.c
@@ -35,8 +35,8 @@
class jongkyo_state : public driver_device
{
public:
- jongkyo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jongkyo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* misc */
UINT8 m_rom_bank;
diff --git a/src/mame/drivers/jp.c b/src/mame/drivers/jp.c
index 8f21fa3ca8f..009684e7bd6 100644
--- a/src/mame/drivers/jp.c
+++ b/src/mame/drivers/jp.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class jp_state : public driver_device
{
public:
- jp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c
index 9742444a417..f062609f594 100644
--- a/src/mame/drivers/jpmsys5.c
+++ b/src/mame/drivers/jpmsys5.c
@@ -32,8 +32,8 @@ enum state { IDLE, START, DATA, STOP1, STOP2 };
class jpmsys5_state : public driver_device
{
public:
- jpmsys5_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jpmsys5_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_palette[16][3];
int m_pal_addr;
diff --git a/src/mame/drivers/jrpacman.c b/src/mame/drivers/jrpacman.c
index 78801e32c17..0a46f70d5de 100644
--- a/src/mame/drivers/jrpacman.c
+++ b/src/mame/drivers/jrpacman.c
@@ -107,8 +107,8 @@
class jrpacman_state : public pacman_state
{
public:
- jrpacman_state(running_machine &machine, const driver_device_config_base &config)
- : pacman_state(machine, config) { }
+ jrpacman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : pacman_state(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/jubilee.c b/src/mame/drivers/jubilee.c
index 407b775e92a..d43158bf0b3 100644
--- a/src/mame/drivers/jubilee.c
+++ b/src/mame/drivers/jubilee.c
@@ -93,8 +93,8 @@
class jubilee_state : public driver_device
{
public:
- jubilee_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jubilee_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/drivers/junofrst.c b/src/mame/drivers/junofrst.c
index 6a2a86763c8..2cd14eed668 100644
--- a/src/mame/drivers/junofrst.c
+++ b/src/mame/drivers/junofrst.c
@@ -92,8 +92,8 @@ Blitter source graphics
class junofrst_state : public tutankhm_state
{
public:
- junofrst_state(running_machine &machine, const driver_device_config_base &config)
- : tutankhm_state(machine, config) { }
+ junofrst_state(const machine_config &mconfig, device_type type, const char *tag)
+ : tutankhm_state(mconfig, type, tag) { }
UINT8 m_blitterdata[4];
int m_i8039_status;
diff --git a/src/mame/drivers/jvh.c b/src/mame/drivers/jvh.c
index abb82cb863b..8c237362126 100644
--- a/src/mame/drivers/jvh.c
+++ b/src/mame/drivers/jvh.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class jvh_state : public driver_device
{
public:
- jvh_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jvh_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c
index 76a7b6d4f05..acba1bb239d 100644
--- a/src/mame/drivers/karnov.c
+++ b/src/mame/drivers/karnov.c
@@ -838,8 +838,8 @@ static MACHINE_CONFIG_START( karnov, karnov_state )
MCFG_GFXDECODE(karnov)
MCFG_PALETTE_LENGTH(1024)
- MCFG_DEVICE_ADD("spritegen", deco_karnovsprites_, 0)
- deco_karnovsprites_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
+ deco_karnovsprites_device::set_gfx_region(*device, 2);
MCFG_PALETTE_INIT(karnov)
MCFG_VIDEO_START(karnov)
@@ -883,8 +883,8 @@ static MACHINE_CONFIG_START( wndrplnt, karnov_state )
MCFG_GFXDECODE(karnov)
MCFG_PALETTE_LENGTH(1024)
- MCFG_DEVICE_ADD("spritegen", deco_karnovsprites_, 0)
- deco_karnovsprites_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen", DECO_KARNOVSPRITES, 0)
+ deco_karnovsprites_device::set_gfx_region(*device, 2);
MCFG_PALETTE_INIT(karnov)
MCFG_VIDEO_START(wndrplnt)
diff --git a/src/mame/drivers/kingdrby.c b/src/mame/drivers/kingdrby.c
index 525969f6f04..0157348b4ae 100644
--- a/src/mame/drivers/kingdrby.c
+++ b/src/mame/drivers/kingdrby.c
@@ -76,8 +76,8 @@ sg1_b.e1 4096 0x92ef3c13 D2732D
class kingdrby_state : public driver_device
{
public:
- kingdrby_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kingdrby_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_sound_cmd;
UINT8 *m_vram;
diff --git a/src/mame/drivers/kingpin.c b/src/mame/drivers/kingpin.c
index 881e1bf6390..c1658dc4e11 100644
--- a/src/mame/drivers/kingpin.c
+++ b/src/mame/drivers/kingpin.c
@@ -29,8 +29,8 @@ Todo:
class kingpin_state : public driver_device
{
public:
- kingpin_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kingpin_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_code_base;
};
diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c
index 54d5d9fcf0a..501aa8fa60b 100644
--- a/src/mame/drivers/kinst.c
+++ b/src/mame/drivers/kinst.c
@@ -139,8 +139,8 @@ Notes:
class kinst_state : public driver_device
{
public:
- kinst_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kinst_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_rambase;
UINT32 *m_rambase2;
diff --git a/src/mame/drivers/kissproto.c b/src/mame/drivers/kissproto.c
index cbfe360f9a8..8799a291e6d 100644
--- a/src/mame/drivers/kissproto.c
+++ b/src/mame/drivers/kissproto.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class kissp_state : public driver_device
{
public:
- kissp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kissp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/koftball.c b/src/mame/drivers/koftball.c
index 26f1a20676a..d9a961d09bf 100644
--- a/src/mame/drivers/koftball.c
+++ b/src/mame/drivers/koftball.c
@@ -37,8 +37,8 @@ ft5_v6_c4.u58 /
class koftball_state : public driver_device
{
public:
- koftball_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ koftball_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_bmc_1_videoram;
UINT16 *m_bmc_2_videoram;
diff --git a/src/mame/drivers/koikoi.c b/src/mame/drivers/koikoi.c
index fc9f3087c2e..0ea9eab3b41 100644
--- a/src/mame/drivers/koikoi.c
+++ b/src/mame/drivers/koikoi.c
@@ -48,8 +48,8 @@ static const int input_tab[]= { 0x22, 0x64, 0x44, 0x68, 0x30, 0x50, 0x70, 0x48,
class koikoi_state : public driver_device
{
public:
- koikoi_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ koikoi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/konamigq.c b/src/mame/drivers/konamigq.c
index 96a270b38a5..cedb2c04a78 100644
--- a/src/mame/drivers/konamigq.c
+++ b/src/mame/drivers/konamigq.c
@@ -58,8 +58,8 @@
class konamigq_state : public psx_state
{
public:
- konamigq_state(running_machine &machine, const driver_device_config_base &config)
- : psx_state(machine, config) { }
+ konamigq_state(const machine_config &mconfig, device_type type, const char *tag)
+ : psx_state(mconfig, type, tag) { }
UINT8 m_sndto000[ 16 ];
UINT8 m_sndtor3k[ 16 ];
diff --git a/src/mame/drivers/konamigv.c b/src/mame/drivers/konamigv.c
index 6344b3282a7..cd6a576d07f 100644
--- a/src/mame/drivers/konamigv.c
+++ b/src/mame/drivers/konamigv.c
@@ -125,8 +125,8 @@ Notes:
class konamigv_state : public psx_state
{
public:
- konamigv_state(running_machine &machine, const driver_device_config_base &config)
- : psx_state(machine, config) { }
+ konamigv_state(const machine_config &mconfig, device_type type, const char *tag)
+ : psx_state(mconfig, type, tag) { }
UINT32 m_flash_address;
diff --git a/src/mame/drivers/konamim2.c b/src/mame/drivers/konamim2.c
index 0d4da9bad76..3fe1a891fab 100644
--- a/src/mame/drivers/konamim2.c
+++ b/src/mame/drivers/konamim2.c
@@ -203,8 +203,8 @@ typedef struct
class konamim2_state : public driver_device
{
public:
- konamim2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ konamim2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT64 *m_main_ram;
UINT32 m_vdl0_address;
diff --git a/src/mame/drivers/kongambl.c b/src/mame/drivers/kongambl.c
index b1e4b1f0ea4..dea9dc3d412 100644
--- a/src/mame/drivers/kongambl.c
+++ b/src/mame/drivers/kongambl.c
@@ -22,8 +22,8 @@
class kongambl_state : public driver_device
{
public:
- kongambl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kongambl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c
index 6ce048874bc..8754ce3286f 100644
--- a/src/mame/drivers/ksys573.c
+++ b/src/mame/drivers/ksys573.c
@@ -383,8 +383,8 @@ G: gun mania only, drives air soft gun (this game uses real BB bullet)
class ksys573_state : public psx_state
{
public:
- ksys573_state(running_machine &machine, const driver_device_config_base &config)
- : psx_state(machine, config) { }
+ ksys573_state(const machine_config &mconfig, device_type type, const char *tag)
+ : psx_state(mconfig, type, tag) { }
int m_flash_bank;
fujitsu_29f016a_device *m_flash_device[5][16];
diff --git a/src/mame/drivers/kungfur.c b/src/mame/drivers/kungfur.c
index 9fd7e54fda3..e9168c6473e 100644
--- a/src/mame/drivers/kungfur.c
+++ b/src/mame/drivers/kungfur.c
@@ -40,8 +40,8 @@ http://www.youtube.com/watch?v=ssEfw-RbSjs
class kungfur_state : public driver_device
{
public:
- kungfur_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kungfur_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_led[0x10];
UINT8 m_mux_data;
diff --git a/src/mame/drivers/laserbas.c b/src/mame/drivers/laserbas.c
index 9e232b0193d..2a2ac283a1e 100644
--- a/src/mame/drivers/laserbas.c
+++ b/src/mame/drivers/laserbas.c
@@ -23,8 +23,8 @@
class laserbas_state : public driver_device
{
public:
- laserbas_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ laserbas_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* misc */
int m_count;
diff --git a/src/mame/drivers/lastbank.c b/src/mame/drivers/lastbank.c
index 685ad4b1e56..6544145bdf5 100644
--- a/src/mame/drivers/lastbank.c
+++ b/src/mame/drivers/lastbank.c
@@ -16,8 +16,8 @@
class lastbank_state : public driver_device
{
public:
- lastbank_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lastbank_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static VIDEO_START( lastbank )
diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c
index 847ef7e4883..e81aae8afc0 100644
--- a/src/mame/drivers/lastfght.c
+++ b/src/mame/drivers/lastfght.c
@@ -70,8 +70,8 @@ Notes:
class lastfght_state : public driver_device
{
public:
- lastfght_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lastfght_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
bitmap_t *m_bitmap[2];
diff --git a/src/mame/drivers/lgp.c b/src/mame/drivers/lgp.c
index 61b3d33853a..ed0bc74ff98 100644
--- a/src/mame/drivers/lgp.c
+++ b/src/mame/drivers/lgp.c
@@ -72,8 +72,8 @@ Dumping Notes:
class lgp_state : public driver_device
{
public:
- lgp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lgp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
device_t *m_laserdisc;
UINT8 *m_tile_ram;
diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c
index 404ab9ff8b9..d275215e831 100644
--- a/src/mame/drivers/limenko.c
+++ b/src/mame/drivers/limenko.c
@@ -33,8 +33,8 @@
class limenko_state : public driver_device
{
public:
- limenko_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ limenko_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_spriteram;
UINT32 *m_spriteram2;
diff --git a/src/mame/drivers/littlerb.c b/src/mame/drivers/littlerb.c
index 63df2c73035..5963abdb5c8 100644
--- a/src/mame/drivers/littlerb.c
+++ b/src/mame/drivers/littlerb.c
@@ -65,8 +65,8 @@ Dip sw.2
class littlerb_state : public driver_device
{
public:
- littlerb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ littlerb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_vdp_address_low;
UINT16 m_vdp_address_high;
@@ -151,37 +151,15 @@ ADDRESS_MAP_END
/* VDP device to give us our own memory map */
class littlerb_vdp_device;
-class littlerb_vdp_device_config;
class littlerb_vdp_device : public device_t,
public device_memory_interface
{
- friend class littlerb_vdp_device_config;
- littlerb_vdp_device(running_machine &_machine, const littlerb_vdp_device_config &config);
public:
+ littlerb_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
virtual void device_start() { }
- const littlerb_vdp_device_config &m_config;
-};
-
-class littlerb_vdp_device_config : public device_config,
- public device_config_memory_interface
-{
- friend class littlerb_vdp_device;
- littlerb_vdp_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- {
- return global_alloc(littlerb_vdp_device_config(mconfig, tag, owner, clock));
- }
-
- virtual device_t *alloc_device(running_machine &machine) const
- {
- return auto_alloc(machine, littlerb_vdp_device(machine, *this));
- }
-
-protected:
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const
{
return (spacenum == 0) ? &m_space_config : NULL;
@@ -190,21 +168,15 @@ protected:
address_space_config m_space_config;
};
-littlerb_vdp_device::littlerb_vdp_device(running_machine &_machine, const littlerb_vdp_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
- m_config(config)
-{
-}
+const device_type LITTLERBVDP = &device_creator<littlerb_vdp_device>;
-littlerb_vdp_device_config::littlerb_vdp_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "LITTLERBVDP", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
+littlerb_vdp_device::littlerb_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, LITTLERBVDP, "LITTLERBVDP", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
m_space_config("littlerb_vdp", ENDIANNESS_LITTLE, 16,32, 0, NULL, *ADDRESS_MAP_NAME(littlerb_vdp_map8))
{
}
-const device_type LITTLERBVDP = littlerb_vdp_device_config::static_alloc_device_config;
/* end VDP device to give us our own memory map */
diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c
index 9eb8522fec7..dea7279ccbf 100644
--- a/src/mame/drivers/looping.c
+++ b/src/mame/drivers/looping.c
@@ -97,8 +97,8 @@ L056-6 9A " " VLI-8-4 7A "
class looping_state : public driver_device
{
public:
- looping_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ looping_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/ltcasino.c b/src/mame/drivers/ltcasino.c
index 64111d00b1e..5173ac4c76a 100644
--- a/src/mame/drivers/ltcasino.c
+++ b/src/mame/drivers/ltcasino.c
@@ -21,8 +21,8 @@ etc.
class ltcasino_state : public driver_device
{
public:
- ltcasino_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ltcasino_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_tile_num_ram;
UINT8 *m_tile_atr_ram;
diff --git a/src/mame/drivers/ltd.c b/src/mame/drivers/ltd.c
index f6520c1b094..68f5d2543be 100644
--- a/src/mame/drivers/ltd.c
+++ b/src/mame/drivers/ltd.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class ltd_state : public driver_device
{
public:
- ltd_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ltd_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/luckgrln.c b/src/mame/drivers/luckgrln.c
index cce3861e6b9..bf80b24c11f 100644
--- a/src/mame/drivers/luckgrln.c
+++ b/src/mame/drivers/luckgrln.c
@@ -86,8 +86,8 @@
class luckgrln_state : public driver_device
{
public:
- luckgrln_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ luckgrln_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_luck_vram1;
UINT8 *m_luck_vram2;
diff --git a/src/mame/drivers/m14.c b/src/mame/drivers/m14.c
index a6bf3acc0e7..b0296450ac5 100644
--- a/src/mame/drivers/m14.c
+++ b/src/mame/drivers/m14.c
@@ -57,8 +57,8 @@ Dumped by Chackn
class m14_state : public driver_device
{
public:
- m14_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m14_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
tilemap_t *m_m14_tilemap;
diff --git a/src/mame/drivers/m63.c b/src/mame/drivers/m63.c
index 416d856ec8f..743b87cf93e 100644
--- a/src/mame/drivers/m63.c
+++ b/src/mame/drivers/m63.c
@@ -124,8 +124,8 @@ Dip locations verified for:
class m63_state : public driver_device
{
public:
- m63_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m63_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 * m_videoram;
UINT8 * m_colorram;
diff --git a/src/mame/drivers/m79amb.c b/src/mame/drivers/m79amb.c
index e2144d21fe9..ddec2c4e645 100644
--- a/src/mame/drivers/m79amb.c
+++ b/src/mame/drivers/m79amb.c
@@ -61,8 +61,8 @@ and two large (paddles pretending to be) guns.
class m79amb_state : public driver_device
{
public:
- m79amb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m79amb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/macs.c b/src/mame/drivers/macs.c
index 7183081a1ca..29638247e0e 100644
--- a/src/mame/drivers/macs.c
+++ b/src/mame/drivers/macs.c
@@ -64,8 +64,8 @@ KISEKAE -- info
class macs_state : public driver_device
{
public:
- macs_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ macs_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_mux_data;
UINT8 m_rev;
diff --git a/src/mame/drivers/madmotor.c b/src/mame/drivers/madmotor.c
index 42e703db3c1..9346efabad1 100644
--- a/src/mame/drivers/madmotor.c
+++ b/src/mame/drivers/madmotor.c
@@ -275,15 +275,15 @@ static MACHINE_CONFIG_START( madmotor, madmotor_state )
MCFG_GFXDECODE(madmotor)
MCFG_PALETTE_LENGTH(1024)
- MCFG_DEVICE_ADD("tilegen1", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 0,0,0);
- MCFG_DEVICE_ADD("tilegen2", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 0,1,0);
- MCFG_DEVICE_ADD("tilegen3", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 0,2,1);
-
- MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
- deco_mxc06_device_config::set_gfx_region(device, 3);
+ MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
+ MCFG_DEVICE_ADD("tilegen2", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 0,1,0);
+ MCFG_DEVICE_ADD("tilegen3", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 0,2,1);
+
+ MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
+ deco_mxc06_device::set_gfx_region(*device, 3);
MCFG_VIDEO_START(madmotor)
diff --git a/src/mame/drivers/magic10.c b/src/mame/drivers/magic10.c
index 48bf0bd96cc..931168829fe 100644
--- a/src/mame/drivers/magic10.c
+++ b/src/mame/drivers/magic10.c
@@ -88,8 +88,8 @@
class magic10_state : public driver_device
{
public:
- magic10_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ magic10_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_layer0_tilemap;
tilemap_t *m_layer1_tilemap;
diff --git a/src/mame/drivers/magicard.c b/src/mame/drivers/magicard.c
index 43a663e5d93..f2d32682dc7 100644
--- a/src/mame/drivers/magicard.c
+++ b/src/mame/drivers/magicard.c
@@ -169,8 +169,8 @@
class magicard_state : public driver_device
{
public:
- magicard_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ magicard_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_magicram;
UINT16 *m_pcab_vregs;
diff --git a/src/mame/drivers/magicfly.c b/src/mame/drivers/magicfly.c
index 10b5dbcb2c8..6b494b51169 100644
--- a/src/mame/drivers/magicfly.c
+++ b/src/mame/drivers/magicfly.c
@@ -405,8 +405,8 @@
class magicfly_state : public driver_device
{
public:
- magicfly_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ magicfly_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/drivers/magictg.c b/src/mame/drivers/magictg.c
index 36601d5df9a..1104d3dc6cf 100644
--- a/src/mame/drivers/magictg.c
+++ b/src/mame/drivers/magictg.c
@@ -117,8 +117,8 @@ Medium size chip with heat sink on it
class magictg_state : public driver_device
{
public:
- magictg_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ magictg_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/magtouch.c b/src/mame/drivers/magtouch.c
index 2c8139df14b..ac6249d65d6 100644
--- a/src/mame/drivers/magtouch.c
+++ b/src/mame/drivers/magtouch.c
@@ -85,8 +85,8 @@ video card
class magtouch_state : public driver_device
{
public:
- magtouch_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ magtouch_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/majorpkr.c b/src/mame/drivers/majorpkr.c
index 29083180616..8c2aa28d58a 100644
--- a/src/mame/drivers/majorpkr.c
+++ b/src/mame/drivers/majorpkr.c
@@ -459,7 +459,7 @@
class majorpkr_state : public driver_device
{
public:
- majorpkr_state(running_machine &machine, const driver_device_config_base &config) : driver_device(machine, config), oki(*this, "oki") { }
+ majorpkr_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), oki(*this, "oki") { }
int m_mux_data;
int m_palette_bank;
diff --git a/src/mame/drivers/marinedt.c b/src/mame/drivers/marinedt.c
index 43a55852110..98de198df7e 100644
--- a/src/mame/drivers/marinedt.c
+++ b/src/mame/drivers/marinedt.c
@@ -100,8 +100,8 @@ p2 ink doesn't always light up in test mode
class marinedt_state : public driver_device
{
public:
- marinedt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ marinedt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_tx_tileram;
diff --git a/src/mame/drivers/mastboy.c b/src/mame/drivers/mastboy.c
index f30fc33bc6d..f942fbd78cb 100644
--- a/src/mame/drivers/mastboy.c
+++ b/src/mame/drivers/mastboy.c
@@ -443,8 +443,8 @@
class mastboy_state : public driver_device
{
public:
- mastboy_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ mastboy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT8> m_nvram;
diff --git a/src/mame/drivers/maxaflex.c b/src/mame/drivers/maxaflex.c
index fb110d09075..1419db2a49b 100644
--- a/src/mame/drivers/maxaflex.c
+++ b/src/mame/drivers/maxaflex.c
@@ -26,8 +26,8 @@
class maxaflex_state : public driver_device
{
public:
- maxaflex_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ maxaflex_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_portA_in;
UINT8 m_portA_out;
diff --git a/src/mame/drivers/maygay1b.c b/src/mame/drivers/maygay1b.c
index 38e527d651e..8fa61ed15d5 100644
--- a/src/mame/drivers/maygay1b.c
+++ b/src/mame/drivers/maygay1b.c
@@ -49,8 +49,8 @@ struct i8279_state
class maygay1b_state : public driver_device
{
public:
- maygay1b_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ maygay1b_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_lamppos;
int m_alpha_clock;
diff --git a/src/mame/drivers/maygayv1.c b/src/mame/drivers/maygayv1.c
index 2f427bbff5e..22ee5d1913b 100644
--- a/src/mame/drivers/maygayv1.c
+++ b/src/mame/drivers/maygayv1.c
@@ -216,8 +216,8 @@ typedef struct
class maygayv1_state : public driver_device
{
public:
- maygayv1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ maygayv1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_vsync_latch_preset;
UINT8 m_p1;
diff --git a/src/mame/drivers/mayumi.c b/src/mame/drivers/mayumi.c
index 9104ff25ca7..f1081e152a8 100644
--- a/src/mame/drivers/mayumi.c
+++ b/src/mame/drivers/mayumi.c
@@ -17,8 +17,8 @@
class mayumi_state : public driver_device
{
public:
- mayumi_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mayumi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c
index f9241083161..1814e22189c 100644
--- a/src/mame/drivers/mazerbla.c
+++ b/src/mame/drivers/mazerbla.c
@@ -51,8 +51,8 @@ TO DO:
class mazerbla_state : public driver_device
{
public:
- mazerbla_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mazerbla_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_cfb_ram;
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index e91c59edf45..43cd77be6e3 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -89,8 +89,8 @@ struct _speedup_entry
class mediagx_state : public driver_device
{
public:
- mediagx_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mediagx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_cga_ram;
UINT32 *m_bios_ram;
diff --git a/src/mame/drivers/meijinsn.c b/src/mame/drivers/meijinsn.c
index edddc70a7e2..26d67966b80 100644
--- a/src/mame/drivers/meijinsn.c
+++ b/src/mame/drivers/meijinsn.c
@@ -68,8 +68,8 @@ SOFT PSG & VOICE BY M.C & S.H
class meijinsn_state : public driver_device
{
public:
- meijinsn_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ meijinsn_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_shared_ram;
diff --git a/src/mame/drivers/mephisto.c b/src/mame/drivers/mephisto.c
index caf745e402a..c23da7cfa82 100644
--- a/src/mame/drivers/mephisto.c
+++ b/src/mame/drivers/mephisto.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class mephisto_state : public driver_device
{
public:
- mephisto_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mephisto_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c
index 32c609e243f..01718589991 100644
--- a/src/mame/drivers/merit.c
+++ b/src/mame/drivers/merit.c
@@ -57,8 +57,8 @@ Notes: it's important that "user1" is 0xa0000 bytes with empty space filled
class merit_state : public driver_device
{
public:
- merit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ merit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
void dodge_nvram_init(nvram_device &nvram, void *base, size_t size);
pen_t m_pens[NUM_PENS];
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index 3529c0dbad2..2ad960659a8 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -126,8 +126,8 @@ typedef struct
class meritm_state : public driver_device
{
public:
- meritm_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ meritm_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8* m_ram;
device_t *m_z80pio[2];
diff --git a/src/mame/drivers/mgolf.c b/src/mame/drivers/mgolf.c
index 371be4c5ea9..5067749920d 100644
--- a/src/mame/drivers/mgolf.c
+++ b/src/mame/drivers/mgolf.c
@@ -10,8 +10,8 @@
class mgolf_state : public driver_device
{
public:
- mgolf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mgolf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8* m_video_ram;
diff --git a/src/mame/drivers/micropin.c b/src/mame/drivers/micropin.c
index 4aa5ea7d05a..ff520255c9c 100644
--- a/src/mame/drivers/micropin.c
+++ b/src/mame/drivers/micropin.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class micropin_state : public driver_device
{
public:
- micropin_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ micropin_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/midas.c b/src/mame/drivers/midas.c
index 949a84fb105..9ffbe48cc67 100644
--- a/src/mame/drivers/midas.c
+++ b/src/mame/drivers/midas.c
@@ -60,8 +60,8 @@
class midas_state : public driver_device
{
public:
- midas_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ midas_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_gfxram;
UINT16 *m_gfxregs;
diff --git a/src/mame/drivers/midqslvr.c b/src/mame/drivers/midqslvr.c
index 02ca16554b3..499508a3b62 100644
--- a/src/mame/drivers/midqslvr.c
+++ b/src/mame/drivers/midqslvr.c
@@ -36,8 +36,8 @@
class midqslvr_state : public driver_device
{
public:
- midqslvr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ midqslvr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/mil4000.c b/src/mame/drivers/mil4000.c
index 23ee875f9da..d91d3f0a05a 100644
--- a/src/mame/drivers/mil4000.c
+++ b/src/mame/drivers/mil4000.c
@@ -94,8 +94,8 @@ Changes (2008-12-10, Roberto Fresca):
class mil4000_state : public driver_device
{
public:
- mil4000_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mil4000_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_sc0_vram;
UINT16 *m_sc1_vram;
diff --git a/src/mame/drivers/miniboy7.c b/src/mame/drivers/miniboy7.c
index 902412fd543..899f2ab0271 100644
--- a/src/mame/drivers/miniboy7.c
+++ b/src/mame/drivers/miniboy7.c
@@ -155,8 +155,8 @@
class miniboy7_state : public driver_device
{
public:
- miniboy7_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ miniboy7_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/drivers/minivadr.c b/src/mame/drivers/minivadr.c
index f7159cc196f..1f2b7c0a732 100644
--- a/src/mame/drivers/minivadr.c
+++ b/src/mame/drivers/minivadr.c
@@ -17,8 +17,8 @@ Japan). It has no sound.
class minivadr_state : public driver_device
{
public:
- minivadr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ minivadr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/mirage.c b/src/mame/drivers/mirage.c
index 86a97e22152..55dcb38d987 100644
--- a/src/mame/drivers/mirage.c
+++ b/src/mame/drivers/mirage.c
@@ -43,8 +43,8 @@ MR_01-.3A [a0b758aa]
class mirage_state : public driver_device
{
public:
- mirage_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ mirage_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_deco_tilegen1(*this, "tilegen1"),
m_oki_sfx(*this, "oki_sfx"),
@@ -342,8 +342,8 @@ static MACHINE_CONFIG_START( mirage, mirage_state )
MCFG_PALETTE_LENGTH(1024)
MCFG_DECO16IC_ADD("tilegen1", mirage_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/mirax.c b/src/mame/drivers/mirax.c
index 07b7829088d..f48d28d7ec8 100644
--- a/src/mame/drivers/mirax.c
+++ b/src/mame/drivers/mirax.c
@@ -77,8 +77,8 @@ The End
class mirax_state : public driver_device
{
public:
- mirax_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mirax_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_spriteram;
UINT8 m_nAyCtrl;
diff --git a/src/mame/drivers/missb2.c b/src/mame/drivers/missb2.c
index cf38f62efcd..f2682232214 100644
--- a/src/mame/drivers/missb2.c
+++ b/src/mame/drivers/missb2.c
@@ -25,8 +25,8 @@ OKI M6295 sound ROM dump is bad.
class missb2_state : public bublbobl_state
{
public:
- missb2_state(running_machine &machine, const driver_device_config_base &config)
- : bublbobl_state(machine, config) { }
+ missb2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : bublbobl_state(mconfig, type, tag) { }
UINT8 * m_bgvram;
UINT8 * m_bg_paletteram;
diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c
index d4da8b794cb..f5e4f6488ae 100644
--- a/src/mame/drivers/missile.c
+++ b/src/mame/drivers/missile.c
@@ -355,8 +355,8 @@ Super Missile Attack Board Layout
class missile_state : public driver_device
{
public:
- missile_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ missile_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
const UINT8 *m_writeprom;
diff --git a/src/mame/drivers/mjsister.c b/src/mame/drivers/mjsister.c
index 89826f959eb..c05fc73e763 100644
--- a/src/mame/drivers/mjsister.c
+++ b/src/mame/drivers/mjsister.c
@@ -17,8 +17,8 @@
class mjsister_state : public driver_device
{
public:
- mjsister_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mjsister_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
bitmap_t *m_tmpbitmap0;
diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c
index c140131508f..529813c03fc 100644
--- a/src/mame/drivers/mlanding.c
+++ b/src/mame/drivers/mlanding.c
@@ -30,8 +30,8 @@ TODO:
class mlanding_state : public driver_device
{
public:
- mlanding_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mlanding_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 * m_ml_tileram;
UINT16 *m_g_ram;
diff --git a/src/mame/drivers/mogura.c b/src/mame/drivers/mogura.c
index 086e4b4c9f6..e269b3cc55c 100644
--- a/src/mame/drivers/mogura.c
+++ b/src/mame/drivers/mogura.c
@@ -8,8 +8,8 @@
class mogura_state : public driver_device
{
public:
- mogura_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mogura_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_tileram;
diff --git a/src/mame/drivers/mole.c b/src/mame/drivers/mole.c
index 806a143f009..0abd317755e 100644
--- a/src/mame/drivers/mole.c
+++ b/src/mame/drivers/mole.c
@@ -56,8 +56,8 @@
class mole_state : public driver_device
{
public:
- mole_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mole_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/drivers/monzagp.c b/src/mame/drivers/monzagp.c
index 37a44ad94a4..25225ba1043 100644
--- a/src/mame/drivers/monzagp.c
+++ b/src/mame/drivers/monzagp.c
@@ -39,8 +39,8 @@ Lower board (MGP_01):
class monzagp_state : public driver_device
{
public:
- monzagp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ monzagp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_coordx;
int m_coordy;
diff --git a/src/mame/drivers/mpoker.c b/src/mame/drivers/mpoker.c
index 2d54e387df7..b6a4ae79bcc 100644
--- a/src/mame/drivers/mpoker.c
+++ b/src/mame/drivers/mpoker.c
@@ -177,8 +177,8 @@
class mpoker_state : public driver_device
{
public:
- mpoker_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mpoker_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_output[8];
UINT8* m_video;
diff --git a/src/mame/drivers/mpu3.c b/src/mame/drivers/mpu3.c
index 6934266f70c..1bf1cfd3667 100644
--- a/src/mame/drivers/mpu3.c
+++ b/src/mame/drivers/mpu3.c
@@ -105,8 +105,8 @@ struct mpu3_chr_table
class mpu3_state : public driver_device
{
public:
- mpu3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mpu3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_alpha_data_line;
diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c
index 5737bcbfac6..6e56606a543 100644
--- a/src/mame/drivers/mpu4.c
+++ b/src/mame/drivers/mpu4.c
@@ -320,8 +320,8 @@ struct bt471_t
class mpu4_state : public driver_device
{
public:
- mpu4_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mpu4_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_mod_number;
int m_mmtr_data;
diff --git a/src/mame/drivers/mpu5.c b/src/mame/drivers/mpu5.c
index 09c365e583b..3962fb8248c 100644
--- a/src/mame/drivers/mpu5.c
+++ b/src/mame/drivers/mpu5.c
@@ -19,8 +19,8 @@
class mpu5_state : public driver_device
{
public:
- mpu5_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mpu5_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/mrgame.c b/src/mame/drivers/mrgame.c
index e5221351b7c..b2c16470845 100644
--- a/src/mame/drivers/mrgame.c
+++ b/src/mame/drivers/mrgame.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class mrgame_state : public driver_device
{
public:
- mrgame_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mrgame_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/multfish.c b/src/mame/drivers/multfish.c
index a61459c57d2..09d4cf334b2 100644
--- a/src/mame/drivers/multfish.c
+++ b/src/mame/drivers/multfish.c
@@ -177,8 +177,8 @@ below are simply made to the banking address to run on other boards.
class multfish_state : public driver_device
{
public:
- multfish_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ multfish_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* Video related */
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index 3acfa80c2e9..a2faa4c2ca5 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -75,8 +75,8 @@ PCB Layout
class multigam_state : public driver_device
{
public:
- multigam_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ multigam_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8* m_nt_ram;
UINT8* m_vram;
diff --git a/src/mame/drivers/murogem.c b/src/mame/drivers/murogem.c
index baeb8e69ebd..b185c822f0e 100644
--- a/src/mame/drivers/murogem.c
+++ b/src/mame/drivers/murogem.c
@@ -102,8 +102,8 @@ val (hex): 27 20 22 04 26 00 20 20 00 07 00 00 80 00 00 00 ns
class murogem_state : public driver_device
{
public:
- murogem_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ murogem_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
};
diff --git a/src/mame/drivers/murogmbl.c b/src/mame/drivers/murogmbl.c
index 31ad9677aeb..e7bb3f50589 100644
--- a/src/mame/drivers/murogmbl.c
+++ b/src/mame/drivers/murogmbl.c
@@ -41,8 +41,8 @@ Dumped: 06/04/2009 f205v
class murogmbl_state : public driver_device
{
public:
- murogmbl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ murogmbl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8* m_video;
};
diff --git a/src/mame/drivers/mw18w.c b/src/mame/drivers/mw18w.c
index c006e862bf3..7292d0a79ef 100644
--- a/src/mame/drivers/mw18w.c
+++ b/src/mame/drivers/mw18w.c
@@ -22,8 +22,8 @@ To diagnose game, turn on service mode and:
class mw18w_state : public driver_device
{
public:
- mw18w_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mw18w_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/mwarr.c b/src/mame/drivers/mwarr.c
index aa6b5246067..618b5b1f93b 100644
--- a/src/mame/drivers/mwarr.c
+++ b/src/mame/drivers/mwarr.c
@@ -49,8 +49,8 @@ Notes:
class mwarr_state : public driver_device
{
public:
- mwarr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mwarr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 *m_bg_videoram;
diff --git a/src/mame/drivers/namcops2.c b/src/mame/drivers/namcops2.c
index 02cc869b940..830d8c5ca61 100644
--- a/src/mame/drivers/namcops2.c
+++ b/src/mame/drivers/namcops2.c
@@ -28,8 +28,8 @@
class namcops2_state : public driver_device
{
public:
- namcops2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ namcops2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/namcos10.c b/src/mame/drivers/namcos10.c
index ac37d1af350..819cbb3d94c 100644
--- a/src/mame/drivers/namcos10.c
+++ b/src/mame/drivers/namcos10.c
@@ -276,8 +276,8 @@ WRITE32_HANDLER( namcos10_bank_w )
class namcos10_state : public psx_state
{
public:
- namcos10_state(running_machine &machine, const driver_device_config_base &config)
- : psx_state(machine, config) { }
+ namcos10_state(const machine_config &mconfig, device_type type, const char *tag)
+ : psx_state(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( namcos10_map, AS_PROGRAM, 32 )
diff --git a/src/mame/drivers/namcos11.c b/src/mame/drivers/namcos11.c
index 6ec5945a023..bd769dbabc0 100644
--- a/src/mame/drivers/namcos11.c
+++ b/src/mame/drivers/namcos11.c
@@ -278,8 +278,8 @@ Notes:
class namcos11_state : public psx_state
{
public:
- namcos11_state(running_machine &machine, const driver_device_config_base &config)
- : psx_state(machine, config) { }
+ namcos11_state(const machine_config &mconfig, device_type type, const char *tag)
+ : psx_state(mconfig, type, tag) { }
UINT32 *m_sharedram;
UINT32 *m_keycus;
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index b16b71f82b0..8d17fa485cc 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -1034,8 +1034,8 @@ Notes:
class namcos12_state : public psx_state
{
public:
- namcos12_state(running_machine &machine, const driver_device_config_base &config)
- : psx_state(machine, config) { }
+ namcos12_state(const machine_config &mconfig, device_type type, const char *tag)
+ : psx_state(mconfig, type, tag) { }
UINT32 *m_sharedram;
UINT32 m_n_bankoffset;
diff --git a/src/mame/drivers/namcos23.c b/src/mame/drivers/namcos23.c
index 9c2be374e50..35f0396e439 100644
--- a/src/mame/drivers/namcos23.c
+++ b/src/mame/drivers/namcos23.c
@@ -1070,8 +1070,8 @@ typedef struct
class namcos23_state : public driver_device
{
public:
- namcos23_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ namcos23_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
c361_t m_c361;
c417_t m_c417;
diff --git a/src/mame/drivers/neoprint.c b/src/mame/drivers/neoprint.c
index fe470ebcd91..fc16b45555a 100644
--- a/src/mame/drivers/neoprint.c
+++ b/src/mame/drivers/neoprint.c
@@ -29,8 +29,8 @@
class neoprint_state : public driver_device
{
public:
- neoprint_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ neoprint_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16* m_npvidram;
UINT16* m_npvidregs;
diff --git a/src/mame/drivers/neptunp2.c b/src/mame/drivers/neptunp2.c
index 29b7ecfaac9..3256657825a 100644
--- a/src/mame/drivers/neptunp2.c
+++ b/src/mame/drivers/neptunp2.c
@@ -13,8 +13,8 @@
class neptunp2_state : public driver_device
{
public:
- neptunp2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ neptunp2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/nightgal.c b/src/mame/drivers/nightgal.c
index aba953f3c57..b83c9ff5d99 100644
--- a/src/mame/drivers/nightgal.c
+++ b/src/mame/drivers/nightgal.c
@@ -30,8 +30,8 @@ TODO:
class nightgal_state : public driver_device
{
public:
- nightgal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nightgal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
UINT8 m_blit_raw_data[3];
diff --git a/src/mame/drivers/nmg5.c b/src/mame/drivers/nmg5.c
index 70875a803c2..de24ad026d4 100644
--- a/src/mame/drivers/nmg5.c
+++ b/src/mame/drivers/nmg5.c
@@ -229,8 +229,8 @@ Stephh's notes (based on the games M68000 code and some tests) :
class nmg5_state : public driver_device
{
public:
- nmg5_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nmg5_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_fg_videoram;
diff --git a/src/mame/drivers/nsm.c b/src/mame/drivers/nsm.c
index f65d6125736..23d08a5f0a8 100644
--- a/src/mame/drivers/nsm.c
+++ b/src/mame/drivers/nsm.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class nsm_state : public driver_device
{
public:
- nsm_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nsm_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/nsmpoker.c b/src/mame/drivers/nsmpoker.c
index 91588bdb32a..1c48e6469a5 100644
--- a/src/mame/drivers/nsmpoker.c
+++ b/src/mame/drivers/nsmpoker.c
@@ -67,8 +67,8 @@
class nsmpoker_state : public driver_device
{
public:
- nsmpoker_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nsmpoker_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/drivers/nss.c b/src/mame/drivers/nss.c
index 9acff9a9848..3295061567e 100644
--- a/src/mame/drivers/nss.c
+++ b/src/mame/drivers/nss.c
@@ -301,8 +301,8 @@ Contra III CONTRA_III_1 TC574000 CONTRA_III_0 TC574000 GAME1_NSSU
class nss_state : public snes_state
{
public:
- nss_state(running_machine &machine, const driver_device_config_base &config)
- : snes_state(machine, config) { }
+ nss_state(const machine_config &mconfig, device_type type, const char *tag)
+ : snes_state(mconfig, type, tag) { }
UINT8 m_m50458_rom_bank;
UINT8 m_vblank_bit;
diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c
index 64d452082f7..6dda7172259 100644
--- a/src/mame/drivers/nwk-tr.c
+++ b/src/mame/drivers/nwk-tr.c
@@ -229,8 +229,8 @@ Thrill Drive 713A13 - 713A14 -
class nwktr_state : public driver_device
{
public:
- nwktr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nwktr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_led_reg0;
UINT8 m_led_reg1;
diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c
index 689c1363c5c..5e878762054 100644
--- a/src/mame/drivers/nyny.c
+++ b/src/mame/drivers/nyny.c
@@ -87,8 +87,8 @@
class nyny_state : public driver_device
{
public:
- nyny_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nyny_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram1;
diff --git a/src/mame/drivers/olibochu.c b/src/mame/drivers/olibochu.c
index ff9c6953a13..38be2dcfcaf 100644
--- a/src/mame/drivers/olibochu.c
+++ b/src/mame/drivers/olibochu.c
@@ -59,8 +59,8 @@ $7004 writes, related to $7000 reads
class olibochu_state : public driver_device
{
public:
- olibochu_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ olibochu_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/omegrace.c b/src/mame/drivers/omegrace.c
index 5d00d1ee073..43a59589be4 100644
--- a/src/mame/drivers/omegrace.c
+++ b/src/mame/drivers/omegrace.c
@@ -226,8 +226,8 @@
class omegrace_state : public driver_device
{
public:
- omegrace_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ omegrace_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/onetwo.c b/src/mame/drivers/onetwo.c
index 0b208ec1f3c..805291e125e 100644
--- a/src/mame/drivers/onetwo.c
+++ b/src/mame/drivers/onetwo.c
@@ -49,8 +49,8 @@ Note: this is quite clearly a 'Korean bootleg' of Shisensho - Joshiryo-Hen / Mat
class onetwo_state : public driver_device
{
public:
- onetwo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ onetwo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_fgram;
diff --git a/src/mame/drivers/othello.c b/src/mame/drivers/othello.c
index 14b34a4d765..366b41b7628 100644
--- a/src/mame/drivers/othello.c
+++ b/src/mame/drivers/othello.c
@@ -50,8 +50,8 @@ Limit for help/undo (matta):
class othello_state : public driver_device
{
public:
- othello_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ othello_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/pachifev.c b/src/mame/drivers/pachifev.c
index 2d33360526c..e045827fbbb 100644
--- a/src/mame/drivers/pachifev.c
+++ b/src/mame/drivers/pachifev.c
@@ -89,8 +89,8 @@ Stephh's notes (based on the game TMS9995 code and some tests) :
class pachifev_state : public driver_device
{
public:
- pachifev_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pachifev_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* controls related */
int m_power;
diff --git a/src/mame/drivers/pangofun.c b/src/mame/drivers/pangofun.c
index c0ccaeeae9b..1b6db26aadd 100644
--- a/src/mame/drivers/pangofun.c
+++ b/src/mame/drivers/pangofun.c
@@ -103,8 +103,8 @@ Arcade Version (Coin-Op) by InfoCube (Pisa, Italy)
class pangofun_state : public driver_device
{
public:
- pangofun_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pangofun_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/panicr.c b/src/mame/drivers/panicr.c
index 2a15e923ad4..05b8ab65a99 100644
--- a/src/mame/drivers/panicr.c
+++ b/src/mame/drivers/panicr.c
@@ -69,8 +69,8 @@ D.9B [f99cac4b] /
class panicr_state : public driver_device
{
public:
- panicr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ panicr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
tilemap_t *m_bgtilemap;
diff --git a/src/mame/drivers/paranoia.c b/src/mame/drivers/paranoia.c
index 7827d2bc5a3..0db37ddb4ae 100644
--- a/src/mame/drivers/paranoia.c
+++ b/src/mame/drivers/paranoia.c
@@ -46,8 +46,8 @@ HuC6280A (Hudson)
class paranoia_state : public driver_device
{
public:
- paranoia_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ paranoia_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/pasha2.c b/src/mame/drivers/pasha2.c
index 27dbdc314d9..07b3ec073d9 100644
--- a/src/mame/drivers/pasha2.c
+++ b/src/mame/drivers/pasha2.c
@@ -79,8 +79,8 @@ Notes:
class pasha2_state : public driver_device
{
public:
- pasha2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pasha2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_paletteram;
diff --git a/src/mame/drivers/pcat_dyn.c b/src/mame/drivers/pcat_dyn.c
index ff00befd904..d1a8fbd4438 100644
--- a/src/mame/drivers/pcat_dyn.c
+++ b/src/mame/drivers/pcat_dyn.c
@@ -30,8 +30,8 @@ TODO:
class pcat_dyn_state : public driver_device
{
public:
- pcat_dyn_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pcat_dyn_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/pcat_nit.c b/src/mame/drivers/pcat_nit.c
index ea7fa9567c6..8e3e0a351ca 100644
--- a/src/mame/drivers/pcat_nit.c
+++ b/src/mame/drivers/pcat_nit.c
@@ -95,8 +95,8 @@ Smitdogg
class pcat_nit_state : public driver_device
{
public:
- pcat_nit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pcat_nit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_banked_nvram;
};
diff --git a/src/mame/drivers/pcktgal.c b/src/mame/drivers/pcktgal.c
index 647855eca41..036c6c8c3dc 100644
--- a/src/mame/drivers/pcktgal.c
+++ b/src/mame/drivers/pcktgal.c
@@ -243,8 +243,8 @@ static MACHINE_CONFIG_START( pcktgal, pcktgal_state )
MCFG_PALETTE_INIT(pcktgal)
- MCFG_DEVICE_ADD("tilegen1", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 0,0,0);
+ MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 0,0,0);
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/pcxt.c b/src/mame/drivers/pcxt.c
index 721fe7b1db6..4004c9206ed 100644
--- a/src/mame/drivers/pcxt.c
+++ b/src/mame/drivers/pcxt.c
@@ -74,8 +74,8 @@ the main program is 9th October 1990.
class pcxt_state : public driver_device
{
public:
- pcxt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pcxt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_vga_vram;
UINT8 *m_work_ram;
diff --git a/src/mame/drivers/pengadvb.c b/src/mame/drivers/pengadvb.c
index 26d4f7eeab9..88775148a94 100644
--- a/src/mame/drivers/pengadvb.c
+++ b/src/mame/drivers/pengadvb.c
@@ -29,8 +29,8 @@ NOTE! switches 1, 3 & 5 must be ON or the game will not boot.
class pengadvb_state : public driver_device
{
public:
- pengadvb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pengadvb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_main_mem;
UINT8 m_mem_map;
diff --git a/src/mame/drivers/pengo.c b/src/mame/drivers/pengo.c
index 559ef329d54..425d1b22012 100644
--- a/src/mame/drivers/pengo.c
+++ b/src/mame/drivers/pengo.c
@@ -71,8 +71,8 @@
class pengo_state : public pacman_state
{
public:
- pengo_state(running_machine &machine, const driver_device_config_base &config)
- : pacman_state(machine, config) { }
+ pengo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : pacman_state(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c
index fece5903c37..a660bf5d42c 100644
--- a/src/mame/drivers/peplus.c
+++ b/src/mame/drivers/peplus.c
@@ -178,8 +178,8 @@ Stephh's log (2007.11.28) :
class peplus_state : public driver_device
{
public:
- peplus_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ peplus_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_cmos_ram(*this, "cmos") { }
UINT8 *m_videoram;
diff --git a/src/mame/drivers/peyper.c b/src/mame/drivers/peyper.c
index 21ce2d05db8..de90aa4f3b5 100644
--- a/src/mame/drivers/peyper.c
+++ b/src/mame/drivers/peyper.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class peyper_state : public driver_device
{
public:
- peyper_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ peyper_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( peyper_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c
index 39c4ff732a9..0fcb25a598a 100644
--- a/src/mame/drivers/pgm.c
+++ b/src/mame/drivers/pgm.c
@@ -1494,8 +1494,8 @@ MACHINE_CONFIG_END
class cavepgm_state : public pgm_state
{
public:
- cavepgm_state(running_machine &machine, const driver_device_config_base &config)
- : pgm_state(machine, config) {
+ cavepgm_state(const machine_config &mconfig, device_type type, const char *tag)
+ : pgm_state(mconfig, type, tag) {
m_ddp3internal_slot = 0;
}
diff --git a/src/mame/drivers/photon.c b/src/mame/drivers/photon.c
index 53370c4c26d..0ae7410b26f 100644
--- a/src/mame/drivers/photon.c
+++ b/src/mame/drivers/photon.c
@@ -25,8 +25,8 @@
class photon_state : public driver_device
{
public:
- photon_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ photon_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/photon2.c b/src/mame/drivers/photon2.c
index 9b9ede14a4d..407c4081fa5 100644
--- a/src/mame/drivers/photon2.c
+++ b/src/mame/drivers/photon2.c
@@ -17,8 +17,8 @@
class photon2_state : public driver_device
{
public:
- photon2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ photon2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_spectrum_video_ram;
int m_spectrum_frame_number;
diff --git a/src/mame/drivers/photoply.c b/src/mame/drivers/photoply.c
index 033c065714f..de6d6d5b701 100644
--- a/src/mame/drivers/photoply.c
+++ b/src/mame/drivers/photoply.c
@@ -30,8 +30,8 @@ TODO:
class photoply_state : public driver_device
{
public:
- photoply_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ photoply_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_vga_vram;
UINT8 m_vga_regs[0x19];
diff --git a/src/mame/drivers/pinkiri8.c b/src/mame/drivers/pinkiri8.c
index 08d04790c50..9dbc522a776 100644
--- a/src/mame/drivers/pinkiri8.c
+++ b/src/mame/drivers/pinkiri8.c
@@ -39,8 +39,8 @@ Dumped by Chackn
class pinkiri8_state : public driver_device
{
public:
- pinkiri8_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pinkiri8_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8* m_janshi_vram1;
UINT8* m_janshi_vram2;
@@ -79,85 +79,55 @@ ADDRESS_MAP_END
/* VDP device to give us our own memory map */
-class janshi_vdp_device_config : public device_config,
- public device_config_memory_interface
-{
- friend class janshi_vdp_device;
- janshi_vdp_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-protected:
- virtual void device_config_complete();
- virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
- address_space_config m_space_config;
-};
-
class janshi_vdp_device : public device_t,
public device_memory_interface
{
- friend class janshi_vdp_device_config;
- janshi_vdp_device(running_machine &_machine, const janshi_vdp_device_config &config);
public:
+ janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
+ virtual void device_config_complete();
+ virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
virtual void device_start();
virtual void device_reset();
- const janshi_vdp_device_config &m_config;
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+ address_space_config m_space_config;
};
-const device_type JANSHIVDP = janshi_vdp_device_config::static_alloc_device_config;
+const device_type JANSHIVDP = &device_creator<janshi_vdp_device>;
-janshi_vdp_device_config::janshi_vdp_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "JANSHIVDP", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
+janshi_vdp_device::janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, JANSHIVDP, "JANSHIVDP", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
m_space_config("janshi_vdp", ENDIANNESS_LITTLE, 8,24, 0, NULL, *ADDRESS_MAP_NAME(janshi_vdp_map8))
{
}
-device_config *janshi_vdp_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(janshi_vdp_device_config(mconfig, tag, owner, clock));
-}
-
-device_t *janshi_vdp_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, janshi_vdp_device(machine, *this));
-}
-
-void janshi_vdp_device_config::device_config_complete()
+void janshi_vdp_device::device_config_complete()
{
// int address_bits = 24;
// m_space_config = address_space_config("janshi_vdp", ENDIANNESS_BIG, 8, address_bits, 0, *ADDRESS_MAP_NAME(janshi_vdp_map8));
}
-bool janshi_vdp_device_config::device_validity_check(emu_options &options, const game_driver &driver) const
+bool janshi_vdp_device::device_validity_check(emu_options &options, const game_driver &driver) const
{
bool error = false;
return error;
}
-const address_space_config *janshi_vdp_device_config::memory_space_config(address_spacenum spacenum) const
+void janshi_vdp_device::device_start()
{
- return (spacenum == 0) ? &m_space_config : NULL;
}
-
-janshi_vdp_device::janshi_vdp_device(running_machine &_machine, const janshi_vdp_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
- m_config(config)
+void janshi_vdp_device::device_reset()
{
}
-void janshi_vdp_device::device_start()
+const address_space_config *janshi_vdp_device::memory_space_config(address_spacenum spacenum) const
{
+ return (spacenum == 0) ? &m_space_config : NULL;
}
-void janshi_vdp_device::device_reset()
-{
-}
/* end VDP device to give us our own memory map */
diff --git a/src/mame/drivers/pipeline.c b/src/mame/drivers/pipeline.c
index 0bbf0f89e54..2586c24e859 100644
--- a/src/mame/drivers/pipeline.c
+++ b/src/mame/drivers/pipeline.c
@@ -75,8 +75,8 @@ Stephh's notes (based on the games Z80 code and some tests) :
class pipeline_state : public driver_device
{
public:
- pipeline_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pipeline_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_tilemap1;
tilemap_t *m_tilemap2;
diff --git a/src/mame/drivers/pkscram.c b/src/mame/drivers/pkscram.c
index c99f6b0600a..37682ea54b7 100644
--- a/src/mame/drivers/pkscram.c
+++ b/src/mame/drivers/pkscram.c
@@ -20,8 +20,8 @@ driver by David Haywood and few bits by Pierpaolo Prazzoli
class pkscram_state : public driver_device
{
public:
- pkscram_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pkscram_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_out;
UINT8 m_interrupt_line_active;
diff --git a/src/mame/drivers/pktgaldx.c b/src/mame/drivers/pktgaldx.c
index 27ee5a65073..4b5737c97a1 100644
--- a/src/mame/drivers/pktgaldx.c
+++ b/src/mame/drivers/pktgaldx.c
@@ -350,8 +350,8 @@ static MACHINE_CONFIG_START( pktgaldx, pktgaldx_state )
MCFG_DECO16IC_ADD("tilegen1", pktgaldx_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/play_1.c b/src/mame/drivers/play_1.c
index 0369239b2a7..bbe24b802af 100644
--- a/src/mame/drivers/play_1.c
+++ b/src/mame/drivers/play_1.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class play_1_state : public driver_device
{
public:
- play_1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ play_1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( play_1_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/play_2.c b/src/mame/drivers/play_2.c
index 9c2a8a8d2c2..3ddcc73c840 100644
--- a/src/mame/drivers/play_2.c
+++ b/src/mame/drivers/play_2.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class play_2_state : public driver_device
{
public:
- play_2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ play_2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( play_2_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/play_3.c b/src/mame/drivers/play_3.c
index f2054239a96..426732caea1 100644
--- a/src/mame/drivers/play_3.c
+++ b/src/mame/drivers/play_3.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class play_3_state : public driver_device
{
public:
- play_3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ play_3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/play_5.c b/src/mame/drivers/play_5.c
index dd0671f29d3..21b570c5e05 100644
--- a/src/mame/drivers/play_5.c
+++ b/src/mame/drivers/play_5.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class play_5_state : public driver_device
{
public:
- play_5_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ play_5_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c
index 2a44b799370..72653af0b0f 100644
--- a/src/mame/drivers/pntnpuzl.c
+++ b/src/mame/drivers/pntnpuzl.c
@@ -128,8 +128,8 @@ CN1 standard DB15 VGA connector (15KHz)
class pntnpuzl_state : public driver_device
{
public:
- pntnpuzl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pntnpuzl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_eeprom;
UINT16* m_3a0000ram;
diff --git a/src/mame/drivers/poker72.c b/src/mame/drivers/poker72.c
index 72a4de4f3d8..7458bba9429 100644
--- a/src/mame/drivers/poker72.c
+++ b/src/mame/drivers/poker72.c
@@ -18,8 +18,8 @@
class poker72_state : public driver_device
{
public:
- poker72_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ poker72_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_vram;
UINT8 *m_pal;
diff --git a/src/mame/drivers/poo.c b/src/mame/drivers/poo.c
index 873946a04b8..874373bd458 100644
--- a/src/mame/drivers/poo.c
+++ b/src/mame/drivers/poo.c
@@ -49,8 +49,8 @@ Other bits from DSW2 (but bit 5) don't seem to be read / tested at all ...
class poo_state : public driver_device
{
public:
- poo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ poo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_vram;
UINT8 *m_scrolly;
diff --git a/src/mame/drivers/ppmast93.c b/src/mame/drivers/ppmast93.c
index fda2ad8a7c6..0f5c06216e7 100644
--- a/src/mame/drivers/ppmast93.c
+++ b/src/mame/drivers/ppmast93.c
@@ -139,8 +139,8 @@ Dip locations added based on the notes above.
class ppmast93_state : public driver_device
{
public:
- ppmast93_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ppmast93_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c
index f1f892e0475..5c93764b4e5 100644
--- a/src/mame/drivers/progolf.c
+++ b/src/mame/drivers/progolf.c
@@ -59,8 +59,8 @@ Twenty four 8116 rams.
class progolf_state : public driver_device
{
public:
- progolf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ progolf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_char_pen;
diff --git a/src/mame/drivers/psattack.c b/src/mame/drivers/psattack.c
index 92bb3110c46..3ea60bbfb08 100644
--- a/src/mame/drivers/psattack.c
+++ b/src/mame/drivers/psattack.c
@@ -82,8 +82,8 @@ GUN_xP are 6 pin gun connectors (pins 1-4 match the UNICO sytle guns):
class psattack_state : public driver_device
{
public:
- psattack_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ psattack_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/pturn.c b/src/mame/drivers/pturn.c
index 517f5745e8f..6de03cfd6a9 100644
--- a/src/mame/drivers/pturn.c
+++ b/src/mame/drivers/pturn.c
@@ -83,8 +83,8 @@ ROMS: All ROM labels say only "PROM" and a number.
class pturn_state : public driver_device
{
public:
- pturn_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pturn_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
tilemap_t *m_fgmap;
diff --git a/src/mame/drivers/pzletime.c b/src/mame/drivers/pzletime.c
index 3b77c8abe25..074f7c9c161 100644
--- a/src/mame/drivers/pzletime.c
+++ b/src/mame/drivers/pzletime.c
@@ -22,8 +22,8 @@
class pzletime_state : public driver_device
{
public:
- pzletime_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pzletime_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bg_videoram;
diff --git a/src/mame/drivers/quakeat.c b/src/mame/drivers/quakeat.c
index 73c5e6b0a4a..41742c324d5 100644
--- a/src/mame/drivers/quakeat.c
+++ b/src/mame/drivers/quakeat.c
@@ -66,8 +66,8 @@ TODO:
class quakeat_state : public driver_device
{
public:
- quakeat_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ quakeat_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
device_t *m_pic8259_1;
device_t *m_pic8259_2;
diff --git a/src/mame/drivers/quantum.c b/src/mame/drivers/quantum.c
index 4737725b098..8c4691503fa 100644
--- a/src/mame/drivers/quantum.c
+++ b/src/mame/drivers/quantum.c
@@ -54,8 +54,8 @@
class quantum_state : public driver_device
{
public:
- quantum_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ quantum_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/queen.c b/src/mame/drivers/queen.c
index 469434e0678..5a1b181840d 100644
--- a/src/mame/drivers/queen.c
+++ b/src/mame/drivers/queen.c
@@ -26,8 +26,8 @@ processor speed is 533MHz <- likely to be a Celeron or a Pentium III class CPU -
class queen_state : public driver_device
{
public:
- queen_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ queen_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/quizo.c b/src/mame/drivers/quizo.c
index 397761f6263..e6c1f8c9580 100644
--- a/src/mame/drivers/quizo.c
+++ b/src/mame/drivers/quizo.c
@@ -31,8 +31,8 @@ Xtals 8MHz, 21.47727MHz
class quizo_state : public driver_device
{
public:
- quizo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ quizo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_port60;
diff --git a/src/mame/drivers/quizpun2.c b/src/mame/drivers/quizpun2.c
index 3b48b8ffa42..222e6c337aa 100644
--- a/src/mame/drivers/quizpun2.c
+++ b/src/mame/drivers/quizpun2.c
@@ -55,8 +55,8 @@ struct prot_t {
class quizpun2_state : public driver_device
{
public:
- quizpun2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ quizpun2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
struct prot_t m_prot;
UINT8 *m_bg_ram;
diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c
index 7d8cf01ea7f..c461a575ed6 100644
--- a/src/mame/drivers/r2dtank.c
+++ b/src/mame/drivers/r2dtank.c
@@ -52,8 +52,8 @@ RAM = 4116 (x11)
class r2dtank_state : public driver_device
{
public:
- r2dtank_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ r2dtank_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/drivers/r2dx_v33.c b/src/mame/drivers/r2dx_v33.c
index d4e420b4b52..f1a021cea5f 100644
--- a/src/mame/drivers/r2dx_v33.c
+++ b/src/mame/drivers/r2dx_v33.c
@@ -28,8 +28,8 @@ Then it puts settings at 0x9e08 and 0x9e0a (bp 91acb)
class r2dx_v33_state : public driver_device
{
public:
- r2dx_v33_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ r2dx_v33_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_spriteram;
};
diff --git a/src/mame/drivers/rabbit.c b/src/mame/drivers/rabbit.c
index 24c03181f46..beb09e13e83 100644
--- a/src/mame/drivers/rabbit.c
+++ b/src/mame/drivers/rabbit.c
@@ -93,8 +93,8 @@ Custom: Imagetek 15000 (2ch video & 2ch sound)
class rabbit_state : public driver_device
{
public:
- rabbit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rabbit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_viewregs0;
UINT32 *m_viewregs6;
diff --git a/src/mame/drivers/rbmk.c b/src/mame/drivers/rbmk.c
index 60353ead6a4..80ad30885bb 100644
--- a/src/mame/drivers/rbmk.c
+++ b/src/mame/drivers/rbmk.c
@@ -60,8 +60,8 @@ Notes:
class rbmk_state : public driver_device
{
public:
- rbmk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rbmk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_gms_vidram;
UINT16 *m_gms_vidram2;
diff --git a/src/mame/drivers/rcorsair.c b/src/mame/drivers/rcorsair.c
index 2be5581614d..fe5a25a8293 100644
--- a/src/mame/drivers/rcorsair.c
+++ b/src/mame/drivers/rcorsair.c
@@ -53,8 +53,8 @@ so even the Main CPU is unknown, assuming the 8085 is the sound CPU
class rcorsair_state : public driver_device
{
public:
- rcorsair_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rcorsair_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/re900.c b/src/mame/drivers/re900.c
index a1342bf24c7..02298413c79 100644
--- a/src/mame/drivers/re900.c
+++ b/src/mame/drivers/re900.c
@@ -85,8 +85,8 @@
class re900_state : public driver_device
{
public:
- re900_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ re900_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_rom;
UINT8 m_psg_pa;
diff --git a/src/mame/drivers/rgum.c b/src/mame/drivers/rgum.c
index 5076ec2a60e..85797b26de8 100644
--- a/src/mame/drivers/rgum.c
+++ b/src/mame/drivers/rgum.c
@@ -22,8 +22,8 @@ The ppi at 3000-3003 seems to be a dual port communication thing with the z80.
class rgum_state : public driver_device
{
public:
- rgum_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rgum_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_vram;
UINT8 *m_cram;
diff --git a/src/mame/drivers/rmhaihai.c b/src/mame/drivers/rmhaihai.c
index d556461d6a1..6da9da02ef7 100644
--- a/src/mame/drivers/rmhaihai.c
+++ b/src/mame/drivers/rmhaihai.c
@@ -37,8 +37,8 @@ TODO:
class rmhaihai_state : public driver_device
{
public:
- rmhaihai_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rmhaihai_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_gfxbank;
UINT8 *m_videoram;
diff --git a/src/mame/drivers/rotaryf.c b/src/mame/drivers/rotaryf.c
index 9111258bd95..22ffe7a93dc 100644
--- a/src/mame/drivers/rotaryf.c
+++ b/src/mame/drivers/rotaryf.c
@@ -20,8 +20,8 @@ driver by Barry Rodewald
class rotaryf_state : public driver_device
{
public:
- rotaryf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rotaryf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
size_t m_videoram_size;
diff --git a/src/mame/drivers/roul.c b/src/mame/drivers/roul.c
index be40a9674b8..18252a94140 100644
--- a/src/mame/drivers/roul.c
+++ b/src/mame/drivers/roul.c
@@ -70,8 +70,8 @@ Stephh's notes (based on the game Z80 code and some tests) :
class roul_state : public driver_device
{
public:
- roul_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ roul_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_reg[0x10];
UINT8 *m_videobuf;
diff --git a/src/mame/drivers/rowamet.c b/src/mame/drivers/rowamet.c
index aab39889359..80643cc2dd5 100644
--- a/src/mame/drivers/rowamet.c
+++ b/src/mame/drivers/rowamet.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class rowamet_state : public driver_device
{
public:
- rowamet_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rowamet_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c
index 8113c578628..6e63cf5cb8c 100644
--- a/src/mame/drivers/royalmah.c
+++ b/src/mame/drivers/royalmah.c
@@ -102,8 +102,8 @@ Stephh's notes (based on the games Z80 code and some tests) :
class royalmah_state : public driver_device
{
public:
- royalmah_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ royalmah_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_input_port_select;
diff --git a/src/mame/drivers/s11.c b/src/mame/drivers/s11.c
index 4c720ead424..9333622bfe1 100644
--- a/src/mame/drivers/s11.c
+++ b/src/mame/drivers/s11.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class williams_s11_state : public driver_device
{
public:
- williams_s11_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ williams_s11_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/s11a.c b/src/mame/drivers/s11a.c
index a5f5e012d70..987e1143859 100644
--- a/src/mame/drivers/s11a.c
+++ b/src/mame/drivers/s11a.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class williams_s11a_state : public driver_device
{
public:
- williams_s11a_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ williams_s11a_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/s11b.c b/src/mame/drivers/s11b.c
index 87b0585e151..ddbc830e831 100644
--- a/src/mame/drivers/s11b.c
+++ b/src/mame/drivers/s11b.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class williams_s11b_state : public driver_device
{
public:
- williams_s11b_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ williams_s11b_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/s11c.c b/src/mame/drivers/s11c.c
index 609894d2225..072c7f83371 100644
--- a/src/mame/drivers/s11c.c
+++ b/src/mame/drivers/s11c.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class williams_s11c_state : public driver_device
{
public:
- williams_s11c_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ williams_s11c_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/s3.c b/src/mame/drivers/s3.c
index 94ce383756d..fc7b36c751e 100644
--- a/src/mame/drivers/s3.c
+++ b/src/mame/drivers/s3.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class williams_s3_state : public driver_device
{
public:
- williams_s3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ williams_s3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( williams_s3_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/s4.c b/src/mame/drivers/s4.c
index 0fb6d4e5997..e5518b9e140 100644
--- a/src/mame/drivers/s4.c
+++ b/src/mame/drivers/s4.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class williams_s4_state : public driver_device
{
public:
- williams_s4_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ williams_s4_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( williams_s4_map, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/s6.c b/src/mame/drivers/s6.c
index 2b740582e95..38e53d2a3a0 100644
--- a/src/mame/drivers/s6.c
+++ b/src/mame/drivers/s6.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class williams_s6_state : public driver_device
{
public:
- williams_s6_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ williams_s6_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/s6a.c b/src/mame/drivers/s6a.c
index 4cac4508b9c..e123f54b41c 100644
--- a/src/mame/drivers/s6a.c
+++ b/src/mame/drivers/s6a.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class williams_s6a_state : public driver_device
{
public:
- williams_s6a_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ williams_s6a_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/s7.c b/src/mame/drivers/s7.c
index 4b94c4c8227..272a6261ee2 100644
--- a/src/mame/drivers/s7.c
+++ b/src/mame/drivers/s7.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class williams_s7_state : public driver_device
{
public:
- williams_s7_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ williams_s7_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/s8.c b/src/mame/drivers/s8.c
index eb9a2e5e1a8..90a453ee442 100644
--- a/src/mame/drivers/s8.c
+++ b/src/mame/drivers/s8.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class williams_s8_state : public driver_device
{
public:
- williams_s8_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ williams_s8_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/s9.c b/src/mame/drivers/s9.c
index a78d6871b96..805dafc4db3 100644
--- a/src/mame/drivers/s9.c
+++ b/src/mame/drivers/s9.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class williams_s9_state : public driver_device
{
public:
- williams_s9_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ williams_s9_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/safarir.c b/src/mame/drivers/safarir.c
index 746f26a460b..049cfc8bf99 100644
--- a/src/mame/drivers/safarir.c
+++ b/src/mame/drivers/safarir.c
@@ -54,8 +54,8 @@ modified by Hau
class safarir_state : public driver_device
{
public:
- safarir_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ safarir_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_ram_1;
UINT8 *m_ram_2;
diff --git a/src/mame/drivers/sandscrp.c b/src/mame/drivers/sandscrp.c
index 885179f0b09..f0a66038762 100644
--- a/src/mame/drivers/sandscrp.c
+++ b/src/mame/drivers/sandscrp.c
@@ -83,8 +83,8 @@ Is there another alt program rom set labeled 9 & 10?
class sandscrp_state : public kaneko16_state
{
public:
- sandscrp_state(running_machine &machine, const driver_device_config_base &config)
- : kaneko16_state(machine, config) { }
+ sandscrp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : kaneko16_state(mconfig, type, tag) { }
UINT8 m_sprite_irq;
UINT8 m_unknown_irq;
diff --git a/src/mame/drivers/sangho.c b/src/mame/drivers/sangho.c
index 73169a63630..fc77e5ea154 100644
--- a/src/mame/drivers/sangho.c
+++ b/src/mame/drivers/sangho.c
@@ -46,8 +46,8 @@ is a YM2413 compatible chip.
class sangho_state : public driver_device
{
public:
- sangho_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sangho_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8* m_ram;
UINT8 m_sexyboom_bank[8];
diff --git a/src/mame/drivers/savquest.c b/src/mame/drivers/savquest.c
index 1029e936ecf..c4ff68ca4eb 100644
--- a/src/mame/drivers/savquest.c
+++ b/src/mame/drivers/savquest.c
@@ -38,8 +38,8 @@
class savquest_state : public driver_device
{
public:
- savquest_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ savquest_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/sbowling.c b/src/mame/drivers/sbowling.c
index 5e2c7a04f4e..f6e129864e1 100644
--- a/src/mame/drivers/sbowling.c
+++ b/src/mame/drivers/sbowling.c
@@ -48,8 +48,8 @@ PROMs : NEC B406 (1kx4) x2
class sbowling_state : public driver_device
{
public:
- sbowling_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sbowling_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_bgmap;
UINT8 *m_videoram;
diff --git a/src/mame/drivers/sbrkout.c b/src/mame/drivers/sbrkout.c
index 8129a7543e9..9d8bd9e35ab 100644
--- a/src/mame/drivers/sbrkout.c
+++ b/src/mame/drivers/sbrkout.c
@@ -40,8 +40,8 @@
class sbrkout_state : public driver_device
{
public:
- sbrkout_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sbrkout_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
emu_timer *m_scanline_timer;
diff --git a/src/mame/drivers/scobra.c b/src/mame/drivers/scobra.c
index 4d046387854..6f8b9355359 100644
--- a/src/mame/drivers/scobra.c
+++ b/src/mame/drivers/scobra.c
@@ -43,8 +43,8 @@ Notes/Tidbits:
class scobra_state : public scramble_state
{
public:
- scobra_state(running_machine &machine, const driver_device_config_base &config)
- : scramble_state(machine, config) { }
+ scobra_state(const machine_config &mconfig, device_type type, const char *tag)
+ : scramble_state(mconfig, type, tag) { }
UINT8 *m_soundram;
};
diff --git a/src/mame/drivers/seattle.c b/src/mame/drivers/seattle.c
index 0a26d13d7dd..1badd31bac9 100644
--- a/src/mame/drivers/seattle.c
+++ b/src/mame/drivers/seattle.c
@@ -424,8 +424,8 @@ struct _widget_data
class seattle_state : public driver_device
{
public:
- seattle_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ seattle_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT32> m_nvram;
diff --git a/src/mame/drivers/segald.c b/src/mame/drivers/segald.c
index 91c9ce17a44..eb95d02e538 100644
--- a/src/mame/drivers/segald.c
+++ b/src/mame/drivers/segald.c
@@ -27,8 +27,8 @@ Todo:
class segald_state : public driver_device
{
public:
- segald_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ segald_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_nmi_enable;
diff --git a/src/mame/drivers/sengokmj.c b/src/mame/drivers/sengokmj.c
index e2eab373724..b8bd89e75ed 100644
--- a/src/mame/drivers/sengokmj.c
+++ b/src/mame/drivers/sengokmj.c
@@ -62,8 +62,8 @@ RSSENGO2.72 chr.
class sengokmj_state : public driver_device
{
public:
- sengokmj_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sengokmj_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_sengokumj_mux_data;
UINT8 m_hopper_io;
diff --git a/src/mame/drivers/sfbonus.c b/src/mame/drivers/sfbonus.c
index 3b68de9123f..69eb0c9782c 100644
--- a/src/mame/drivers/sfbonus.c
+++ b/src/mame/drivers/sfbonus.c
@@ -277,8 +277,8 @@ MH86171 Color Pallete RAMDAC
class sfbonus_state : public driver_device
{
public:
- sfbonus_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sfbonus_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
bitmap_t *m_temp_reel_bitmap;
tilemap_t *m_tilemap;
diff --git a/src/mame/drivers/sfkick.c b/src/mame/drivers/sfkick.c
index 5b9942bc184..f74ed0db9dc 100644
--- a/src/mame/drivers/sfkick.c
+++ b/src/mame/drivers/sfkick.c
@@ -62,8 +62,8 @@ YM2203C
class sfkick_state : public driver_device
{
public:
- sfkick_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sfkick_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_main_mem;
int m_bank_cfg;
diff --git a/src/mame/drivers/sg1000a.c b/src/mame/drivers/sg1000a.c
index 07ffce2526f..b7b7fde4237 100644
--- a/src/mame/drivers/sg1000a.c
+++ b/src/mame/drivers/sg1000a.c
@@ -122,8 +122,8 @@ CN4 CN5
class sg1000a_state : public driver_device
{
public:
- sg1000a_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sg1000a_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/shanghai.c b/src/mame/drivers/shanghai.c
index 2936efcbd3c..9def1e5e45d 100644
--- a/src/mame/drivers/shanghai.c
+++ b/src/mame/drivers/shanghai.c
@@ -31,8 +31,8 @@ displayed.
class shanghai_state : public driver_device
{
public:
- shanghai_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ shanghai_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/shougi.c b/src/mame/drivers/shougi.c
index cfc3c1c6919..700280c68c0 100644
--- a/src/mame/drivers/shougi.c
+++ b/src/mame/drivers/shougi.c
@@ -90,8 +90,8 @@ PROM : Type MB7051
class shougi_state : public driver_device
{
public:
- shougi_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ shougi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_nmi_enabled;
diff --git a/src/mame/drivers/sigmab52.c b/src/mame/drivers/sigmab52.c
index a7a985f7284..3e458ffb711 100644
--- a/src/mame/drivers/sigmab52.c
+++ b/src/mame/drivers/sigmab52.c
@@ -135,8 +135,8 @@
class sigmab52_state : public driver_device
{
public:
- sigmab52_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sigmab52_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_latch;
unsigned int m_acrtc_data;
diff --git a/src/mame/drivers/sigmab98.c b/src/mame/drivers/sigmab98.c
index ba7821afc84..25b3cb1e7a1 100644
--- a/src/mame/drivers/sigmab98.c
+++ b/src/mame/drivers/sigmab98.c
@@ -100,8 +100,8 @@ Notes:
class sigmab98_state : public driver_device
{
public:
- sigmab98_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sigmab98_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_spriteram;
size_t m_spriteram_size;
diff --git a/src/mame/drivers/simpl156.c b/src/mame/drivers/simpl156.c
index cfa3f7fffd9..70db91c22bc 100644
--- a/src/mame/drivers/simpl156.c
+++ b/src/mame/drivers/simpl156.c
@@ -453,9 +453,9 @@ static MACHINE_CONFIG_START( chainrec, simpl156_state )
MCFG_VIDEO_START(simpl156)
MCFG_DECO16IC_ADD("tilegen1", simpl156_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
- decospr_device_config::set_pri_callback(device, simpl156_pri_callback);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
+ decospr_device::set_pri_callback(*device, simpl156_pri_callback);
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/skeetsht.c b/src/mame/drivers/skeetsht.c
index 855e9ae8097..a72670c8134 100644
--- a/src/mame/drivers/skeetsht.c
+++ b/src/mame/drivers/skeetsht.c
@@ -20,8 +20,8 @@
class skeetsht_state : public driver_device
{
public:
- skeetsht_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ skeetsht_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_tms_vram;
UINT8 m_porta_latch;
diff --git a/src/mame/drivers/skimaxx.c b/src/mame/drivers/skimaxx.c
index cbe81381191..21ccc737000 100644
--- a/src/mame/drivers/skimaxx.c
+++ b/src/mame/drivers/skimaxx.c
@@ -43,8 +43,8 @@
class skimaxx_state : public driver_device
{
public:
- skimaxx_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ skimaxx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_bg_buffer;
UINT16 *m_fg_buffer;
diff --git a/src/mame/drivers/skyarmy.c b/src/mame/drivers/skyarmy.c
index e950d7be38f..df706aa6785 100644
--- a/src/mame/drivers/skyarmy.c
+++ b/src/mame/drivers/skyarmy.c
@@ -32,8 +32,8 @@
class skyarmy_state : public driver_device
{
public:
- skyarmy_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ skyarmy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_spriteram;
UINT8 *m_videoram;
diff --git a/src/mame/drivers/skylncr.c b/src/mame/drivers/skylncr.c
index d07ea722d6f..8937a77169e 100644
--- a/src/mame/drivers/skylncr.c
+++ b/src/mame/drivers/skylncr.c
@@ -42,8 +42,8 @@
class skylncr_state : public driver_device
{
public:
- skylncr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ skylncr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_tmap;
UINT8 *m_videoram;
diff --git a/src/mame/drivers/sleic.c b/src/mame/drivers/sleic.c
index 4cdc86f0f49..8696cba320a 100644
--- a/src/mame/drivers/sleic.c
+++ b/src/mame/drivers/sleic.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class sleic_state : public driver_device
{
public:
- sleic_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sleic_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/sliver.c b/src/mame/drivers/sliver.c
index fa1e5609035..82e3032317c 100644
--- a/src/mame/drivers/sliver.c
+++ b/src/mame/drivers/sliver.c
@@ -79,8 +79,8 @@ Notes:
class sliver_state : public driver_device
{
public:
- sliver_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sliver_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_io_offset;
UINT16 m_io_reg[IO_SIZE];
diff --git a/src/mame/drivers/slotcarn.c b/src/mame/drivers/slotcarn.c
index 527e93c6a1d..c58e87d9956 100644
--- a/src/mame/drivers/slotcarn.c
+++ b/src/mame/drivers/slotcarn.c
@@ -33,8 +33,8 @@
class slotcarn_state : public driver_device
{
public:
- slotcarn_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ slotcarn_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
pen_t m_pens[NUM_PENS];
UINT8 *m_ram_attr;
diff --git a/src/mame/drivers/sms.c b/src/mame/drivers/sms.c
index ea00db9ac01..94912eac2c9 100644
--- a/src/mame/drivers/sms.c
+++ b/src/mame/drivers/sms.c
@@ -223,8 +223,8 @@ U145 1Brown PAL14H4CN
class sms_state : public driver_device
{
public:
- sms_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sms_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_communication_port[4];
UINT8 m_communication_port_status;
diff --git a/src/mame/drivers/snesb.c b/src/mame/drivers/snesb.c
index c82e27f0be5..fade313cd29 100644
--- a/src/mame/drivers/snesb.c
+++ b/src/mame/drivers/snesb.c
@@ -147,8 +147,8 @@ Iron PCB (same as Final Fight 2?)
class snesb_state : public snes_state
{
public:
- snesb_state(running_machine &machine, const driver_device_config_base &config)
- : snes_state(machine, config) { }
+ snesb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : snes_state(mconfig, type, tag) { }
INT8 *m_shared_ram;
UINT8 m_ffight2b_coins;
diff --git a/src/mame/drivers/sothello.c b/src/mame/drivers/sothello.c
index e9ba583f388..e9f43db086d 100644
--- a/src/mame/drivers/sothello.c
+++ b/src/mame/drivers/sothello.c
@@ -46,8 +46,8 @@ OSC : 8.0000MHz(X1) 21.477 MHz(X2) 384kHz(X3)
class sothello_state : public driver_device
{
public:
- sothello_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sothello_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_subcpu_status;
int m_soundcpu_busy;
diff --git a/src/mame/drivers/spaceg.c b/src/mame/drivers/spaceg.c
index 28f503aa26b..17a5b46c3dc 100644
--- a/src/mame/drivers/spaceg.c
+++ b/src/mame/drivers/spaceg.c
@@ -176,8 +176,8 @@ Notes:
class spaceg_state : public driver_device
{
public:
- spaceg_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ spaceg_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 * m_videoram;
UINT8 * m_colorram;
diff --git a/src/mame/drivers/speglsht.c b/src/mame/drivers/speglsht.c
index bd9d4d3b2aa..8cf102203a2 100644
--- a/src/mame/drivers/speglsht.c
+++ b/src/mame/drivers/speglsht.c
@@ -113,8 +113,8 @@ Notes:
class speglsht_state : public driver_device
{
public:
- speglsht_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ speglsht_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_shared;
UINT32 *m_framebuffer;
diff --git a/src/mame/drivers/spinb.c b/src/mame/drivers/spinb.c
index e9403a5a9e4..a25c663542d 100644
--- a/src/mame/drivers/spinb.c
+++ b/src/mame/drivers/spinb.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class spinb_state : public driver_device
{
public:
- spinb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ spinb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/spoker.c b/src/mame/drivers/spoker.c
index 3de88b768ac..b12a671ba81 100644
--- a/src/mame/drivers/spoker.c
+++ b/src/mame/drivers/spoker.c
@@ -25,8 +25,8 @@ TODO:
class spoker_state : public driver_device
{
public:
- spoker_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ spoker_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_bg_tile_ram;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/drivers/spool99.c b/src/mame/drivers/spool99.c
index 676f9aa0b1e..b677cba1350 100644
--- a/src/mame/drivers/spool99.c
+++ b/src/mame/drivers/spool99.c
@@ -97,8 +97,8 @@ Note
class spool99_state : public driver_device
{
public:
- spool99_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ spool99_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_main;
tilemap_t *m_sc0_tilemap;
diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c
index 8c178d95056..96d8120af45 100644
--- a/src/mame/drivers/srmp5.c
+++ b/src/mame/drivers/srmp5.c
@@ -64,8 +64,8 @@ This is not a bug (real machine behaves the same).
class srmp5_state : public driver_device
{
public:
- srmp5_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ srmp5_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 m_databank;
UINT16 *m_tileram;
diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c
index 17eddfd2229..4b406089f73 100644
--- a/src/mame/drivers/srmp6.c
+++ b/src/mame/drivers/srmp6.c
@@ -74,8 +74,8 @@ Dumped 06/15/2000
class srmp6_state : public driver_device
{
public:
- srmp6_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ srmp6_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16* m_tileram;
UINT16* m_dmaram;
diff --git a/src/mame/drivers/ssfindo.c b/src/mame/drivers/ssfindo.c
index 0d79b36161e..5038b17fcc3 100644
--- a/src/mame/drivers/ssfindo.c
+++ b/src/mame/drivers/ssfindo.c
@@ -215,8 +215,8 @@ enum
class ssfindo_state : public driver_device
{
public:
- ssfindo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ssfindo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 m_PS7500_IO[MAXIO];
UINT32 m_PS7500_FIFO[256];
diff --git a/src/mame/drivers/sshangha.c b/src/mame/drivers/sshangha.c
index 1f58afc0672..9f673a73d7f 100644
--- a/src/mame/drivers/sshangha.c
+++ b/src/mame/drivers/sshangha.c
@@ -426,11 +426,11 @@ static MACHINE_CONFIG_START( sshangha, sshangha_state )
MCFG_DECO16IC_ADD("tilegen1", sshangha_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen1", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
- MCFG_DEVICE_ADD("spritegen2", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
MCFG_VIDEO_START(sshangha)
diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c
index 940bf3d9b45..f932cfa6acf 100644
--- a/src/mame/drivers/ssingles.c
+++ b/src/mame/drivers/ssingles.c
@@ -153,8 +153,8 @@ Dumped by Chack'n
class ssingles_state : public driver_device
{
public:
- ssingles_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ssingles_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_videoram[VMEM_SIZE];
UINT8 m_colorram[VMEM_SIZE];
diff --git a/src/mame/drivers/sstrangr.c b/src/mame/drivers/sstrangr.c
index 8ab57a7f1c5..fa3d1ea43c6 100644
--- a/src/mame/drivers/sstrangr.c
+++ b/src/mame/drivers/sstrangr.c
@@ -16,8 +16,8 @@
class sstrangr_state : public driver_device
{
public:
- sstrangr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sstrangr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_ram;
UINT8 m_flip_screen;
diff --git a/src/mame/drivers/st_mp100.c b/src/mame/drivers/st_mp100.c
index 0ed7f462581..6d17dcdc253 100644
--- a/src/mame/drivers/st_mp100.c
+++ b/src/mame/drivers/st_mp100.c
@@ -10,8 +10,8 @@ extern const char layout_pinball[];
class st_mp100_state : public driver_device
{
public:
- st_mp100_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ st_mp100_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/st_mp200.c b/src/mame/drivers/st_mp200.c
index 83dca951bed..3f568737274 100644
--- a/src/mame/drivers/st_mp200.c
+++ b/src/mame/drivers/st_mp200.c
@@ -10,8 +10,8 @@ extern const char layout_pinball[];
class st_mp200_state : public driver_device
{
public:
- st_mp200_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ st_mp200_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/stadhero.c b/src/mame/drivers/stadhero.c
index 53340efd3db..e477946b5d3 100644
--- a/src/mame/drivers/stadhero.c
+++ b/src/mame/drivers/stadhero.c
@@ -234,11 +234,11 @@ static MACHINE_CONFIG_START( stadhero, stadhero_state )
MCFG_GFXDECODE(stadhero)
MCFG_PALETTE_LENGTH(1024)
- MCFG_DEVICE_ADD("tilegen1", deco_bac06_, 0)
- deco_bac06_device_config::set_gfx_region_wide(device, 1,1,2);
+ MCFG_DEVICE_ADD("tilegen1", DECO_BAC06, 0)
+ deco_bac06_device::set_gfx_region_wide(*device, 1,1,2);
- MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
- deco_mxc06_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
+ deco_mxc06_device::set_gfx_region(*device, 2);
MCFG_VIDEO_START(stadhero)
diff --git a/src/mame/drivers/statriv2.c b/src/mame/drivers/statriv2.c
index 884a17dcfb4..9f8a62d42da 100644
--- a/src/mame/drivers/statriv2.c
+++ b/src/mame/drivers/statriv2.c
@@ -79,8 +79,8 @@ quaquiz2 - no inputs, needs NVRAM
class statriv2_state : public driver_device
{
public:
- statriv2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ statriv2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
tilemap_t *m_tilemap;
diff --git a/src/mame/drivers/stepstag.c b/src/mame/drivers/stepstag.c
index 9a59a337b40..6119005dde8 100644
--- a/src/mame/drivers/stepstag.c
+++ b/src/mame/drivers/stepstag.c
@@ -24,8 +24,8 @@
class stepstag_state : public driver_device
{
public:
- stepstag_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ stepstag_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/sub.c b/src/mame/drivers/sub.c
index d54983e56eb..d0029db42fc 100644
--- a/src/mame/drivers/sub.c
+++ b/src/mame/drivers/sub.c
@@ -115,8 +115,8 @@ PCB2 (Top board, CPU board)
class sub_state : public driver_device
{
public:
- sub_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sub_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8* m_vid;
UINT8* m_attr;
diff --git a/src/mame/drivers/subsino.c b/src/mame/drivers/subsino.c
index 589581113b3..e47a0155b58 100644
--- a/src/mame/drivers/subsino.c
+++ b/src/mame/drivers/subsino.c
@@ -231,8 +231,8 @@
class subsino_state : public driver_device
{
public:
- subsino_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ subsino_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/drivers/subsino2.c b/src/mame/drivers/subsino2.c
index f333e3d7abb..42f818992c7 100644
--- a/src/mame/drivers/subsino2.c
+++ b/src/mame/drivers/subsino2.c
@@ -77,8 +77,8 @@ struct layer_t
class subsino2_state : public driver_device
{
public:
- subsino2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ subsino2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_hm86171_colorram;
layer_t m_layers[2];
diff --git a/src/mame/drivers/supbtime.c b/src/mame/drivers/supbtime.c
index 08f7b968fc1..5cd71240f54 100644
--- a/src/mame/drivers/supbtime.c
+++ b/src/mame/drivers/supbtime.c
@@ -367,8 +367,8 @@ static MACHINE_CONFIG_START( supbtime, supbtime_state )
MCFG_PALETTE_LENGTH(1024)
MCFG_DECO16IC_ADD("tilegen1", supbtime_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -410,8 +410,8 @@ static MACHINE_CONFIG_START( chinatwn, supbtime_state )
MCFG_PALETTE_LENGTH(1024)
MCFG_DECO16IC_ADD("tilegen1", supbtime_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/supdrapo.c b/src/mame/drivers/supdrapo.c
index b1b8571dc62..2be72769424 100644
--- a/src/mame/drivers/supdrapo.c
+++ b/src/mame/drivers/supdrapo.c
@@ -68,8 +68,8 @@
class supdrapo_state : public driver_device
{
public:
- supdrapo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ supdrapo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_char_bank;
UINT8 *m_col_line;
diff --git a/src/mame/drivers/superdq.c b/src/mame/drivers/superdq.c
index be5ee411c08..e10528ae782 100644
--- a/src/mame/drivers/superdq.c
+++ b/src/mame/drivers/superdq.c
@@ -30,8 +30,8 @@
class superdq_state : public driver_device
{
public:
- superdq_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ superdq_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
device_t *m_laserdisc;
UINT8 m_ld_in_latch;
diff --git a/src/mame/drivers/supertnk.c b/src/mame/drivers/supertnk.c
index 970134f5b37..fdff8c34cd5 100644
--- a/src/mame/drivers/supertnk.c
+++ b/src/mame/drivers/supertnk.c
@@ -108,8 +108,8 @@ CRU lines:
class supertnk_state : public driver_device
{
public:
- supertnk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ supertnk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram[3];
UINT8 m_rom_bank;
diff --git a/src/mame/drivers/suprgolf.c b/src/mame/drivers/suprgolf.c
index c01fe9c3378..372370aba08 100644
--- a/src/mame/drivers/suprgolf.c
+++ b/src/mame/drivers/suprgolf.c
@@ -27,8 +27,8 @@
class suprgolf_state : public driver_device
{
public:
- suprgolf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ suprgolf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_tilemap;
UINT8 *m_videoram;
diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c
index 49dc48c1714..6b13c6fb163 100644
--- a/src/mame/drivers/suprnova.c
+++ b/src/mame/drivers/suprnova.c
@@ -814,7 +814,7 @@ static MACHINE_CONFIG_START( skns, skns_state )
MCFG_PALETTE_LENGTH(32768)
MCFG_GFXDECODE(skns_bg)
- MCFG_DEVICE_ADD("spritegen", sknsspr_, 0)
+ MCFG_DEVICE_ADD("spritegen", SKNS_SPRITE, 0)
MCFG_VIDEO_START(skns)
MCFG_VIDEO_RESET(skns)
diff --git a/src/mame/drivers/taito.c b/src/mame/drivers/taito.c
index 2052b2cec33..07d74923af1 100644
--- a/src/mame/drivers/taito.c
+++ b/src/mame/drivers/taito.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class taito_state : public driver_device
{
public:
- taito_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taito_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/taito_x.c b/src/mame/drivers/taito_x.c
index b6b5f1a1472..c06dd0ae4cd 100644
--- a/src/mame/drivers/taito_x.c
+++ b/src/mame/drivers/taito_x.c
@@ -324,8 +324,8 @@ Stephh's notes (based on the game M68000 code and some tests) :
class taitox_state : public seta_state
{
public:
- taitox_state(running_machine &machine, const driver_device_config_base &config)
- : seta_state(machine, config) { }
+ taitox_state(const machine_config &mconfig, device_type type, const char *tag)
+ : seta_state(mconfig, type, tag) { }
int m_banknum;
};
diff --git a/src/mame/drivers/taitogn.c b/src/mame/drivers/taitogn.c
index a51d32fdba6..7f513b69ca8 100644
--- a/src/mame/drivers/taitogn.c
+++ b/src/mame/drivers/taitogn.c
@@ -331,8 +331,8 @@ Type 3 (PCMCIA Compact Flash Adaptor + Compact Flash card, sealed together with
class taitogn_state : public psx_state
{
public:
- taitogn_state(running_machine &machine, const driver_device_config_base &config)
- : psx_state(machine, config) { }
+ taitogn_state(const machine_config &mconfig, device_type type, const char *tag)
+ : psx_state(mconfig, type, tag) { }
intel_te28f160_device *m_biosflash;
intel_e28f400_device *m_pgmflash;
diff --git a/src/mame/drivers/taitopjc.c b/src/mame/drivers/taitopjc.c
index 96038449f11..182b61de319 100644
--- a/src/mame/drivers/taitopjc.c
+++ b/src/mame/drivers/taitopjc.c
@@ -61,8 +61,8 @@
class taitopjc_state : public driver_device
{
public:
- taitopjc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taitopjc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/taitotz.c b/src/mame/drivers/taitotz.c
index d1331cb9a76..9cf6ff808a0 100644
--- a/src/mame/drivers/taitotz.c
+++ b/src/mame/drivers/taitotz.c
@@ -75,8 +75,8 @@ IC7 Panasonic MN1020819DA E68-01
class taitotz_state : public driver_device
{
public:
- taitotz_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taitotz_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/taitowlf.c b/src/mame/drivers/taitowlf.c
index 74ec833606c..83294d78a5b 100644
--- a/src/mame/drivers/taitowlf.c
+++ b/src/mame/drivers/taitowlf.c
@@ -21,8 +21,8 @@
class taitowlf_state : public driver_device
{
public:
- taitowlf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taitowlf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_cga_ram;
UINT32 *m_bios_ram;
diff --git a/src/mame/drivers/tattack.c b/src/mame/drivers/tattack.c
index bf02f8428c1..3d1509639e4 100644
--- a/src/mame/drivers/tattack.c
+++ b/src/mame/drivers/tattack.c
@@ -25,8 +25,8 @@
class tattack_state : public driver_device
{
public:
- tattack_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tattack_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/drivers/tcl.c b/src/mame/drivers/tcl.c
index efb1c73f82a..14874ef8562 100644
--- a/src/mame/drivers/tcl.c
+++ b/src/mame/drivers/tcl.c
@@ -49,8 +49,8 @@ Notes:
class tcl_state : public driver_device
{
public:
- tcl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tcl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/techno.c b/src/mame/drivers/techno.c
index 611f0d8374f..647a7dff42b 100644
--- a/src/mame/drivers/techno.c
+++ b/src/mame/drivers/techno.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class techno_state : public driver_device
{
public:
- techno_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ techno_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/tempest.c b/src/mame/drivers/tempest.c
index a22a49d3839..c4b77801847 100644
--- a/src/mame/drivers/tempest.c
+++ b/src/mame/drivers/tempest.c
@@ -289,8 +289,8 @@ Version 1 for Tempest Analog Vector-Generator PCB Assembly A037383-01 or A037383
class tempest_state : public driver_device
{
public:
- tempest_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tempest_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_player_select;
};
diff --git a/src/mame/drivers/tgtpanic.c b/src/mame/drivers/tgtpanic.c
index 3dba386c743..dbd3f8478d1 100644
--- a/src/mame/drivers/tgtpanic.c
+++ b/src/mame/drivers/tgtpanic.c
@@ -16,8 +16,8 @@
class tgtpanic_state : public driver_device
{
public:
- tgtpanic_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tgtpanic_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_ram;
UINT8 m_color;
diff --git a/src/mame/drivers/thayers.c b/src/mame/drivers/thayers.c
index 159f13d58b4..1f6d8232211 100644
--- a/src/mame/drivers/thayers.c
+++ b/src/mame/drivers/thayers.c
@@ -34,8 +34,8 @@ struct ssi263_t
class thayers_state : public driver_device
{
public:
- thayers_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ thayers_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
device_t *m_laserdisc;
UINT8 m_laserdisc_data;
diff --git a/src/mame/drivers/tickee.c b/src/mame/drivers/tickee.c
index 44ac392d433..9e2feeb35ea 100644
--- a/src/mame/drivers/tickee.c
+++ b/src/mame/drivers/tickee.c
@@ -32,8 +32,8 @@
class tickee_state : public driver_device
{
public:
- tickee_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tickee_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_control;
UINT16 *m_vram;
diff --git a/src/mame/drivers/timetrv.c b/src/mame/drivers/timetrv.c
index 4905afbd489..ca95d78d74b 100644
--- a/src/mame/drivers/timetrv.c
+++ b/src/mame/drivers/timetrv.c
@@ -30,8 +30,8 @@ CPU is an Intel 80188
class timetrv_state : public driver_device
{
public:
- timetrv_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ timetrv_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_led_vram_lo;
UINT8 *m_led_vram_hi;
diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c
index eaec4724d6b..f00a31f00b0 100644
--- a/src/mame/drivers/tmaster.c
+++ b/src/mame/drivers/tmaster.c
@@ -120,8 +120,8 @@ To Do:
class tmaster_state : public driver_device
{
public:
- tmaster_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tmaster_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_okibank;
UINT8 m_rtc_ram[8];
diff --git a/src/mame/drivers/tmmjprd.c b/src/mame/drivers/tmmjprd.c
index ba4ea344bbf..db0792d6186 100644
--- a/src/mame/drivers/tmmjprd.c
+++ b/src/mame/drivers/tmmjprd.c
@@ -39,8 +39,8 @@
class tmmjprd_state : public driver_device
{
public:
- tmmjprd_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tmmjprd_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_tilemap_regs[4];
UINT32 *m_spriteregs;
diff --git a/src/mame/drivers/tokyocop.c b/src/mame/drivers/tokyocop.c
index 714d67a8398..1c332dfcf9c 100644
--- a/src/mame/drivers/tokyocop.c
+++ b/src/mame/drivers/tokyocop.c
@@ -23,8 +23,8 @@ I/O Board with Altera Flex EPF15K50EQC240-3
class tokyocop_state : public driver_device
{
public:
- tokyocop_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tokyocop_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/tomcat.c b/src/mame/drivers/tomcat.c
index 8f78ba75850..c9df5f74e6a 100644
--- a/src/mame/drivers/tomcat.c
+++ b/src/mame/drivers/tomcat.c
@@ -39,8 +39,8 @@
class tomcat_state : public driver_device
{
public:
- tomcat_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tomcat_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_control_num;
UINT16 *m_shared_ram;
diff --git a/src/mame/drivers/toratora.c b/src/mame/drivers/toratora.c
index 0a9adc1f1ee..0e0c8b9a7a9 100644
--- a/src/mame/drivers/toratora.c
+++ b/src/mame/drivers/toratora.c
@@ -26,8 +26,8 @@ TODO:
class toratora_state : public driver_device
{
public:
- toratora_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ toratora_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/drivers/tourtabl.c b/src/mame/drivers/tourtabl.c
index a54009bdb78..10345cfb4e4 100644
--- a/src/mame/drivers/tourtabl.c
+++ b/src/mame/drivers/tourtabl.c
@@ -16,8 +16,8 @@
class tourtabl_state : public driver_device
{
public:
- tourtabl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tourtabl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/trvmadns.c b/src/mame/drivers/trvmadns.c
index bea8b911159..2dfc27a3f5e 100644
--- a/src/mame/drivers/trvmadns.c
+++ b/src/mame/drivers/trvmadns.c
@@ -68,8 +68,8 @@ Technology = NMOS
class trvmadns_state : public driver_device
{
public:
- trvmadns_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ trvmadns_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_bg_tilemap;
UINT8 *m_gfxram;
diff --git a/src/mame/drivers/ttchamp.c b/src/mame/drivers/ttchamp.c
index 4540e5ff013..2f9b87f491f 100644
--- a/src/mame/drivers/ttchamp.c
+++ b/src/mame/drivers/ttchamp.c
@@ -48,8 +48,8 @@ The PCB is Spanish and manufacured by Gamart.
class ttchamp_state : public driver_device
{
public:
- ttchamp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ttchamp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_peno_vram;
UINT16 m_paloff;
diff --git a/src/mame/drivers/tugboat.c b/src/mame/drivers/tugboat.c
index af1d7f13270..c30693b76cb 100644
--- a/src/mame/drivers/tugboat.c
+++ b/src/mame/drivers/tugboat.c
@@ -31,8 +31,8 @@ always false - counter was reloaded and incremented before interrupt occurs
class tugboat_state : public driver_device
{
public:
- tugboat_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tugboat_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_ram;
UINT8 m_hd46505_0_reg[18];
diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c
index 98fc8098543..2aec88bff6d 100644
--- a/src/mame/drivers/tumblep.c
+++ b/src/mame/drivers/tumblep.c
@@ -330,8 +330,8 @@ static MACHINE_CONFIG_START( tumblep, tumblep_state )
MCFG_PALETTE_LENGTH(1024)
MCFG_DECO16IC_ADD("tilegen1", tumblep_deco16ic_tilegen1_intf)
- MCFG_DEVICE_ADD("spritegen", decospr_, 0)
- decospr_device_config::set_gfx_region(device, 2);
+ MCFG_DEVICE_ADD("spritegen", DECO_SPRITE, 0)
+ decospr_device::set_gfx_region(*device, 2);
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
diff --git a/src/mame/drivers/turrett.c b/src/mame/drivers/turrett.c
index 74249f31b3f..ac6368d833d 100644
--- a/src/mame/drivers/turrett.c
+++ b/src/mame/drivers/turrett.c
@@ -64,8 +64,8 @@ Windows showed a 5.94 gig partion empty and a 12.74 unallocated partition
class turrett_state : public driver_device
{
public:
- turrett_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ turrett_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/twinkle.c b/src/mame/drivers/twinkle.c
index 2f3bca9566d..0c2df6e0d70 100644
--- a/src/mame/drivers/twinkle.c
+++ b/src/mame/drivers/twinkle.c
@@ -239,8 +239,8 @@ Notes:
class twinkle_state : public psx_state
{
public:
- twinkle_state(running_machine &machine, const driver_device_config_base &config)
- : psx_state(machine, config) { }
+ twinkle_state(const machine_config &mconfig, device_type type, const char *tag)
+ : psx_state(mconfig, type, tag) { }
UINT16 m_spu_ctrl; // SPU board control register
UINT8 m_spu_shared[0x400]; // SPU/PSX shared dual-ported RAM
diff --git a/src/mame/drivers/twins.c b/src/mame/drivers/twins.c
index ad1fbd483f1..30e1d68fb5b 100644
--- a/src/mame/drivers/twins.c
+++ b/src/mame/drivers/twins.c
@@ -56,8 +56,8 @@ Electronic Devices was printed on rom labels
class twins_state : public driver_device
{
public:
- twins_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ twins_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT16 *m_pal;
diff --git a/src/mame/drivers/uapce.c b/src/mame/drivers/uapce.c
index 21cc8647717..163b5a36bd0 100644
--- a/src/mame/drivers/uapce.c
+++ b/src/mame/drivers/uapce.c
@@ -35,8 +35,8 @@
class uapce_state : public driver_device
{
public:
- uapce_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ uapce_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_jamma_if_control_latch;
};
diff --git a/src/mame/drivers/ultrsprt.c b/src/mame/drivers/ultrsprt.c
index d8a7f09f93a..175fc6dd0fb 100644
--- a/src/mame/drivers/ultrsprt.c
+++ b/src/mame/drivers/ultrsprt.c
@@ -20,8 +20,8 @@ TODO:
class ultrsprt_state : public driver_device
{
public:
- ultrsprt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ultrsprt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_vram;
UINT32 *m_workram;
diff --git a/src/mame/drivers/upscope.c b/src/mame/drivers/upscope.c
index 4160c305316..3c8b15fb008 100644
--- a/src/mame/drivers/upscope.c
+++ b/src/mame/drivers/upscope.c
@@ -33,8 +33,8 @@
class upscope_state : public amiga_state
{
public:
- upscope_state(running_machine &machine, const driver_device_config_base &config)
- : amiga_state(machine, config) { }
+ upscope_state(const machine_config &mconfig, device_type type, const char *tag)
+ : amiga_state(mconfig, type, tag) { }
UINT8 m_nvram[0x100];
UINT8 m_prev_cia1_porta;
diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c
index 9c5f5f0f39b..f84fce72dcc 100644
--- a/src/mame/drivers/vamphalf.c
+++ b/src/mame/drivers/vamphalf.c
@@ -48,8 +48,8 @@
class vamphalf_state : public driver_device
{
public:
- vamphalf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vamphalf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_tiles;
UINT16 *m_wram;
diff --git a/src/mame/drivers/vaportra.c b/src/mame/drivers/vaportra.c
index ee8e3ac1275..ef5b197f29f 100644
--- a/src/mame/drivers/vaportra.c
+++ b/src/mame/drivers/vaportra.c
@@ -294,8 +294,8 @@ static MACHINE_CONFIG_START( vaportra, vaportra_state )
MCFG_DECO16IC_ADD("tilegen2", vaportra_deco16ic_tilegen2_intf)
- MCFG_DEVICE_ADD("spritegen", deco_mxc06_, 0)
- deco_mxc06_device_config::set_gfx_region(device, 4);
+ MCFG_DEVICE_ADD("spritegen", DECO_MXC06, 0)
+ deco_mxc06_device::set_gfx_region(*device, 4);
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c
index 86e2fbba2ca..1f4d5d3dd82 100644
--- a/src/mame/drivers/vcombat.c
+++ b/src/mame/drivers/vcombat.c
@@ -93,8 +93,8 @@ TODO : This is a partially working driver. Most of the memory maps for
class vcombat_state : public driver_device
{
public:
- vcombat_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vcombat_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16* m_m68k_framebuffer[2];
UINT16* m_i860_framebuffer[2][2];
diff --git a/src/mame/drivers/vd.c b/src/mame/drivers/vd.c
index 196936e25bf..da69c8bdf0e 100644
--- a/src/mame/drivers/vd.c
+++ b/src/mame/drivers/vd.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class vd_state : public driver_device
{
public:
- vd_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vd_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/vega.c b/src/mame/drivers/vega.c
index 37552f4ef32..4b32773e59e 100644
--- a/src/mame/drivers/vega.c
+++ b/src/mame/drivers/vega.c
@@ -19,8 +19,8 @@
class vega_state : public driver_device
{
public:
- vega_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vega_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/vegaeo.c b/src/mame/drivers/vegaeo.c
index fef8f44e494..e881606ae5b 100644
--- a/src/mame/drivers/vegaeo.c
+++ b/src/mame/drivers/vegaeo.c
@@ -22,8 +22,8 @@
class vegaeo_state : public driver_device
{
public:
- vegaeo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vegaeo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_vega_vram;
UINT8 m_vega_vbuffer;
diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c
index a5be8c0a839..db2a894208b 100644
--- a/src/mame/drivers/vegas.c
+++ b/src/mame/drivers/vegas.c
@@ -458,8 +458,8 @@ typedef struct
class vegas_state : public driver_device
{
public:
- vegas_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ vegas_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_timekeeper(*this, "timekeeper") { }
required_device<m48t37_device> m_timekeeper;
diff --git a/src/mame/drivers/videopkr.c b/src/mame/drivers/videopkr.c
index b0eed592339..fcde00949ed 100644
--- a/src/mame/drivers/videopkr.c
+++ b/src/mame/drivers/videopkr.c
@@ -297,8 +297,8 @@
class videopkr_state : public driver_device
{
public:
- videopkr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ videopkr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_data_ram[0x100];
UINT8 m_video_ram[0x0400];
diff --git a/src/mame/drivers/viper.c b/src/mame/drivers/viper.c
index ccf4c0b8925..6b38bcf6579 100644
--- a/src/mame/drivers/viper.c
+++ b/src/mame/drivers/viper.c
@@ -114,8 +114,8 @@ static SCREEN_UPDATE(viper)
class viper_state : public driver_device
{
public:
- viper_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ viper_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 m_epic_iack;
@@ -982,7 +982,7 @@ static INTERRUPT_GEN(viper_vblank)
//mpc8240_interrupt(device->machine, MPC8240_IRQ3);
}
-static void voodoo_vblank(const device_config *device, int param)
+static void voodoo_vblank(const device_t *device, int param)
{
//mpc8240_interrupt(device->machine, MPC8240_IRQ4);
}
diff --git a/src/mame/drivers/vmetal.c b/src/mame/drivers/vmetal.c
index ccbe28b255c..12f5611cdf9 100644
--- a/src/mame/drivers/vmetal.c
+++ b/src/mame/drivers/vmetal.c
@@ -82,8 +82,8 @@ cleanup
class vmetal_state : public metro_state
{
public:
- vmetal_state(running_machine &machine, const driver_device_config_base &config)
- : metro_state(machine, config) { }
+ vmetal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : metro_state(mconfig, type, tag) { }
UINT16 *m_texttileram;
UINT16 *m_mid1tileram;
diff --git a/src/mame/drivers/vp101.c b/src/mame/drivers/vp101.c
index 1f1689455db..bb7c4d45e48 100644
--- a/src/mame/drivers/vp101.c
+++ b/src/mame/drivers/vp101.c
@@ -20,8 +20,8 @@
class vp101_state : public driver_device
{
public:
- vp101_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vp101_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/vpoker.c b/src/mame/drivers/vpoker.c
index b85ff8c2653..0d4f77dd853 100644
--- a/src/mame/drivers/vpoker.c
+++ b/src/mame/drivers/vpoker.c
@@ -115,8 +115,8 @@ nm23114 x2
class vpoker_state : public driver_device
{
public:
- vpoker_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vpoker_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_blit_ram[8];
diff --git a/src/mame/drivers/vroulet.c b/src/mame/drivers/vroulet.c
index ab30767c284..645ade85b82 100644
--- a/src/mame/drivers/vroulet.c
+++ b/src/mame/drivers/vroulet.c
@@ -44,8 +44,8 @@ Tomasz Slanina 20050225
class vroulet_state : public driver_device
{
public:
- vroulet_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vroulet_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_ball;
UINT8 *m_videoram;
diff --git a/src/mame/drivers/wallc.c b/src/mame/drivers/wallc.c
index 73a3db11639..f74963f0b8d 100644
--- a/src/mame/drivers/wallc.c
+++ b/src/mame/drivers/wallc.c
@@ -56,8 +56,8 @@ Thanks to HIGHWAYMAN for providing info on how to get to these epoxies
class wallc_state : public driver_device
{
public:
- wallc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wallc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/drivers/wardner.c b/src/mame/drivers/wardner.c
index c0812f42f8d..e695e5856e1 100644
--- a/src/mame/drivers/wardner.c
+++ b/src/mame/drivers/wardner.c
@@ -135,8 +135,8 @@ out:
class wardner_state : public twincobr_state
{
public:
- wardner_state(running_machine &machine, const driver_device_config_base &config)
- : twincobr_state(machine, config) { }
+ wardner_state(const machine_config &mconfig, device_type type, const char *tag)
+ : twincobr_state(mconfig, type,tag) { }
UINT8 *m_rambase_ae00;
UINT8 *m_rambase_c000;
diff --git a/src/mame/drivers/wheelfir.c b/src/mame/drivers/wheelfir.c
index 9e9120df43c..f2a46fdd95c 100644
--- a/src/mame/drivers/wheelfir.c
+++ b/src/mame/drivers/wheelfir.c
@@ -228,8 +228,8 @@ struct scroll_info
class wheelfir_state : public driver_device
{
public:
- wheelfir_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wheelfir_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
device_t *m_maincpu;
device_t *m_subcpu;
diff --git a/src/mame/drivers/white_mod.c b/src/mame/drivers/white_mod.c
index 8f2b417304a..94b17d5239c 100644
--- a/src/mame/drivers/white_mod.c
+++ b/src/mame/drivers/white_mod.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class whitestar_mod_state : public driver_device
{
public:
- whitestar_mod_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ whitestar_mod_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/whitestar.c b/src/mame/drivers/whitestar.c
index 6caadf64da3..77d10b100ec 100644
--- a/src/mame/drivers/whitestar.c
+++ b/src/mame/drivers/whitestar.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class whitestar_state : public driver_device
{
public:
- whitestar_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ whitestar_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/wico.c b/src/mame/drivers/wico.c
index c3272a6fde6..244c0db9ac0 100644
--- a/src/mame/drivers/wico.c
+++ b/src/mame/drivers/wico.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class wico_state : public driver_device
{
public:
- wico_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wico_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/wink.c b/src/mame/drivers/wink.c
index b7ccff65977..0a3343c7621 100644
--- a/src/mame/drivers/wink.c
+++ b/src/mame/drivers/wink.c
@@ -20,8 +20,8 @@
class wink_state : public driver_device
{
public:
- wink_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wink_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/drivers/witch.c b/src/mame/drivers/witch.c
index 9da3d3f1ff5..a3e12b4306c 100644
--- a/src/mame/drivers/witch.c
+++ b/src/mame/drivers/witch.c
@@ -199,8 +199,8 @@ TODO :
class witch_state : public driver_device
{
public:
- witch_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ witch_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_gfx0a_tilemap;
tilemap_t *m_gfx0b_tilemap;
diff --git a/src/mame/drivers/wldarrow.c b/src/mame/drivers/wldarrow.c
index f6a56ac5b7f..6d89e92f70b 100644
--- a/src/mame/drivers/wldarrow.c
+++ b/src/mame/drivers/wldarrow.c
@@ -28,8 +28,8 @@ todo:
class wldarrow_state : public driver_device
{
public:
- wldarrow_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wldarrow_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram_0;
UINT8 *m_videoram_1;
diff --git a/src/mame/drivers/wpc_95.c b/src/mame/drivers/wpc_95.c
index f539eace04d..75cdcd9d0cd 100644
--- a/src/mame/drivers/wpc_95.c
+++ b/src/mame/drivers/wpc_95.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class wpc_95_state : public driver_device
{
public:
- wpc_95_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wpc_95_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/wpc_an.c b/src/mame/drivers/wpc_an.c
index ef36d9f269f..362c2e647d6 100644
--- a/src/mame/drivers/wpc_an.c
+++ b/src/mame/drivers/wpc_an.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class wpc_an_state : public driver_device
{
public:
- wpc_an_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wpc_an_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/wpc_dcs.c b/src/mame/drivers/wpc_dcs.c
index 94a1288a346..c916554ea4f 100644
--- a/src/mame/drivers/wpc_dcs.c
+++ b/src/mame/drivers/wpc_dcs.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class wpc_dcs_state : public driver_device
{
public:
- wpc_dcs_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wpc_dcs_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/wpc_dot.c b/src/mame/drivers/wpc_dot.c
index b49ed6d0260..6f7288bd146 100644
--- a/src/mame/drivers/wpc_dot.c
+++ b/src/mame/drivers/wpc_dot.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class wpc_dot_state : public driver_device
{
public:
- wpc_dot_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wpc_dot_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/wpc_flip1.c b/src/mame/drivers/wpc_flip1.c
index 24d8d32b5ec..c4ed13a8a6c 100644
--- a/src/mame/drivers/wpc_flip1.c
+++ b/src/mame/drivers/wpc_flip1.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class wpc_flip1_state : public driver_device
{
public:
- wpc_flip1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wpc_flip1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/wpc_flip2.c b/src/mame/drivers/wpc_flip2.c
index d6c495e5430..331218852ba 100644
--- a/src/mame/drivers/wpc_flip2.c
+++ b/src/mame/drivers/wpc_flip2.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class wpc_flip2_state : public driver_device
{
public:
- wpc_flip2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wpc_flip2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/wpc_s.c b/src/mame/drivers/wpc_s.c
index 0cc63f3d298..359331ed2eb 100644
--- a/src/mame/drivers/wpc_s.c
+++ b/src/mame/drivers/wpc_s.c
@@ -6,8 +6,8 @@ extern const char layout_pinball[];
class wpc_s_state : public driver_device
{
public:
- wpc_s_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wpc_s_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c
index 5f16f07d3dd..6487c1c70a8 100644
--- a/src/mame/drivers/xtheball.c
+++ b/src/mame/drivers/xtheball.c
@@ -17,8 +17,8 @@
class xtheball_state : public driver_device
{
public:
- xtheball_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ xtheball_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_vram_bg;
UINT16 *m_vram_fg;
diff --git a/src/mame/drivers/xtom3d.c b/src/mame/drivers/xtom3d.c
index e49661d6ed3..3c43b27b781 100644
--- a/src/mame/drivers/xtom3d.c
+++ b/src/mame/drivers/xtom3d.c
@@ -50,8 +50,8 @@ MX29F1610MC 16M FlashROM (x7)
class xtom3d_state : public driver_device
{
public:
- xtom3d_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ xtom3d_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/zac_1.c b/src/mame/drivers/zac_1.c
index 6cd73e45906..3338f0b587a 100644
--- a/src/mame/drivers/zac_1.c
+++ b/src/mame/drivers/zac_1.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class zac_1_state : public driver_device
{
public:
- zac_1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ zac_1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/zac_2.c b/src/mame/drivers/zac_2.c
index 6ea1b24aef9..fc028875c9d 100644
--- a/src/mame/drivers/zac_2.c
+++ b/src/mame/drivers/zac_2.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class zac_2_state : public driver_device
{
public:
- zac_2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ zac_2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/zac_proto.c b/src/mame/drivers/zac_proto.c
index 6d92422d784..c1f73e6272e 100644
--- a/src/mame/drivers/zac_proto.c
+++ b/src/mame/drivers/zac_proto.c
@@ -9,8 +9,8 @@ extern const char layout_pinball[];
class zac_proto_state : public driver_device
{
public:
- zac_proto_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ zac_proto_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c
index 8db2dc8ef3b..4480beadf39 100644
--- a/src/mame/drivers/zn.c
+++ b/src/mame/drivers/zn.c
@@ -31,8 +31,8 @@
class zn_state : public psx_state
{
public:
- zn_state(running_machine &machine, const driver_device_config_base &config)
- : psx_state(machine, config) { }
+ zn_state(const machine_config &mconfig, device_type type, const char *tag)
+ : psx_state(mconfig, type, tag) { }
UINT32 m_n_znsecsel;
UINT32 m_b_znsecport;
diff --git a/src/mame/drivers/zr107.c b/src/mame/drivers/zr107.c
index c57bca533e7..c2d882509ae 100644
--- a/src/mame/drivers/zr107.c
+++ b/src/mame/drivers/zr107.c
@@ -180,8 +180,8 @@ Check gticlub.c for details on the bottom board.
class zr107_state : public driver_device
{
public:
- zr107_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ zr107_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_led_reg0;
UINT8 m_led_reg1;
diff --git a/src/mame/includes/1942.h b/src/mame/includes/1942.h
index b146f1d8e05..bfd3b40c2b8 100644
--- a/src/mame/includes/1942.h
+++ b/src/mame/includes/1942.h
@@ -7,8 +7,8 @@
class _1942_state : public driver_device
{
public:
- _1942_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ _1942_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_fg_videoram;
diff --git a/src/mame/includes/1943.h b/src/mame/includes/1943.h
index 6988726c630..b59e5df0eb5 100644
--- a/src/mame/includes/1943.h
+++ b/src/mame/includes/1943.h
@@ -7,8 +7,8 @@
class _1943_state : public driver_device
{
public:
- _1943_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ _1943_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/20pacgal.h b/src/mame/includes/20pacgal.h
index ffb8e294ed4..a9b775e122e 100644
--- a/src/mame/includes/20pacgal.h
+++ b/src/mame/includes/20pacgal.h
@@ -10,8 +10,8 @@
class _20pacgal_state : public driver_device
{
public:
- _20pacgal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ _20pacgal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 *m_char_gfx_ram;
diff --git a/src/mame/includes/40love.h b/src/mame/includes/40love.h
index 0ac4986d9c2..0a4a3ed4565 100644
--- a/src/mame/includes/40love.h
+++ b/src/mame/includes/40love.h
@@ -1,8 +1,8 @@
class fortyl_state : public driver_device
{
public:
- fortyl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ fortyl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/4enraya.h b/src/mame/includes/4enraya.h
index e85fda6e67a..80443d68d4e 100644
--- a/src/mame/includes/4enraya.h
+++ b/src/mame/includes/4enraya.h
@@ -7,8 +7,8 @@
class _4enraya_state : public driver_device
{
public:
- _4enraya_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ _4enraya_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 m_videoram[0x1000];
diff --git a/src/mame/includes/8080bw.h b/src/mame/includes/8080bw.h
index 07ae3f9eff0..e75099bccc6 100644
--- a/src/mame/includes/8080bw.h
+++ b/src/mame/includes/8080bw.h
@@ -13,8 +13,8 @@
class _8080bw_state : public mw8080bw_state
{
public:
- _8080bw_state(running_machine &machine, const driver_device_config_base &config)
- : mw8080bw_state(machine, config) { }
+ _8080bw_state(const machine_config &mconfig, device_type type, const char *tag)
+ : mw8080bw_state(mconfig, type, tag) { }
/* misc game specific */
emu_timer *m_schaser_effect_555_timer;
diff --git a/src/mame/includes/88games.h b/src/mame/includes/88games.h
index 039451ffb46..adf3ef8b12c 100644
--- a/src/mame/includes/88games.h
+++ b/src/mame/includes/88games.h
@@ -7,8 +7,8 @@
class _88games_state : public driver_device
{
public:
- _88games_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ _88games_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/actfancr.h b/src/mame/includes/actfancr.h
index 5b5b7a49b10..066d05736a3 100644
--- a/src/mame/includes/actfancr.h
+++ b/src/mame/includes/actfancr.h
@@ -7,8 +7,8 @@
class actfancr_state : public driver_device
{
public:
- actfancr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ actfancr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_main_ram;
diff --git a/src/mame/includes/aeroboto.h b/src/mame/includes/aeroboto.h
index 7b9dbe09173..cf08f9a7146 100644
--- a/src/mame/includes/aeroboto.h
+++ b/src/mame/includes/aeroboto.h
@@ -7,8 +7,8 @@
class aeroboto_state : public driver_device
{
public:
- aeroboto_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ aeroboto_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_mainram;
diff --git a/src/mame/includes/aerofgt.h b/src/mame/includes/aerofgt.h
index 3c40658afa0..ef3df6c8929 100644
--- a/src/mame/includes/aerofgt.h
+++ b/src/mame/includes/aerofgt.h
@@ -2,8 +2,8 @@
class aerofgt_state : public driver_device
{
public:
- aerofgt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ aerofgt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bg1videoram;
diff --git a/src/mame/includes/airbustr.h b/src/mame/includes/airbustr.h
index 2d4bd18335d..a8e3538392c 100644
--- a/src/mame/includes/airbustr.h
+++ b/src/mame/includes/airbustr.h
@@ -7,8 +7,8 @@
class airbustr_state : public driver_device
{
public:
- airbustr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ airbustr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/ajax.h b/src/mame/includes/ajax.h
index a26cfd29a4f..f9e6fd08a56 100644
--- a/src/mame/includes/ajax.h
+++ b/src/mame/includes/ajax.h
@@ -2,8 +2,8 @@
class ajax_state : public driver_device
{
public:
- ajax_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ajax_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT8 * m_paletteram; // currently this uses generic palette handling
diff --git a/src/mame/includes/aliens.h b/src/mame/includes/aliens.h
index 3767a38faee..2180af2f237 100644
--- a/src/mame/includes/aliens.h
+++ b/src/mame/includes/aliens.h
@@ -7,8 +7,8 @@
class aliens_state : public driver_device
{
public:
- aliens_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ aliens_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/alpha68k.h b/src/mame/includes/alpha68k.h
index 1aa7a58cb54..b104fbe4e18 100644
--- a/src/mame/includes/alpha68k.h
+++ b/src/mame/includes/alpha68k.h
@@ -7,8 +7,8 @@
class alpha68k_state : public driver_device
{
public:
- alpha68k_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ alpha68k_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/includes/ambush.h b/src/mame/includes/ambush.h
index fc369e3fdf7..212c864de0d 100644
--- a/src/mame/includes/ambush.h
+++ b/src/mame/includes/ambush.h
@@ -7,8 +7,8 @@
class ambush_state : public driver_device
{
public:
- ambush_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ambush_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h
index 24a98b5fe69..c11bb725361 100644
--- a/src/mame/includes/amiga.h
+++ b/src/mame/includes/amiga.h
@@ -375,8 +375,8 @@ struct _autoconfig_device
class amiga_state : public driver_device
{
public:
- amiga_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ amiga_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_chip_ram;
size_t m_chip_ram_size;
diff --git a/src/mame/includes/ampoker2.h b/src/mame/includes/ampoker2.h
index 114a47a9c25..5c2284c8874 100644
--- a/src/mame/includes/ampoker2.h
+++ b/src/mame/includes/ampoker2.h
@@ -1,8 +1,8 @@
class ampoker2_state : public driver_device
{
public:
- ampoker2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ampoker2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/includes/amspdwy.h b/src/mame/includes/amspdwy.h
index 41ecb4b7caa..46ac2027bb1 100644
--- a/src/mame/includes/amspdwy.h
+++ b/src/mame/includes/amspdwy.h
@@ -7,8 +7,8 @@
class amspdwy_state : public driver_device
{
public:
- amspdwy_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ amspdwy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/angelkds.h b/src/mame/includes/angelkds.h
index dd9530540c2..5c4d0f8bd07 100644
--- a/src/mame/includes/angelkds.h
+++ b/src/mame/includes/angelkds.h
@@ -7,8 +7,8 @@
class angelkds_state : public driver_device
{
public:
- angelkds_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ angelkds_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_paletteram;
diff --git a/src/mame/includes/appoooh.h b/src/mame/includes/appoooh.h
index 7fae09c0273..769e7d78ed4 100644
--- a/src/mame/includes/appoooh.h
+++ b/src/mame/includes/appoooh.h
@@ -3,8 +3,8 @@
class appoooh_state : public driver_device
{
public:
- appoooh_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ appoooh_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bg_videoram;
diff --git a/src/mame/includes/aquarium.h b/src/mame/includes/aquarium.h
index aafdce7a669..578e9a1e660 100644
--- a/src/mame/includes/aquarium.h
+++ b/src/mame/includes/aquarium.h
@@ -4,8 +4,8 @@
class aquarium_state : public driver_device
{
public:
- aquarium_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ aquarium_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_scroll;
diff --git a/src/mame/includes/arabian.h b/src/mame/includes/arabian.h
index 6691e672dd6..d160b8812c1 100644
--- a/src/mame/includes/arabian.h
+++ b/src/mame/includes/arabian.h
@@ -9,8 +9,8 @@
class arabian_state : public driver_device
{
public:
- arabian_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ arabian_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_blitter;
diff --git a/src/mame/includes/arcadecl.h b/src/mame/includes/arcadecl.h
index fd54696f44d..c139b91c191 100644
--- a/src/mame/includes/arcadecl.h
+++ b/src/mame/includes/arcadecl.h
@@ -10,8 +10,8 @@
class arcadecl_state : public atarigen_state
{
public:
- arcadecl_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ arcadecl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 * m_bitmap;
UINT8 m_has_mo;
diff --git a/src/mame/includes/argus.h b/src/mame/includes/argus.h
index 35a10f783e9..43a8b4c66b9 100644
--- a/src/mame/includes/argus.h
+++ b/src/mame/includes/argus.h
@@ -1,8 +1,8 @@
class argus_state : public driver_device
{
public:
- argus_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ argus_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_paletteram;
UINT8 *m_txram;
diff --git a/src/mame/includes/arkanoid.h b/src/mame/includes/arkanoid.h
index ac83ae91c90..b12fe8595e0 100644
--- a/src/mame/includes/arkanoid.h
+++ b/src/mame/includes/arkanoid.h
@@ -13,8 +13,8 @@ enum {
class arkanoid_state : public driver_device
{
public:
- arkanoid_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ arkanoid_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/armedf.h b/src/mame/includes/armedf.h
index 3b73a732b8c..725e28f786c 100644
--- a/src/mame/includes/armedf.h
+++ b/src/mame/includes/armedf.h
@@ -2,8 +2,8 @@
class armedf_state : public driver_device
{
public:
- armedf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ armedf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_text_videoram;
@@ -33,8 +33,8 @@ public:
class bigfghtr_state : public armedf_state
{
public:
- bigfghtr_state(running_machine &machine, const driver_device_config_base &config)
- : armedf_state(machine, config) { }
+ bigfghtr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : armedf_state(mconfig, type, tag) { }
UINT16 * m_sharedram;
diff --git a/src/mame/includes/artmagic.h b/src/mame/includes/artmagic.h
index d05e8c66fbd..0b2ab227b81 100644
--- a/src/mame/includes/artmagic.h
+++ b/src/mame/includes/artmagic.h
@@ -7,8 +7,8 @@
class artmagic_state : public driver_device
{
public:
- artmagic_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ artmagic_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_control;
UINT8 m_tms_irq;
diff --git a/src/mame/includes/ashnojoe.h b/src/mame/includes/ashnojoe.h
index ed589e92a5d..661b5fcb69f 100644
--- a/src/mame/includes/ashnojoe.h
+++ b/src/mame/includes/ashnojoe.h
@@ -7,8 +7,8 @@
class ashnojoe_state : public driver_device
{
public:
- ashnojoe_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ashnojoe_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_tileram;
diff --git a/src/mame/includes/asterix.h b/src/mame/includes/asterix.h
index edb9e686149..fcac032cfd2 100644
--- a/src/mame/includes/asterix.h
+++ b/src/mame/includes/asterix.h
@@ -7,8 +7,8 @@
class asterix_state : public driver_device
{
public:
- asterix_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ asterix_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT16 * m_paletteram; // currently this uses generic palette handling
diff --git a/src/mame/includes/asteroid.h b/src/mame/includes/asteroid.h
index 159096392e0..61d96b9f959 100644
--- a/src/mame/includes/asteroid.h
+++ b/src/mame/includes/asteroid.h
@@ -9,8 +9,8 @@
class asteroid_state : public driver_device
{
public:
- asteroid_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ asteroid_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_ram1;
UINT8 *m_ram2;
diff --git a/src/mame/includes/astrocde.h b/src/mame/includes/astrocde.h
index dd6e54f5cf4..5357f85b35c 100644
--- a/src/mame/includes/astrocde.h
+++ b/src/mame/includes/astrocde.h
@@ -15,8 +15,8 @@
class astrocde_state : public driver_device
{
public:
- astrocde_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ astrocde_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_video_config;
diff --git a/src/mame/includes/astrof.h b/src/mame/includes/astrof.h
index 4a077716cac..246cad2598f 100644
--- a/src/mame/includes/astrof.h
+++ b/src/mame/includes/astrof.h
@@ -7,8 +7,8 @@
class astrof_state : public driver_device
{
public:
- astrof_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ astrof_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
UINT8 * m_videoram;
diff --git a/src/mame/includes/asuka.h b/src/mame/includes/asuka.h
index 04f77809e70..d022ccfead8 100644
--- a/src/mame/includes/asuka.h
+++ b/src/mame/includes/asuka.h
@@ -7,8 +7,8 @@
class asuka_state : public driver_device
{
public:
- asuka_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ asuka_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT16 * paletteram; // this currently uses generic palette handlers
diff --git a/src/mame/includes/atarifb.h b/src/mame/includes/atarifb.h
index eb39a2007ec..47ecdbd01a8 100644
--- a/src/mame/includes/atarifb.h
+++ b/src/mame/includes/atarifb.h
@@ -18,8 +18,8 @@
class atarifb_state : public driver_device
{
public:
- atarifb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ atarifb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
UINT8 * m_alphap1_videoram;
diff --git a/src/mame/includes/atarig1.h b/src/mame/includes/atarig1.h
index 3382d5051f2..68621a68610 100644
--- a/src/mame/includes/atarig1.h
+++ b/src/mame/includes/atarig1.h
@@ -9,8 +9,8 @@
class atarig1_state : public atarigen_state
{
public:
- atarig1_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ atarig1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT8 m_is_pitfight;
diff --git a/src/mame/includes/atarig42.h b/src/mame/includes/atarig42.h
index 218237deaa2..735775246b5 100644
--- a/src/mame/includes/atarig42.h
+++ b/src/mame/includes/atarig42.h
@@ -9,8 +9,8 @@
class atarig42_state : public atarigen_state
{
public:
- atarig42_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ atarig42_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 m_playfield_base;
diff --git a/src/mame/includes/atarigt.h b/src/mame/includes/atarigt.h
index 746ad541dd4..9e04721d894 100644
--- a/src/mame/includes/atarigt.h
+++ b/src/mame/includes/atarigt.h
@@ -16,8 +16,8 @@
class atarigt_state : public atarigen_state
{
public:
- atarigt_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ atarigt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT8 m_is_primrage;
UINT16 * m_colorram;
diff --git a/src/mame/includes/atarigx2.h b/src/mame/includes/atarigx2.h
index 3197a8c26bc..81e92b9c8f4 100644
--- a/src/mame/includes/atarigx2.h
+++ b/src/mame/includes/atarigx2.h
@@ -9,8 +9,8 @@
class atarigx2_state : public atarigen_state
{
public:
- atarigx2_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ atarigx2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 m_playfield_base;
diff --git a/src/mame/includes/atarisy1.h b/src/mame/includes/atarisy1.h
index 6b3fb2f3b21..69adad05bde 100644
--- a/src/mame/includes/atarisy1.h
+++ b/src/mame/includes/atarisy1.h
@@ -9,8 +9,8 @@
class atarisy1_state : public atarigen_state
{
public:
- atarisy1_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config),
+ atarisy1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag),
m_joystick_timer(*this, "joystick_timer"),
m_yscroll_reset_timer(*this, "yreset_timer"),
m_scanline_timer(*this, "scan_timer"),
diff --git a/src/mame/includes/atarisy2.h b/src/mame/includes/atarisy2.h
index 68be7cc0006..8ee7ddb914b 100644
--- a/src/mame/includes/atarisy2.h
+++ b/src/mame/includes/atarisy2.h
@@ -9,8 +9,8 @@
class atarisy2_state : public atarigen_state
{
public:
- atarisy2_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ atarisy2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 * m_slapstic_base;
diff --git a/src/mame/includes/atetris.h b/src/mame/includes/atetris.h
index c655c193c74..2e1bd165730 100644
--- a/src/mame/includes/atetris.h
+++ b/src/mame/includes/atetris.h
@@ -7,8 +7,8 @@
class atetris_state : public driver_device
{
public:
- atetris_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ atetris_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT8> m_nvram;
diff --git a/src/mame/includes/avalnche.h b/src/mame/includes/avalnche.h
index d92097e4487..cd51c34fd4a 100644
--- a/src/mame/includes/avalnche.h
+++ b/src/mame/includes/avalnche.h
@@ -10,8 +10,8 @@
class avalnche_state : public driver_device
{
public:
- avalnche_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ avalnche_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
UINT8 * m_videoram;
diff --git a/src/mame/includes/aztarac.h b/src/mame/includes/aztarac.h
index 6d03394b6ac..0a21f2dd297 100644
--- a/src/mame/includes/aztarac.h
+++ b/src/mame/includes/aztarac.h
@@ -7,8 +7,8 @@
class aztarac_state : public driver_device
{
public:
- aztarac_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ aztarac_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT16> m_nvram;
diff --git a/src/mame/includes/badlands.h b/src/mame/includes/badlands.h
index 46f6958076f..ed8b84e4765 100644
--- a/src/mame/includes/badlands.h
+++ b/src/mame/includes/badlands.h
@@ -9,8 +9,8 @@
class badlands_state : public atarigen_state
{
public:
- badlands_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ badlands_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT8 m_pedal_value[2];
diff --git a/src/mame/includes/bagman.h b/src/mame/includes/bagman.h
index 73d21aaed3b..c24b888a11e 100644
--- a/src/mame/includes/bagman.h
+++ b/src/mame/includes/bagman.h
@@ -2,8 +2,8 @@
class bagman_state : public driver_device
{
public:
- bagman_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bagman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_ls259_buf[8];
UINT8 m_p1_res;
diff --git a/src/mame/includes/balsente.h b/src/mame/includes/balsente.h
index 01cf6787fe3..09156d7c961 100644
--- a/src/mame/includes/balsente.h
+++ b/src/mame/includes/balsente.h
@@ -29,8 +29,8 @@
class balsente_state : public driver_device
{
public:
- balsente_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ balsente_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_scanline_timer(*this, "scan_timer"),
m_counter_0_timer(*this, "8253_0_timer"),
m_cem1(*this, "cem1"),
diff --git a/src/mame/includes/bankp.h b/src/mame/includes/bankp.h
index 1fae0ad0e8f..9633b478a33 100644
--- a/src/mame/includes/bankp.h
+++ b/src/mame/includes/bankp.h
@@ -12,8 +12,8 @@
class bankp_state : public driver_device
{
public:
- bankp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bankp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/baraduke.h b/src/mame/includes/baraduke.h
index 9d3fa0ea161..fea629e3454 100644
--- a/src/mame/includes/baraduke.h
+++ b/src/mame/includes/baraduke.h
@@ -1,8 +1,8 @@
class baraduke_state : public driver_device
{
public:
- baraduke_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ baraduke_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_inputport_selected;
int m_counter;
diff --git a/src/mame/includes/batman.h b/src/mame/includes/batman.h
index 6138845b9d5..291bb1e241c 100644
--- a/src/mame/includes/batman.h
+++ b/src/mame/includes/batman.h
@@ -9,8 +9,8 @@
class batman_state : public atarigen_state
{
public:
- batman_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ batman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 m_latch_data;
diff --git a/src/mame/includes/battlane.h b/src/mame/includes/battlane.h
index e5c419abf9a..f5f6ce26c5e 100644
--- a/src/mame/includes/battlane.h
+++ b/src/mame/includes/battlane.h
@@ -7,8 +7,8 @@
class battlane_state : public driver_device
{
public:
- battlane_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ battlane_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_tileram;
diff --git a/src/mame/includes/battlera.h b/src/mame/includes/battlera.h
index 1eeac3338fe..011f0b39078 100644
--- a/src/mame/includes/battlera.h
+++ b/src/mame/includes/battlera.h
@@ -1,8 +1,8 @@
class battlera_state : public driver_device
{
public:
- battlera_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ battlera_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_control_port_select;
int m_msm5205next;
diff --git a/src/mame/includes/battlex.h b/src/mame/includes/battlex.h
index d76e50736e5..a6d22bdf71e 100644
--- a/src/mame/includes/battlex.h
+++ b/src/mame/includes/battlex.h
@@ -7,8 +7,8 @@
class battlex_state : public driver_device
{
public:
- battlex_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ battlex_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_in0_b4;
diff --git a/src/mame/includes/battlnts.h b/src/mame/includes/battlnts.h
index 32a59c5d851..0a32d23929a 100644
--- a/src/mame/includes/battlnts.h
+++ b/src/mame/includes/battlnts.h
@@ -7,8 +7,8 @@
class battlnts_state : public driver_device
{
public:
- battlnts_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ battlnts_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT8 * paletteram; // this currently uses generic palette handling
diff --git a/src/mame/includes/bbusters.h b/src/mame/includes/bbusters.h
index b6c36a43955..2b93a6c73dd 100644
--- a/src/mame/includes/bbusters.h
+++ b/src/mame/includes/bbusters.h
@@ -1,8 +1,8 @@
class bbusters_state : public driver_device
{
public:
- bbusters_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ bbusters_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_eprom_data(*this, "eeprom") { }
UINT16 *m_videoram;
diff --git a/src/mame/includes/beathead.h b/src/mame/includes/beathead.h
index 68a361ae82b..e5cb9a4455f 100644
--- a/src/mame/includes/beathead.h
+++ b/src/mame/includes/beathead.h
@@ -11,8 +11,8 @@
class beathead_state : public atarigen_state
{
public:
- beathead_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config),
+ beathead_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_nvram(*this, "nvram") { }
diff --git a/src/mame/includes/beezer.h b/src/mame/includes/beezer.h
index cc824fb600b..3c2b3a50117 100644
--- a/src/mame/includes/beezer.h
+++ b/src/mame/includes/beezer.h
@@ -3,8 +3,8 @@
class beezer_state : public driver_device
{
public:
- beezer_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ beezer_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_pbus;
diff --git a/src/mame/includes/bigevglf.h b/src/mame/includes/bigevglf.h
index 9fb0af6c858..f828f2f62c0 100644
--- a/src/mame/includes/bigevglf.h
+++ b/src/mame/includes/bigevglf.h
@@ -2,8 +2,8 @@
class bigevglf_state : public driver_device
{
public:
- bigevglf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bigevglf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_paletteram;
diff --git a/src/mame/includes/bigstrkb.h b/src/mame/includes/bigstrkb.h
index c12e209b96e..90f946d02d5 100644
--- a/src/mame/includes/bigstrkb.h
+++ b/src/mame/includes/bigstrkb.h
@@ -1,8 +1,8 @@
class bigstrkb_state : public driver_device
{
public:
- bigstrkb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bigstrkb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_tilemap;
tilemap_t *m_tilemap2;
diff --git a/src/mame/includes/bionicc.h b/src/mame/includes/bionicc.h
index 4186df23a15..0d34d023bc2 100644
--- a/src/mame/includes/bionicc.h
+++ b/src/mame/includes/bionicc.h
@@ -7,8 +7,8 @@
class bionicc_state : public driver_device
{
public:
- bionicc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bionicc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bgvideoram;
diff --git a/src/mame/includes/bishi.h b/src/mame/includes/bishi.h
index ca16477862a..de6130248df 100644
--- a/src/mame/includes/bishi.h
+++ b/src/mame/includes/bishi.h
@@ -10,8 +10,8 @@
class bishi_state : public driver_device
{
public:
- bishi_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bishi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/bking.h b/src/mame/includes/bking.h
index e64ada8c9f4..2d69627df5f 100644
--- a/src/mame/includes/bking.h
+++ b/src/mame/includes/bking.h
@@ -1,8 +1,8 @@
class bking_state : public driver_device
{
public:
- bking_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bking_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_playfield_ram;
diff --git a/src/mame/includes/bladestl.h b/src/mame/includes/bladestl.h
index 1091e8a71ae..cc740ce010c 100644
--- a/src/mame/includes/bladestl.h
+++ b/src/mame/includes/bladestl.h
@@ -7,8 +7,8 @@
class bladestl_state : public driver_device
{
public:
- bladestl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bladestl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_paletteram;
diff --git a/src/mame/includes/blktiger.h b/src/mame/includes/blktiger.h
index edfc7fbc7a2..0d9a131f4db 100644
--- a/src/mame/includes/blktiger.h
+++ b/src/mame/includes/blktiger.h
@@ -7,8 +7,8 @@
class blktiger_state : public driver_device
{
public:
- blktiger_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ blktiger_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_txvideoram;
diff --git a/src/mame/includes/blmbycar.h b/src/mame/includes/blmbycar.h
index f6d13e74e52..6d335960fdb 100644
--- a/src/mame/includes/blmbycar.h
+++ b/src/mame/includes/blmbycar.h
@@ -7,8 +7,8 @@
class blmbycar_state : public driver_device
{
public:
- blmbycar_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ blmbycar_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_vram_0;
diff --git a/src/mame/includes/blockade.h b/src/mame/includes/blockade.h
index c9603ef4708..ff776d9f760 100644
--- a/src/mame/includes/blockade.h
+++ b/src/mame/includes/blockade.h
@@ -4,8 +4,8 @@
class blockade_state : public driver_device
{
public:
- blockade_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ blockade_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 * m_videoram;
diff --git a/src/mame/includes/blockhl.h b/src/mame/includes/blockhl.h
index 30ae67c94a3..39e11823b57 100644
--- a/src/mame/includes/blockhl.h
+++ b/src/mame/includes/blockhl.h
@@ -7,8 +7,8 @@
class blockhl_state : public driver_device
{
public:
- blockhl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ blockhl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/blockout.h b/src/mame/includes/blockout.h
index d4c73f96768..3efb7acdb85 100644
--- a/src/mame/includes/blockout.h
+++ b/src/mame/includes/blockout.h
@@ -7,8 +7,8 @@
class blockout_state : public driver_device
{
public:
- blockout_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ blockout_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/includes/bloodbro.h b/src/mame/includes/bloodbro.h
index 3fbdc366451..47611f2171f 100644
--- a/src/mame/includes/bloodbro.h
+++ b/src/mame/includes/bloodbro.h
@@ -1,8 +1,8 @@
class bloodbro_state : public driver_device
{
public:
- bloodbro_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bloodbro_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_bgvideoram;
UINT16 *m_fgvideoram;
diff --git a/src/mame/includes/blstroid.h b/src/mame/includes/blstroid.h
index 9a2937c0ef4..da2c2b01447 100644
--- a/src/mame/includes/blstroid.h
+++ b/src/mame/includes/blstroid.h
@@ -9,8 +9,8 @@
class blstroid_state : public atarigen_state
{
public:
- blstroid_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ blstroid_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 * m_priorityram;
};
diff --git a/src/mame/includes/blueprnt.h b/src/mame/includes/blueprnt.h
index 20ab103a3ad..d1da1019dcc 100644
--- a/src/mame/includes/blueprnt.h
+++ b/src/mame/includes/blueprnt.h
@@ -7,8 +7,8 @@
class blueprnt_state : public driver_device
{
public:
- blueprnt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ blueprnt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/bogeyman.h b/src/mame/includes/bogeyman.h
index 265118491f8..19d0e9b9af2 100644
--- a/src/mame/includes/bogeyman.h
+++ b/src/mame/includes/bogeyman.h
@@ -7,8 +7,8 @@
class bogeyman_state : public driver_device
{
public:
- bogeyman_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bogeyman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/bombjack.h b/src/mame/includes/bombjack.h
index 4c2232663a9..597f94cb9e0 100644
--- a/src/mame/includes/bombjack.h
+++ b/src/mame/includes/bombjack.h
@@ -7,8 +7,8 @@
class bombjack_state : public driver_device
{
public:
- bombjack_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bombjack_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/boogwing.h b/src/mame/includes/boogwing.h
index 638060127a4..88974ee340f 100644
--- a/src/mame/includes/boogwing.h
+++ b/src/mame/includes/boogwing.h
@@ -11,8 +11,8 @@
class boogwing_state : public driver_device
{
public:
- boogwing_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ boogwing_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_decocomn(*this, "deco_common"),
diff --git a/src/mame/includes/bottom9.h b/src/mame/includes/bottom9.h
index bc84afe5c74..3f57d3f1f35 100644
--- a/src/mame/includes/bottom9.h
+++ b/src/mame/includes/bottom9.h
@@ -7,8 +7,8 @@
class bottom9_state : public driver_device
{
public:
- bottom9_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bottom9_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT8 * m_paletteram; // currently this uses generic palette handling
diff --git a/src/mame/includes/brkthru.h b/src/mame/includes/brkthru.h
index b851ffe12ef..ffac73bd168 100644
--- a/src/mame/includes/brkthru.h
+++ b/src/mame/includes/brkthru.h
@@ -7,8 +7,8 @@
class brkthru_state : public driver_device
{
public:
- brkthru_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ brkthru_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/bsktball.h b/src/mame/includes/bsktball.h
index 9976176fba9..4ebb182c84c 100644
--- a/src/mame/includes/bsktball.h
+++ b/src/mame/includes/bsktball.h
@@ -16,8 +16,8 @@
class bsktball_state : public driver_device
{
public:
- bsktball_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bsktball_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/btime.h b/src/mame/includes/btime.h
index 7057a06b2e3..aaee90cf5f6 100644
--- a/src/mame/includes/btime.h
+++ b/src/mame/includes/btime.h
@@ -2,8 +2,8 @@
class btime_state : public driver_device
{
public:
- btime_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ btime_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/btoads.h b/src/mame/includes/btoads.h
index 05f885977d6..f3f3a0f9009 100644
--- a/src/mame/includes/btoads.h
+++ b/src/mame/includes/btoads.h
@@ -9,8 +9,8 @@
class btoads_state : public driver_device
{
public:
- btoads_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ btoads_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_main_to_sound_data;
UINT8 m_main_to_sound_ready;
diff --git a/src/mame/includes/bublbobl.h b/src/mame/includes/bublbobl.h
index 7f00dcd4ac2..0e1311e75b9 100644
--- a/src/mame/includes/bublbobl.h
+++ b/src/mame/includes/bublbobl.h
@@ -2,8 +2,8 @@
class bublbobl_state : public driver_device
{
public:
- bublbobl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bublbobl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_mcu_sharedram;
diff --git a/src/mame/includes/buggychl.h b/src/mame/includes/buggychl.h
index 8b0e2c18b1a..f42f9623c8f 100644
--- a/src/mame/includes/buggychl.h
+++ b/src/mame/includes/buggychl.h
@@ -5,8 +5,8 @@
class buggychl_state : public driver_device
{
public:
- buggychl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ buggychl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/bwing.h b/src/mame/includes/bwing.h
index 1c749ab2e14..00ac870580d 100644
--- a/src/mame/includes/bwing.h
+++ b/src/mame/includes/bwing.h
@@ -9,8 +9,8 @@
class bwing_state : public driver_device
{
public:
- bwing_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bwing_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/bzone.h b/src/mame/includes/bzone.h
index 7d06911a4e5..31d16de92ba 100644
--- a/src/mame/includes/bzone.h
+++ b/src/mame/includes/bzone.h
@@ -12,8 +12,8 @@
class bzone_state : public driver_device
{
public:
- bzone_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ bzone_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_analog_data;
UINT8 m_rb_input_select;
diff --git a/src/mame/includes/cabal.h b/src/mame/includes/cabal.h
index 76015c97a88..f1e54cadf35 100644
--- a/src/mame/includes/cabal.h
+++ b/src/mame/includes/cabal.h
@@ -1,8 +1,8 @@
class cabal_state : public driver_device
{
public:
- cabal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cabal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_spriteram;
UINT16 *m_colorram;
diff --git a/src/mame/includes/calomega.h b/src/mame/includes/calomega.h
index 780330a0a02..53432d5e709 100644
--- a/src/mame/includes/calomega.h
+++ b/src/mame/includes/calomega.h
@@ -1,8 +1,8 @@
class calomega_state : public driver_device
{
public:
- calomega_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ calomega_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_tx_line;
UINT8 m_rx_line;
diff --git a/src/mame/includes/canyon.h b/src/mame/includes/canyon.h
index 8aa5e832bc1..edd03667471 100644
--- a/src/mame/includes/canyon.h
+++ b/src/mame/includes/canyon.h
@@ -20,8 +20,8 @@
class canyon_state : public driver_device
{
public:
- canyon_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ canyon_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/capbowl.h b/src/mame/includes/capbowl.h
index faa10baf663..e32c8e7d267 100644
--- a/src/mame/includes/capbowl.h
+++ b/src/mame/includes/capbowl.h
@@ -9,8 +9,8 @@
class capbowl_state : public driver_device
{
public:
- capbowl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ capbowl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
void init_nvram(nvram_device &nvram, void *base, size_t size);
diff --git a/src/mame/includes/carjmbre.h b/src/mame/includes/carjmbre.h
index 8a5d816e644..2bc73754d71 100644
--- a/src/mame/includes/carjmbre.h
+++ b/src/mame/includes/carjmbre.h
@@ -7,8 +7,8 @@
class carjmbre_state : public driver_device
{
public:
- carjmbre_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ carjmbre_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/carpolo.h b/src/mame/includes/carpolo.h
index 0b62973d55f..d50a376c940 100644
--- a/src/mame/includes/carpolo.h
+++ b/src/mame/includes/carpolo.h
@@ -11,8 +11,8 @@
class carpolo_state : public driver_device
{
public:
- carpolo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ carpolo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_alpharam;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h
index 2562e682fec..46737b4c2e3 100644
--- a/src/mame/includes/cave.h
+++ b/src/mame/includes/cave.h
@@ -24,8 +24,8 @@ struct sprite_cave
class cave_state : public driver_device
{
public:
- cave_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config), m_int_timer(*this, "int_timer") { }
+ cave_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag), m_int_timer(*this, "int_timer") { }
/* memory pointers */
UINT16 * m_videoregs;
diff --git a/src/mame/includes/cbasebal.h b/src/mame/includes/cbasebal.h
index b5384938ec1..14110a63417 100644
--- a/src/mame/includes/cbasebal.h
+++ b/src/mame/includes/cbasebal.h
@@ -7,8 +7,8 @@
class cbasebal_state : public driver_device
{
public:
- cbasebal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cbasebal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_spriteram;
diff --git a/src/mame/includes/cbuster.h b/src/mame/includes/cbuster.h
index 616feabcc1e..c400d1bd75a 100644
--- a/src/mame/includes/cbuster.h
+++ b/src/mame/includes/cbuster.h
@@ -7,8 +7,8 @@
class cbuster_state : public driver_device
{
public:
- cbuster_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cbuster_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_pf1_rowscroll;
diff --git a/src/mame/includes/ccastles.h b/src/mame/includes/ccastles.h
index 56bc7273a0c..ce3e10c692b 100644
--- a/src/mame/includes/ccastles.h
+++ b/src/mame/includes/ccastles.h
@@ -10,8 +10,8 @@
class ccastles_state : public driver_device
{
public:
- ccastles_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ ccastles_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_nvram_4b(*this, "nvram_4b"),
m_nvram_4a(*this, "nvram_4a") { }
diff --git a/src/mame/includes/cchasm.h b/src/mame/includes/cchasm.h
index 95419370336..dd6b48234f5 100644
--- a/src/mame/includes/cchasm.h
+++ b/src/mame/includes/cchasm.h
@@ -9,8 +9,8 @@
class cchasm_state : public driver_device
{
public:
- cchasm_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cchasm_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_sound_flags;
int m_coin_flag;
diff --git a/src/mame/includes/cclimber.h b/src/mame/includes/cclimber.h
index 71bc8d4790c..2f7d4de8300 100644
--- a/src/mame/includes/cclimber.h
+++ b/src/mame/includes/cclimber.h
@@ -1,8 +1,8 @@
class cclimber_state : public driver_device
{
public:
- cclimber_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cclimber_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/includes/cd32.h b/src/mame/includes/cd32.h
index b7209cb7ae3..615a935e4cd 100644
--- a/src/mame/includes/cd32.h
+++ b/src/mame/includes/cd32.h
@@ -12,8 +12,8 @@ CuboCD32 definitions
class cd32_state : public amiga_state
{
public:
- cd32_state(running_machine &machine, const driver_device_config_base &config)
- : amiga_state(machine, config) { }
+ cd32_state(const machine_config &mconfig, device_type type, const char *tag)
+ : amiga_state(mconfig, type, tag) { }
UINT16 m_potgo_value;
int m_cd32_shifter[2];
diff --git a/src/mame/includes/cdi.h b/src/mame/includes/cdi.h
index 9572918a759..e5e7388af6e 100644
--- a/src/mame/includes/cdi.h
+++ b/src/mame/includes/cdi.h
@@ -15,8 +15,8 @@
class cdi_state : public driver_device
{
public:
- cdi_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cdi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_planea;
UINT16 *m_planeb;
diff --git a/src/mame/includes/centiped.h b/src/mame/includes/centiped.h
index caf381dccd6..11509461458 100644
--- a/src/mame/includes/centiped.h
+++ b/src/mame/includes/centiped.h
@@ -7,8 +7,8 @@
class centiped_state : public driver_device
{
public:
- centiped_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ centiped_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_oldpos[4];
diff --git a/src/mame/includes/chaknpop.h b/src/mame/includes/chaknpop.h
index 60e154af438..86f627c9c72 100644
--- a/src/mame/includes/chaknpop.h
+++ b/src/mame/includes/chaknpop.h
@@ -6,8 +6,8 @@
class chaknpop_state : public driver_device
{
public:
- chaknpop_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ chaknpop_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_mcu_ram;
diff --git a/src/mame/includes/champbas.h b/src/mame/includes/champbas.h
index 52cb971e20e..38ab629f0a3 100644
--- a/src/mame/includes/champbas.h
+++ b/src/mame/includes/champbas.h
@@ -11,8 +11,8 @@
class champbas_state : public driver_device
{
public:
- champbas_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ champbas_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bg_videoram;
diff --git a/src/mame/includes/changela.h b/src/mame/includes/changela.h
index 44ba0d2f537..1a06bb8bdcb 100644
--- a/src/mame/includes/changela.h
+++ b/src/mame/includes/changela.h
@@ -3,8 +3,8 @@
class changela_state : public driver_device
{
public:
- changela_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ changela_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/cheekyms.h b/src/mame/includes/cheekyms.h
index 8a8cb0e585e..a2b76407e47 100644
--- a/src/mame/includes/cheekyms.h
+++ b/src/mame/includes/cheekyms.h
@@ -8,8 +8,8 @@
class cheekyms_state : public driver_device
{
public:
- cheekyms_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cheekyms_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/chqflag.h b/src/mame/includes/chqflag.h
index 7598629f372..86f684bdf2e 100644
--- a/src/mame/includes/chqflag.h
+++ b/src/mame/includes/chqflag.h
@@ -7,8 +7,8 @@
class chqflag_state : public driver_device
{
public:
- chqflag_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ chqflag_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/cidelsa.h b/src/mame/includes/cidelsa.h
index f16175bdc4b..39001ae8243 100644
--- a/src/mame/includes/cidelsa.h
+++ b/src/mame/includes/cidelsa.h
@@ -38,8 +38,8 @@
class cidelsa_state : public driver_device
{
public:
- cidelsa_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ cidelsa_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, CDP1802_TAG),
m_vis(*this, CDP1869_TAG)
{ }
@@ -77,8 +77,8 @@ public:
class draco_state : public cidelsa_state
{
public:
- draco_state(running_machine &machine, const driver_device_config_base &config)
- : cidelsa_state(machine, config),
+ draco_state(const machine_config &mconfig, device_type type, const char *tag)
+ : cidelsa_state(mconfig, type, tag),
m_psg(*this, AY8910_TAG)
{ }
diff --git a/src/mame/includes/cinemat.h b/src/mame/includes/cinemat.h
index abe4889a1c2..886103501c8 100644
--- a/src/mame/includes/cinemat.h
+++ b/src/mame/includes/cinemat.h
@@ -8,8 +8,8 @@
class cinemat_state : public driver_device
{
public:
- cinemat_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cinemat_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_sound_control;
void (*m_sound_handler)(running_machine &,UINT8 sound_val, UINT8 bits_changed);
diff --git a/src/mame/includes/circus.h b/src/mame/includes/circus.h
index 725968a5607..cf3ff4b92c5 100644
--- a/src/mame/includes/circus.h
+++ b/src/mame/includes/circus.h
@@ -3,8 +3,8 @@
class circus_state : public driver_device
{
public:
- circus_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ circus_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/circusc.h b/src/mame/includes/circusc.h
index 2a191c1a9a5..823082b3649 100644
--- a/src/mame/includes/circusc.h
+++ b/src/mame/includes/circusc.h
@@ -7,8 +7,8 @@
class circusc_state : public driver_device
{
public:
- circusc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ circusc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/cischeat.h b/src/mame/includes/cischeat.h
index 645655dd182..237a4f0bd36 100644
--- a/src/mame/includes/cischeat.h
+++ b/src/mame/includes/cischeat.h
@@ -1,8 +1,8 @@
class cischeat_state : public driver_device
{
public:
- cischeat_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cischeat_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_scrollram[3];
UINT16 *m_objectram;
diff --git a/src/mame/includes/citycon.h b/src/mame/includes/citycon.h
index 59d69461318..ae702ae517f 100644
--- a/src/mame/includes/citycon.h
+++ b/src/mame/includes/citycon.h
@@ -7,8 +7,8 @@
class citycon_state : public driver_device
{
public:
- citycon_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ citycon_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/cloak.h b/src/mame/includes/cloak.h
index 2febd0851c1..6f9e88e929e 100644
--- a/src/mame/includes/cloak.h
+++ b/src/mame/includes/cloak.h
@@ -7,8 +7,8 @@
class cloak_state : public driver_device
{
public:
- cloak_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cloak_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/cloud9.h b/src/mame/includes/cloud9.h
index 56fd5afd34b..91307065362 100644
--- a/src/mame/includes/cloud9.h
+++ b/src/mame/includes/cloud9.h
@@ -10,8 +10,8 @@
class cloud9_state : public driver_device
{
public:
- cloud9_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ cloud9_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_nvram(*this, "nvram") { }
diff --git a/src/mame/includes/clshroad.h b/src/mame/includes/clshroad.h
index 46e604c4b2b..5f0ce83adf1 100644
--- a/src/mame/includes/clshroad.h
+++ b/src/mame/includes/clshroad.h
@@ -1,8 +1,8 @@
class clshroad_state : public driver_device
{
public:
- clshroad_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ clshroad_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_vram_0;
UINT8 *m_vram_1;
diff --git a/src/mame/includes/cninja.h b/src/mame/includes/cninja.h
index b58e5b1423c..a245596fa0e 100644
--- a/src/mame/includes/cninja.h
+++ b/src/mame/includes/cninja.h
@@ -11,8 +11,8 @@
class cninja_state : public driver_device
{
public:
- cninja_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ cninja_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_decocomn(*this, "deco_common"),
diff --git a/src/mame/includes/combatsc.h b/src/mame/includes/combatsc.h
index 79149298259..954948082a5 100644
--- a/src/mame/includes/combatsc.h
+++ b/src/mame/includes/combatsc.h
@@ -7,8 +7,8 @@
class combatsc_state : public driver_device
{
public:
- combatsc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ combatsc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/commando.h b/src/mame/includes/commando.h
index ce48a8bc629..dc097aa9fba 100644
--- a/src/mame/includes/commando.h
+++ b/src/mame/includes/commando.h
@@ -7,8 +7,8 @@
class commando_state : public driver_device
{
public:
- commando_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ commando_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/compgolf.h b/src/mame/includes/compgolf.h
index 9df1cfdbda7..ea76a80fc03 100644
--- a/src/mame/includes/compgolf.h
+++ b/src/mame/includes/compgolf.h
@@ -7,8 +7,8 @@
class compgolf_state : public driver_device
{
public:
- compgolf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ compgolf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/contra.h b/src/mame/includes/contra.h
index f8dbb01b603..c0278299ed6 100644
--- a/src/mame/includes/contra.h
+++ b/src/mame/includes/contra.h
@@ -7,8 +7,8 @@
class contra_state : public driver_device
{
public:
- contra_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ contra_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_spriteram;
diff --git a/src/mame/includes/coolpool.h b/src/mame/includes/coolpool.h
index 116fff0d61d..3a1ee040acd 100644
--- a/src/mame/includes/coolpool.h
+++ b/src/mame/includes/coolpool.h
@@ -3,8 +3,8 @@
class coolpool_state : public driver_device
{
public:
- coolpool_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ coolpool_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
UINT16 *m_vram_base;
diff --git a/src/mame/includes/cop01.h b/src/mame/includes/cop01.h
index 5e01824ca52..679c0ba306a 100644
--- a/src/mame/includes/cop01.h
+++ b/src/mame/includes/cop01.h
@@ -7,8 +7,8 @@
class cop01_state : public driver_device
{
public:
- cop01_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cop01_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bgvideoram;
diff --git a/src/mame/includes/copsnrob.h b/src/mame/includes/copsnrob.h
index e76cd39cad5..428007e5398 100644
--- a/src/mame/includes/copsnrob.h
+++ b/src/mame/includes/copsnrob.h
@@ -10,8 +10,8 @@
class copsnrob_state : public driver_device
{
public:
- copsnrob_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ copsnrob_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/cosmic.h b/src/mame/includes/cosmic.h
index 379a6c7b57d..13a7f93acde 100644
--- a/src/mame/includes/cosmic.h
+++ b/src/mame/includes/cosmic.h
@@ -11,8 +11,8 @@
class cosmic_state : public driver_device
{
public:
- cosmic_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cosmic_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h
index 720d3f0a550..5253edadd2a 100644
--- a/src/mame/includes/cps1.h
+++ b/src/mame/includes/cps1.h
@@ -62,8 +62,8 @@ struct CPS1config
class cps_state : public driver_device
{
public:
- cps_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cps_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// cps1
diff --git a/src/mame/includes/cps3.h b/src/mame/includes/cps3.h
index 0c9ff69fd9e..cec60caefce 100644
--- a/src/mame/includes/cps3.h
+++ b/src/mame/includes/cps3.h
@@ -10,8 +10,8 @@
class cps3_state : public driver_device
{
public:
- cps3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cps3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
fujitsu_29f016a_device *m_simm[7][8];
UINT32* m_decrypted_bios;
diff --git a/src/mame/includes/crbaloon.h b/src/mame/includes/crbaloon.h
index c8a5e3733e3..4d7baf5f91f 100644
--- a/src/mame/includes/crbaloon.h
+++ b/src/mame/includes/crbaloon.h
@@ -11,8 +11,8 @@ Crazy Ballooon
class crbaloon_state : public driver_device
{
public:
- crbaloon_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ crbaloon_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_pc3092_data;
UINT8 *m_videoram;
diff --git a/src/mame/includes/crgolf.h b/src/mame/includes/crgolf.h
index 4faf328099b..568685184fa 100644
--- a/src/mame/includes/crgolf.h
+++ b/src/mame/includes/crgolf.h
@@ -10,8 +10,8 @@
class crgolf_state : public driver_device
{
public:
- crgolf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ crgolf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram_a;
diff --git a/src/mame/includes/crimfght.h b/src/mame/includes/crimfght.h
index edc29e27077..04b5c87e546 100644
--- a/src/mame/includes/crimfght.h
+++ b/src/mame/includes/crimfght.h
@@ -7,8 +7,8 @@
class crimfght_state : public driver_device
{
public:
- crimfght_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ crimfght_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT8 * m_paletteram; // currently this uses generic palette handling
diff --git a/src/mame/includes/crospang.h b/src/mame/includes/crospang.h
index f93cfdcb089..7e15469a739 100644
--- a/src/mame/includes/crospang.h
+++ b/src/mame/includes/crospang.h
@@ -7,8 +7,8 @@
class crospang_state : public driver_device
{
public:
- crospang_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ crospang_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bg_videoram;
diff --git a/src/mame/includes/crshrace.h b/src/mame/includes/crshrace.h
index b16665055bc..65cb8bc3bfc 100644
--- a/src/mame/includes/crshrace.h
+++ b/src/mame/includes/crshrace.h
@@ -2,8 +2,8 @@
class crshrace_state : public driver_device
{
public:
- crshrace_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ crshrace_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram1;
diff --git a/src/mame/includes/cvs.h b/src/mame/includes/cvs.h
index 63a43c63221..34eee7bb9ee 100644
--- a/src/mame/includes/cvs.h
+++ b/src/mame/includes/cvs.h
@@ -19,8 +19,8 @@ struct cvs_star
class cvs_state : public driver_device
{
public:
- cvs_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ cvs_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_video_ram;
@@ -70,8 +70,8 @@ public:
class quasar_state : public cvs_state
{
public:
- quasar_state(running_machine &machine, const driver_device_config_base &config)
- : cvs_state(machine, config) { }
+ quasar_state(const machine_config &mconfig, device_type type, const char *tag)
+ : cvs_state(mconfig, type, tag) { }
UINT8 * m_effectram;
UINT8 m_effectcontrol;
diff --git a/src/mame/includes/cyberbal.h b/src/mame/includes/cyberbal.h
index 81b3257d5e4..20b10c9c5d1 100644
--- a/src/mame/includes/cyberbal.h
+++ b/src/mame/includes/cyberbal.h
@@ -9,8 +9,8 @@
class cyberbal_state : public atarigen_state
{
public:
- cyberbal_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ cyberbal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 * m_paletteram_0;
UINT16 * m_paletteram_1;
diff --git a/src/mame/includes/darius.h b/src/mame/includes/darius.h
index 6f32a882068..20c2a31093e 100644
--- a/src/mame/includes/darius.h
+++ b/src/mame/includes/darius.h
@@ -10,8 +10,8 @@
class darius_state : public driver_device
{
public:
- darius_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ darius_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram;
diff --git a/src/mame/includes/darkmist.h b/src/mame/includes/darkmist.h
index 409a39afdff..eaed9b55bbd 100644
--- a/src/mame/includes/darkmist.h
+++ b/src/mame/includes/darkmist.h
@@ -1,8 +1,8 @@
class darkmist_state : public driver_device
{
public:
- darkmist_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ darkmist_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_workram;
diff --git a/src/mame/includes/darkseal.h b/src/mame/includes/darkseal.h
index 4c402e0b8dd..f6a04be131f 100644
--- a/src/mame/includes/darkseal.h
+++ b/src/mame/includes/darkseal.h
@@ -3,8 +3,8 @@
class darkseal_state : public driver_device
{
public:
- darkseal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ darkseal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_deco_tilegen1(*this, "tilegen1"),
m_deco_tilegen2(*this, "tilegen2") { }
diff --git a/src/mame/includes/dassault.h b/src/mame/includes/dassault.h
index bcaf7bdf8b7..f4a5ebeab6f 100644
--- a/src/mame/includes/dassault.h
+++ b/src/mame/includes/dassault.h
@@ -11,8 +11,8 @@
class dassault_state : public driver_device
{
public:
- dassault_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ dassault_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_subcpu(*this, "sub"),
diff --git a/src/mame/includes/dbz.h b/src/mame/includes/dbz.h
index 343d7cefbea..db0e4a9a1aa 100644
--- a/src/mame/includes/dbz.h
+++ b/src/mame/includes/dbz.h
@@ -7,8 +7,8 @@
class dbz_state : public driver_device
{
public:
- dbz_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dbz_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bg1_videoram;
diff --git a/src/mame/includes/dcheese.h b/src/mame/includes/dcheese.h
index a1f0f853ee4..d1b89633ab6 100644
--- a/src/mame/includes/dcheese.h
+++ b/src/mame/includes/dcheese.h
@@ -8,8 +8,8 @@
class dcheese_state : public driver_device
{
public:
- dcheese_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dcheese_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
UINT16 m_blitter_color[2];
diff --git a/src/mame/includes/dcon.h b/src/mame/includes/dcon.h
index ffae06be7fe..65d65d83a53 100644
--- a/src/mame/includes/dcon.h
+++ b/src/mame/includes/dcon.h
@@ -1,8 +1,8 @@
class dcon_state : public driver_device
{
public:
- dcon_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dcon_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_back_data;
UINT16 *m_fore_data;
diff --git a/src/mame/includes/dday.h b/src/mame/includes/dday.h
index 4c50ac89323..15d779d1854 100644
--- a/src/mame/includes/dday.h
+++ b/src/mame/includes/dday.h
@@ -8,8 +8,8 @@
class dday_state : public driver_device
{
public:
- dday_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dday_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bgvideoram;
diff --git a/src/mame/includes/ddragon.h b/src/mame/includes/ddragon.h
index d82909fc3a6..c4a48cff9f9 100644
--- a/src/mame/includes/ddragon.h
+++ b/src/mame/includes/ddragon.h
@@ -8,8 +8,8 @@
class ddragon_state : public driver_device
{
public:
- ddragon_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ddragon_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_rambase;
diff --git a/src/mame/includes/ddragon3.h b/src/mame/includes/ddragon3.h
index 2d8905510b6..a1b2c25c426 100644
--- a/src/mame/includes/ddragon3.h
+++ b/src/mame/includes/ddragon3.h
@@ -8,8 +8,8 @@
class ddragon3_state : public driver_device
{
public:
- ddragon3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ddragon3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bg_videoram;
diff --git a/src/mame/includes/ddribble.h b/src/mame/includes/ddribble.h
index 8f64c8d141c..e684b469267 100644
--- a/src/mame/includes/ddribble.h
+++ b/src/mame/includes/ddribble.h
@@ -7,8 +7,8 @@
class ddribble_state : public driver_device
{
public:
- ddribble_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ddribble_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_sharedram;
diff --git a/src/mame/includes/deadang.h b/src/mame/includes/deadang.h
index 3486d589d8e..9dfa747d63c 100644
--- a/src/mame/includes/deadang.h
+++ b/src/mame/includes/deadang.h
@@ -1,8 +1,8 @@
class deadang_state : public driver_device
{
public:
- deadang_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ deadang_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT16 *m_video_data;
diff --git a/src/mame/includes/dec0.h b/src/mame/includes/dec0.h
index 2a826dc17a3..49235d981ac 100644
--- a/src/mame/includes/dec0.h
+++ b/src/mame/includes/dec0.h
@@ -1,8 +1,8 @@
class dec0_state : public driver_device
{
public:
- dec0_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dec0_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_automat_adpcm_byte;
int m_automat_msm5205_vclk_toggle;
diff --git a/src/mame/includes/dec8.h b/src/mame/includes/dec8.h
index f678cfb2003..974bef7cffd 100644
--- a/src/mame/includes/dec8.h
+++ b/src/mame/includes/dec8.h
@@ -2,8 +2,8 @@
class dec8_state : public driver_device
{
public:
- dec8_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dec8_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h
index ac515941d5f..e8b7a1a7c78 100644
--- a/src/mame/includes/deco32.h
+++ b/src/mame/includes/deco32.h
@@ -1,8 +1,8 @@
class deco32_state : public driver_device
{
public:
- deco32_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ deco32_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_ram;
int m_raster_enable;
@@ -50,8 +50,8 @@ public:
class dragngun_state : public deco32_state
{
public:
- dragngun_state(running_machine &machine, const driver_device_config_base &config)
- : deco32_state(machine, config) { }
+ dragngun_state(const machine_config &mconfig, device_type type, const char *tag)
+ : deco32_state(mconfig, type, tag) { }
UINT32 *m_dragngun_sprite_layout_0_ram;
UINT32 *m_dragngun_sprite_layout_1_ram;
diff --git a/src/mame/includes/deco_mlc.h b/src/mame/includes/deco_mlc.h
index 8c8cc2e2f2b..0a0fab878eb 100644
--- a/src/mame/includes/deco_mlc.h
+++ b/src/mame/includes/deco_mlc.h
@@ -1,8 +1,8 @@
class deco_mlc_state : public driver_device
{
public:
- deco_mlc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ deco_mlc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_mlc_ram;
UINT32 *m_irq_ram;
diff --git a/src/mame/includes/deniam.h b/src/mame/includes/deniam.h
index 55dc84759f6..23ed74e1a80 100644
--- a/src/mame/includes/deniam.h
+++ b/src/mame/includes/deniam.h
@@ -8,8 +8,8 @@
class deniam_state : public driver_device
{
public:
- deniam_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ deniam_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/includes/dietgo.h b/src/mame/includes/dietgo.h
index 70319b422ed..e5afaad2da0 100644
--- a/src/mame/includes/dietgo.h
+++ b/src/mame/includes/dietgo.h
@@ -7,8 +7,8 @@
class dietgo_state : public driver_device
{
public:
- dietgo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dietgo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_pf1_rowscroll;
diff --git a/src/mame/includes/djboy.h b/src/mame/includes/djboy.h
index 82cf7970b5c..3f88b80f17b 100644
--- a/src/mame/includes/djboy.h
+++ b/src/mame/includes/djboy.h
@@ -9,8 +9,8 @@
class djboy_state : public driver_device
{
public:
- djboy_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ djboy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 *m_videoram;
diff --git a/src/mame/includes/djmain.h b/src/mame/includes/djmain.h
index 3a3179a846b..7350e72b968 100644
--- a/src/mame/includes/djmain.h
+++ b/src/mame/includes/djmain.h
@@ -1,8 +1,8 @@
class djmain_state : public driver_device
{
public:
- djmain_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ djmain_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_sndram_bank;
UINT8 *m_sndram;
diff --git a/src/mame/includes/dkong.h b/src/mame/includes/dkong.h
index 5ccd2a2a287..1ef30784c10 100644
--- a/src/mame/includes/dkong.h
+++ b/src/mame/includes/dkong.h
@@ -72,8 +72,8 @@ enum
class dkong_state : public driver_device
{
public:
- dkong_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dkong_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_video_ram;
diff --git a/src/mame/includes/docastle.h b/src/mame/includes/docastle.h
index 1b11c7ef607..13ce0111d36 100644
--- a/src/mame/includes/docastle.h
+++ b/src/mame/includes/docastle.h
@@ -3,8 +3,8 @@
class docastle_state : public driver_device
{
public:
- docastle_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ docastle_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/dogfgt.h b/src/mame/includes/dogfgt.h
index 981300d0665..c82cb09d652 100644
--- a/src/mame/includes/dogfgt.h
+++ b/src/mame/includes/dogfgt.h
@@ -6,8 +6,8 @@
class dogfgt_state : public driver_device
{
public:
- dogfgt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dogfgt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bgvideoram;
diff --git a/src/mame/includes/dooyong.h b/src/mame/includes/dooyong.h
index ac68e616efc..9014c676ce2 100644
--- a/src/mame/includes/dooyong.h
+++ b/src/mame/includes/dooyong.h
@@ -1,8 +1,8 @@
class dooyong_state : public driver_device
{
public:
- dooyong_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dooyong_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_txvideoram;
UINT8 *m_paletteram_flytiger;
diff --git a/src/mame/includes/dragrace.h b/src/mame/includes/dragrace.h
index b069affd4df..74cdcd021e0 100644
--- a/src/mame/includes/dragrace.h
+++ b/src/mame/includes/dragrace.h
@@ -25,8 +25,8 @@
class dragrace_state : public driver_device
{
public:
- dragrace_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dragrace_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_playfield_ram;
diff --git a/src/mame/includes/drgnmst.h b/src/mame/includes/drgnmst.h
index fd002471c15..6d2ae07e4e5 100644
--- a/src/mame/includes/drgnmst.h
+++ b/src/mame/includes/drgnmst.h
@@ -4,8 +4,8 @@
class drgnmst_state : public driver_device
{
public:
- drgnmst_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ drgnmst_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_oki_1(*this, "oki1"),
m_oki_2(*this, "oki2") { }
diff --git a/src/mame/includes/dribling.h b/src/mame/includes/dribling.h
index ff0cf9dc43e..b11947e966b 100644
--- a/src/mame/includes/dribling.h
+++ b/src/mame/includes/dribling.h
@@ -9,8 +9,8 @@
class dribling_state : public driver_device
{
public:
- dribling_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dribling_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/drmicro.h b/src/mame/includes/drmicro.h
index 71bc6800d35..a05162e23f5 100644
--- a/src/mame/includes/drmicro.h
+++ b/src/mame/includes/drmicro.h
@@ -8,8 +8,8 @@
class drmicro_state : public driver_device
{
public:
- drmicro_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ drmicro_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/dynax.h b/src/mame/includes/dynax.h
index 44ef2485905..4401cbde0ce 100644
--- a/src/mame/includes/dynax.h
+++ b/src/mame/includes/dynax.h
@@ -9,8 +9,8 @@
class dynax_state : public driver_device
{
public:
- dynax_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dynax_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
// up to 8 layers, 2 images per layer (interleaved on screen)
UINT8 * m_pixmap[8][2];
diff --git a/src/mame/includes/dynduke.h b/src/mame/includes/dynduke.h
index dd8dba352d8..a0ac14081a2 100644
--- a/src/mame/includes/dynduke.h
+++ b/src/mame/includes/dynduke.h
@@ -1,8 +1,8 @@
class dynduke_state : public driver_device
{
public:
- dynduke_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ dynduke_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT16 *m_back_data;
diff --git a/src/mame/includes/eolith.h b/src/mame/includes/eolith.h
index de6ef9de3c2..8e6eec31c3d 100644
--- a/src/mame/includes/eolith.h
+++ b/src/mame/includes/eolith.h
@@ -1,8 +1,8 @@
class eolith_state : public driver_device
{
public:
- eolith_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ eolith_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_coin_counter_bit;
int m_buffer;
diff --git a/src/mame/includes/epos.h b/src/mame/includes/epos.h
index 362d0968caf..2ab02869942 100644
--- a/src/mame/includes/epos.h
+++ b/src/mame/includes/epos.h
@@ -7,8 +7,8 @@
class epos_state : public driver_device
{
public:
- epos_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ epos_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/eprom.h b/src/mame/includes/eprom.h
index cd07a2d7e0f..71ab7910796 100644
--- a/src/mame/includes/eprom.h
+++ b/src/mame/includes/eprom.h
@@ -9,8 +9,8 @@
class eprom_state : public atarigen_state
{
public:
- eprom_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ eprom_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
int m_screen_intensity;
int m_video_disable;
diff --git a/src/mame/includes/equites.h b/src/mame/includes/equites.h
index a3cfd9e02bf..7c3b7574127 100644
--- a/src/mame/includes/equites.h
+++ b/src/mame/includes/equites.h
@@ -7,8 +7,8 @@
class equites_state : public driver_device
{
public:
- equites_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ equites_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bg_videoram;
diff --git a/src/mame/includes/esd16.h b/src/mame/includes/esd16.h
index 94dce636444..1caa222dafe 100644
--- a/src/mame/includes/esd16.h
+++ b/src/mame/includes/esd16.h
@@ -7,8 +7,8 @@
class esd16_state : public driver_device
{
public:
- esd16_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ esd16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_vram_0;
diff --git a/src/mame/includes/espial.h b/src/mame/includes/espial.h
index 9bf96399564..d03b0cee09c 100644
--- a/src/mame/includes/espial.h
+++ b/src/mame/includes/espial.h
@@ -7,8 +7,8 @@
class espial_state : public driver_device
{
public:
- espial_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ espial_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 * m_videoram;
UINT8 * m_colorram;
diff --git a/src/mame/includes/esripsys.h b/src/mame/includes/esripsys.h
index 7ac1624d3a0..b7579c28cac 100644
--- a/src/mame/includes/esripsys.h
+++ b/src/mame/includes/esripsys.h
@@ -26,8 +26,8 @@ struct line_buffer_t
class esripsys_state : public driver_device
{
public:
- esripsys_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ esripsys_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_g_iodata;
UINT8 m_g_ioaddr;
diff --git a/src/mame/includes/exedexes.h b/src/mame/includes/exedexes.h
index 4df6a244a1e..48e1b3098bf 100644
--- a/src/mame/includes/exedexes.h
+++ b/src/mame/includes/exedexes.h
@@ -8,8 +8,8 @@
class exedexes_state : public driver_device
{
public:
- exedexes_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ exedexes_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/exerion.h b/src/mame/includes/exerion.h
index 56f21aa9e2c..98a04cfde9c 100644
--- a/src/mame/includes/exerion.h
+++ b/src/mame/includes/exerion.h
@@ -21,8 +21,8 @@
class exerion_state : public driver_device
{
public:
- exerion_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ exerion_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_main_ram;
diff --git a/src/mame/includes/exidy.h b/src/mame/includes/exidy.h
index 043b456b753..672a516e9b4 100644
--- a/src/mame/includes/exidy.h
+++ b/src/mame/includes/exidy.h
@@ -22,8 +22,8 @@
class exidy_state : public driver_device
{
public:
- exidy_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ exidy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_last_dial;
UINT8 *m_videoram;
diff --git a/src/mame/includes/exidy440.h b/src/mame/includes/exidy440.h
index 51631d6000a..c3cec5e2403 100644
--- a/src/mame/includes/exidy440.h
+++ b/src/mame/includes/exidy440.h
@@ -10,8 +10,8 @@
class exidy440_state : public driver_device
{
public:
- exidy440_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ exidy440_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_bank;
const UINT8 *m_showdown_bank_data[2];
diff --git a/src/mame/includes/exprraid.h b/src/mame/includes/exprraid.h
index fe6168b8b36..8beea521e02 100644
--- a/src/mame/includes/exprraid.h
+++ b/src/mame/includes/exprraid.h
@@ -8,8 +8,8 @@
class exprraid_state : public driver_device
{
public:
- exprraid_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ exprraid_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_main_ram;
diff --git a/src/mame/includes/exterm.h b/src/mame/includes/exterm.h
index 84bfa4817cb..b5ea7154ce0 100644
--- a/src/mame/includes/exterm.h
+++ b/src/mame/includes/exterm.h
@@ -7,8 +7,8 @@
class exterm_state : public driver_device
{
public:
- exterm_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ exterm_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_aimpos[2];
UINT8 m_trackball_old[2];
diff --git a/src/mame/includes/exzisus.h b/src/mame/includes/exzisus.h
index 952be3a0bd9..7a40ebbee17 100644
--- a/src/mame/includes/exzisus.h
+++ b/src/mame/includes/exzisus.h
@@ -1,8 +1,8 @@
class exzisus_state : public driver_device
{
public:
- exzisus_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ exzisus_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_sharedram_ab;
UINT8 *m_sharedram_ac;
diff --git a/src/mame/includes/f1gp.h b/src/mame/includes/f1gp.h
index 9635833e308..d557671ba74 100644
--- a/src/mame/includes/f1gp.h
+++ b/src/mame/includes/f1gp.h
@@ -2,8 +2,8 @@
class f1gp_state : public driver_device
{
public:
- f1gp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ f1gp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_sharedram;
diff --git a/src/mame/includes/fantland.h b/src/mame/includes/fantland.h
index c0212879615..a32aa676d49 100644
--- a/src/mame/includes/fantland.h
+++ b/src/mame/includes/fantland.h
@@ -3,8 +3,8 @@
class fantland_state : public driver_device
{
public:
- fantland_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ fantland_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT8 * m_spriteram; // currently directly used in a 16bit map...
diff --git a/src/mame/includes/fastfred.h b/src/mame/includes/fastfred.h
index 20e05f6e548..110f67423d2 100644
--- a/src/mame/includes/fastfred.h
+++ b/src/mame/includes/fastfred.h
@@ -10,8 +10,8 @@
class fastfred_state : public galaxold_state
{
public:
- fastfred_state(running_machine &machine, const driver_device_config_base &config)
- : galaxold_state(machine, config) { }
+ fastfred_state(const machine_config &mconfig, device_type type, const char *tag)
+ : galaxold_state(mconfig, type, tag) { }
UINT8 m_imago_sprites[0x800*3];
UINT16 m_imago_sprites_address;
diff --git a/src/mame/includes/fastlane.h b/src/mame/includes/fastlane.h
index b76e7296e01..50097491536 100644
--- a/src/mame/includes/fastlane.h
+++ b/src/mame/includes/fastlane.h
@@ -7,8 +7,8 @@
class fastlane_state : public driver_device
{
public:
- fastlane_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ fastlane_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram1;
diff --git a/src/mame/includes/fcombat.h b/src/mame/includes/fcombat.h
index e056d15e82c..1d98b5240a7 100644
--- a/src/mame/includes/fcombat.h
+++ b/src/mame/includes/fcombat.h
@@ -25,8 +25,8 @@
class fcombat_state : public driver_device
{
public:
- fcombat_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ fcombat_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/fgoal.h b/src/mame/includes/fgoal.h
index 168cc05870f..163a5f7265b 100644
--- a/src/mame/includes/fgoal.h
+++ b/src/mame/includes/fgoal.h
@@ -3,8 +3,8 @@
class fgoal_state : public driver_device
{
public:
- fgoal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ fgoal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_video_ram;
diff --git a/src/mame/includes/finalizr.h b/src/mame/includes/finalizr.h
index 2c761fb6da6..4ea9a51ea6d 100644
--- a/src/mame/includes/finalizr.h
+++ b/src/mame/includes/finalizr.h
@@ -7,8 +7,8 @@
class finalizr_state : public driver_device
{
public:
- finalizr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ finalizr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/firetrap.h b/src/mame/includes/firetrap.h
index 1e49fb40c29..4d33516d886 100644
--- a/src/mame/includes/firetrap.h
+++ b/src/mame/includes/firetrap.h
@@ -7,8 +7,8 @@
class firetrap_state : public driver_device
{
public:
- firetrap_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ firetrap_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bg1videoram;
diff --git a/src/mame/includes/firetrk.h b/src/mame/includes/firetrk.h
index c40cf8e3895..c31b811c846 100644
--- a/src/mame/includes/firetrk.h
+++ b/src/mame/includes/firetrk.h
@@ -33,8 +33,8 @@ Atari Fire Truck + Super Bug + Monte Carlo driver
class firetrk_state : public driver_device
{
public:
- firetrk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ firetrk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_in_service_mode;
UINT32 m_dial[2];
diff --git a/src/mame/includes/fitfight.h b/src/mame/includes/fitfight.h
index 6e4749315ee..ce619a520a5 100644
--- a/src/mame/includes/fitfight.h
+++ b/src/mame/includes/fitfight.h
@@ -2,8 +2,8 @@
class fitfight_state : public driver_device
{
public:
- fitfight_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ fitfight_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_fof_100000;
diff --git a/src/mame/includes/flkatck.h b/src/mame/includes/flkatck.h
index cdebf1581da..c85ea1d4386 100644
--- a/src/mame/includes/flkatck.h
+++ b/src/mame/includes/flkatck.h
@@ -7,8 +7,8 @@
class flkatck_state : public driver_device
{
public:
- flkatck_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ flkatck_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_k007121_ram;
diff --git a/src/mame/includes/flower.h b/src/mame/includes/flower.h
index 55b8aeaf396..333e2769e75 100644
--- a/src/mame/includes/flower.h
+++ b/src/mame/includes/flower.h
@@ -3,8 +3,8 @@
class flower_state : public driver_device
{
public:
- flower_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ flower_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_spriteram;
UINT8 *m_sn_irq_enable;
diff --git a/src/mame/includes/flstory.h b/src/mame/includes/flstory.h
index e8d134e7c89..23a500f645b 100644
--- a/src/mame/includes/flstory.h
+++ b/src/mame/includes/flstory.h
@@ -2,8 +2,8 @@
class flstory_state : public driver_device
{
public:
- flstory_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ flstory_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/foodf.h b/src/mame/includes/foodf.h
index 3b7f556291f..ec86619e8ad 100644
--- a/src/mame/includes/foodf.h
+++ b/src/mame/includes/foodf.h
@@ -10,8 +10,8 @@
class foodf_state : public atarigen_state
{
public:
- foodf_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config),
+ foodf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_device<x2212_device> m_nvram;
diff --git a/src/mame/includes/freekick.h b/src/mame/includes/freekick.h
index 956a81fed8e..1a880b103ab 100644
--- a/src/mame/includes/freekick.h
+++ b/src/mame/includes/freekick.h
@@ -3,8 +3,8 @@
class freekick_state : public driver_device
{
public:
- freekick_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ freekick_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/fromanc2.h b/src/mame/includes/fromanc2.h
index f1caf4bd96f..25bb7e4dabe 100644
--- a/src/mame/includes/fromanc2.h
+++ b/src/mame/includes/fromanc2.h
@@ -2,8 +2,8 @@
class fromanc2_state : public driver_device
{
public:
- fromanc2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ fromanc2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 *m_paletteram[2];
diff --git a/src/mame/includes/fromance.h b/src/mame/includes/fromance.h
index a95ee62bada..7fd1b8bf700 100644
--- a/src/mame/includes/fromance.h
+++ b/src/mame/includes/fromance.h
@@ -10,8 +10,8 @@
class fromance_state : public driver_device
{
public:
- fromance_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ fromance_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers (used by pipedrm) */
UINT8 * m_videoram;
diff --git a/src/mame/includes/funkybee.h b/src/mame/includes/funkybee.h
index adfacf23a04..998edddebb2 100644
--- a/src/mame/includes/funkybee.h
+++ b/src/mame/includes/funkybee.h
@@ -3,8 +3,8 @@
class funkybee_state : public driver_device
{
public:
- funkybee_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ funkybee_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/funkyjet.h b/src/mame/includes/funkyjet.h
index 25fab8bb58c..4b2498b3f27 100644
--- a/src/mame/includes/funkyjet.h
+++ b/src/mame/includes/funkyjet.h
@@ -7,8 +7,8 @@
class funkyjet_state : public driver_device
{
public:
- funkyjet_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ funkyjet_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_pf1_rowscroll;
diff --git a/src/mame/includes/funworld.h b/src/mame/includes/funworld.h
index 4350b32d033..61b27615008 100644
--- a/src/mame/includes/funworld.h
+++ b/src/mame/includes/funworld.h
@@ -1,8 +1,8 @@
class funworld_state : public driver_device
{
public:
- funworld_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ funworld_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8* m_videoram;
UINT8* m_colorram;
diff --git a/src/mame/includes/funybubl.h b/src/mame/includes/funybubl.h
index fc56105f7d5..ea5303f8ac6 100644
--- a/src/mame/includes/funybubl.h
+++ b/src/mame/includes/funybubl.h
@@ -3,8 +3,8 @@
class funybubl_state : public driver_device
{
public:
- funybubl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ funybubl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_paletteram;
diff --git a/src/mame/includes/fuukifg2.h b/src/mame/includes/fuukifg2.h
index db2389d0fc5..15bfe85500a 100644
--- a/src/mame/includes/fuukifg2.h
+++ b/src/mame/includes/fuukifg2.h
@@ -3,8 +3,8 @@
class fuuki16_state : public driver_device
{
public:
- fuuki16_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ fuuki16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_vram[4];
diff --git a/src/mame/includes/fuukifg3.h b/src/mame/includes/fuukifg3.h
index c94aab99cbf..ec8ac61309e 100644
--- a/src/mame/includes/fuukifg3.h
+++ b/src/mame/includes/fuukifg3.h
@@ -12,8 +12,8 @@
class fuuki32_state : public driver_device
{
public:
- fuuki32_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ fuuki32_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT32 * m_vram[4];
diff --git a/src/mame/includes/gaelco.h b/src/mame/includes/gaelco.h
index aec5c29efb9..5ddbdcf5e45 100644
--- a/src/mame/includes/gaelco.h
+++ b/src/mame/includes/gaelco.h
@@ -7,8 +7,8 @@
class gaelco_state : public driver_device
{
public:
- gaelco_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gaelco_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/includes/gaelco2.h b/src/mame/includes/gaelco2.h
index f8bba3daed5..9ee3494d35e 100644
--- a/src/mame/includes/gaelco2.h
+++ b/src/mame/includes/gaelco2.h
@@ -1,8 +1,8 @@
class gaelco2_state : public driver_device
{
public:
- gaelco2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gaelco2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_snowboar_protection;
UINT16 *m_vregs;
diff --git a/src/mame/includes/gaelco3d.h b/src/mame/includes/gaelco3d.h
index a9e0694675d..a319a20ca0e 100644
--- a/src/mame/includes/gaelco3d.h
+++ b/src/mame/includes/gaelco3d.h
@@ -14,8 +14,8 @@
class gaelco3d_state : public driver_device
{
public:
- gaelco3d_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gaelco3d_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_adsp_ram_base;
UINT16 *m_m68k_ram_base;
diff --git a/src/mame/includes/gaiden.h b/src/mame/includes/gaiden.h
index 6de2885dd52..6a2ebdb9e93 100644
--- a/src/mame/includes/gaiden.h
+++ b/src/mame/includes/gaiden.h
@@ -7,8 +7,8 @@
class gaiden_state : public driver_device
{
public:
- gaiden_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gaiden_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/includes/galaga.h b/src/mame/includes/galaga.h
index 5796ddd0947..2e2edb092e2 100644
--- a/src/mame/includes/galaga.h
+++ b/src/mame/includes/galaga.h
@@ -3,8 +3,8 @@
class galaga_state : public driver_device
{
public:
- galaga_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ galaga_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 *m_galaga_ram1;
@@ -33,8 +33,8 @@ public:
class xevious_state : public galaga_state
{
public:
- xevious_state(running_machine &machine, const driver_device_config_base &config)
- : galaga_state(machine, config) { }
+ xevious_state(const machine_config &mconfig, device_type type, const char *tag)
+ : galaga_state(mconfig, type, tag) { }
UINT8 *m_xevious_fg_videoram;
UINT8 *m_xevious_fg_colorram;
@@ -51,8 +51,8 @@ public:
class bosco_state : public galaga_state
{
public:
- bosco_state(running_machine &machine, const driver_device_config_base &config)
- : galaga_state(machine, config) { }
+ bosco_state(const machine_config &mconfig, device_type type, const char *tag)
+ : galaga_state(mconfig, type, tag) { }
UINT8 *m_bosco_radarattr;
@@ -66,8 +66,8 @@ public:
class digdug_state : public galaga_state
{
public:
- digdug_state(running_machine &machine, const driver_device_config_base &config)
- : galaga_state(machine, config) { }
+ digdug_state(const machine_config &mconfig, device_type type, const char *tag)
+ : galaga_state(mconfig, type, tag) { }
UINT8 *m_digdug_objram;
UINT8 *m_digdug_posram;
diff --git a/src/mame/includes/galastrm.h b/src/mame/includes/galastrm.h
index 4dd6019188d..9fb2ea24d39 100644
--- a/src/mame/includes/galastrm.h
+++ b/src/mame/includes/galastrm.h
@@ -13,8 +13,8 @@ struct tempsprite
class galastrm_state : public driver_device
{
public:
- galastrm_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ galastrm_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_coin_word;
UINT16 m_frame_counter;
diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h
index 70db4912c49..ac9baf4a01c 100644
--- a/src/mame/includes/galaxian.h
+++ b/src/mame/includes/galaxian.h
@@ -35,8 +35,8 @@ typedef void (*galaxian_draw_background_func)(running_machine &machine, bitmap_t
class galaxian_state : public driver_device
{
public:
- galaxian_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ galaxian_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_counter_74ls161[2];
diff --git a/src/mame/includes/galaxold.h b/src/mame/includes/galaxold.h
index 31eabe0d9f3..4813fd36f0a 100644
--- a/src/mame/includes/galaxold.h
+++ b/src/mame/includes/galaxold.h
@@ -23,8 +23,8 @@ struct star
class galaxold_state : public driver_device
{
public:
- galaxold_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ galaxold_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/galivan.h b/src/mame/includes/galivan.h
index 28f86912d1e..1eb6791636f 100644
--- a/src/mame/includes/galivan.h
+++ b/src/mame/includes/galivan.h
@@ -7,8 +7,8 @@
class galivan_state : public driver_device
{
public:
- galivan_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ galivan_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/galpani2.h b/src/mame/includes/galpani2.h
index 0f007db3645..7a1f95f4709 100644
--- a/src/mame/includes/galpani2.h
+++ b/src/mame/includes/galpani2.h
@@ -3,8 +3,8 @@
class galpani2_state : public kaneko16_state
{
public:
- galpani2_state(running_machine &machine, const driver_device_config_base &config)
- : kaneko16_state(machine, config) { }
+ galpani2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : kaneko16_state(mconfig, type, tag) { }
UINT16 *m_bg8[2];
UINT16 *m_palette[2];
diff --git a/src/mame/includes/galpanic.h b/src/mame/includes/galpanic.h
index 26547c74976..c62f7cb5708 100644
--- a/src/mame/includes/galpanic.h
+++ b/src/mame/includes/galpanic.h
@@ -3,8 +3,8 @@
class galpanic_state : public kaneko16_state
{
public:
- galpanic_state(running_machine &machine, const driver_device_config_base &config)
- : kaneko16_state(machine, config) { }
+ galpanic_state(const machine_config &mconfig, device_type type, const char *tag)
+ : kaneko16_state(mconfig, type, tag) { }
UINT16 *m_bgvideoram;
UINT16 *m_fgvideoram;
diff --git a/src/mame/includes/galspnbl.h b/src/mame/includes/galspnbl.h
index c7eef830f87..650999ece20 100644
--- a/src/mame/includes/galspnbl.h
+++ b/src/mame/includes/galspnbl.h
@@ -8,8 +8,8 @@
class galspnbl_state : public driver_device
{
public:
- galspnbl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ galspnbl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/includes/gameplan.h b/src/mame/includes/gameplan.h
index 59fd5e9bed1..4dfd825e0fe 100644
--- a/src/mame/includes/gameplan.h
+++ b/src/mame/includes/gameplan.h
@@ -24,8 +24,8 @@ driver by Chris Moore
class gameplan_state : public driver_device
{
public:
- gameplan_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ gameplan_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_via_0(*this, "via6522_0"),
m_via_1(*this, "via6522_1"),
m_via_2(*this, "via6522_2") { }
diff --git a/src/mame/includes/gaplus.h b/src/mame/includes/gaplus.h
index f52b288e07b..4b648101df1 100644
--- a/src/mame/includes/gaplus.h
+++ b/src/mame/includes/gaplus.h
@@ -9,8 +9,8 @@ struct star {
class gaplus_state : public driver_device
{
public:
- gaplus_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gaplus_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_customio_3;
UINT8 *m_videoram;
diff --git a/src/mame/includes/gatron.h b/src/mame/includes/gatron.h
index f9e3315d67b..ca07c8b8a9e 100644
--- a/src/mame/includes/gatron.h
+++ b/src/mame/includes/gatron.h
@@ -1,8 +1,8 @@
class gatron_state : public driver_device
{
public:
- gatron_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gatron_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/includes/gauntlet.h b/src/mame/includes/gauntlet.h
index ea0652e1e54..249139e675b 100644
--- a/src/mame/includes/gauntlet.h
+++ b/src/mame/includes/gauntlet.h
@@ -9,8 +9,8 @@
class gauntlet_state : public atarigen_state
{
public:
- gauntlet_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ gauntlet_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 m_sound_reset_val;
UINT8 m_vindctr2_screen_refresh;
diff --git a/src/mame/includes/gberet.h b/src/mame/includes/gberet.h
index 0537fb006b5..bf4d5275f94 100644
--- a/src/mame/includes/gberet.h
+++ b/src/mame/includes/gberet.h
@@ -7,8 +7,8 @@
class gberet_state : public driver_device
{
public:
- gberet_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gberet_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/gbusters.h b/src/mame/includes/gbusters.h
index 2c236c6957e..8fc3d4e3f8a 100644
--- a/src/mame/includes/gbusters.h
+++ b/src/mame/includes/gbusters.h
@@ -7,8 +7,8 @@
class gbusters_state : public driver_device
{
public:
- gbusters_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gbusters_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/gcpinbal.h b/src/mame/includes/gcpinbal.h
index 202d01ca873..70dc0ff8793 100644
--- a/src/mame/includes/gcpinbal.h
+++ b/src/mame/includes/gcpinbal.h
@@ -5,8 +5,8 @@
class gcpinbal_state : public driver_device
{
public:
- gcpinbal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ gcpinbal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_oki(*this, "oki"),
m_msm(*this, "msm") { }
diff --git a/src/mame/includes/gijoe.h b/src/mame/includes/gijoe.h
index 602195f3722..621aa116d42 100644
--- a/src/mame/includes/gijoe.h
+++ b/src/mame/includes/gijoe.h
@@ -7,8 +7,8 @@
class gijoe_state : public driver_device
{
public:
- gijoe_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gijoe_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_workram;
diff --git a/src/mame/includes/ginganin.h b/src/mame/includes/ginganin.h
index 637868912d8..48cb1454a0f 100644
--- a/src/mame/includes/ginganin.h
+++ b/src/mame/includes/ginganin.h
@@ -7,8 +7,8 @@
class ginganin_state : public driver_device
{
public:
- ginganin_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ginganin_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_fgram;
diff --git a/src/mame/includes/gladiatr.h b/src/mame/includes/gladiatr.h
index 44ff4a1ac81..7f9d41664a8 100644
--- a/src/mame/includes/gladiatr.h
+++ b/src/mame/includes/gladiatr.h
@@ -1,8 +1,8 @@
class gladiatr_state : public driver_device
{
public:
- gladiatr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ gladiatr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT8> m_nvram;
diff --git a/src/mame/includes/glass.h b/src/mame/includes/glass.h
index 984452fe94d..7e0ac01b4c3 100644
--- a/src/mame/includes/glass.h
+++ b/src/mame/includes/glass.h
@@ -7,8 +7,8 @@
class glass_state : public driver_device
{
public:
- glass_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ glass_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/includes/gng.h b/src/mame/includes/gng.h
index 63b3da32461..922dd4b9049 100644
--- a/src/mame/includes/gng.h
+++ b/src/mame/includes/gng.h
@@ -7,8 +7,8 @@
class gng_state : public driver_device
{
public:
- gng_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gng_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bgvideoram;
diff --git a/src/mame/includes/goal92.h b/src/mame/includes/goal92.h
index d4c1c21974c..b2de65800c1 100644
--- a/src/mame/includes/goal92.h
+++ b/src/mame/includes/goal92.h
@@ -7,8 +7,8 @@
class goal92_state : public driver_device
{
public:
- goal92_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ goal92_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bg_data;
diff --git a/src/mame/includes/goindol.h b/src/mame/includes/goindol.h
index 99e2b811661..d66a996426b 100644
--- a/src/mame/includes/goindol.h
+++ b/src/mame/includes/goindol.h
@@ -7,8 +7,8 @@
class goindol_state : public driver_device
{
public:
- goindol_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ goindol_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bg_videoram;
diff --git a/src/mame/includes/goldstar.h b/src/mame/includes/goldstar.h
index f6725f745b3..37c5bb25159 100644
--- a/src/mame/includes/goldstar.h
+++ b/src/mame/includes/goldstar.h
@@ -1,8 +1,8 @@
class goldstar_state : public driver_device
{
public:
- goldstar_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ goldstar_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_dataoffset;
diff --git a/src/mame/includes/gomoku.h b/src/mame/includes/gomoku.h
index 4b878ec1a9b..18a5b88b37f 100644
--- a/src/mame/includes/gomoku.h
+++ b/src/mame/includes/gomoku.h
@@ -3,8 +3,8 @@
class gomoku_state : public driver_device
{
public:
- gomoku_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gomoku_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/includes/gotcha.h b/src/mame/includes/gotcha.h
index 3dc655cc97f..2b66a6b9fcd 100644
--- a/src/mame/includes/gotcha.h
+++ b/src/mame/includes/gotcha.h
@@ -7,8 +7,8 @@
class gotcha_state : public driver_device
{
public:
- gotcha_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gotcha_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_fgvideoram;
diff --git a/src/mame/includes/gottlieb.h b/src/mame/includes/gottlieb.h
index 222cd81cb4c..4e25f67f868 100644
--- a/src/mame/includes/gottlieb.h
+++ b/src/mame/includes/gottlieb.h
@@ -16,8 +16,8 @@
class gottlieb_state : public driver_device
{
public:
- gottlieb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gottlieb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_votrax_queue[100];
diff --git a/src/mame/includes/gotya.h b/src/mame/includes/gotya.h
index c5a4d41672f..cdaf0dcb63f 100644
--- a/src/mame/includes/gotya.h
+++ b/src/mame/includes/gotya.h
@@ -2,8 +2,8 @@
class gotya_state : public driver_device
{
public:
- gotya_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gotya_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/gradius3.h b/src/mame/includes/gradius3.h
index ca57d28ed1a..323de401ca1 100644
--- a/src/mame/includes/gradius3.h
+++ b/src/mame/includes/gradius3.h
@@ -7,8 +7,8 @@
class gradius3_state : public driver_device
{
public:
- gradius3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gradius3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_gfxram;
diff --git a/src/mame/includes/grchamp.h b/src/mame/includes/grchamp.h
index 1c825bb85d4..808447a6f57 100644
--- a/src/mame/includes/grchamp.h
+++ b/src/mame/includes/grchamp.h
@@ -9,8 +9,8 @@
class grchamp_state : public driver_device
{
public:
- grchamp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ grchamp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_cpu0_out[16];
UINT8 m_cpu1_out[16];
diff --git a/src/mame/includes/gridlee.h b/src/mame/includes/gridlee.h
index 7cdf4c991d7..2df7520adb5 100644
--- a/src/mame/includes/gridlee.h
+++ b/src/mame/includes/gridlee.h
@@ -23,8 +23,8 @@
class gridlee_state : public driver_device
{
public:
- gridlee_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gridlee_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
cpu_device *m_maincpu;
diff --git a/src/mame/includes/groundfx.h b/src/mame/includes/groundfx.h
index ecf5341448c..985fa86f744 100644
--- a/src/mame/includes/groundfx.h
+++ b/src/mame/includes/groundfx.h
@@ -11,8 +11,8 @@ struct tempsprite
class groundfx_state : public driver_device
{
public:
- groundfx_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ groundfx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_coin_word;
UINT16 m_frame_counter;
diff --git a/src/mame/includes/gstriker.h b/src/mame/includes/gstriker.h
index b43bd7577d0..95718a28f3c 100644
--- a/src/mame/includes/gstriker.h
+++ b/src/mame/includes/gstriker.h
@@ -45,8 +45,8 @@ typedef struct
class gstriker_state : public driver_device
{
public:
- gstriker_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gstriker_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_dmmy_8f_ret;
int m_pending_command;
diff --git a/src/mame/includes/gsword.h b/src/mame/includes/gsword.h
index 55de4d96055..5ce82b92079 100644
--- a/src/mame/includes/gsword.h
+++ b/src/mame/includes/gsword.h
@@ -1,8 +1,8 @@
class gsword_state : public driver_device
{
public:
- gsword_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gsword_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_coins;
diff --git a/src/mame/includes/gumbo.h b/src/mame/includes/gumbo.h
index 080ccf3ec44..11a9ce26065 100644
--- a/src/mame/includes/gumbo.h
+++ b/src/mame/includes/gumbo.h
@@ -7,8 +7,8 @@
class gumbo_state : public driver_device
{
public:
- gumbo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gumbo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bg_videoram;
diff --git a/src/mame/includes/gunbustr.h b/src/mame/includes/gunbustr.h
index 661baf21ce4..b6fba6977c4 100644
--- a/src/mame/includes/gunbustr.h
+++ b/src/mame/includes/gunbustr.h
@@ -11,8 +11,8 @@ struct tempsprite
class gunbustr_state : public driver_device
{
public:
- gunbustr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gunbustr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_coin_word;
UINT32 *m_ram;
diff --git a/src/mame/includes/gundealr.h b/src/mame/includes/gundealr.h
index 5c7c031fb6e..1939d793862 100644
--- a/src/mame/includes/gundealr.h
+++ b/src/mame/includes/gundealr.h
@@ -7,8 +7,8 @@
class gundealr_state : public driver_device
{
public:
- gundealr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gundealr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bg_videoram;
diff --git a/src/mame/includes/gunsmoke.h b/src/mame/includes/gunsmoke.h
index 9e3aa23b25c..eeed81dc719 100644
--- a/src/mame/includes/gunsmoke.h
+++ b/src/mame/includes/gunsmoke.h
@@ -7,8 +7,8 @@
class gunsmoke_state : public driver_device
{
public:
- gunsmoke_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gunsmoke_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/gyruss.h b/src/mame/includes/gyruss.h
index eb70ee94cba..9665b65d7f0 100644
--- a/src/mame/includes/gyruss.h
+++ b/src/mame/includes/gyruss.h
@@ -7,8 +7,8 @@
class gyruss_state : public driver_device
{
public:
- gyruss_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ gyruss_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/hanaawas.h b/src/mame/includes/hanaawas.h
index e0e9425b15d..85725912461 100644
--- a/src/mame/includes/hanaawas.h
+++ b/src/mame/includes/hanaawas.h
@@ -7,8 +7,8 @@
class hanaawas_state : public driver_device
{
public:
- hanaawas_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hanaawas_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h
index 604a04e0545..3e9754ac3ad 100644
--- a/src/mame/includes/harddriv.h
+++ b/src/mame/includes/harddriv.h
@@ -14,8 +14,8 @@
class harddriv_state : public atarigen_state
{
public:
- harddriv_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config),
+ harddriv_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_gsp(*this, "gsp"),
m_msp(*this, "msp"),
diff --git a/src/mame/includes/hcastle.h b/src/mame/includes/hcastle.h
index 61ae2b560c8..ea1fb53525a 100644
--- a/src/mame/includes/hcastle.h
+++ b/src/mame/includes/hcastle.h
@@ -7,8 +7,8 @@
class hcastle_state : public driver_device
{
public:
- hcastle_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hcastle_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_pf1_videoram;
diff --git a/src/mame/includes/hexion.h b/src/mame/includes/hexion.h
index 0dda735fe3d..02e7185704c 100644
--- a/src/mame/includes/hexion.h
+++ b/src/mame/includes/hexion.h
@@ -1,8 +1,8 @@
class hexion_state : public driver_device
{
public:
- hexion_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hexion_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_vram[2];
UINT8 *m_unkram;
diff --git a/src/mame/includes/higemaru.h b/src/mame/includes/higemaru.h
index e256cdeaba0..2b9dceb70d9 100644
--- a/src/mame/includes/higemaru.h
+++ b/src/mame/includes/higemaru.h
@@ -7,8 +7,8 @@
class higemaru_state : public driver_device
{
public:
- higemaru_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ higemaru_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/himesiki.h b/src/mame/includes/himesiki.h
index abe2a05a7dc..c449c93cfb0 100644
--- a/src/mame/includes/himesiki.h
+++ b/src/mame/includes/himesiki.h
@@ -7,8 +7,8 @@
class himesiki_state : public driver_device
{
public:
- himesiki_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ himesiki_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bg_ram;
diff --git a/src/mame/includes/hitme.h b/src/mame/includes/hitme.h
index 3c236b42d37..1a1b6138aa1 100644
--- a/src/mame/includes/hitme.h
+++ b/src/mame/includes/hitme.h
@@ -15,8 +15,8 @@
class hitme_state : public driver_device
{
public:
- hitme_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hitme_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/hnayayoi.h b/src/mame/includes/hnayayoi.h
index a9a7489db6d..6898ae913c3 100644
--- a/src/mame/includes/hnayayoi.h
+++ b/src/mame/includes/hnayayoi.h
@@ -7,8 +7,8 @@
class hnayayoi_state : public driver_device
{
public:
- hnayayoi_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hnayayoi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
UINT8 *m_pixmap[8];
diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h
index 84bd6190074..f89b1c8bc8b 100644
--- a/src/mame/includes/hng64.h
+++ b/src/mame/includes/hng64.h
@@ -6,8 +6,8 @@
class hng64_state : public driver_device
{
public:
- hng64_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hng64_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_mcu_type;
UINT32 *m_mainram;
diff --git a/src/mame/includes/holeland.h b/src/mame/includes/holeland.h
index 8d229bd9f3e..3e4c41f2cf7 100644
--- a/src/mame/includes/holeland.h
+++ b/src/mame/includes/holeland.h
@@ -7,8 +7,8 @@
class holeland_state : public driver_device
{
public:
- holeland_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ holeland_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/homedata.h b/src/mame/includes/homedata.h
index 3e323014586..2ea631c9655 100644
--- a/src/mame/includes/homedata.h
+++ b/src/mame/includes/homedata.h
@@ -2,8 +2,8 @@
class homedata_state : public driver_device
{
public:
- homedata_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ homedata_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_vreg;
diff --git a/src/mame/includes/homerun.h b/src/mame/includes/homerun.h
index 754de8e9511..44017718f4c 100644
--- a/src/mame/includes/homerun.h
+++ b/src/mame/includes/homerun.h
@@ -7,8 +7,8 @@
class homerun_state : public driver_device
{
public:
- homerun_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ homerun_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/hyhoo.h b/src/mame/includes/hyhoo.h
index d4b644eb338..90b927d1d0c 100644
--- a/src/mame/includes/hyhoo.h
+++ b/src/mame/includes/hyhoo.h
@@ -1,8 +1,8 @@
class hyhoo_state : public driver_device
{
public:
- hyhoo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hyhoo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_clut;
int m_blitter_destx;
diff --git a/src/mame/includes/hyperspt.h b/src/mame/includes/hyperspt.h
index d964e29c8bc..a6639718564 100644
--- a/src/mame/includes/hyperspt.h
+++ b/src/mame/includes/hyperspt.h
@@ -1,8 +1,8 @@
class hyperspt_state : public driver_device
{
public:
- hyperspt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hyperspt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/hyprduel.h b/src/mame/includes/hyprduel.h
index 00b30cc466c..4b05fc5aea5 100644
--- a/src/mame/includes/hyprduel.h
+++ b/src/mame/includes/hyprduel.h
@@ -5,8 +5,8 @@
class hyprduel_state : public driver_device
{
public:
- hyprduel_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ hyprduel_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoregs;
diff --git a/src/mame/includes/ikki.h b/src/mame/includes/ikki.h
index 95d88eb0151..616a650eb5b 100644
--- a/src/mame/includes/ikki.h
+++ b/src/mame/includes/ikki.h
@@ -7,8 +7,8 @@
class ikki_state : public driver_device
{
public:
- ikki_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ikki_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/inufuku.h b/src/mame/includes/inufuku.h
index 12c8a71c6e4..476a9df126c 100644
--- a/src/mame/includes/inufuku.h
+++ b/src/mame/includes/inufuku.h
@@ -2,8 +2,8 @@
class inufuku_state : public driver_device
{
public:
- inufuku_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ inufuku_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bg_videoram;
diff --git a/src/mame/includes/iqblock.h b/src/mame/includes/iqblock.h
index 1ff6886c78b..2e58ada783b 100644
--- a/src/mame/includes/iqblock.h
+++ b/src/mame/includes/iqblock.h
@@ -1,8 +1,8 @@
class iqblock_state : public driver_device
{
public:
- iqblock_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ iqblock_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_rambase;
UINT8 *m_bgvideoram;
diff --git a/src/mame/includes/irobot.h b/src/mame/includes/irobot.h
index 5980fab1869..41b957ae871 100644
--- a/src/mame/includes/irobot.h
+++ b/src/mame/includes/irobot.h
@@ -24,8 +24,8 @@ typedef struct irmb_ops
class irobot_state : public driver_device
{
public:
- irobot_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ irobot_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT8> m_nvram;
diff --git a/src/mame/includes/ironhors.h b/src/mame/includes/ironhors.h
index 5a3a2726852..f185480ab0a 100644
--- a/src/mame/includes/ironhors.h
+++ b/src/mame/includes/ironhors.h
@@ -7,8 +7,8 @@
class ironhors_state : public driver_device
{
public:
- ironhors_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ironhors_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/itech32.h b/src/mame/includes/itech32.h
index 7f84dd03da4..94304c2f801 100644
--- a/src/mame/includes/itech32.h
+++ b/src/mame/includes/itech32.h
@@ -17,8 +17,8 @@
class itech32_state : public driver_device
{
public:
- itech32_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ itech32_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
void nvram_init(nvram_device &nvram, void *base, size_t length);
diff --git a/src/mame/includes/itech8.h b/src/mame/includes/itech8.h
index 25f7b9ede48..ef4aa79064b 100644
--- a/src/mame/includes/itech8.h
+++ b/src/mame/includes/itech8.h
@@ -12,8 +12,8 @@
class itech8_state : public driver_device
{
public:
- itech8_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ itech8_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_grom_bank;
UINT8 m_blitter_int;
diff --git a/src/mame/includes/jack.h b/src/mame/includes/jack.h
index f8d677f8a8a..3143ba7461e 100644
--- a/src/mame/includes/jack.h
+++ b/src/mame/includes/jack.h
@@ -7,8 +7,8 @@
class jack_state : public driver_device
{
public:
- jack_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jack_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/jackal.h b/src/mame/includes/jackal.h
index b939f3a40a0..9340830d60d 100644
--- a/src/mame/includes/jackal.h
+++ b/src/mame/includes/jackal.h
@@ -7,8 +7,8 @@
class jackal_state : public driver_device
{
public:
- jackal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jackal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoctrl;
diff --git a/src/mame/includes/jailbrek.h b/src/mame/includes/jailbrek.h
index 8ceaaba486c..e1ca6e5e4af 100644
--- a/src/mame/includes/jailbrek.h
+++ b/src/mame/includes/jailbrek.h
@@ -10,8 +10,8 @@
class jailbrek_state : public driver_device
{
public:
- jailbrek_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jailbrek_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/jedi.h b/src/mame/includes/jedi.h
index a32a08bdc87..be02576d6f4 100644
--- a/src/mame/includes/jedi.h
+++ b/src/mame/includes/jedi.h
@@ -17,8 +17,8 @@
class jedi_state : public driver_device
{
public:
- jedi_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ jedi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT8> m_nvram;
diff --git a/src/mame/includes/jpmimpct.h b/src/mame/includes/jpmimpct.h
index 1fe3d2e6ea5..b688413f32d 100644
--- a/src/mame/includes/jpmimpct.h
+++ b/src/mame/includes/jpmimpct.h
@@ -52,8 +52,8 @@ struct bt477_t
class jpmimpct_state : public driver_device
{
public:
- jpmimpct_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ jpmimpct_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_tms_irq;
UINT8 m_duart_1_irq;
diff --git a/src/mame/includes/kaneko16.h b/src/mame/includes/kaneko16.h
index 2c039306526..bd37b13a043 100644
--- a/src/mame/includes/kaneko16.h
+++ b/src/mame/includes/kaneko16.h
@@ -71,8 +71,8 @@ typedef struct
class kaneko16_state : public driver_device
{
public:
- kaneko16_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kaneko16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_mcu_ram;
UINT8 m_nvram_save[128];
diff --git a/src/mame/includes/kangaroo.h b/src/mame/includes/kangaroo.h
index 572136a344b..0c13419a834 100644
--- a/src/mame/includes/kangaroo.h
+++ b/src/mame/includes/kangaroo.h
@@ -9,8 +9,8 @@
class kangaroo_state : public driver_device
{
public:
- kangaroo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kangaroo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_video_control;
diff --git a/src/mame/includes/karnov.h b/src/mame/includes/karnov.h
index 2fe80088c08..70d651dc7f7 100644
--- a/src/mame/includes/karnov.h
+++ b/src/mame/includes/karnov.h
@@ -7,8 +7,8 @@
class karnov_state : public driver_device
{
public:
- karnov_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ karnov_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/includes/kchamp.h b/src/mame/includes/kchamp.h
index 3f978551e91..1104b2a1a5f 100644
--- a/src/mame/includes/kchamp.h
+++ b/src/mame/includes/kchamp.h
@@ -7,8 +7,8 @@
class kchamp_state : public driver_device
{
public:
- kchamp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kchamp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/kickgoal.h b/src/mame/includes/kickgoal.h
index 286e1287dd4..e1070c0c741 100644
--- a/src/mame/includes/kickgoal.h
+++ b/src/mame/includes/kickgoal.h
@@ -10,8 +10,8 @@
class kickgoal_state : public driver_device
{
public:
- kickgoal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ kickgoal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_adpcm(*this, "oki"),
m_eeprom(*this, "eeprom") { }
diff --git a/src/mame/includes/kingobox.h b/src/mame/includes/kingobox.h
index c9157f540c5..0eaba02f092 100644
--- a/src/mame/includes/kingobox.h
+++ b/src/mame/includes/kingobox.h
@@ -7,8 +7,8 @@
class kingofb_state : public driver_device
{
public:
- kingofb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kingofb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/klax.h b/src/mame/includes/klax.h
index 168436c0094..9b4f591a7dd 100644
--- a/src/mame/includes/klax.h
+++ b/src/mame/includes/klax.h
@@ -9,8 +9,8 @@
class klax_state : public atarigen_state
{
public:
- klax_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ klax_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
};
diff --git a/src/mame/includes/kncljoe.h b/src/mame/includes/kncljoe.h
index b6893d79fa0..38d8139f4bd 100644
--- a/src/mame/includes/kncljoe.h
+++ b/src/mame/includes/kncljoe.h
@@ -7,8 +7,8 @@
class kncljoe_state : public driver_device
{
public:
- kncljoe_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kncljoe_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/kopunch.h b/src/mame/includes/kopunch.h
index 9a20ad12ef1..8afb8071ae5 100644
--- a/src/mame/includes/kopunch.h
+++ b/src/mame/includes/kopunch.h
@@ -7,8 +7,8 @@
class kopunch_state : public driver_device
{
public:
- kopunch_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kopunch_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/ksayakyu.h b/src/mame/includes/ksayakyu.h
index f47de06a6a9..efa526954fa 100644
--- a/src/mame/includes/ksayakyu.h
+++ b/src/mame/includes/ksayakyu.h
@@ -7,8 +7,8 @@
class ksayakyu_state : public driver_device
{
public:
- ksayakyu_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ksayakyu_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/kyugo.h b/src/mame/includes/kyugo.h
index 3da13d15fc6..3d2bca6fbc6 100644
--- a/src/mame/includes/kyugo.h
+++ b/src/mame/includes/kyugo.h
@@ -7,8 +7,8 @@
class kyugo_state : public driver_device
{
public:
- kyugo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ kyugo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_fgvideoram;
diff --git a/src/mame/includes/labyrunr.h b/src/mame/includes/labyrunr.h
index 1a54f1227c0..12a646f9d91 100644
--- a/src/mame/includes/labyrunr.h
+++ b/src/mame/includes/labyrunr.h
@@ -7,8 +7,8 @@
class labyrunr_state : public driver_device
{
public:
- labyrunr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ labyrunr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram1;
diff --git a/src/mame/includes/ladybug.h b/src/mame/includes/ladybug.h
index 606adb7004c..b35856b0257 100644
--- a/src/mame/includes/ladybug.h
+++ b/src/mame/includes/ladybug.h
@@ -9,8 +9,8 @@
class ladybug_state : public driver_device
{
public:
- ladybug_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ladybug_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/ladyfrog.h b/src/mame/includes/ladyfrog.h
index 1a411cd93e6..13bfca079b3 100644
--- a/src/mame/includes/ladyfrog.h
+++ b/src/mame/includes/ladyfrog.h
@@ -7,8 +7,8 @@
class ladyfrog_state : public driver_device
{
public:
- ladyfrog_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ladyfrog_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/laserbat.h b/src/mame/includes/laserbat.h
index 5a41b42ad54..43aa059268b 100644
--- a/src/mame/includes/laserbat.h
+++ b/src/mame/includes/laserbat.h
@@ -7,8 +7,8 @@
class laserbat_state : public driver_device
{
public:
- laserbat_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ laserbat_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/includes/lasso.h b/src/mame/includes/lasso.h
index c61e31bc6ad..1cd08df1cd7 100644
--- a/src/mame/includes/lasso.h
+++ b/src/mame/includes/lasso.h
@@ -7,8 +7,8 @@
class lasso_state : public driver_device
{
public:
- lasso_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lasso_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/lastduel.h b/src/mame/includes/lastduel.h
index f2db954ae9b..632d2cc02db 100644
--- a/src/mame/includes/lastduel.h
+++ b/src/mame/includes/lastduel.h
@@ -7,8 +7,8 @@
class lastduel_state : public driver_device
{
public:
- lastduel_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lastduel_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_vram;
diff --git a/src/mame/includes/lazercmd.h b/src/mame/includes/lazercmd.h
index c210decb26b..be1766926a5 100644
--- a/src/mame/includes/lazercmd.h
+++ b/src/mame/includes/lazercmd.h
@@ -20,8 +20,8 @@
class lazercmd_state : public driver_device
{
public:
- lazercmd_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lazercmd_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/legionna.h b/src/mame/includes/legionna.h
index f42844aa44f..d0ab7601534 100644
--- a/src/mame/includes/legionna.h
+++ b/src/mame/includes/legionna.h
@@ -1,8 +1,8 @@
class legionna_state : public driver_device
{
public:
- legionna_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ legionna_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_back_data;
UINT16 *m_fore_data;
diff --git a/src/mame/includes/leland.h b/src/mame/includes/leland.h
index 26642ef6047..c035da5386b 100644
--- a/src/mame/includes/leland.h
+++ b/src/mame/includes/leland.h
@@ -21,8 +21,8 @@ struct vram_state_data
class leland_state : public driver_device
{
public:
- leland_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ leland_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_dac_control;
UINT8 *m_alleymas_kludge_mem;
diff --git a/src/mame/includes/lemmings.h b/src/mame/includes/lemmings.h
index e47f40cdff7..5852da9d0e3 100644
--- a/src/mame/includes/lemmings.h
+++ b/src/mame/includes/lemmings.h
@@ -2,8 +2,8 @@
class lemmings_state : public driver_device
{
public:
- lemmings_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lemmings_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_pixel_0_data;
diff --git a/src/mame/includes/lethal.h b/src/mame/includes/lethal.h
index d7543820ac5..7821834180c 100644
--- a/src/mame/includes/lethal.h
+++ b/src/mame/includes/lethal.h
@@ -7,8 +7,8 @@
class lethal_state : public driver_device
{
public:
- lethal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lethal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT8 * m_paletteram; // currently this uses generic palette handling
diff --git a/src/mame/includes/lethalj.h b/src/mame/includes/lethalj.h
index a18af214b9a..0265bc33b3b 100644
--- a/src/mame/includes/lethalj.h
+++ b/src/mame/includes/lethalj.h
@@ -7,8 +7,8 @@
class lethalj_state : public driver_device
{
public:
- lethalj_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lethalj_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_blitter_data[8];
UINT16 *m_screenram;
diff --git a/src/mame/includes/liberate.h b/src/mame/includes/liberate.h
index a45301a26ac..1110ae4e4a0 100644
--- a/src/mame/includes/liberate.h
+++ b/src/mame/includes/liberate.h
@@ -1,8 +1,8 @@
class liberate_state : public driver_device
{
public:
- liberate_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ liberate_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/includes/liberatr.h b/src/mame/includes/liberatr.h
index 64317b3d92f..9d3f796c8e9 100644
--- a/src/mame/includes/liberatr.h
+++ b/src/mame/includes/liberatr.h
@@ -11,8 +11,8 @@
class liberatr_state : public atarigen_state
{
public:
- liberatr_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config),
+ liberatr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag),
m_base_ram(*this, "base_ram"),
m_planet_frame(*this, "planet_frame"),
m_planet_select(*this, "planet_select"),
diff --git a/src/mame/includes/lkage.h b/src/mame/includes/lkage.h
index 8ea34030656..de81488397c 100644
--- a/src/mame/includes/lkage.h
+++ b/src/mame/includes/lkage.h
@@ -2,8 +2,8 @@
class lkage_state : public driver_device
{
public:
- lkage_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lkage_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 * m_scroll;
UINT8 * m_vreg;
diff --git a/src/mame/includes/lockon.h b/src/mame/includes/lockon.h
index 19f8d1efc98..b071d5515c6 100644
--- a/src/mame/includes/lockon.h
+++ b/src/mame/includes/lockon.h
@@ -18,8 +18,8 @@
class lockon_state : public driver_device
{
public:
- lockon_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lockon_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 *m_char_ram;
diff --git a/src/mame/includes/lordgun.h b/src/mame/includes/lordgun.h
index 4f825d3208f..681f3e91220 100644
--- a/src/mame/includes/lordgun.h
+++ b/src/mame/includes/lordgun.h
@@ -14,8 +14,8 @@ struct _lordgun_gun_data
class lordgun_state : public driver_device
{
public:
- lordgun_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lordgun_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_old;
UINT8 m_aliencha_dip_sel;
diff --git a/src/mame/includes/lsasquad.h b/src/mame/includes/lsasquad.h
index 64698a3f802..02d22f24b4f 100644
--- a/src/mame/includes/lsasquad.h
+++ b/src/mame/includes/lsasquad.h
@@ -2,8 +2,8 @@
class lsasquad_state : public driver_device
{
public:
- lsasquad_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lsasquad_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_scrollram;
diff --git a/src/mame/includes/lucky74.h b/src/mame/includes/lucky74.h
index 395084d8646..9170804cdaf 100644
--- a/src/mame/includes/lucky74.h
+++ b/src/mame/includes/lucky74.h
@@ -1,8 +1,8 @@
class lucky74_state : public driver_device
{
public:
- lucky74_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lucky74_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_ym2149_portb;
UINT8 m_usart_8251;
diff --git a/src/mame/includes/lvcards.h b/src/mame/includes/lvcards.h
index ca42d87cd4d..39addbd582a 100644
--- a/src/mame/includes/lvcards.h
+++ b/src/mame/includes/lvcards.h
@@ -1,8 +1,8 @@
class lvcards_state : public driver_device
{
public:
- lvcards_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lvcards_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_payout;
UINT8 m_pulse;
diff --git a/src/mame/includes/lwings.h b/src/mame/includes/lwings.h
index 2d5445f04a6..49b8f86698b 100644
--- a/src/mame/includes/lwings.h
+++ b/src/mame/includes/lwings.h
@@ -2,8 +2,8 @@
class lwings_state : public driver_device
{
public:
- lwings_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ lwings_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_fgvideoram;
diff --git a/src/mame/includes/m10.h b/src/mame/includes/m10.h
index 9c3ab489475..84544e04197 100644
--- a/src/mame/includes/m10.h
+++ b/src/mame/includes/m10.h
@@ -30,8 +30,8 @@
class m10_state : public driver_device
{
public:
- m10_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m10_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_chargen;
diff --git a/src/mame/includes/m107.h b/src/mame/includes/m107.h
index e5e1f8fba7c..d32a9ac45d3 100644
--- a/src/mame/includes/m107.h
+++ b/src/mame/includes/m107.h
@@ -16,8 +16,8 @@ struct _pf_layer_info
class m107_state : public driver_device
{
public:
- m107_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m107_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
emu_timer *m_scanline_timer;
UINT8 m_irq_vectorbase;
diff --git a/src/mame/includes/m52.h b/src/mame/includes/m52.h
index 689d6f3896a..8baea175a59 100644
--- a/src/mame/includes/m52.h
+++ b/src/mame/includes/m52.h
@@ -1,8 +1,8 @@
class m52_state : public driver_device
{
public:
- m52_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m52_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/m57.h b/src/mame/includes/m57.h
index 6a3a74e57c4..94b0e8bedcf 100644
--- a/src/mame/includes/m57.h
+++ b/src/mame/includes/m57.h
@@ -1,8 +1,8 @@
class m57_state : public driver_device
{
public:
- m57_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m57_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/m58.h b/src/mame/includes/m58.h
index 955025d91cc..be6b2775110 100644
--- a/src/mame/includes/m58.h
+++ b/src/mame/includes/m58.h
@@ -1,8 +1,8 @@
class m58_state : public driver_device
{
public:
- m58_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m58_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/m62.h b/src/mame/includes/m62.h
index ee75202574a..f1dd2843593 100644
--- a/src/mame/includes/m62.h
+++ b/src/mame/includes/m62.h
@@ -1,8 +1,8 @@
class m62_state : public driver_device
{
public:
- m62_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m62_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_spriteram;
diff --git a/src/mame/includes/m72.h b/src/mame/includes/m72.h
index 62982fb1445..a117708c325 100644
--- a/src/mame/includes/m72.h
+++ b/src/mame/includes/m72.h
@@ -7,8 +7,8 @@
class m72_state : public driver_device
{
public:
- m72_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m72_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_protection_ram;
emu_timer *m_scanline_timer;
diff --git a/src/mame/includes/m90.h b/src/mame/includes/m90.h
index 23908fa50d8..655cb5b90c7 100644
--- a/src/mame/includes/m90.h
+++ b/src/mame/includes/m90.h
@@ -1,8 +1,8 @@
class m90_state : public driver_device
{
public:
- m90_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m90_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_video_data;
UINT16 *m_spriteram;
diff --git a/src/mame/includes/m92.h b/src/mame/includes/m92.h
index d602a960bfa..1263dfd9b10 100644
--- a/src/mame/includes/m92.h
+++ b/src/mame/includes/m92.h
@@ -16,8 +16,8 @@ struct _pf_layer_info
class m92_state : public driver_device
{
public:
- m92_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ m92_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_irqvector;
UINT16 m_sound_status;
diff --git a/src/mame/includes/macrossp.h b/src/mame/includes/macrossp.h
index b950853c2de..73fa552bd7e 100644
--- a/src/mame/includes/macrossp.h
+++ b/src/mame/includes/macrossp.h
@@ -7,8 +7,8 @@
class macrossp_state : public driver_device
{
public:
- macrossp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ macrossp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT32 * m_mainram;
diff --git a/src/mame/includes/madalien.h b/src/mame/includes/madalien.h
index 1e5df150c58..d9d193ed4e7 100644
--- a/src/mame/includes/madalien.h
+++ b/src/mame/includes/madalien.h
@@ -15,8 +15,8 @@
class madalien_state : public driver_device
{
public:
- madalien_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ madalien_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_shift_hi;
UINT8 *m_shift_lo;
diff --git a/src/mame/includes/madmotor.h b/src/mame/includes/madmotor.h
index 2d4c8a891e2..39bad970420 100644
--- a/src/mame/includes/madmotor.h
+++ b/src/mame/includes/madmotor.h
@@ -7,8 +7,8 @@
class madmotor_state : public driver_device
{
public:
- madmotor_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ madmotor_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram;
diff --git a/src/mame/includes/magmax.h b/src/mame/includes/magmax.h
index 9c5e292f39f..833fbe3d556 100644
--- a/src/mame/includes/magmax.h
+++ b/src/mame/includes/magmax.h
@@ -1,8 +1,8 @@
class magmax_state : public driver_device
{
public:
- magmax_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ magmax_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT8 m_sound_latch;
diff --git a/src/mame/includes/mainevt.h b/src/mame/includes/mainevt.h
index 633d126efcc..6f2f1ff4f22 100644
--- a/src/mame/includes/mainevt.h
+++ b/src/mame/includes/mainevt.h
@@ -7,8 +7,8 @@
class mainevt_state : public driver_device
{
public:
- mainevt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mainevt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT8 * m_paletteram; // currently this uses generic palette handling
diff --git a/src/mame/includes/mainsnk.h b/src/mame/includes/mainsnk.h
index f8f65583342..8793f1ec934 100644
--- a/src/mame/includes/mainsnk.h
+++ b/src/mame/includes/mainsnk.h
@@ -1,8 +1,8 @@
class mainsnk_state : public driver_device
{
public:
- mainsnk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mainsnk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_tx_tilemap;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/includes/malzak.h b/src/mame/includes/malzak.h
index 9ff28aa9757..2280a2089fc 100644
--- a/src/mame/includes/malzak.h
+++ b/src/mame/includes/malzak.h
@@ -8,8 +8,8 @@
class malzak_state : public driver_device
{
public:
- malzak_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ malzak_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* misc */
// int playfield_x[256];
diff --git a/src/mame/includes/mappy.h b/src/mame/includes/mappy.h
index 1253c33daeb..09d8647bc11 100644
--- a/src/mame/includes/mappy.h
+++ b/src/mame/includes/mappy.h
@@ -1,8 +1,8 @@
class mappy_state : public driver_device
{
public:
- mappy_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mappy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/marineb.h b/src/mame/includes/marineb.h
index d64669e421e..0f455d01414 100644
--- a/src/mame/includes/marineb.h
+++ b/src/mame/includes/marineb.h
@@ -1,8 +1,8 @@
class marineb_state : public driver_device
{
public:
- marineb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ marineb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 * m_videoram;
UINT8 * m_colorram;
diff --git a/src/mame/includes/mario.h b/src/mame/includes/mario.h
index 7914c064f1b..509d43ccf85 100644
--- a/src/mame/includes/mario.h
+++ b/src/mame/includes/mario.h
@@ -33,8 +33,8 @@
class mario_state : public driver_device
{
public:
- mario_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mario_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
diff --git a/src/mame/includes/markham.h b/src/mame/includes/markham.h
index 0df178d507f..dd8aabac908 100644
--- a/src/mame/includes/markham.h
+++ b/src/mame/includes/markham.h
@@ -7,8 +7,8 @@
class markham_state : public driver_device
{
public:
- markham_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ markham_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/matmania.h b/src/mame/includes/matmania.h
index 01e8f4666da..c321a1eb4be 100644
--- a/src/mame/includes/matmania.h
+++ b/src/mame/includes/matmania.h
@@ -2,8 +2,8 @@
class matmania_state : public driver_device
{
public:
- matmania_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ matmania_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/mcatadv.h b/src/mame/includes/mcatadv.h
index 736c6cf32ba..db1d515716b 100644
--- a/src/mame/includes/mcatadv.h
+++ b/src/mame/includes/mcatadv.h
@@ -2,8 +2,8 @@
class mcatadv_state : public driver_device
{
public:
- mcatadv_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mcatadv_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram1;
diff --git a/src/mame/includes/mcr.h b/src/mame/includes/mcr.h
index a5cad9b710c..79abd73c4c9 100644
--- a/src/mame/includes/mcr.h
+++ b/src/mame/includes/mcr.h
@@ -16,8 +16,8 @@
class mcr_state : public driver_device
{
public:
- mcr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mcr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
};
diff --git a/src/mame/includes/mcr3.h b/src/mame/includes/mcr3.h
index cb97e62fddc..546d2a586bc 100644
--- a/src/mame/includes/mcr3.h
+++ b/src/mame/includes/mcr3.h
@@ -1,8 +1,8 @@
class mcr3_state : public driver_device
{
public:
- mcr3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mcr3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/mcr68.h b/src/mame/includes/mcr68.h
index b912e2de5cd..d43b2a03063 100644
--- a/src/mame/includes/mcr68.h
+++ b/src/mame/includes/mcr68.h
@@ -13,8 +13,8 @@ struct counter_state
class mcr68_state : public driver_device
{
public:
- mcr68_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mcr68_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT16 m_control_word;
diff --git a/src/mame/includes/meadows.h b/src/mame/includes/meadows.h
index 207fbd720ed..67714892f07 100644
--- a/src/mame/includes/meadows.h
+++ b/src/mame/includes/meadows.h
@@ -9,8 +9,8 @@
class meadows_state : public driver_device
{
public:
- meadows_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ meadows_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_dac;
diff --git a/src/mame/includes/megadriv.h b/src/mame/includes/megadriv.h
index f6d4ef05364..6c518df6f78 100644
--- a/src/mame/includes/megadriv.h
+++ b/src/mame/includes/megadriv.h
@@ -95,15 +95,15 @@ extern int megadrive_region_pal;
class md_base_state : public driver_device
{
public:
- md_base_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ md_base_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
};
class md_boot_state : public md_base_state
{
public:
- md_boot_state(running_machine &machine, const driver_device_config_base &config)
- : md_base_state(machine, config) { }
+ md_boot_state(const machine_config &mconfig, device_type type, const char *tag)
+ : md_base_state(mconfig, type, tag) { }
// bootleg specific
int m_aladmdb_mcu_port;
@@ -112,8 +112,8 @@ public:
class segac2_state : public md_base_state
{
public:
- segac2_state(running_machine &machine, const driver_device_config_base &config)
- : md_base_state(machine, config) { }
+ segac2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : md_base_state(mconfig, type, tag) { }
// for Print Club only
int m_cam_data;
@@ -143,8 +143,8 @@ public:
class mplay_state : public md_base_state
{
public:
- mplay_state(running_machine &machine, const driver_device_config_base &config)
- : md_base_state(machine, config) { }
+ mplay_state(const machine_config &mconfig, device_type type, const char *tag)
+ : md_base_state(mconfig, type, tag) { }
UINT32 m_bios_mode; // determines whether ROM banks or Game data
// is to read from 0x8000-0xffff
@@ -169,8 +169,8 @@ public:
class mtech_state : public md_base_state
{
public:
- mtech_state(running_machine &machine, const driver_device_config_base &config)
- : md_base_state(machine, config) { }
+ mtech_state(const machine_config &mconfig, device_type type, const char *tag)
+ : md_base_state(mconfig, type, tag) { }
UINT8 m_mt_cart_select_reg;
UINT32 m_bios_port_ctrl;
@@ -216,8 +216,8 @@ struct _megadriv_cart
class md_cons_state : public md_base_state
{
public:
- md_cons_state(running_machine &machine, const driver_device_config_base &config)
- : md_base_state(machine, config) { }
+ md_cons_state(const machine_config &mconfig, device_type type, const char *tag)
+ : md_base_state(mconfig, type, tag) { }
emu_timer *m_mess_io_timeout[3];
int m_mess_io_stage[3];
@@ -229,8 +229,8 @@ public:
class pico_state : public md_cons_state
{
public:
- pico_state(running_machine &machine, const driver_device_config_base &config)
- : md_cons_state(machine, config) { }
+ pico_state(const machine_config &mconfig, device_type type, const char *tag)
+ : md_cons_state(mconfig, type, tag) { }
UINT8 m_page_register;
};
@@ -238,8 +238,8 @@ public:
class mdsvp_state : public md_cons_state
{
public:
- mdsvp_state(running_machine &machine, const driver_device_config_base &config)
- : md_cons_state(machine, config) { }
+ mdsvp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : md_cons_state(mconfig, type, tag) { }
UINT8 *m_iram; // IRAM (0-0x7ff)
UINT8 *m_dram; // [0x20000];
@@ -254,15 +254,15 @@ public:
class _32x_state : public md_base_state
{
public:
- _32x_state(running_machine &machine, const driver_device_config_base &config)
- : md_base_state(machine, config) { }
+ _32x_state(const machine_config &mconfig, device_type type, const char *tag)
+ : md_base_state(mconfig, type, tag) { }
};
class segacd_state : public _32x_state // use _32x_state as base to make easier the combo 32X + SCD
{
public:
- segacd_state(running_machine &machine, const driver_device_config_base &config)
- : _32x_state(machine, config) { }
+ segacd_state(const machine_config &mconfig, device_type type, const char *tag)
+ : _32x_state(mconfig, type, tag) { }
};
diff --git a/src/mame/includes/megasys1.h b/src/mame/includes/megasys1.h
index 9aa01aa6b29..c61123ea89b 100644
--- a/src/mame/includes/megasys1.h
+++ b/src/mame/includes/megasys1.h
@@ -17,8 +17,8 @@
class megasys1_state : public driver_device
{
public:
- megasys1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ megasys1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_spriteram;
UINT16 m_ip_select;
diff --git a/src/mame/includes/megazone.h b/src/mame/includes/megazone.h
index febd019d3f3..8bf2caac6e0 100644
--- a/src/mame/includes/megazone.h
+++ b/src/mame/includes/megazone.h
@@ -7,8 +7,8 @@
class megazone_state : public driver_device
{
public:
- megazone_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ megazone_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_scrollx;
diff --git a/src/mame/includes/mermaid.h b/src/mame/includes/mermaid.h
index 865c3ead679..ab81f90d88d 100644
--- a/src/mame/includes/mermaid.h
+++ b/src/mame/includes/mermaid.h
@@ -7,8 +7,8 @@
class mermaid_state : public driver_device
{
public:
- mermaid_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mermaid_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/metalmx.h b/src/mame/includes/metalmx.h
index 6e5170125a2..211e2e31168 100644
--- a/src/mame/includes/metalmx.h
+++ b/src/mame/includes/metalmx.h
@@ -6,8 +6,8 @@
class metalmx_state : public driver_device
{
public:
- metalmx_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ metalmx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_gsp(*this, "gsp"),
m_adsp(*this, "adsp"),
diff --git a/src/mame/includes/metlclsh.h b/src/mame/includes/metlclsh.h
index f73a6883411..6e3b50e0be0 100644
--- a/src/mame/includes/metlclsh.h
+++ b/src/mame/includes/metlclsh.h
@@ -7,8 +7,8 @@
class metlclsh_state : public driver_device
{
public:
- metlclsh_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ metlclsh_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bgram;
diff --git a/src/mame/includes/metro.h b/src/mame/includes/metro.h
index e517022a1bc..e8d4005834f 100644
--- a/src/mame/includes/metro.h
+++ b/src/mame/includes/metro.h
@@ -11,8 +11,8 @@
class metro_state : public driver_device
{
public:
- metro_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ metro_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_oki(*this, "oki"),
diff --git a/src/mame/includes/mexico86.h b/src/mame/includes/mexico86.h
index eec13203cdb..88195620cc4 100644
--- a/src/mame/includes/mexico86.h
+++ b/src/mame/includes/mexico86.h
@@ -2,8 +2,8 @@
class mexico86_state : public driver_device
{
public:
- mexico86_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mexico86_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_protection_ram;
diff --git a/src/mame/includes/mhavoc.h b/src/mame/includes/mhavoc.h
index 147d0aab736..ef174f5132b 100644
--- a/src/mame/includes/mhavoc.h
+++ b/src/mame/includes/mhavoc.h
@@ -18,8 +18,8 @@
class mhavoc_state : public driver_device
{
public:
- mhavoc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mhavoc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_zram0;
UINT8 *m_zram1;
diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h
index 18413a38748..2ad4399162e 100644
--- a/src/mame/includes/micro3d.h
+++ b/src/mame/includes/micro3d.h
@@ -15,8 +15,8 @@
class micro3d_state : public driver_device
{
public:
- micro3d_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ micro3d_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_shared_ram;
device_t *m_duart68681;
diff --git a/src/mame/includes/midtunit.h b/src/mame/includes/midtunit.h
index 07761128220..6bc7b16f914 100644
--- a/src/mame/includes/midtunit.h
+++ b/src/mame/includes/midtunit.h
@@ -7,8 +7,8 @@
class midtunit_state : public driver_device
{
public:
- midtunit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ midtunit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT16> m_nvram;
diff --git a/src/mame/includes/midvunit.h b/src/mame/includes/midvunit.h
index a16ca6b14c1..3b489714ac5 100644
--- a/src/mame/includes/midvunit.h
+++ b/src/mame/includes/midvunit.h
@@ -11,8 +11,8 @@
class midvunit_state : public driver_device
{
public:
- midvunit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ midvunit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
optional_shared_ptr<UINT32> m_nvram;
diff --git a/src/mame/includes/midwunit.h b/src/mame/includes/midwunit.h
index 4956cecfbde..188e039d8f0 100644
--- a/src/mame/includes/midwunit.h
+++ b/src/mame/includes/midwunit.h
@@ -7,8 +7,8 @@
class midwunit_state : public driver_device
{
public:
- midwunit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ midwunit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT16> m_nvram;
diff --git a/src/mame/includes/midxunit.h b/src/mame/includes/midxunit.h
index e4cd52db175..9e30d17069c 100644
--- a/src/mame/includes/midxunit.h
+++ b/src/mame/includes/midxunit.h
@@ -7,8 +7,8 @@
class midxunit_state : public driver_device
{
public:
- midxunit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ midxunit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT16> m_nvram;
diff --git a/src/mame/includes/midyunit.h b/src/mame/includes/midyunit.h
index 1e8745af07a..e984bc6c7bb 100644
--- a/src/mame/includes/midyunit.h
+++ b/src/mame/includes/midyunit.h
@@ -30,8 +30,8 @@ struct dma_state_t
class midyunit_state : public driver_device
{
public:
- midyunit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ midyunit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_cmos_ram;
UINT32 m_cmos_page;
diff --git a/src/mame/includes/midzeus.h b/src/mame/includes/midzeus.h
index ea9c34323cc..dc50589cefd 100644
--- a/src/mame/includes/midzeus.h
+++ b/src/mame/includes/midzeus.h
@@ -9,8 +9,8 @@
class midzeus_state : public driver_device
{
public:
- midzeus_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ midzeus_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT32> m_nvram;
diff --git a/src/mame/includes/mikie.h b/src/mame/includes/mikie.h
index 83609652fcd..690edb46ec1 100644
--- a/src/mame/includes/mikie.h
+++ b/src/mame/includes/mikie.h
@@ -7,8 +7,8 @@
class mikie_state : public driver_device
{
public:
- mikie_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mikie_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/mitchell.h b/src/mame/includes/mitchell.h
index ae3f459fb7a..3d6eb372ab5 100644
--- a/src/mame/includes/mitchell.h
+++ b/src/mame/includes/mitchell.h
@@ -9,8 +9,8 @@
class mitchell_state : public driver_device
{
public:
- mitchell_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ mitchell_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_audiocpu(*this, "audiocpu"),
m_oki(*this, "oki") { }
diff --git a/src/mame/includes/mjkjidai.h b/src/mame/includes/mjkjidai.h
index ac9be177417..d84c108e90c 100644
--- a/src/mame/includes/mjkjidai.h
+++ b/src/mame/includes/mjkjidai.h
@@ -1,8 +1,8 @@
class mjkjidai_state : public driver_device
{
public:
- mjkjidai_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mjkjidai_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_spriteram1;
diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h
index 42781604410..5952773326e 100644
--- a/src/mame/includes/model1.h
+++ b/src/mame/includes/model1.h
@@ -6,8 +6,8 @@ enum {MAT_STACK_SIZE = 32};
class model1_state : public driver_device
{
public:
- model1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ model1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
struct view *m_view;
struct point *m_pointdb;
diff --git a/src/mame/includes/model2.h b/src/mame/includes/model2.h
index 2f3e7c45e43..65a93595617 100644
--- a/src/mame/includes/model2.h
+++ b/src/mame/includes/model2.h
@@ -8,8 +8,8 @@ typedef struct _geo_state geo_state;
class model2_state : public driver_device
{
public:
- model2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ model2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_workram;
UINT32 m_intreq;
diff --git a/src/mame/includes/model3.h b/src/mame/includes/model3.h
index b2f93643f82..1a8076464e7 100644
--- a/src/mame/includes/model3.h
+++ b/src/mame/includes/model3.h
@@ -13,8 +13,8 @@ typedef struct _cached_texture cached_texture;
class model3_state : public driver_device
{
public:
- model3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ model3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_irq_enable;
UINT8 m_irq_state;
diff --git a/src/mame/includes/momoko.h b/src/mame/includes/momoko.h
index 618c6088afc..2a8b5bbc798 100644
--- a/src/mame/includes/momoko.h
+++ b/src/mame/includes/momoko.h
@@ -7,8 +7,8 @@
class momoko_state : public driver_device
{
public:
- momoko_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ momoko_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bg_scrollx;
diff --git a/src/mame/includes/moo.h b/src/mame/includes/moo.h
index 4a160c69cec..a166987338c 100644
--- a/src/mame/includes/moo.h
+++ b/src/mame/includes/moo.h
@@ -7,8 +7,8 @@
class moo_state : public driver_device
{
public:
- moo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ moo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_workram;
diff --git a/src/mame/includes/mosaic.h b/src/mame/includes/mosaic.h
index 900051f471f..015960bd3d9 100644
--- a/src/mame/includes/mosaic.h
+++ b/src/mame/includes/mosaic.h
@@ -7,8 +7,8 @@
class mosaic_state : public driver_device
{
public:
- mosaic_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mosaic_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_fgvideoram;
diff --git a/src/mame/includes/mouser.h b/src/mame/includes/mouser.h
index bd3839a2bef..2e6acf33f9f 100644
--- a/src/mame/includes/mouser.h
+++ b/src/mame/includes/mouser.h
@@ -7,8 +7,8 @@
class mouser_state : public driver_device
{
public:
- mouser_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mouser_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/mrdo.h b/src/mame/includes/mrdo.h
index c3abb083e1c..0d1c28274cb 100644
--- a/src/mame/includes/mrdo.h
+++ b/src/mame/includes/mrdo.h
@@ -7,8 +7,8 @@
class mrdo_state : public driver_device
{
public:
- mrdo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mrdo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bgvideoram;
diff --git a/src/mame/includes/mrflea.h b/src/mame/includes/mrflea.h
index b594e848285..acf1e4c121a 100644
--- a/src/mame/includes/mrflea.h
+++ b/src/mame/includes/mrflea.h
@@ -7,8 +7,8 @@
class mrflea_state : public driver_device
{
public:
- mrflea_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mrflea_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/mrjong.h b/src/mame/includes/mrjong.h
index fe6ae0b25ca..2de79c911be 100644
--- a/src/mame/includes/mrjong.h
+++ b/src/mame/includes/mrjong.h
@@ -7,8 +7,8 @@
class mrjong_state : public driver_device
{
public:
- mrjong_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mrjong_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/ms32.h b/src/mame/includes/ms32.h
index e08628c59b0..fbeb158faa2 100644
--- a/src/mame/includes/ms32.h
+++ b/src/mame/includes/ms32.h
@@ -1,8 +1,8 @@
class ms32_state : public driver_device
{
public:
- ms32_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ms32_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_nvram_8;
UINT32 *m_mahjong_input_select;
diff --git a/src/mame/includes/msisaac.h b/src/mame/includes/msisaac.h
index ea0fc1d0406..dea7234ae66 100644
--- a/src/mame/includes/msisaac.h
+++ b/src/mame/includes/msisaac.h
@@ -4,8 +4,8 @@
class msisaac_state : public driver_device
{
public:
- msisaac_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ msisaac_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/mugsmash.h b/src/mame/includes/mugsmash.h
index 3e9dcc4e380..bd5ff20f144 100644
--- a/src/mame/includes/mugsmash.h
+++ b/src/mame/includes/mugsmash.h
@@ -2,8 +2,8 @@
class mugsmash_state : public driver_device
{
public:
- mugsmash_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mugsmash_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram1;
UINT16 *m_videoram2;
diff --git a/src/mame/includes/multfish.h b/src/mame/includes/multfish.h
index 07bc6002b9d..4a907d92447 100644
--- a/src/mame/includes/multfish.h
+++ b/src/mame/includes/multfish.h
@@ -7,8 +7,8 @@
class multfish_state : public driver_device
{
public:
- multfish_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ multfish_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* Video related */
diff --git a/src/mame/includes/munchmo.h b/src/mame/includes/munchmo.h
index f71c12a6a5f..fb702d1cbc9 100644
--- a/src/mame/includes/munchmo.h
+++ b/src/mame/includes/munchmo.h
@@ -7,8 +7,8 @@
class munchmo_state : public driver_device
{
public:
- munchmo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ munchmo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_vreg;
diff --git a/src/mame/includes/mustache.h b/src/mame/includes/mustache.h
index ce1c54bf9da..91968b3a040 100644
--- a/src/mame/includes/mustache.h
+++ b/src/mame/includes/mustache.h
@@ -1,8 +1,8 @@
class mustache_state : public driver_device
{
public:
- mustache_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mustache_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
emu_timer *m_clear_irq_timer;
diff --git a/src/mame/includes/mw8080bw.h b/src/mame/includes/mw8080bw.h
index 9333631d319..676bd43e68b 100644
--- a/src/mame/includes/mw8080bw.h
+++ b/src/mame/includes/mw8080bw.h
@@ -33,8 +33,8 @@
class mw8080bw_state : public driver_device
{
public:
- mw8080bw_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mw8080bw_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_main_ram;
diff --git a/src/mame/includes/mystston.h b/src/mame/includes/mystston.h
index 99256f23914..feb52763136 100644
--- a/src/mame/includes/mystston.h
+++ b/src/mame/includes/mystston.h
@@ -13,8 +13,8 @@
class mystston_state : public driver_device
{
public:
- mystston_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mystston_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* machine state */
UINT8 *m_ay8910_data;
diff --git a/src/mame/includes/mystwarr.h b/src/mame/includes/mystwarr.h
index bb21c8bda08..5df176a8e8b 100644
--- a/src/mame/includes/mystwarr.h
+++ b/src/mame/includes/mystwarr.h
@@ -1,8 +1,8 @@
class mystwarr_state : public driver_device
{
public:
- mystwarr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ mystwarr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_gx_workram;
UINT8 m_mw_irq_control;
diff --git a/src/mame/includes/n64.h b/src/mame/includes/n64.h
index a778d6150f9..c6fca55b101 100644
--- a/src/mame/includes/n64.h
+++ b/src/mame/includes/n64.h
@@ -9,8 +9,8 @@
class _n64_state : public driver_device
{
public:
- _n64_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ _n64_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
N64::RDP::Processor m_rdp;
diff --git a/src/mame/includes/n8080.h b/src/mame/includes/n8080.h
index b0d5bd24b03..fcf922dc641 100644
--- a/src/mame/includes/n8080.h
+++ b/src/mame/includes/n8080.h
@@ -2,8 +2,8 @@
class n8080_state : public driver_device
{
public:
- n8080_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ n8080_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/namcofl.h b/src/mame/includes/namcofl.h
index 5b3243c1d45..2367e9e98f6 100644
--- a/src/mame/includes/namcofl.h
+++ b/src/mame/includes/namcofl.h
@@ -16,8 +16,8 @@
class namcofl_state : public driver_device
{
public:
- namcofl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ namcofl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
emu_timer *m_raster_interrupt_timer;
UINT32 *m_workram;
diff --git a/src/mame/includes/namcona1.h b/src/mame/includes/namcona1.h
index 0d11558d6c3..34fcb8cf0b7 100644
--- a/src/mame/includes/namcona1.h
+++ b/src/mame/includes/namcona1.h
@@ -19,8 +19,8 @@ enum
class namcona1_state : public driver_device
{
public:
- namcona1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ namcona1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT16 *m_spriteram;
diff --git a/src/mame/includes/namconb1.h b/src/mame/includes/namconb1.h
index 222936ac602..d1d51cc29f3 100644
--- a/src/mame/includes/namconb1.h
+++ b/src/mame/includes/namconb1.h
@@ -16,8 +16,8 @@
class namconb1_state : public driver_device
{
public:
- namconb1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ namconb1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_nvmem32;
UINT16 *m_namconb_shareram;
diff --git a/src/mame/includes/namcond1.h b/src/mame/includes/namcond1.h
index f8433babab5..17b5533cf46 100644
--- a/src/mame/includes/namcond1.h
+++ b/src/mame/includes/namcond1.h
@@ -9,8 +9,8 @@
class namcond1_state : public driver_device
{
public:
- namcond1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ namcond1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_h8_irq5_enabled;
UINT16 *m_shared_ram;
diff --git a/src/mame/includes/namcos1.h b/src/mame/includes/namcos1.h
index 8aa3d4099b6..f67fc6f00d6 100644
--- a/src/mame/includes/namcos1.h
+++ b/src/mame/includes/namcos1.h
@@ -12,8 +12,8 @@ typedef struct
class namcos1_state : public driver_device
{
public:
- namcos1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ namcos1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_dac0_value;
int m_dac1_value;
diff --git a/src/mame/includes/namcos21.h b/src/mame/includes/namcos21.h
index 3931c602548..5da4c16879f 100644
--- a/src/mame/includes/namcos21.h
+++ b/src/mame/includes/namcos21.h
@@ -26,8 +26,8 @@ struct dsp_state
class namcos21_state : public driver_device
{
public:
- namcos21_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ namcos21_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT16 *m_winrun_dspbios;
diff --git a/src/mame/includes/namcos22.h b/src/mame/includes/namcos22.h
index d203ae26487..ea13681d871 100644
--- a/src/mame/includes/namcos22.h
+++ b/src/mame/includes/namcos22.h
@@ -39,8 +39,8 @@ enum
class namcos22_state : public driver_device
{
public:
- namcos22_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ namcos22_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_spriteram;
int m_mbEnableDspIrqs;
diff --git a/src/mame/includes/namcos86.h b/src/mame/includes/namcos86.h
index 10843ccdc46..2bd5f2a08f1 100644
--- a/src/mame/includes/namcos86.h
+++ b/src/mame/includes/namcos86.h
@@ -1,8 +1,8 @@
class namcos86_state : public driver_device
{
public:
- namcos86_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ namcos86_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_spriteram;
int m_wdog;
diff --git a/src/mame/includes/naughtyb.h b/src/mame/includes/naughtyb.h
index c9813bd93f3..c8877a5206e 100644
--- a/src/mame/includes/naughtyb.h
+++ b/src/mame/includes/naughtyb.h
@@ -1,8 +1,8 @@
class naughtyb_state : public driver_device
{
public:
- naughtyb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ naughtyb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_popflame_prot_seed;
diff --git a/src/mame/includes/nbmj8688.h b/src/mame/includes/nbmj8688.h
index 741251e5190..7ddf5b7d456 100644
--- a/src/mame/includes/nbmj8688.h
+++ b/src/mame/includes/nbmj8688.h
@@ -1,8 +1,8 @@
class nbmj8688_state : public driver_device
{
public:
- nbmj8688_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nbmj8688_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_mjsikaku_scrolly;
int m_blitter_destx;
diff --git a/src/mame/includes/nbmj8891.h b/src/mame/includes/nbmj8891.h
index 8e8d8cd0e66..053c0784612 100644
--- a/src/mame/includes/nbmj8891.h
+++ b/src/mame/includes/nbmj8891.h
@@ -1,8 +1,8 @@
class nbmj8891_state : public driver_device
{
public:
- nbmj8891_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nbmj8891_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_scrolly;
int m_blitter_destx;
diff --git a/src/mame/includes/nbmj8900.h b/src/mame/includes/nbmj8900.h
index bd82ab4d496..f9c957836a4 100644
--- a/src/mame/includes/nbmj8900.h
+++ b/src/mame/includes/nbmj8900.h
@@ -1,8 +1,8 @@
class nbmj8900_state : public driver_device
{
public:
- nbmj8900_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nbmj8900_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_scrolly;
int m_blitter_destx;
diff --git a/src/mame/includes/nbmj8991.h b/src/mame/includes/nbmj8991.h
index ea65cd9b2a0..46fb59b9957 100644
--- a/src/mame/includes/nbmj8991.h
+++ b/src/mame/includes/nbmj8991.h
@@ -1,8 +1,8 @@
class nbmj8991_state : public driver_device
{
public:
- nbmj8991_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nbmj8991_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_scrollx;
int m_scrolly;
diff --git a/src/mame/includes/nbmj9195.h b/src/mame/includes/nbmj9195.h
index 7ff463c8c2c..773b367b53d 100644
--- a/src/mame/includes/nbmj9195.h
+++ b/src/mame/includes/nbmj9195.h
@@ -7,8 +7,8 @@
class nbmj9195_state : public driver_device
{
public:
- nbmj9195_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nbmj9195_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_inputport;
int m_dipswbitsel;
diff --git a/src/mame/includes/nemesis.h b/src/mame/includes/nemesis.h
index 7ad94bda874..03dd5d077ee 100644
--- a/src/mame/includes/nemesis.h
+++ b/src/mame/includes/nemesis.h
@@ -1,8 +1,8 @@
class nemesis_state : public driver_device
{
public:
- nemesis_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nemesis_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram1;
diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h
index c394a226446..3dd2343df1c 100644
--- a/src/mame/includes/neogeo.h
+++ b/src/mame/includes/neogeo.h
@@ -31,8 +31,8 @@
class neogeo_state : public driver_device
{
public:
- neogeo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ neogeo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT8 *memcard_data; // this currently uses generic handlers
diff --git a/src/mame/includes/news.h b/src/mame/includes/news.h
index c6d05995750..3a6b22e7af4 100644
--- a/src/mame/includes/news.h
+++ b/src/mame/includes/news.h
@@ -2,8 +2,8 @@
class news_state : public driver_device
{
public:
- news_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ news_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_bgram;
diff --git a/src/mame/includes/ninjakd2.h b/src/mame/includes/ninjakd2.h
index 311e2311952..b5fb334b4ab 100644
--- a/src/mame/includes/ninjakd2.h
+++ b/src/mame/includes/ninjakd2.h
@@ -1,8 +1,8 @@
class ninjakd2_state : public driver_device
{
public:
- ninjakd2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ninjakd2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
const INT16* m_sampledata;
UINT8 m_omegaf_io_protection[3];
diff --git a/src/mame/includes/ninjaw.h b/src/mame/includes/ninjaw.h
index 77897965af3..3e0f9a3ef64 100644
--- a/src/mame/includes/ninjaw.h
+++ b/src/mame/includes/ninjaw.h
@@ -7,8 +7,8 @@
class ninjaw_state : public driver_device
{
public:
- ninjaw_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ninjaw_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram;
diff --git a/src/mame/includes/nitedrvr.h b/src/mame/includes/nitedrvr.h
index 16c11f089f1..b09516401ff 100644
--- a/src/mame/includes/nitedrvr.h
+++ b/src/mame/includes/nitedrvr.h
@@ -18,8 +18,8 @@
class nitedrvr_state : public driver_device
{
public:
- nitedrvr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nitedrvr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_hvc;
diff --git a/src/mame/includes/niyanpai.h b/src/mame/includes/niyanpai.h
index 3f9b6e81488..04a00cfc246 100644
--- a/src/mame/includes/niyanpai.h
+++ b/src/mame/includes/niyanpai.h
@@ -3,8 +3,8 @@
class niyanpai_state : public driver_device
{
public:
- niyanpai_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ niyanpai_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_musobana_inputport;
int m_musobana_outcoin_flag;
diff --git a/src/mame/includes/nmk16.h b/src/mame/includes/nmk16.h
index 41b3719846c..daa63edbd1d 100644
--- a/src/mame/includes/nmk16.h
+++ b/src/mame/includes/nmk16.h
@@ -1,8 +1,8 @@
class nmk16_state : public driver_device
{
public:
- nmk16_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nmk16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int mask[4*2];
UINT16* m_mainram;
diff --git a/src/mame/includes/norautp.h b/src/mame/includes/norautp.h
index 6cfb92a58b9..e6b4bff26c8 100644
--- a/src/mame/includes/norautp.h
+++ b/src/mame/includes/norautp.h
@@ -9,8 +9,8 @@
class norautp_state : public driver_device
{
public:
- norautp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ norautp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_np_vram;
UINT16 m_np_addr;
diff --git a/src/mame/includes/nova2001.h b/src/mame/includes/nova2001.h
index 8bc5af6e8a4..e5409c28c2d 100644
--- a/src/mame/includes/nova2001.h
+++ b/src/mame/includes/nova2001.h
@@ -1,8 +1,8 @@
class nova2001_state : public driver_device
{
public:
- nova2001_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nova2001_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_ninjakun_io_a002_ctrl;
UINT8 *m_fg_videoram;
diff --git a/src/mame/includes/nycaptor.h b/src/mame/includes/nycaptor.h
index e684728f28a..c295830480d 100644
--- a/src/mame/includes/nycaptor.h
+++ b/src/mame/includes/nycaptor.h
@@ -2,8 +2,8 @@
class nycaptor_state : public driver_device
{
public:
- nycaptor_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ nycaptor_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_sharedram;
diff --git a/src/mame/includes/offtwall.h b/src/mame/includes/offtwall.h
index 4455d23d4f7..120ecb18b93 100644
--- a/src/mame/includes/offtwall.h
+++ b/src/mame/includes/offtwall.h
@@ -9,8 +9,8 @@
class offtwall_state : public atarigen_state
{
public:
- offtwall_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ offtwall_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 *m_bankswitch_base;
UINT16 *m_bankrom_base;
diff --git a/src/mame/includes/ohmygod.h b/src/mame/includes/ohmygod.h
index 960083edf43..ad3af3370d6 100644
--- a/src/mame/includes/ohmygod.h
+++ b/src/mame/includes/ohmygod.h
@@ -7,8 +7,8 @@
class ohmygod_state : public driver_device
{
public:
- ohmygod_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ohmygod_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
diff --git a/src/mame/includes/ojankohs.h b/src/mame/includes/ojankohs.h
index 98d41f42cab..2f52ba65782 100644
--- a/src/mame/includes/ojankohs.h
+++ b/src/mame/includes/ojankohs.h
@@ -7,8 +7,8 @@
class ojankohs_state : public driver_device
{
public:
- ojankohs_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ojankohs_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/oneshot.h b/src/mame/includes/oneshot.h
index 561f6472343..80b8c265440 100644
--- a/src/mame/includes/oneshot.h
+++ b/src/mame/includes/oneshot.h
@@ -2,8 +2,8 @@
class oneshot_state : public driver_device
{
public:
- oneshot_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ oneshot_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_sprites;
diff --git a/src/mame/includes/opwolf.h b/src/mame/includes/opwolf.h
index bce73fa57f8..f8067fd7bd7 100644
--- a/src/mame/includes/opwolf.h
+++ b/src/mame/includes/opwolf.h
@@ -7,8 +7,8 @@
class opwolf_state : public driver_device
{
public:
- opwolf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ opwolf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_cchip_ram;
diff --git a/src/mame/includes/orbit.h b/src/mame/includes/orbit.h
index b5ca0fafc81..a12b7da5f05 100644
--- a/src/mame/includes/orbit.h
+++ b/src/mame/includes/orbit.h
@@ -18,8 +18,8 @@
class orbit_state : public driver_device
{
public:
- orbit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ orbit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_playfield_ram;
diff --git a/src/mame/includes/othldrby.h b/src/mame/includes/othldrby.h
index 277381af675..729fa7c8174 100644
--- a/src/mame/includes/othldrby.h
+++ b/src/mame/includes/othldrby.h
@@ -9,8 +9,8 @@
class othldrby_state : public driver_device
{
public:
- othldrby_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ othldrby_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_vram;
diff --git a/src/mame/includes/othunder.h b/src/mame/includes/othunder.h
index e56072d91eb..33e18919cf8 100644
--- a/src/mame/includes/othunder.h
+++ b/src/mame/includes/othunder.h
@@ -18,8 +18,8 @@ struct othunder_tempsprite
class othunder_state : public driver_device
{
public:
- othunder_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ othunder_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram;
diff --git a/src/mame/includes/overdriv.h b/src/mame/includes/overdriv.h
index 8d8da6986cf..b78c41396ea 100644
--- a/src/mame/includes/overdriv.h
+++ b/src/mame/includes/overdriv.h
@@ -7,8 +7,8 @@
class overdriv_state : public driver_device
{
public:
- overdriv_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ overdriv_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT16 * m_paletteram; // currently this uses generic palette handling
diff --git a/src/mame/includes/pacland.h b/src/mame/includes/pacland.h
index 5d7e375df01..a720fe2fc2f 100644
--- a/src/mame/includes/pacland.h
+++ b/src/mame/includes/pacland.h
@@ -1,8 +1,8 @@
class pacland_state : public driver_device
{
public:
- pacland_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pacland_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_videoram2;
diff --git a/src/mame/includes/pacman.h b/src/mame/includes/pacman.h
index d8ec3c0bc9c..354c985d60b 100644
--- a/src/mame/includes/pacman.h
+++ b/src/mame/includes/pacman.h
@@ -7,8 +7,8 @@
class pacman_state : public driver_device
{
public:
- pacman_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pacman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_cannonb_bit_to_read;
int m_mystery;
diff --git a/src/mame/includes/pandoras.h b/src/mame/includes/pandoras.h
index 39fcb1eb624..eab03a61455 100644
--- a/src/mame/includes/pandoras.h
+++ b/src/mame/includes/pandoras.h
@@ -7,8 +7,8 @@
class pandoras_state : public driver_device
{
public:
- pandoras_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pandoras_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/paradise.h b/src/mame/includes/paradise.h
index 18b9eea93e6..dfaf5c37854 100644
--- a/src/mame/includes/paradise.h
+++ b/src/mame/includes/paradise.h
@@ -2,8 +2,8 @@
class paradise_state : public driver_device
{
public:
- paradise_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ paradise_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_vram_0;
diff --git a/src/mame/includes/parodius.h b/src/mame/includes/parodius.h
index 10ae80c68df..c64e343e864 100644
--- a/src/mame/includes/parodius.h
+++ b/src/mame/includes/parodius.h
@@ -7,8 +7,8 @@
class parodius_state : public driver_device
{
public:
- parodius_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ parodius_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/pass.h b/src/mame/includes/pass.h
index 866c91b26ab..4284abf1523 100644
--- a/src/mame/includes/pass.h
+++ b/src/mame/includes/pass.h
@@ -1,8 +1,8 @@
class pass_state : public driver_device
{
public:
- pass_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pass_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_bg_tilemap;
tilemap_t *m_fg_tilemap;
diff --git a/src/mame/includes/pastelg.h b/src/mame/includes/pastelg.h
index 1b1a562d603..8750366381a 100644
--- a/src/mame/includes/pastelg.h
+++ b/src/mame/includes/pastelg.h
@@ -1,8 +1,8 @@
class pastelg_state : public driver_device
{
public:
- pastelg_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pastelg_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_mux_data;
int m_blitter_destx;
diff --git a/src/mame/includes/pbaction.h b/src/mame/includes/pbaction.h
index 0a3921ba9cd..14f0e89f76c 100644
--- a/src/mame/includes/pbaction.h
+++ b/src/mame/includes/pbaction.h
@@ -7,8 +7,8 @@
class pbaction_state : public driver_device
{
public:
- pbaction_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pbaction_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/pcktgal.h b/src/mame/includes/pcktgal.h
index 6a69e5040fc..94b8ee84f25 100644
--- a/src/mame/includes/pcktgal.h
+++ b/src/mame/includes/pcktgal.h
@@ -1,8 +1,8 @@
class pcktgal_state : public driver_device
{
public:
- pcktgal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pcktgal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_msm5205next;
int m_toggle;
diff --git a/src/mame/includes/pgm.h b/src/mame/includes/pgm.h
index 3dec690e776..7df1d102da4 100644
--- a/src/mame/includes/pgm.h
+++ b/src/mame/includes/pgm.h
@@ -2,8 +2,8 @@
class pgm_state : public driver_device
{
public:
- pgm_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pgm_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT16 * m_mainram; // currently this is also used by nvram handler
diff --git a/src/mame/includes/phoenix.h b/src/mame/includes/phoenix.h
index 8e22be61d92..661ceaef5d7 100644
--- a/src/mame/includes/phoenix.h
+++ b/src/mame/includes/phoenix.h
@@ -6,8 +6,8 @@
class phoenix_state : public driver_device
{
public:
- phoenix_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ phoenix_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram_pg[2];
UINT8 m_videoram_pg_index;
diff --git a/src/mame/includes/pingpong.h b/src/mame/includes/pingpong.h
index 6657139e755..69aabb7cd48 100644
--- a/src/mame/includes/pingpong.h
+++ b/src/mame/includes/pingpong.h
@@ -1,8 +1,8 @@
class pingpong_state : public driver_device
{
public:
- pingpong_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pingpong_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_intenable;
int m_question_addr_high;
diff --git a/src/mame/includes/pirates.h b/src/mame/includes/pirates.h
index 73f7ca60803..78502e47b07 100644
--- a/src/mame/includes/pirates.h
+++ b/src/mame/includes/pirates.h
@@ -1,8 +1,8 @@
class pirates_state : public driver_device
{
public:
- pirates_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pirates_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_tx_tileram;
UINT16 *m_spriteram;
diff --git a/src/mame/includes/pitnrun.h b/src/mame/includes/pitnrun.h
index 808a1cda79e..c67516f1f65 100644
--- a/src/mame/includes/pitnrun.h
+++ b/src/mame/includes/pitnrun.h
@@ -1,8 +1,8 @@
class pitnrun_state : public driver_device
{
public:
- pitnrun_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pitnrun_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_nmi;
diff --git a/src/mame/includes/pktgaldx.h b/src/mame/includes/pktgaldx.h
index 37072d9ed81..cab46a4fd98 100644
--- a/src/mame/includes/pktgaldx.h
+++ b/src/mame/includes/pktgaldx.h
@@ -7,8 +7,8 @@
class pktgaldx_state : public driver_device
{
public:
- pktgaldx_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pktgaldx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_pf1_rowscroll;
diff --git a/src/mame/includes/playch10.h b/src/mame/includes/playch10.h
index cfb52eff595..dbffe910a83 100644
--- a/src/mame/includes/playch10.h
+++ b/src/mame/includes/playch10.h
@@ -7,8 +7,8 @@ typedef struct
class playch10_state : public driver_device
{
public:
- playch10_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ playch10_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_ram_8w;
diff --git a/src/mame/includes/playmark.h b/src/mame/includes/playmark.h
index 38c425d00b4..490cdfc5000 100644
--- a/src/mame/includes/playmark.h
+++ b/src/mame/includes/playmark.h
@@ -3,8 +3,8 @@
class playmark_state : public driver_device
{
public:
- playmark_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ playmark_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bgvideoram;
diff --git a/src/mame/includes/plygonet.h b/src/mame/includes/plygonet.h
index d42deb8d4da..778831deafa 100644
--- a/src/mame/includes/plygonet.h
+++ b/src/mame/includes/plygonet.h
@@ -7,8 +7,8 @@ static const UINT16 dsp56k_bank04_size = 0x1fc0;
class polygonet_state : public driver_device
{
public:
- polygonet_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ polygonet_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* 68k-side shared ram */
UINT32* m_shared_ram;
diff --git a/src/mame/includes/pokechmp.h b/src/mame/includes/pokechmp.h
index e519dc33edb..6bbde80bbaa 100644
--- a/src/mame/includes/pokechmp.h
+++ b/src/mame/includes/pokechmp.h
@@ -1,8 +1,8 @@
class pokechmp_state : public driver_device
{
public:
- pokechmp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pokechmp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/includes/polepos.h b/src/mame/includes/polepos.h
index 8c48e5f0921..4de79ae9f9c 100644
--- a/src/mame/includes/polepos.h
+++ b/src/mame/includes/polepos.h
@@ -11,8 +11,8 @@
class polepos_state : public driver_device
{
public:
- polepos_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ polepos_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_steer_last;
UINT8 m_steer_delta;
diff --git a/src/mame/includes/policetr.h b/src/mame/includes/policetr.h
index 6d5b86437d1..d2103e26db2 100644
--- a/src/mame/includes/policetr.h
+++ b/src/mame/includes/policetr.h
@@ -7,8 +7,8 @@
class policetr_state : public driver_device
{
public:
- policetr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ policetr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 m_control_data;
UINT32 m_bsmt_data_bank;
diff --git a/src/mame/includes/polyplay.h b/src/mame/includes/polyplay.h
index e272ca15b7f..d8f678635f3 100644
--- a/src/mame/includes/polyplay.h
+++ b/src/mame/includes/polyplay.h
@@ -5,8 +5,8 @@
class polyplay_state : public driver_device
{
public:
- polyplay_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ polyplay_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_freq1;
diff --git a/src/mame/includes/poolshrk.h b/src/mame/includes/poolshrk.h
index 33972b1be4b..c55b18d39e3 100644
--- a/src/mame/includes/poolshrk.h
+++ b/src/mame/includes/poolshrk.h
@@ -11,8 +11,8 @@
class poolshrk_state : public driver_device
{
public:
- poolshrk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ poolshrk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_da_latch;
UINT8* m_playfield_ram;
diff --git a/src/mame/includes/pooyan.h b/src/mame/includes/pooyan.h
index a89236077e4..f90f225a389 100644
--- a/src/mame/includes/pooyan.h
+++ b/src/mame/includes/pooyan.h
@@ -1,8 +1,8 @@
class pooyan_state : public driver_device
{
public:
- pooyan_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pooyan_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/popeye.h b/src/mame/includes/popeye.h
index c18f994f1a8..8623d8943fc 100644
--- a/src/mame/includes/popeye.h
+++ b/src/mame/includes/popeye.h
@@ -1,8 +1,8 @@
class popeye_state : public driver_device
{
public:
- popeye_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ popeye_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_prot0;
UINT8 m_prot1;
diff --git a/src/mame/includes/popper.h b/src/mame/includes/popper.h
index 88b310ebbff..e3cae69dcdc 100644
--- a/src/mame/includes/popper.h
+++ b/src/mame/includes/popper.h
@@ -7,8 +7,8 @@
class popper_state : public driver_device
{
public:
- popper_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ popper_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/portrait.h b/src/mame/includes/portrait.h
index 03b08a8c4da..5c563dc1ba0 100644
--- a/src/mame/includes/portrait.h
+++ b/src/mame/includes/portrait.h
@@ -1,8 +1,8 @@
class portrait_state : public driver_device
{
public:
- portrait_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ portrait_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_bgvideoram;
UINT8 *m_fgvideoram;
diff --git a/src/mame/includes/powerins.h b/src/mame/includes/powerins.h
index 68521f09a8f..9f72e68519e 100644
--- a/src/mame/includes/powerins.h
+++ b/src/mame/includes/powerins.h
@@ -1,8 +1,8 @@
class powerins_state : public driver_device
{
public:
- powerins_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ powerins_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_oki_bank;
UINT16 *m_vram_0;
diff --git a/src/mame/includes/prehisle.h b/src/mame/includes/prehisle.h
index 3b90984b23d..23133c5cbc3 100644
--- a/src/mame/includes/prehisle.h
+++ b/src/mame/includes/prehisle.h
@@ -1,8 +1,8 @@
class prehisle_state : public driver_device
{
public:
- prehisle_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ prehisle_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_spriteram;
diff --git a/src/mame/includes/psikyo.h b/src/mame/includes/psikyo.h
index 1ced0e3a3d3..26f2e5d14e4 100644
--- a/src/mame/includes/psikyo.h
+++ b/src/mame/includes/psikyo.h
@@ -7,8 +7,8 @@
class psikyo_state : public driver_device
{
public:
- psikyo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ psikyo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT32 * m_vram_0;
diff --git a/src/mame/includes/psikyo4.h b/src/mame/includes/psikyo4.h
index e1717a6a303..66396045da0 100644
--- a/src/mame/includes/psikyo4.h
+++ b/src/mame/includes/psikyo4.h
@@ -10,8 +10,8 @@
class psikyo4_state : public driver_device
{
public:
- psikyo4_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ psikyo4_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT32 * m_vidregs;
diff --git a/src/mame/includes/psikyosh.h b/src/mame/includes/psikyosh.h
index 130fedd9f24..3c193ecb615 100644
--- a/src/mame/includes/psikyosh.h
+++ b/src/mame/includes/psikyosh.h
@@ -19,8 +19,8 @@
class psikyosh_state : public driver_device
{
public:
- psikyosh_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ psikyosh_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT32 * m_bgram;
diff --git a/src/mame/includes/psx.h b/src/mame/includes/psx.h
index 2704b3ebbef..0d4afa8b3b1 100644
--- a/src/mame/includes/psx.h
+++ b/src/mame/includes/psx.h
@@ -45,8 +45,8 @@ typedef struct _psx_gpu psx_gpu;
class psx_state : public driver_device
{
public:
- psx_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ psx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
psx_machine *m_p_psx;
psx_gpu *m_p_psxgpu;
diff --git a/src/mame/includes/psychic5.h b/src/mame/includes/psychic5.h
index 793303b9d05..2ced0fcb9bd 100644
--- a/src/mame/includes/psychic5.h
+++ b/src/mame/includes/psychic5.h
@@ -1,8 +1,8 @@
class psychic5_state : public driver_device
{
public:
- psychic5_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ psychic5_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_bank_latch;
UINT8 m_ps5_vram_page;
diff --git a/src/mame/includes/punchout.h b/src/mame/includes/punchout.h
index c635cb4ffb9..27b9abfd4dc 100644
--- a/src/mame/includes/punchout.h
+++ b/src/mame/includes/punchout.h
@@ -1,8 +1,8 @@
class punchout_state : public driver_device
{
public:
- punchout_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ punchout_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_rp5c01_mode_sel;
int m_rp5c01_mem[16*4];
diff --git a/src/mame/includes/pushman.h b/src/mame/includes/pushman.h
index d2760e0ee8c..4d0a3d854bf 100644
--- a/src/mame/includes/pushman.h
+++ b/src/mame/includes/pushman.h
@@ -7,8 +7,8 @@
class pushman_state : public driver_device
{
public:
- pushman_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ pushman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/includes/qdrmfgp.h b/src/mame/includes/qdrmfgp.h
index 35822090051..ca6e6589020 100644
--- a/src/mame/includes/qdrmfgp.h
+++ b/src/mame/includes/qdrmfgp.h
@@ -1,8 +1,8 @@
class qdrmfgp_state : public driver_device
{
public:
- qdrmfgp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ qdrmfgp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT8> m_nvram;
diff --git a/src/mame/includes/qix.h b/src/mame/includes/qix.h
index bbd5bb794ad..ecd1aac4f02 100644
--- a/src/mame/includes/qix.h
+++ b/src/mame/includes/qix.h
@@ -22,8 +22,8 @@
class qix_state : public driver_device
{
public:
- qix_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ qix_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* machine state */
UINT8 *m_68705_port_out;
diff --git a/src/mame/includes/quizdna.h b/src/mame/includes/quizdna.h
index c80fd3bbe45..a9bbcfb3add 100644
--- a/src/mame/includes/quizdna.h
+++ b/src/mame/includes/quizdna.h
@@ -1,8 +1,8 @@
class quizdna_state : public driver_device
{
public:
- quizdna_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ quizdna_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_bg_ram;
UINT8 *m_fg_ram;
diff --git a/src/mame/includes/quizpani.h b/src/mame/includes/quizpani.h
index 3ddc78c9254..5949f5440f4 100644
--- a/src/mame/includes/quizpani.h
+++ b/src/mame/includes/quizpani.h
@@ -1,8 +1,8 @@
class quizpani_state : public driver_device
{
public:
- quizpani_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ quizpani_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_bg_videoram;
UINT16 *m_txt_videoram;
diff --git a/src/mame/includes/raiden.h b/src/mame/includes/raiden.h
index 3204332bea1..23a8ab9ca72 100644
--- a/src/mame/includes/raiden.h
+++ b/src/mame/includes/raiden.h
@@ -1,8 +1,8 @@
class raiden_state : public driver_device
{
public:
- raiden_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ raiden_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT16 *m_shared_ram;
diff --git a/src/mame/includes/raiden2.h b/src/mame/includes/raiden2.h
index a73f7a4552e..4bf877ce4e3 100644
--- a/src/mame/includes/raiden2.h
+++ b/src/mame/includes/raiden2.h
@@ -1,8 +1,8 @@
class raiden2_state : public driver_device
{
public:
- raiden2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ raiden2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
DECLARE_WRITE16_MEMBER( cop_itoa_low_w );
DECLARE_WRITE16_MEMBER( cop_itoa_high_w );
diff --git a/src/mame/includes/rainbow.h b/src/mame/includes/rainbow.h
index 69c9158a89c..7863df3a0af 100644
--- a/src/mame/includes/rainbow.h
+++ b/src/mame/includes/rainbow.h
@@ -7,8 +7,8 @@
class rainbow_state : public driver_device
{
public:
- rainbow_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rainbow_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram;
diff --git a/src/mame/includes/rallyx.h b/src/mame/includes/rallyx.h
index 76c2da8b127..005a8c93092 100644
--- a/src/mame/includes/rallyx.h
+++ b/src/mame/includes/rallyx.h
@@ -8,8 +8,8 @@ struct jungler_star
class rallyx_state : public driver_device
{
public:
- rallyx_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rallyx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/rampart.h b/src/mame/includes/rampart.h
index 7c81b7ee041..b44a1029b8b 100644
--- a/src/mame/includes/rampart.h
+++ b/src/mame/includes/rampart.h
@@ -9,8 +9,8 @@
class rampart_state : public atarigen_state
{
public:
- rampart_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ rampart_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 * m_bitmap;
UINT8 m_has_mo;
diff --git a/src/mame/includes/rastan.h b/src/mame/includes/rastan.h
index 2e7aefae9eb..3614ced9d8b 100644
--- a/src/mame/includes/rastan.h
+++ b/src/mame/includes/rastan.h
@@ -7,8 +7,8 @@
class rastan_state : public driver_device
{
public:
- rastan_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rastan_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT16 * paletteram; // this currently uses generic palette handlers
diff --git a/src/mame/includes/realbrk.h b/src/mame/includes/realbrk.h
index 0161c5b69cf..369fc01f303 100644
--- a/src/mame/includes/realbrk.h
+++ b/src/mame/includes/realbrk.h
@@ -1,8 +1,8 @@
class realbrk_state : public driver_device
{
public:
- realbrk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ realbrk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_dsw_select;
UINT16 *m_backup_ram;
diff --git a/src/mame/includes/redalert.h b/src/mame/includes/redalert.h
index e0400898a1e..05730cb3579 100644
--- a/src/mame/includes/redalert.h
+++ b/src/mame/includes/redalert.h
@@ -10,8 +10,8 @@
class redalert_state : public driver_device
{
public:
- redalert_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ redalert_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_ay8910_latch_1;
UINT8 m_ay8910_latch_2;
diff --git a/src/mame/includes/relief.h b/src/mame/includes/relief.h
index f97de5d3e78..f2350622819 100644
--- a/src/mame/includes/relief.h
+++ b/src/mame/includes/relief.h
@@ -9,8 +9,8 @@
class relief_state : public atarigen_state
{
public:
- relief_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ relief_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT8 m_ym2413_volume;
UINT8 m_overall_volume;
diff --git a/src/mame/includes/renegade.h b/src/mame/includes/renegade.h
index c18c6b8035f..b10fbb17ac5 100644
--- a/src/mame/includes/renegade.h
+++ b/src/mame/includes/renegade.h
@@ -3,8 +3,8 @@
class renegade_state : public driver_device
{
public:
- renegade_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ renegade_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_bank;
int m_mcu_sim;
diff --git a/src/mame/includes/retofinv.h b/src/mame/includes/retofinv.h
index 9e3c91fa53f..a279bf08c20 100644
--- a/src/mame/includes/retofinv.h
+++ b/src/mame/includes/retofinv.h
@@ -1,8 +1,8 @@
class retofinv_state : public driver_device
{
public:
- retofinv_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ retofinv_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_cpu2_m6000;
UINT8 *m_fg_videoram;
diff --git a/src/mame/includes/rockrage.h b/src/mame/includes/rockrage.h
index 14d81e80a48..d165a861e81 100644
--- a/src/mame/includes/rockrage.h
+++ b/src/mame/includes/rockrage.h
@@ -7,8 +7,8 @@
class rockrage_state : public driver_device
{
public:
- rockrage_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rockrage_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_paletteram;
diff --git a/src/mame/includes/rocnrope.h b/src/mame/includes/rocnrope.h
index 2a0017ace16..f2d970d1fb8 100644
--- a/src/mame/includes/rocnrope.h
+++ b/src/mame/includes/rocnrope.h
@@ -1,8 +1,8 @@
class rocnrope_state : public driver_device
{
public:
- rocnrope_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rocnrope_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/rohga.h b/src/mame/includes/rohga.h
index 3d67543cd5b..9a393feb010 100644
--- a/src/mame/includes/rohga.h
+++ b/src/mame/includes/rohga.h
@@ -11,8 +11,8 @@
class rohga_state : public driver_device
{
public:
- rohga_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ rohga_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_decocomn(*this, "deco_common"),
diff --git a/src/mame/includes/rollerg.h b/src/mame/includes/rollerg.h
index c60a4bc452b..1e294f16dc9 100644
--- a/src/mame/includes/rollerg.h
+++ b/src/mame/includes/rollerg.h
@@ -7,8 +7,8 @@
class rollerg_state : public driver_device
{
public:
- rollerg_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rollerg_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT8 * m_paletteram; // currently this uses generic palette handling
diff --git a/src/mame/includes/rollrace.h b/src/mame/includes/rollrace.h
index 6d685f6d286..2d7b714f904 100644
--- a/src/mame/includes/rollrace.h
+++ b/src/mame/includes/rollrace.h
@@ -1,8 +1,8 @@
class rollrace_state : public driver_device
{
public:
- rollrace_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rollrace_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/includes/route16.h b/src/mame/includes/route16.h
index 712bb899a1a..b50636901df 100644
--- a/src/mame/includes/route16.h
+++ b/src/mame/includes/route16.h
@@ -1,8 +1,8 @@
class route16_state : public driver_device
{
public:
- route16_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ route16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_sharedram;
UINT8 m_ttmahjng_port_select;
diff --git a/src/mame/includes/rpunch.h b/src/mame/includes/rpunch.h
index 3706ef269a6..2e26661a6af 100644
--- a/src/mame/includes/rpunch.h
+++ b/src/mame/includes/rpunch.h
@@ -1,8 +1,8 @@
class rpunch_state : public driver_device
{
public:
- rpunch_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rpunch_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT8 m_sound_data;
diff --git a/src/mame/includes/runaway.h b/src/mame/includes/runaway.h
index 99d1533d937..e208e533634 100644
--- a/src/mame/includes/runaway.h
+++ b/src/mame/includes/runaway.h
@@ -1,8 +1,8 @@
class runaway_state : public driver_device
{
public:
- runaway_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ runaway_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
emu_timer *m_interrupt_timer;
UINT8* m_video_ram;
diff --git a/src/mame/includes/rungun.h b/src/mame/includes/rungun.h
index 31fca98cc4d..a8369b4777a 100644
--- a/src/mame/includes/rungun.h
+++ b/src/mame/includes/rungun.h
@@ -7,8 +7,8 @@
class rungun_state : public driver_device
{
public:
- rungun_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ rungun_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_936_videoram;
diff --git a/src/mame/includes/sauro.h b/src/mame/includes/sauro.h
index 3fbff6f07f8..21f4f7af141 100644
--- a/src/mame/includes/sauro.h
+++ b/src/mame/includes/sauro.h
@@ -1,8 +1,8 @@
class sauro_state : public driver_device
{
public:
- sauro_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sauro_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
size_t m_spriteram_size;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/sbasketb.h b/src/mame/includes/sbasketb.h
index 9a56149eda8..deb421761fe 100644
--- a/src/mame/includes/sbasketb.h
+++ b/src/mame/includes/sbasketb.h
@@ -1,8 +1,8 @@
class sbasketb_state : public driver_device
{
public:
- sbasketb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sbasketb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/sbugger.h b/src/mame/includes/sbugger.h
index d8f3187c77e..b2d43d035a2 100644
--- a/src/mame/includes/sbugger.h
+++ b/src/mame/includes/sbugger.h
@@ -1,8 +1,8 @@
class sbugger_state : public driver_device
{
public:
- sbugger_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sbugger_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_videoram_attr;
diff --git a/src/mame/includes/scotrsht.h b/src/mame/includes/scotrsht.h
index 5f9ad2a264f..a173e1342bc 100644
--- a/src/mame/includes/scotrsht.h
+++ b/src/mame/includes/scotrsht.h
@@ -1,8 +1,8 @@
class scotrsht_state : public driver_device
{
public:
- scotrsht_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ scotrsht_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_irq_enable;
UINT8 *m_scroll;
diff --git a/src/mame/includes/scramble.h b/src/mame/includes/scramble.h
index 0117463621c..54e5679c50f 100644
--- a/src/mame/includes/scramble.h
+++ b/src/mame/includes/scramble.h
@@ -4,8 +4,8 @@
class scramble_state : public galaxold_state
{
public:
- scramble_state(running_machine &machine, const driver_device_config_base &config)
- : galaxold_state(machine, config) { }
+ scramble_state(const machine_config &mconfig, device_type type, const char *tag)
+ : galaxold_state(mconfig, type, tag) { }
UINT8 *m_soundram;
UINT8 m_cavelon_bank;
diff --git a/src/mame/includes/sderby.h b/src/mame/includes/sderby.h
index 96ce4e3c60e..391007befd7 100644
--- a/src/mame/includes/sderby.h
+++ b/src/mame/includes/sderby.h
@@ -1,8 +1,8 @@
class sderby_state : public driver_device
{
public:
- sderby_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sderby_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_spriteram;
size_t m_spriteram_size;
diff --git a/src/mame/includes/segag80r.h b/src/mame/includes/segag80r.h
index 329a686eb53..7f1e599b545 100644
--- a/src/mame/includes/segag80r.h
+++ b/src/mame/includes/segag80r.h
@@ -9,8 +9,8 @@
class segag80r_state : public driver_device
{
public:
- segag80r_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ segag80r_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_sound_state[2];
UINT8 m_sound_rate;
diff --git a/src/mame/includes/segag80v.h b/src/mame/includes/segag80v.h
index a70da5b18d5..10d04bbd0f0 100644
--- a/src/mame/includes/segag80v.h
+++ b/src/mame/includes/segag80v.h
@@ -9,8 +9,8 @@
class segag80v_state : public driver_device
{
public:
- segag80v_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ segag80v_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_mainram;
device_t *m_usb;
diff --git a/src/mame/includes/segas16.h b/src/mame/includes/segas16.h
index fefc0497aae..b78e47f83ef 100644
--- a/src/mame/includes/segas16.h
+++ b/src/mame/includes/segas16.h
@@ -2,8 +2,8 @@
class segas1x_state : public driver_device
{
public:
- segas1x_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ segas1x_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_interrupt_timer(*this, "int_timer") { }
/* memory pointers */
diff --git a/src/mame/includes/segas24.h b/src/mame/includes/segas24.h
index bb7ca9db8fe..34dee277a81 100644
--- a/src/mame/includes/segas24.h
+++ b/src/mame/includes/segas24.h
@@ -3,8 +3,8 @@
class segas24_state : public driver_device
{
public:
- segas24_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ segas24_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
static const UINT8 mahmajn_mlt[8];
diff --git a/src/mame/includes/segas32.h b/src/mame/includes/segas32.h
index 9403db443b5..6a6c00cafc0 100644
--- a/src/mame/includes/segas32.h
+++ b/src/mame/includes/segas32.h
@@ -16,8 +16,8 @@ struct layer_info
class segas32_state : public driver_device
{
public:
- segas32_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ segas32_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_z80_shared_ram;
UINT8 m_v60_irq_control[0x10];
diff --git a/src/mame/includes/seibuspi.h b/src/mame/includes/seibuspi.h
index 31d1f4403cd..c060675e812 100644
--- a/src/mame/includes/seibuspi.h
+++ b/src/mame/includes/seibuspi.h
@@ -5,8 +5,8 @@
class seibuspi_state : public driver_device
{
public:
- seibuspi_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ seibuspi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_spimainram;
UINT32 *m_spi_scrollram;
diff --git a/src/mame/includes/seicross.h b/src/mame/includes/seicross.h
index d72d794c005..fba7b479e5d 100644
--- a/src/mame/includes/seicross.h
+++ b/src/mame/includes/seicross.h
@@ -1,8 +1,8 @@
class seicross_state : public driver_device
{
public:
- seicross_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ seicross_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_nvram;
size_t m_nvram_size;
diff --git a/src/mame/includes/senjyo.h b/src/mame/includes/senjyo.h
index da264d32d97..32493551dc5 100644
--- a/src/mame/includes/senjyo.h
+++ b/src/mame/includes/senjyo.h
@@ -6,8 +6,8 @@
class senjyo_state : public driver_device
{
public:
- senjyo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ senjyo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_int_delay_kludge;
UINT8 m_sound_cmd;
diff --git a/src/mame/includes/seta.h b/src/mame/includes/seta.h
index 78db6f71447..27ae2b1dd98 100644
--- a/src/mame/includes/seta.h
+++ b/src/mame/includes/seta.h
@@ -27,8 +27,8 @@ struct _game_offset
class seta_state : public driver_device
{
public:
- seta_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ seta_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_sharedram;
UINT16 *m_workram;
diff --git a/src/mame/includes/seta2.h b/src/mame/includes/seta2.h
index 20b4ceb765c..5c0f3adb93a 100644
--- a/src/mame/includes/seta2.h
+++ b/src/mame/includes/seta2.h
@@ -1,8 +1,8 @@
class seta2_state : public driver_device
{
public:
- seta2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ seta2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
optional_shared_ptr<UINT16> m_nvram;
diff --git a/src/mame/includes/sf.h b/src/mame/includes/sf.h
index 73cb7cf27de..e74b5e0e411 100644
--- a/src/mame/includes/sf.h
+++ b/src/mame/includes/sf.h
@@ -7,8 +7,8 @@
class sf_state : public driver_device
{
public:
- sf_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/includes/shadfrce.h b/src/mame/includes/shadfrce.h
index ce141c18b47..1b76e78516b 100644
--- a/src/mame/includes/shadfrce.h
+++ b/src/mame/includes/shadfrce.h
@@ -1,8 +1,8 @@
class shadfrce_state : public driver_device
{
public:
- shadfrce_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ shadfrce_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_fgtilemap;
tilemap_t *m_bg0tilemap;
diff --git a/src/mame/includes/shangha3.h b/src/mame/includes/shangha3.h
index 0cc9037f735..271f129f430 100644
--- a/src/mame/includes/shangha3.h
+++ b/src/mame/includes/shangha3.h
@@ -1,8 +1,8 @@
class shangha3_state : public driver_device
{
public:
- shangha3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ shangha3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_prot_count;
UINT16 *m_ram;
diff --git a/src/mame/includes/shangkid.h b/src/mame/includes/shangkid.h
index 55dc38aa94e..1991a705a1c 100644
--- a/src/mame/includes/shangkid.h
+++ b/src/mame/includes/shangkid.h
@@ -1,8 +1,8 @@
class shangkid_state : public driver_device
{
public:
- shangkid_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ shangkid_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/shaolins.h b/src/mame/includes/shaolins.h
index 11dff920c36..1033f5b6046 100644
--- a/src/mame/includes/shaolins.h
+++ b/src/mame/includes/shaolins.h
@@ -1,8 +1,8 @@
class shaolins_state : public driver_device
{
public:
- shaolins_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ shaolins_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
size_t m_spriteram_size;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/shisen.h b/src/mame/includes/shisen.h
index d6af97294c5..17dcddb06d1 100644
--- a/src/mame/includes/shisen.h
+++ b/src/mame/includes/shisen.h
@@ -1,8 +1,8 @@
class shisen_state : public driver_device
{
public:
- shisen_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ shisen_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_gfxbank;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/includes/shootout.h b/src/mame/includes/shootout.h
index b104a6b7573..d7f154cbd1f 100644
--- a/src/mame/includes/shootout.h
+++ b/src/mame/includes/shootout.h
@@ -1,8 +1,8 @@
class shootout_state : public driver_device
{
public:
- shootout_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ shootout_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_background;
tilemap_t *m_foreground;
diff --git a/src/mame/includes/shuuz.h b/src/mame/includes/shuuz.h
index b76b0f1d66c..2245a84072e 100644
--- a/src/mame/includes/shuuz.h
+++ b/src/mame/includes/shuuz.h
@@ -9,8 +9,8 @@
class shuuz_state : public atarigen_state
{
public:
- shuuz_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ shuuz_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
int m_cur[2];
};
diff --git a/src/mame/includes/sidearms.h b/src/mame/includes/sidearms.h
index 0873f0f844b..a2fa87058bf 100644
--- a/src/mame/includes/sidearms.h
+++ b/src/mame/includes/sidearms.h
@@ -1,8 +1,8 @@
class sidearms_state : public driver_device
{
public:
- sidearms_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sidearms_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_gameid;
diff --git a/src/mame/includes/sidepckt.h b/src/mame/includes/sidepckt.h
index 0f9627baccc..e70a31d20c3 100644
--- a/src/mame/includes/sidepckt.h
+++ b/src/mame/includes/sidepckt.h
@@ -1,8 +1,8 @@
class sidepckt_state : public driver_device
{
public:
- sidepckt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sidepckt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_bg_tilemap;
UINT8 *m_colorram;
diff --git a/src/mame/includes/silkroad.h b/src/mame/includes/silkroad.h
index 10472b4f665..e4b74a557b5 100644
--- a/src/mame/includes/silkroad.h
+++ b/src/mame/includes/silkroad.h
@@ -1,8 +1,8 @@
class silkroad_state : public driver_device
{
public:
- silkroad_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ silkroad_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 *m_vidram;
UINT32 *m_vidram2;
diff --git a/src/mame/includes/simpl156.h b/src/mame/includes/simpl156.h
index 9d7ad2e8e1f..6ee7be80f02 100644
--- a/src/mame/includes/simpl156.h
+++ b/src/mame/includes/simpl156.h
@@ -11,8 +11,8 @@
class simpl156_state : public driver_device
{
public:
- simpl156_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ simpl156_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_deco_tilegen1(*this, "tilegen1"),
m_eeprom(*this, "eeprom"),
diff --git a/src/mame/includes/simpsons.h b/src/mame/includes/simpsons.h
index c22ccc093ad..7a88cbcb097 100644
--- a/src/mame/includes/simpsons.h
+++ b/src/mame/includes/simpsons.h
@@ -2,8 +2,8 @@
class simpsons_state : public driver_device
{
public:
- simpsons_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ simpsons_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/skullxbo.h b/src/mame/includes/skullxbo.h
index 13718a0be5d..b9bed8c023c 100644
--- a/src/mame/includes/skullxbo.h
+++ b/src/mame/includes/skullxbo.h
@@ -9,8 +9,8 @@
class skullxbo_state : public atarigen_state
{
public:
- skullxbo_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ skullxbo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
};
diff --git a/src/mame/includes/skydiver.h b/src/mame/includes/skydiver.h
index 9dcf2f9ca75..424d7f1f486 100644
--- a/src/mame/includes/skydiver.h
+++ b/src/mame/includes/skydiver.h
@@ -22,8 +22,8 @@
class skydiver_state : public driver_device
{
public:
- skydiver_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ skydiver_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_nmion;
UINT8 *m_videoram;
diff --git a/src/mame/includes/skyfox.h b/src/mame/includes/skyfox.h
index ea25adfe54c..6faf1705558 100644
--- a/src/mame/includes/skyfox.h
+++ b/src/mame/includes/skyfox.h
@@ -7,8 +7,8 @@
class skyfox_state : public driver_device
{
public:
- skyfox_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ skyfox_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_spriteram;
diff --git a/src/mame/includes/skykid.h b/src/mame/includes/skykid.h
index f0d456e36e5..64fa347ca8a 100644
--- a/src/mame/includes/skykid.h
+++ b/src/mame/includes/skykid.h
@@ -1,8 +1,8 @@
class skykid_state : public driver_device
{
public:
- skykid_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ skykid_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_inputport_selected;
UINT8 *m_textram;
diff --git a/src/mame/includes/skyraid.h b/src/mame/includes/skyraid.h
index 926cb6b4458..5347135ebf8 100644
--- a/src/mame/includes/skyraid.h
+++ b/src/mame/includes/skyraid.h
@@ -3,8 +3,8 @@
class skyraid_state : public driver_device
{
public:
- skyraid_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ skyraid_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_analog_range;
int m_analog_offset;
diff --git a/src/mame/includes/slapfght.h b/src/mame/includes/slapfght.h
index f6e87063d35..4e0ddcfe545 100644
--- a/src/mame/includes/slapfght.h
+++ b/src/mame/includes/slapfght.h
@@ -14,8 +14,8 @@ enum {
class slapfght_state : public driver_device
{
public:
- slapfght_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ slapfght_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_getstar_id;
UINT8 *m_slapfight_videoram;
diff --git a/src/mame/includes/slapshot.h b/src/mame/includes/slapshot.h
index e0a3f2c18ee..bbba495a9d4 100644
--- a/src/mame/includes/slapshot.h
+++ b/src/mame/includes/slapshot.h
@@ -17,8 +17,8 @@ struct slapshot_tempsprite
class slapshot_state : public driver_device
{
public:
- slapshot_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ slapshot_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_color_ram;
diff --git a/src/mame/includes/snes.h b/src/mame/includes/snes.h
index abbe1ea23f5..7665f4f3006 100644
--- a/src/mame/includes/snes.h
+++ b/src/mame/includes/snes.h
@@ -404,8 +404,8 @@ typedef UINT8 (*snes_oldjoy_read)(running_machine &machine);
class snes_state : public driver_device
{
public:
- snes_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ snes_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* misc */
UINT16 m_htmult; /* in 512 wide, we run HTOTAL double and halve it on latching */
diff --git a/src/mame/includes/snk.h b/src/mame/includes/snk.h
index f52968262e0..09932558214 100644
--- a/src/mame/includes/snk.h
+++ b/src/mame/includes/snk.h
@@ -7,8 +7,8 @@
class snk_state : public driver_device
{
public:
- snk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ snk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_countryc_trackball;
int m_last_value[2];
diff --git a/src/mame/includes/snk6502.h b/src/mame/includes/snk6502.h
index 965ac9b2599..a968658c605 100644
--- a/src/mame/includes/snk6502.h
+++ b/src/mame/includes/snk6502.h
@@ -13,8 +13,8 @@
class snk6502_state : public driver_device
{
public:
- snk6502_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ snk6502_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_sasuke_counter;
diff --git a/src/mame/includes/snk68.h b/src/mame/includes/snk68.h
index 5c6fdbbdc78..9f2a1ee55ab 100644
--- a/src/mame/includes/snk68.h
+++ b/src/mame/includes/snk68.h
@@ -1,8 +1,8 @@
class snk68_state : public driver_device
{
public:
- snk68_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ snk68_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_invert_controls;
int m_sound_status;
diff --git a/src/mame/includes/snookr10.h b/src/mame/includes/snookr10.h
index a7ffaed1294..c440192be8b 100644
--- a/src/mame/includes/snookr10.h
+++ b/src/mame/includes/snookr10.h
@@ -1,8 +1,8 @@
class snookr10_state : public driver_device
{
public:
- snookr10_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ snookr10_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_outportl;
int m_outporth;
diff --git a/src/mame/includes/snowbros.h b/src/mame/includes/snowbros.h
index 81bf94f257a..c59360faac4 100644
--- a/src/mame/includes/snowbros.h
+++ b/src/mame/includes/snowbros.h
@@ -3,8 +3,8 @@
class snowbros_state : public driver_device
{
public:
- snowbros_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ snowbros_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_hyperpac_ram;
int m_sb3_music_is_playing;
diff --git a/src/mame/includes/solomon.h b/src/mame/includes/solomon.h
index bf0d527cc22..07c03ba6746 100644
--- a/src/mame/includes/solomon.h
+++ b/src/mame/includes/solomon.h
@@ -1,8 +1,8 @@
class solomon_state : public driver_device
{
public:
- solomon_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ solomon_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
size_t m_spriteram_size;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/sonson.h b/src/mame/includes/sonson.h
index b01c49c42a0..5c4edd8c00c 100644
--- a/src/mame/includes/sonson.h
+++ b/src/mame/includes/sonson.h
@@ -7,8 +7,8 @@
class sonson_state : public driver_device
{
public:
- sonson_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sonson_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/spacefb.h b/src/mame/includes/spacefb.h
index 30af71df7af..b6c8a0affaa 100644
--- a/src/mame/includes/spacefb.h
+++ b/src/mame/includes/spacefb.h
@@ -27,8 +27,8 @@
class spacefb_state : public driver_device
{
public:
- spacefb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ spacefb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_sound_latch;
emu_timer *m_interrupt_timer;
diff --git a/src/mame/includes/spbactn.h b/src/mame/includes/spbactn.h
index fa546983498..b7ded7af8bd 100644
--- a/src/mame/includes/spbactn.h
+++ b/src/mame/includes/spbactn.h
@@ -1,8 +1,8 @@
class spbactn_state : public driver_device
{
public:
- spbactn_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ spbactn_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_bgvideoram;
UINT16 *m_fgvideoram;
diff --git a/src/mame/includes/spcforce.h b/src/mame/includes/spcforce.h
index 3622a95f113..bab1ecbc7ac 100644
--- a/src/mame/includes/spcforce.h
+++ b/src/mame/includes/spcforce.h
@@ -1,8 +1,8 @@
class spcforce_state : public driver_device
{
public:
- spcforce_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ spcforce_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_scrollram;
UINT8 *m_videoram;
diff --git a/src/mame/includes/spdodgeb.h b/src/mame/includes/spdodgeb.h
index 34ae7bbdf69..5b883a94942 100644
--- a/src/mame/includes/spdodgeb.h
+++ b/src/mame/includes/spdodgeb.h
@@ -1,8 +1,8 @@
class spdodgeb_state : public driver_device
{
public:
- spdodgeb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ spdodgeb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_toggle;
int m_adpcm_pos[2];
diff --git a/src/mame/includes/speedatk.h b/src/mame/includes/speedatk.h
index bc16e024420..5f5d2184cbb 100644
--- a/src/mame/includes/speedatk.h
+++ b/src/mame/includes/speedatk.h
@@ -1,8 +1,8 @@
class speedatk_state : public driver_device
{
public:
- speedatk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ speedatk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_colorram;
diff --git a/src/mame/includes/speedbal.h b/src/mame/includes/speedbal.h
index 0741bf5276e..59cf6fdafc2 100644
--- a/src/mame/includes/speedbal.h
+++ b/src/mame/includes/speedbal.h
@@ -1,8 +1,8 @@
class speedbal_state : public driver_device
{
public:
- speedbal_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ speedbal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_background_videoram;
UINT8 *m_foreground_videoram;
diff --git a/src/mame/includes/speedspn.h b/src/mame/includes/speedspn.h
index 309b0874329..deec090a051 100644
--- a/src/mame/includes/speedspn.h
+++ b/src/mame/includes/speedspn.h
@@ -1,8 +1,8 @@
class speedspn_state : public driver_device
{
public:
- speedspn_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ speedspn_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_attram;
tilemap_t *m_tilemap;
diff --git a/src/mame/includes/spiders.h b/src/mame/includes/spiders.h
index aee604a2076..42ab797bdae 100644
--- a/src/mame/includes/spiders.h
+++ b/src/mame/includes/spiders.h
@@ -10,8 +10,8 @@
class spiders_state : public driver_device
{
public:
- spiders_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ spiders_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_ram;
UINT8 m_flipscreen;
diff --git a/src/mame/includes/splash.h b/src/mame/includes/splash.h
index 2cd55e56e1d..f452844ace0 100644
--- a/src/mame/includes/splash.h
+++ b/src/mame/includes/splash.h
@@ -1,8 +1,8 @@
class splash_state : public driver_device
{
public:
- splash_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ splash_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_vregs;
UINT16 *m_videoram;
diff --git a/src/mame/includes/sprcros2.h b/src/mame/includes/sprcros2.h
index 8a87d40f406..d5fc24dc606 100644
--- a/src/mame/includes/sprcros2.h
+++ b/src/mame/includes/sprcros2.h
@@ -1,8 +1,8 @@
class sprcros2_state : public driver_device
{
public:
- sprcros2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sprcros2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_s_port3;
UINT8 m_port7;
diff --git a/src/mame/includes/sprint2.h b/src/mame/includes/sprint2.h
index f6914676b4d..46d25f429ca 100644
--- a/src/mame/includes/sprint2.h
+++ b/src/mame/includes/sprint2.h
@@ -24,8 +24,8 @@
class sprint2_state : public driver_device
{
public:
- sprint2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sprint2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_attract;
int m_steering[2];
diff --git a/src/mame/includes/sprint4.h b/src/mame/includes/sprint4.h
index 580aecbab8d..94092cb166b 100644
--- a/src/mame/includes/sprint4.h
+++ b/src/mame/includes/sprint4.h
@@ -1,8 +1,8 @@
class sprint4_state : public driver_device
{
public:
- sprint4_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sprint4_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_da_latch;
diff --git a/src/mame/includes/sprint8.h b/src/mame/includes/sprint8.h
index 71a4f4d168d..911f518edd4 100644
--- a/src/mame/includes/sprint8.h
+++ b/src/mame/includes/sprint8.h
@@ -3,8 +3,8 @@
class sprint8_state : public driver_device
{
public:
- sprint8_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sprint8_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_steer_dir[8];
int m_steer_flag[8];
diff --git a/src/mame/includes/spy.h b/src/mame/includes/spy.h
index 577121cc550..80056a9edad 100644
--- a/src/mame/includes/spy.h
+++ b/src/mame/includes/spy.h
@@ -7,8 +7,8 @@
class spy_state : public driver_device
{
public:
- spy_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ spy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/srmp2.h b/src/mame/includes/srmp2.h
index c5e0f1b6d86..d5dc7d68b9a 100644
--- a/src/mame/includes/srmp2.h
+++ b/src/mame/includes/srmp2.h
@@ -9,8 +9,8 @@ struct iox_t
class srmp2_state : public driver_device
{
public:
- srmp2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ srmp2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_color_bank;
int m_gfx_bank;
diff --git a/src/mame/includes/srumbler.h b/src/mame/includes/srumbler.h
index 139eaf39b7b..f66060574ac 100644
--- a/src/mame/includes/srumbler.h
+++ b/src/mame/includes/srumbler.h
@@ -1,8 +1,8 @@
class srumbler_state : public driver_device
{
public:
- srumbler_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ srumbler_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_backgroundram;
UINT8 *m_foregroundram;
diff --git a/src/mame/includes/sshangha.h b/src/mame/includes/sshangha.h
index fb40f5f5c3e..996d1b26476 100644
--- a/src/mame/includes/sshangha.h
+++ b/src/mame/includes/sshangha.h
@@ -3,8 +3,8 @@
class sshangha_state : public driver_device
{
public:
- sshangha_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ sshangha_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_deco_tilegen1(*this, "tilegen1")
{ }
diff --git a/src/mame/includes/sslam.h b/src/mame/includes/sslam.h
index a5815e87749..9b8380c7676 100644
--- a/src/mame/includes/sslam.h
+++ b/src/mame/includes/sslam.h
@@ -1,8 +1,8 @@
class sslam_state : public driver_device
{
public:
- sslam_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sslam_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
emu_timer *m_music_timer;
diff --git a/src/mame/includes/ssozumo.h b/src/mame/includes/ssozumo.h
index f67dcea15f1..80b4bddf10e 100644
--- a/src/mame/includes/ssozumo.h
+++ b/src/mame/includes/ssozumo.h
@@ -1,8 +1,8 @@
class ssozumo_state : public driver_device
{
public:
- ssozumo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ssozumo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
size_t m_spriteram_size;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/sspeedr.h b/src/mame/includes/sspeedr.h
index 19b0f89c2c1..a08a92b7302 100644
--- a/src/mame/includes/sspeedr.h
+++ b/src/mame/includes/sspeedr.h
@@ -1,8 +1,8 @@
class sspeedr_state : public driver_device
{
public:
- sspeedr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ sspeedr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_led_TIME[2];
UINT8 m_led_SCORE[24];
diff --git a/src/mame/includes/ssrj.h b/src/mame/includes/ssrj.h
index 3d78af3f5b5..2a75ae9d6b5 100644
--- a/src/mame/includes/ssrj.h
+++ b/src/mame/includes/ssrj.h
@@ -1,8 +1,8 @@
class ssrj_state : public driver_device
{
public:
- ssrj_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ssrj_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_oldport;
tilemap_t *m_tilemap1;
diff --git a/src/mame/includes/ssv.h b/src/mame/includes/ssv.h
index 92ba5ca7585..3a906fafaa3 100644
--- a/src/mame/includes/ssv.h
+++ b/src/mame/includes/ssv.h
@@ -3,8 +3,8 @@
class ssv_state : public driver_device
{
public:
- ssv_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ ssv_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_dsp(*this, "dsp")
{ }
diff --git a/src/mame/includes/stactics.h b/src/mame/includes/stactics.h
index f9d7a64b2e0..3fc8a3990af 100644
--- a/src/mame/includes/stactics.h
+++ b/src/mame/includes/stactics.h
@@ -10,8 +10,8 @@
class stactics_state : public driver_device
{
public:
- stactics_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ stactics_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* machine state */
int m_vert_pos;
diff --git a/src/mame/includes/stadhero.h b/src/mame/includes/stadhero.h
index 6523f67c250..6859a691412 100644
--- a/src/mame/includes/stadhero.h
+++ b/src/mame/includes/stadhero.h
@@ -1,8 +1,8 @@
class stadhero_state : public driver_device
{
public:
- stadhero_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ stadhero_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_pf1_data;
tilemap_t *m_pf1_tilemap;
diff --git a/src/mame/includes/starcrus.h b/src/mame/includes/starcrus.h
index 2c049aad679..0ef6ae44828 100644
--- a/src/mame/includes/starcrus.h
+++ b/src/mame/includes/starcrus.h
@@ -1,8 +1,8 @@
class starcrus_state : public driver_device
{
public:
- starcrus_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ starcrus_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
bitmap_t *m_ship1_vid;
bitmap_t *m_ship2_vid;
diff --git a/src/mame/includes/starfire.h b/src/mame/includes/starfire.h
index c6fd778835f..629116df564 100644
--- a/src/mame/includes/starfire.h
+++ b/src/mame/includes/starfire.h
@@ -13,8 +13,8 @@
class starfire_state : public driver_device
{
public:
- starfire_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ starfire_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
read8_space_func m_input_read;
diff --git a/src/mame/includes/starshp1.h b/src/mame/includes/starshp1.h
index f27010b0331..c2235c5d9af 100644
--- a/src/mame/includes/starshp1.h
+++ b/src/mame/includes/starshp1.h
@@ -33,8 +33,8 @@
class starshp1_state : public driver_device
{
public:
- starshp1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ starshp1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_analog_in_select;
int m_attract;
diff --git a/src/mame/includes/starwars.h b/src/mame/includes/starwars.h
index 393aa4ccd49..f43ef0f938d 100644
--- a/src/mame/includes/starwars.h
+++ b/src/mame/includes/starwars.h
@@ -10,8 +10,8 @@
class starwars_state : public driver_device
{
public:
- starwars_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ starwars_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_sound_data;
UINT8 m_main_data;
diff --git a/src/mame/includes/stfight.h b/src/mame/includes/stfight.h
index 5bfddb832c0..c1c3b470235 100644
--- a/src/mame/includes/stfight.h
+++ b/src/mame/includes/stfight.h
@@ -1,8 +1,8 @@
class stfight_state : public driver_device
{
public:
- stfight_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ stfight_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_text_char_ram;
UINT8 *m_text_attr_ram;
diff --git a/src/mame/includes/stlforce.h b/src/mame/includes/stlforce.h
index 6d337da4c5e..ec72c92cc32 100644
--- a/src/mame/includes/stlforce.h
+++ b/src/mame/includes/stlforce.h
@@ -1,8 +1,8 @@
class stlforce_state : public driver_device
{
public:
- stlforce_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ stlforce_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
tilemap_t *m_bg_tilemap;
tilemap_t *m_mlow_tilemap;
diff --git a/src/mame/includes/strnskil.h b/src/mame/includes/strnskil.h
index 8932d679235..70778739f97 100644
--- a/src/mame/includes/strnskil.h
+++ b/src/mame/includes/strnskil.h
@@ -1,8 +1,8 @@
class strnskil_state : public driver_device
{
public:
- strnskil_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ strnskil_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_xscroll;
diff --git a/src/mame/includes/subs.h b/src/mame/includes/subs.h
index 0b5000b7dbd..9f360e79e4a 100644
--- a/src/mame/includes/subs.h
+++ b/src/mame/includes/subs.h
@@ -19,8 +19,8 @@
class subs_state : public driver_device
{
public:
- subs_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ subs_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/suna16.h b/src/mame/includes/suna16.h
index 5fab251677f..de34e78c52a 100644
--- a/src/mame/includes/suna16.h
+++ b/src/mame/includes/suna16.h
@@ -1,8 +1,8 @@
class suna16_state : public driver_device
{
public:
- suna16_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ suna16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_prot;
UINT16 *m_paletteram;
diff --git a/src/mame/includes/suna8.h b/src/mame/includes/suna8.h
index c2b2d243ba8..f9e241dccc9 100644
--- a/src/mame/includes/suna8.h
+++ b/src/mame/includes/suna8.h
@@ -5,8 +5,8 @@
class suna8_state : public driver_device
{
public:
- suna8_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ suna8_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_rombank;
UINT8 m_spritebank;
diff --git a/src/mame/includes/supbtime.h b/src/mame/includes/supbtime.h
index cf11fd1c8c7..042a849d720 100644
--- a/src/mame/includes/supbtime.h
+++ b/src/mame/includes/supbtime.h
@@ -7,8 +7,8 @@
class supbtime_state : public driver_device
{
public:
- supbtime_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ supbtime_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_pf1_rowscroll;
diff --git a/src/mame/includes/superchs.h b/src/mame/includes/superchs.h
index 5e28ca5cc04..49818094577 100644
--- a/src/mame/includes/superchs.h
+++ b/src/mame/includes/superchs.h
@@ -11,8 +11,8 @@ struct tempsprite
class superchs_state : public driver_device
{
public:
- superchs_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ superchs_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_coin_word;
UINT32 *m_ram;
diff --git a/src/mame/includes/superqix.h b/src/mame/includes/superqix.h
index 8c47ca312bd..36227370766 100644
--- a/src/mame/includes/superqix.h
+++ b/src/mame/includes/superqix.h
@@ -1,8 +1,8 @@
class superqix_state : public driver_device
{
public:
- superqix_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ superqix_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
INT16 *m_samplebuf;
UINT8 m_port1;
diff --git a/src/mame/includes/suprloco.h b/src/mame/includes/suprloco.h
index 91904c84436..4060050d864 100644
--- a/src/mame/includes/suprloco.h
+++ b/src/mame/includes/suprloco.h
@@ -1,8 +1,8 @@
class suprloco_state : public driver_device
{
public:
- suprloco_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ suprloco_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_scrollram;
diff --git a/src/mame/includes/suprnova.h b/src/mame/includes/suprnova.h
index 278bc237740..640c5948b54 100644
--- a/src/mame/includes/suprnova.h
+++ b/src/mame/includes/suprnova.h
@@ -17,8 +17,8 @@ typedef struct
class skns_state : public driver_device
{
public:
- skns_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ skns_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
sknsspr_device* m_spritegen;
UINT32 *m_tilemapA_ram;
diff --git a/src/mame/includes/suprridr.h b/src/mame/includes/suprridr.h
index a64d78a941b..424542a0257 100644
--- a/src/mame/includes/suprridr.h
+++ b/src/mame/includes/suprridr.h
@@ -7,8 +7,8 @@
class suprridr_state : public driver_device
{
public:
- suprridr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ suprridr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_nmi_enable;
UINT8 m_sound_data;
diff --git a/src/mame/includes/suprslam.h b/src/mame/includes/suprslam.h
index 3666f08aa93..f8df81df3b8 100644
--- a/src/mame/includes/suprslam.h
+++ b/src/mame/includes/suprslam.h
@@ -7,8 +7,8 @@
class suprslam_state : public driver_device
{
public:
- suprslam_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ suprslam_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_screen_videoram;
diff --git a/src/mame/includes/surpratk.h b/src/mame/includes/surpratk.h
index e90603e213d..360ba2c5a00 100644
--- a/src/mame/includes/surpratk.h
+++ b/src/mame/includes/surpratk.h
@@ -7,8 +7,8 @@
class surpratk_state : public driver_device
{
public:
- surpratk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ surpratk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/system1.h b/src/mame/includes/system1.h
index 5cffe12a6fb..560e562334b 100644
--- a/src/mame/includes/system1.h
+++ b/src/mame/includes/system1.h
@@ -1,8 +1,8 @@
class system1_state : public driver_device
{
public:
- system1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ system1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
void (*m_videomode_custom)(running_machine &machine, UINT8 data, UINT8 prevdata);
diff --git a/src/mame/includes/system16.h b/src/mame/includes/system16.h
index 40dca40376f..b8625d4d36e 100644
--- a/src/mame/includes/system16.h
+++ b/src/mame/includes/system16.h
@@ -4,8 +4,8 @@
class segas1x_bootleg_state : public driver_device
{
public:
- segas1x_bootleg_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ segas1x_bootleg_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 * m_bg0_tileram;
UINT16 * m_bg1_tileram;
diff --git a/src/mame/includes/tagteam.h b/src/mame/includes/tagteam.h
index 9747d76775a..a1f076e2f8f 100644
--- a/src/mame/includes/tagteam.h
+++ b/src/mame/includes/tagteam.h
@@ -1,8 +1,8 @@
class tagteam_state : public driver_device
{
public:
- tagteam_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tagteam_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_coin;
UINT8 *m_videoram;
diff --git a/src/mame/includes/tail2nos.h b/src/mame/includes/tail2nos.h
index 871830d7b44..c2d96eb2712 100644
--- a/src/mame/includes/tail2nos.h
+++ b/src/mame/includes/tail2nos.h
@@ -7,8 +7,8 @@
class tail2nos_state : public driver_device
{
public:
- tail2nos_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tail2nos_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_bgvideoram;
diff --git a/src/mame/includes/taito_b.h b/src/mame/includes/taito_b.h
index 5c242369b59..987e1aff213 100644
--- a/src/mame/includes/taito_b.h
+++ b/src/mame/includes/taito_b.h
@@ -2,8 +2,8 @@
class taitob_state : public driver_device
{
public:
- taitob_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taitob_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram;
diff --git a/src/mame/includes/taito_f2.h b/src/mame/includes/taito_f2.h
index 70f36d15ffd..dd73fc5a949 100644
--- a/src/mame/includes/taito_f2.h
+++ b/src/mame/includes/taito_f2.h
@@ -13,8 +13,8 @@ struct f2_tempsprite
class taitof2_state : public driver_device
{
public:
- taitof2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ taitof2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_oki(*this, "oki") { }
/* memory pointers */
diff --git a/src/mame/includes/taito_f3.h b/src/mame/includes/taito_f3.h
index 5382657f0b6..319bdb160a0 100644
--- a/src/mame/includes/taito_f3.h
+++ b/src/mame/includes/taito_f3.h
@@ -43,8 +43,8 @@ enum {
class taito_f3_state : public driver_device
{
public:
- taito_f3_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taito_f3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT16 *m_spriteram;
diff --git a/src/mame/includes/taito_h.h b/src/mame/includes/taito_h.h
index f860b4b225e..471ed9e7a8d 100644
--- a/src/mame/includes/taito_h.h
+++ b/src/mame/includes/taito_h.h
@@ -7,8 +7,8 @@
class taitoh_state : public driver_device
{
public:
- taitoh_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taitoh_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_m68000_mainram;
diff --git a/src/mame/includes/taito_l.h b/src/mame/includes/taito_l.h
index 7db85c97e18..c72036a47c2 100644
--- a/src/mame/includes/taito_l.h
+++ b/src/mame/includes/taito_l.h
@@ -4,8 +4,8 @@
class taitol_state : public driver_device
{
public:
- taitol_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taitol_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_shared_ram;
diff --git a/src/mame/includes/taito_o.h b/src/mame/includes/taito_o.h
index 0e3a43ed4e9..989906929f3 100644
--- a/src/mame/includes/taito_o.h
+++ b/src/mame/includes/taito_o.h
@@ -7,8 +7,8 @@
class taitoo_state : public driver_device
{
public:
- taitoo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taitoo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT16 * paletteram; // currently this uses generic palette handling
diff --git a/src/mame/includes/taito_z.h b/src/mame/includes/taito_z.h
index 237af045d66..ef990e6cce4 100644
--- a/src/mame/includes/taito_z.h
+++ b/src/mame/includes/taito_z.h
@@ -8,8 +8,8 @@
class taitoz_state : public driver_device
{
public:
- taitoz_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taitoz_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram;
diff --git a/src/mame/includes/taitoair.h b/src/mame/includes/taitoair.h
index fbe388b4793..a9713b7a36f 100644
--- a/src/mame/includes/taitoair.h
+++ b/src/mame/includes/taitoair.h
@@ -20,8 +20,8 @@ struct taitoair_poly {
class taitoair_state : public driver_device
{
public:
- taitoair_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taitoair_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_m68000_mainram;
diff --git a/src/mame/includes/taitojc.h b/src/mame/includes/taitojc.h
index 4a85b4f26f4..72529069b9b 100644
--- a/src/mame/includes/taitojc.h
+++ b/src/mame/includes/taitojc.h
@@ -3,8 +3,8 @@
class taitojc_state : public driver_device
{
public:
- taitojc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taitojc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_texture_x;
int m_texture_y;
diff --git a/src/mame/includes/taitosj.h b/src/mame/includes/taitosj.h
index edafecb30db..d8cb809b298 100644
--- a/src/mame/includes/taitosj.h
+++ b/src/mame/includes/taitosj.h
@@ -1,8 +1,8 @@
class taitosj_state : public driver_device
{
public:
- taitosj_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taitosj_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_sndnmi_disable;
UINT8 m_input_port_4_f0;
diff --git a/src/mame/includes/tank8.h b/src/mame/includes/tank8.h
index 8d54f35dadc..5d3eae47a17 100644
--- a/src/mame/includes/tank8.h
+++ b/src/mame/includes/tank8.h
@@ -26,8 +26,8 @@
class tank8_state : public driver_device
{
public:
- tank8_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tank8_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_collision_index;
UINT8 *m_video_ram;
diff --git a/src/mame/includes/tankbatt.h b/src/mame/includes/tankbatt.h
index b03fe4bb211..d3e2ea41e67 100644
--- a/src/mame/includes/tankbatt.h
+++ b/src/mame/includes/tankbatt.h
@@ -1,8 +1,8 @@
class tankbatt_state : public driver_device
{
public:
- tankbatt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tankbatt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_nmi_enable;
diff --git a/src/mame/includes/tankbust.h b/src/mame/includes/tankbust.h
index 7e65447ae98..f641d887c34 100644
--- a/src/mame/includes/tankbust.h
+++ b/src/mame/includes/tankbust.h
@@ -1,8 +1,8 @@
class tankbust_state : public driver_device
{
public:
- tankbust_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tankbust_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_latch;
UINT32 m_timer1;
diff --git a/src/mame/includes/taotaido.h b/src/mame/includes/taotaido.h
index 4b95fcfe0ba..4a2f4ed4f95 100644
--- a/src/mame/includes/taotaido.h
+++ b/src/mame/includes/taotaido.h
@@ -1,8 +1,8 @@
class taotaido_state : public driver_device
{
public:
- taotaido_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taotaido_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_pending_command;
UINT16 *m_spriteram;
diff --git a/src/mame/includes/targeth.h b/src/mame/includes/targeth.h
index 95c7ecd85db..4f2b137831a 100644
--- a/src/mame/includes/targeth.h
+++ b/src/mame/includes/targeth.h
@@ -1,8 +1,8 @@
class targeth_state : public driver_device
{
public:
- targeth_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ targeth_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_vregs;
UINT16 *m_videoram;
diff --git a/src/mame/includes/tatsumi.h b/src/mame/includes/tatsumi.h
index f2ee8257dbb..efc5af904fd 100644
--- a/src/mame/includes/tatsumi.h
+++ b/src/mame/includes/tatsumi.h
@@ -1,8 +1,8 @@
class tatsumi_state : public driver_device
{
public:
- tatsumi_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tatsumi_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT16 *m_cyclwarr_cpua_ram;
diff --git a/src/mame/includes/taxidrvr.h b/src/mame/includes/taxidrvr.h
index 646de68b906..243a1878d76 100644
--- a/src/mame/includes/taxidrvr.h
+++ b/src/mame/includes/taxidrvr.h
@@ -1,8 +1,8 @@
class taxidrvr_state : public driver_device
{
public:
- taxidrvr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ taxidrvr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_s1;
int m_s2;
diff --git a/src/mame/includes/tbowl.h b/src/mame/includes/tbowl.h
index cdefda7cf81..73f26ad0e3b 100644
--- a/src/mame/includes/tbowl.h
+++ b/src/mame/includes/tbowl.h
@@ -1,8 +1,8 @@
class tbowl_state : public driver_device
{
public:
- tbowl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tbowl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_adpcm_pos[2];
int m_adpcm_end[2];
diff --git a/src/mame/includes/tceptor.h b/src/mame/includes/tceptor.h
index 6fdd0327288..7162223ec3c 100644
--- a/src/mame/includes/tceptor.h
+++ b/src/mame/includes/tceptor.h
@@ -1,8 +1,8 @@
class tceptor_state : public driver_device
{
public:
- tceptor_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tceptor_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_m6809_irq_enable;
UINT8 m_m68k_irq_enable;
diff --git a/src/mame/includes/tecmo.h b/src/mame/includes/tecmo.h
index 87e20f71a48..31f903ea766 100644
--- a/src/mame/includes/tecmo.h
+++ b/src/mame/includes/tecmo.h
@@ -1,8 +1,8 @@
class tecmo_state : public driver_device
{
public:
- tecmo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tecmo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_adpcm_pos;
int m_adpcm_end;
diff --git a/src/mame/includes/tecmo16.h b/src/mame/includes/tecmo16.h
index c572bf0a01c..6e0bd48db84 100644
--- a/src/mame/includes/tecmo16.h
+++ b/src/mame/includes/tecmo16.h
@@ -1,8 +1,8 @@
class tecmo16_state : public driver_device
{
public:
- tecmo16_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tecmo16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT16 *m_colorram;
diff --git a/src/mame/includes/tecmosys.h b/src/mame/includes/tecmosys.h
index 1afa135c764..3e717a0598b 100644
--- a/src/mame/includes/tecmosys.h
+++ b/src/mame/includes/tecmosys.h
@@ -7,8 +7,8 @@
class tecmosys_state : public driver_device
{
public:
- tecmosys_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tecmosys_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16* m_spriteram;
UINT16* m_tilemap_paletteram16;
diff --git a/src/mame/includes/tehkanwc.h b/src/mame/includes/tehkanwc.h
index f0cceb1645e..9be4a260037 100644
--- a/src/mame/includes/tehkanwc.h
+++ b/src/mame/includes/tehkanwc.h
@@ -1,8 +1,8 @@
class tehkanwc_state : public driver_device
{
public:
- tehkanwc_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tehkanwc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_track0[2];
int m_track1[2];
diff --git a/src/mame/includes/terracre.h b/src/mame/includes/terracre.h
index a152da467b1..f34a4c02ed0 100644
--- a/src/mame/includes/terracre.h
+++ b/src/mame/includes/terracre.h
@@ -1,8 +1,8 @@
class terracre_state : public driver_device
{
public:
- terracre_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ terracre_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
const UINT16 *m_mpProtData;
diff --git a/src/mame/includes/tetrisp2.h b/src/mame/includes/tetrisp2.h
index ed5e36e9ef8..a0211026875 100644
--- a/src/mame/includes/tetrisp2.h
+++ b/src/mame/includes/tetrisp2.h
@@ -1,8 +1,8 @@
class tetrisp2_state : public driver_device
{
public:
- tetrisp2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tetrisp2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_systemregs[0x10];
UINT16 *m_vram_bg;
diff --git a/src/mame/includes/thedeep.h b/src/mame/includes/thedeep.h
index 1b7d3f4d146..50e67b7e435 100644
--- a/src/mame/includes/thedeep.h
+++ b/src/mame/includes/thedeep.h
@@ -1,8 +1,8 @@
class thedeep_state : public driver_device
{
public:
- thedeep_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ thedeep_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_spriteram;
size_t m_spriteram_size;
diff --git a/src/mame/includes/thepit.h b/src/mame/includes/thepit.h
index dba2c56c53e..b435d7e6173 100644
--- a/src/mame/includes/thepit.h
+++ b/src/mame/includes/thepit.h
@@ -1,8 +1,8 @@
class thepit_state : public driver_device
{
public:
- thepit_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ thepit_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_question_address;
int m_question_rom;
diff --git a/src/mame/includes/thief.h b/src/mame/includes/thief.h
index 17b255d153a..a5707ee4d80 100644
--- a/src/mame/includes/thief.h
+++ b/src/mame/includes/thief.h
@@ -8,8 +8,8 @@ typedef struct {
class thief_state : public driver_device
{
public:
- thief_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ thief_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 m_input_select;
diff --git a/src/mame/includes/thoop2.h b/src/mame/includes/thoop2.h
index ff96bd88369..fbb8f0366a7 100644
--- a/src/mame/includes/thoop2.h
+++ b/src/mame/includes/thoop2.h
@@ -1,8 +1,8 @@
class thoop2_state : public driver_device
{
public:
- thoop2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ thoop2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_vregs;
UINT16 *m_videoram;
diff --git a/src/mame/includes/thunderj.h b/src/mame/includes/thunderj.h
index 232feb58600..9c7f85f0dec 100644
--- a/src/mame/includes/thunderj.h
+++ b/src/mame/includes/thunderj.h
@@ -9,8 +9,8 @@
class thunderj_state : public atarigen_state
{
public:
- thunderj_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ thunderj_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT8 m_alpha_tile_bank;
};
diff --git a/src/mame/includes/thunderx.h b/src/mame/includes/thunderx.h
index f2a6b81edcb..f9fc42122c3 100644
--- a/src/mame/includes/thunderx.h
+++ b/src/mame/includes/thunderx.h
@@ -7,8 +7,8 @@
class thunderx_state : public driver_device
{
public:
- thunderx_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ thunderx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/tiamc1.h b/src/mame/includes/tiamc1.h
index e6efbb828e6..00ff3f41f25 100644
--- a/src/mame/includes/tiamc1.h
+++ b/src/mame/includes/tiamc1.h
@@ -3,8 +3,8 @@
class tiamc1_state : public driver_device
{
public:
- tiamc1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tiamc1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_tileram;
UINT8 *m_charram;
diff --git a/src/mame/includes/tigeroad.h b/src/mame/includes/tigeroad.h
index a3dcd7f6f28..e0012585c53 100644
--- a/src/mame/includes/tigeroad.h
+++ b/src/mame/includes/tigeroad.h
@@ -1,8 +1,8 @@
class tigeroad_state : public driver_device
{
public:
- tigeroad_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tigeroad_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT16 *m_ram16;
diff --git a/src/mame/includes/timelimt.h b/src/mame/includes/timelimt.h
index 9f7cb0f4dcb..809bd506074 100644
--- a/src/mame/includes/timelimt.h
+++ b/src/mame/includes/timelimt.h
@@ -1,8 +1,8 @@
class timelimt_state : public driver_device
{
public:
- timelimt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ timelimt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_nmi_enabled;
diff --git a/src/mame/includes/timeplt.h b/src/mame/includes/timeplt.h
index f4aa44ed650..e6dd1621f32 100644
--- a/src/mame/includes/timeplt.h
+++ b/src/mame/includes/timeplt.h
@@ -7,8 +7,8 @@
class timeplt_state : public driver_device
{
public:
- timeplt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ timeplt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/tmnt.h b/src/mame/includes/tmnt.h
index 92a89f06635..ee4086b55b8 100644
--- a/src/mame/includes/tmnt.h
+++ b/src/mame/includes/tmnt.h
@@ -2,8 +2,8 @@
class tmnt_state : public driver_device
{
public:
- tmnt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tmnt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_tmnt2_1c0800;
diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h
index a19c3e6080d..81352d2c71c 100644
--- a/src/mame/includes/tnzs.h
+++ b/src/mame/includes/tnzs.h
@@ -18,8 +18,8 @@ enum
class tnzs_state : public driver_device
{
public:
- tnzs_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tnzs_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_objram;
diff --git a/src/mame/includes/toaplan1.h b/src/mame/includes/toaplan1.h
index 40ee4280dd6..dcb0c57c5be 100644
--- a/src/mame/includes/toaplan1.h
+++ b/src/mame/includes/toaplan1.h
@@ -7,8 +7,8 @@
class toaplan1_state : public driver_device
{
public:
- toaplan1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ toaplan1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_unk_reset_port;
UINT16 *m_colorram1;
diff --git a/src/mame/includes/toaplan2.h b/src/mame/includes/toaplan2.h
index cc41d7e497d..b29ec8eba2b 100644
--- a/src/mame/includes/toaplan2.h
+++ b/src/mame/includes/toaplan2.h
@@ -12,8 +12,8 @@
class toaplan2_state : public driver_device
{
public:
- toaplan2_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config)
+ toaplan2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
{
m_vdp0 = NULL;
m_vdp1 = NULL;
diff --git a/src/mame/includes/toki.h b/src/mame/includes/toki.h
index 711d712fb94..7db761254c8 100644
--- a/src/mame/includes/toki.h
+++ b/src/mame/includes/toki.h
@@ -1,8 +1,8 @@
class toki_state : public driver_device
{
public:
- toki_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ toki_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
int m_msm5205next;
diff --git a/src/mame/includes/toobin.h b/src/mame/includes/toobin.h
index 15a25a6777b..cd26ea35394 100644
--- a/src/mame/includes/toobin.h
+++ b/src/mame/includes/toobin.h
@@ -9,8 +9,8 @@
class toobin_state : public atarigen_state
{
public:
- toobin_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ toobin_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 * m_interrupt_scan;
diff --git a/src/mame/includes/topspeed.h b/src/mame/includes/topspeed.h
index 045dd888109..544d78d0044 100644
--- a/src/mame/includes/topspeed.h
+++ b/src/mame/includes/topspeed.h
@@ -7,8 +7,8 @@
class topspeed_state : public driver_device
{
public:
- topspeed_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ topspeed_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spritemap;
diff --git a/src/mame/includes/toypop.h b/src/mame/includes/toypop.h
index 9ff298b8f07..2bc85d749c2 100644
--- a/src/mame/includes/toypop.h
+++ b/src/mame/includes/toypop.h
@@ -1,8 +1,8 @@
class toypop_state : public driver_device
{
public:
- toypop_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ toypop_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_spriteram;
diff --git a/src/mame/includes/tp84.h b/src/mame/includes/tp84.h
index f90d85a5ac6..e24ff5bb5b0 100644
--- a/src/mame/includes/tp84.h
+++ b/src/mame/includes/tp84.h
@@ -1,8 +1,8 @@
class tp84_state : public driver_device
{
public:
- tp84_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tp84_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
cpu_device *m_audiocpu;
UINT8 *m_bg_videoram;
diff --git a/src/mame/includes/trackfld.h b/src/mame/includes/trackfld.h
index 264a7f93de4..68e13a8a29c 100644
--- a/src/mame/includes/trackfld.h
+++ b/src/mame/includes/trackfld.h
@@ -8,8 +8,8 @@
class trackfld_state : public driver_device
{
public:
- trackfld_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ trackfld_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/travrusa.h b/src/mame/includes/travrusa.h
index 435c41f1d0a..cd358f825d4 100644
--- a/src/mame/includes/travrusa.h
+++ b/src/mame/includes/travrusa.h
@@ -1,8 +1,8 @@
class travrusa_state : public driver_device
{
public:
- travrusa_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ travrusa_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/triplhnt.h b/src/mame/includes/triplhnt.h
index 702e18db386..7e2ec9eb8cf 100644
--- a/src/mame/includes/triplhnt.h
+++ b/src/mame/includes/triplhnt.h
@@ -19,8 +19,8 @@
class triplhnt_state : public driver_device
{
public:
- triplhnt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ triplhnt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_cmos[16];
UINT8 m_da_latch;
diff --git a/src/mame/includes/truco.h b/src/mame/includes/truco.h
index d4214cae472..245ceb979cc 100644
--- a/src/mame/includes/truco.h
+++ b/src/mame/includes/truco.h
@@ -1,8 +1,8 @@
class truco_state : public driver_device
{
public:
- truco_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ truco_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_battery_ram;
diff --git a/src/mame/includes/trucocl.h b/src/mame/includes/trucocl.h
index eb50e275d58..90698564cf2 100644
--- a/src/mame/includes/trucocl.h
+++ b/src/mame/includes/trucocl.h
@@ -1,8 +1,8 @@
class trucocl_state : public driver_device
{
public:
- trucocl_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ trucocl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_cur_dac_address;
int m_cur_dac_address_index;
diff --git a/src/mame/includes/tryout.h b/src/mame/includes/tryout.h
index 7c33b85879a..9454724039b 100644
--- a/src/mame/includes/tryout.h
+++ b/src/mame/includes/tryout.h
@@ -1,8 +1,8 @@
class tryout_state : public driver_device
{
public:
- tryout_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tryout_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_gfx_control;
diff --git a/src/mame/includes/tsamurai.h b/src/mame/includes/tsamurai.h
index 0f5f04d3b82..00e4c58bd79 100644
--- a/src/mame/includes/tsamurai.h
+++ b/src/mame/includes/tsamurai.h
@@ -1,8 +1,8 @@
class tsamurai_state : public driver_device
{
public:
- tsamurai_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tsamurai_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_nmi_enabled;
int m_sound_command1;
diff --git a/src/mame/includes/tubep.h b/src/mame/includes/tubep.h
index f179555e535..b18951259ea 100644
--- a/src/mame/includes/tubep.h
+++ b/src/mame/includes/tubep.h
@@ -1,8 +1,8 @@
class tubep_state : public driver_device
{
public:
- tubep_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tubep_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_sound_latch;
UINT8 m_ls74;
diff --git a/src/mame/includes/tumbleb.h b/src/mame/includes/tumbleb.h
index 23268fa23a0..8dac704db44 100644
--- a/src/mame/includes/tumbleb.h
+++ b/src/mame/includes/tumbleb.h
@@ -2,8 +2,8 @@
class tumbleb_state : public driver_device
{
public:
- tumbleb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tumbleb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_pf1_data;
diff --git a/src/mame/includes/tumblep.h b/src/mame/includes/tumblep.h
index f3a7bc201d0..96816be4d77 100644
--- a/src/mame/includes/tumblep.h
+++ b/src/mame/includes/tumblep.h
@@ -7,8 +7,8 @@
class tumblep_state : public driver_device
{
public:
- tumblep_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tumblep_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_pf1_rowscroll;
diff --git a/src/mame/includes/tunhunt.h b/src/mame/includes/tunhunt.h
index a6e6ce808cc..6b0e97f1fb2 100644
--- a/src/mame/includes/tunhunt.h
+++ b/src/mame/includes/tunhunt.h
@@ -1,8 +1,8 @@
class tunhunt_state : public driver_device
{
public:
- tunhunt_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tunhunt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_control;
UINT8 *m_workram;
diff --git a/src/mame/includes/turbo.h b/src/mame/includes/turbo.h
index d6bf925ad8e..cb2e1e87918 100644
--- a/src/mame/includes/turbo.h
+++ b/src/mame/includes/turbo.h
@@ -25,8 +25,8 @@ struct i8279_state
class turbo_state : public driver_device
{
public:
- turbo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ turbo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/tutankhm.h b/src/mame/includes/tutankhm.h
index c5958028240..899d5039790 100644
--- a/src/mame/includes/tutankhm.h
+++ b/src/mame/includes/tutankhm.h
@@ -1,8 +1,8 @@
class tutankhm_state : public driver_device
{
public:
- tutankhm_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tutankhm_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/twin16.h b/src/mame/includes/twin16.h
index f368b689df6..390a2275d4f 100644
--- a/src/mame/includes/twin16.h
+++ b/src/mame/includes/twin16.h
@@ -1,8 +1,8 @@
class twin16_state : public driver_device
{
public:
- twin16_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ twin16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
UINT16 m_CPUA_register;
diff --git a/src/mame/includes/twincobr.h b/src/mame/includes/twincobr.h
index e5c4f8386ac..b21d1b2e149 100644
--- a/src/mame/includes/twincobr.h
+++ b/src/mame/includes/twincobr.h
@@ -10,8 +10,8 @@
class twincobr_state : public driver_device
{
public:
- twincobr_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ twincobr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_toaplan_main_cpu;
int m_wardner_membank;
diff --git a/src/mame/includes/tx1.h b/src/mame/includes/tx1.h
index 97845f28c37..e71cdeb4cbd 100644
--- a/src/mame/includes/tx1.h
+++ b/src/mame/includes/tx1.h
@@ -101,8 +101,8 @@ struct vregs_t
class tx1_state : public driver_device
{
public:
- tx1_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ tx1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
math_t m_math;
sn74s516_t m_sn74s516;
diff --git a/src/mame/includes/ultraman.h b/src/mame/includes/ultraman.h
index 303baacfea9..738516a5b22 100644
--- a/src/mame/includes/ultraman.h
+++ b/src/mame/includes/ultraman.h
@@ -7,8 +7,8 @@
class ultraman_state : public driver_device
{
public:
- ultraman_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ultraman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT16 * m_paletteram; // currently this uses generic palette handling
diff --git a/src/mame/includes/ultratnk.h b/src/mame/includes/ultratnk.h
index 822ebcd4a51..84c4165db3b 100644
--- a/src/mame/includes/ultratnk.h
+++ b/src/mame/includes/ultratnk.h
@@ -8,8 +8,8 @@
class ultratnk_state : public driver_device
{
public:
- ultratnk_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ ultratnk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_da_latch;
diff --git a/src/mame/includes/undrfire.h b/src/mame/includes/undrfire.h
index 0fad111c5e0..ec57ae3b225 100644
--- a/src/mame/includes/undrfire.h
+++ b/src/mame/includes/undrfire.h
@@ -11,8 +11,8 @@ struct tempsprite
class undrfire_state : public driver_device
{
public:
- undrfire_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ undrfire_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 m_coin_word;
UINT16 m_port_sel;
diff --git a/src/mame/includes/unico.h b/src/mame/includes/unico.h
index dc728964ac3..278bcb66f27 100644
--- a/src/mame/includes/unico.h
+++ b/src/mame/includes/unico.h
@@ -1,8 +1,8 @@
class unico_state : public driver_device
{
public:
- unico_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ unico_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_vram;
UINT16 *m_scroll;
diff --git a/src/mame/includes/usgames.h b/src/mame/includes/usgames.h
index 64db14c5961..c59fe1f5f64 100644
--- a/src/mame/includes/usgames.h
+++ b/src/mame/includes/usgames.h
@@ -1,8 +1,8 @@
class usgames_state : public driver_device
{
public:
- usgames_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ usgames_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_charram;
diff --git a/src/mame/includes/vaportra.h b/src/mame/includes/vaportra.h
index ae0d40177b0..7a16951d317 100644
--- a/src/mame/includes/vaportra.h
+++ b/src/mame/includes/vaportra.h
@@ -7,8 +7,8 @@
class vaportra_state : public driver_device
{
public:
- vaportra_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vaportra_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_pf1_rowscroll;
diff --git a/src/mame/includes/vastar.h b/src/mame/includes/vastar.h
index 1aee0bbadcd..1bb72043b3d 100644
--- a/src/mame/includes/vastar.h
+++ b/src/mame/includes/vastar.h
@@ -1,8 +1,8 @@
class vastar_state : public driver_device
{
public:
- vastar_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vastar_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_spriteram1;
UINT8 *m_spriteram2;
diff --git a/src/mame/includes/vball.h b/src/mame/includes/vball.h
index fae4731448b..67e871cd72f 100644
--- a/src/mame/includes/vball.h
+++ b/src/mame/includes/vball.h
@@ -1,8 +1,8 @@
class vball_state : public driver_device
{
public:
- vball_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vball_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_vb_attribram;
UINT8 *m_vb_videoram;
diff --git a/src/mame/includes/vendetta.h b/src/mame/includes/vendetta.h
index ba2923449f3..74142920e0e 100644
--- a/src/mame/includes/vendetta.h
+++ b/src/mame/includes/vendetta.h
@@ -7,8 +7,8 @@
class vendetta_state : public driver_device
{
public:
- vendetta_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vendetta_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_ram;
diff --git a/src/mame/includes/vertigo.h b/src/mame/includes/vertigo.h
index 299c8c90217..2949e53e80b 100644
--- a/src/mame/includes/vertigo.h
+++ b/src/mame/includes/vertigo.h
@@ -24,10 +24,8 @@ typedef struct _am2901
class vector_generator
{
public:
- vector_generator(running_machine &machine)
- : m_machine(machine) { }
-
- running_machine &machine() const { return m_machine; }
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+ void set_machine(running_machine &machine) { m_machine = &machine; }
UINT32 sreg; /* shift register */
UINT32 l1; /* latch 1 adder operand only */
@@ -49,7 +47,7 @@ public:
UINT32 ven; /* vector intensity enable */
private:
- running_machine &m_machine;
+ running_machine *m_machine;
};
typedef struct _microcode
@@ -86,9 +84,8 @@ typedef struct _vproc
class vertigo_state : public driver_device
{
public:
- vertigo_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
- m_vgen(machine) { }
+ vertigo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_vectorram;
device_t *m_ttl74148;
diff --git a/src/mame/includes/vicdual.h b/src/mame/includes/vicdual.h
index 8c109a2d0a1..28ea1a64f8d 100644
--- a/src/mame/includes/vicdual.h
+++ b/src/mame/includes/vicdual.h
@@ -25,8 +25,8 @@
class vicdual_state : public driver_device
{
public:
- vicdual_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vicdual_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT32 m_coin_status;
UINT8 *m_videoram;
diff --git a/src/mame/includes/victory.h b/src/mame/includes/victory.h
index dc6b868c752..12645be721c 100644
--- a/src/mame/includes/victory.h
+++ b/src/mame/includes/victory.h
@@ -32,8 +32,8 @@ struct micro_t
class victory_state : public driver_device
{
public:
- victory_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ victory_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_charram;
diff --git a/src/mame/includes/videopin.h b/src/mame/includes/videopin.h
index 5bd16acdd03..6e02869b6a7 100644
--- a/src/mame/includes/videopin.h
+++ b/src/mame/includes/videopin.h
@@ -18,8 +18,8 @@
class videopin_state : public driver_device
{
public:
- videopin_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ videopin_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
attotime m_time_pushed;
attotime m_time_released;
diff --git a/src/mame/includes/vigilant.h b/src/mame/includes/vigilant.h
index 15e0c1080fc..635b446af1f 100644
--- a/src/mame/includes/vigilant.h
+++ b/src/mame/includes/vigilant.h
@@ -1,8 +1,8 @@
class vigilant_state : public driver_device
{
public:
- vigilant_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vigilant_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_horiz_scroll_low;
diff --git a/src/mame/includes/vindictr.h b/src/mame/includes/vindictr.h
index 2463f67df6c..41ac951ee27 100644
--- a/src/mame/includes/vindictr.h
+++ b/src/mame/includes/vindictr.h
@@ -9,8 +9,8 @@
class vindictr_state : public atarigen_state
{
public:
- vindictr_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ vindictr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT8 m_playfield_tile_bank;
UINT16 m_playfield_xscroll;
diff --git a/src/mame/includes/volfied.h b/src/mame/includes/volfied.h
index e1905029ad4..f2bd70e9bcf 100644
--- a/src/mame/includes/volfied.h
+++ b/src/mame/includes/volfied.h
@@ -7,8 +7,8 @@
class volfied_state : public driver_device
{
public:
- volfied_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ volfied_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_video_ram;
diff --git a/src/mame/includes/vsnes.h b/src/mame/includes/vsnes.h
index 7391940793c..ddec3328f78 100644
--- a/src/mame/includes/vsnes.h
+++ b/src/mame/includes/vsnes.h
@@ -1,8 +1,8 @@
class vsnes_state : public driver_device
{
public:
- vsnes_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vsnes_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_work_ram;
UINT8 *m_work_ram_1;
diff --git a/src/mame/includes/vulgus.h b/src/mame/includes/vulgus.h
index 0ab535685f8..e23929fe152 100644
--- a/src/mame/includes/vulgus.h
+++ b/src/mame/includes/vulgus.h
@@ -1,8 +1,8 @@
class vulgus_state : public driver_device
{
public:
- vulgus_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ vulgus_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_fgvideoram;
UINT8 *m_bgvideoram;
diff --git a/src/mame/includes/warpwarp.h b/src/mame/includes/warpwarp.h
index 5f66537a963..3bbd1cf925a 100644
--- a/src/mame/includes/warpwarp.h
+++ b/src/mame/includes/warpwarp.h
@@ -3,8 +3,8 @@
class warpwarp_state : public driver_device
{
public:
- warpwarp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ warpwarp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_geebee_videoram;
UINT8 *m_videoram;
diff --git a/src/mame/includes/warriorb.h b/src/mame/includes/warriorb.h
index 3040e67eccc..a2cbcb10588 100644
--- a/src/mame/includes/warriorb.h
+++ b/src/mame/includes/warriorb.h
@@ -7,8 +7,8 @@
class warriorb_state : public driver_device
{
public:
- warriorb_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ warriorb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spriteram;
diff --git a/src/mame/includes/wc90.h b/src/mame/includes/wc90.h
index bdbd1ba0eda..bbfdf3ec4a0 100644
--- a/src/mame/includes/wc90.h
+++ b/src/mame/includes/wc90.h
@@ -1,8 +1,8 @@
class wc90_state : public driver_device
{
public:
- wc90_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wc90_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_fgvideoram;
UINT8 *m_bgvideoram;
diff --git a/src/mame/includes/wc90b.h b/src/mame/includes/wc90b.h
index 71183ab85c0..b73a77ab5e5 100644
--- a/src/mame/includes/wc90b.h
+++ b/src/mame/includes/wc90b.h
@@ -1,8 +1,8 @@
class wc90b_state : public driver_device
{
public:
- wc90b_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wc90b_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_msm5205next;
int m_toggle;
diff --git a/src/mame/includes/wecleman.h b/src/mame/includes/wecleman.h
index a8c5fcced03..a43d8627bc1 100644
--- a/src/mame/includes/wecleman.h
+++ b/src/mame/includes/wecleman.h
@@ -1,8 +1,8 @@
class wecleman_state : public driver_device
{
public:
- wecleman_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wecleman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_blitter_regs;
int m_multiply_reg[2];
diff --git a/src/mame/includes/welltris.h b/src/mame/includes/welltris.h
index 0264cc3d763..acd59ca9571 100644
--- a/src/mame/includes/welltris.h
+++ b/src/mame/includes/welltris.h
@@ -1,8 +1,8 @@
class welltris_state : public driver_device
{
public:
- welltris_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ welltris_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_pending_command;
diff --git a/src/mame/includes/wgp.h b/src/mame/includes/wgp.h
index e6ce50aa487..9056bb50fa1 100644
--- a/src/mame/includes/wgp.h
+++ b/src/mame/includes/wgp.h
@@ -7,8 +7,8 @@
class wgp_state : public driver_device
{
public:
- wgp_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wgp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_spritemap;
diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h
index ef943e99898..143d8f9dad3 100644
--- a/src/mame/includes/williams.h
+++ b/src/mame/includes/williams.h
@@ -10,8 +10,8 @@
class williams_state : public driver_device
{
public:
- williams_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ williams_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_nvram(*this, "nvram") { }
required_shared_ptr<UINT8> m_nvram;
diff --git a/src/mame/includes/wiping.h b/src/mame/includes/wiping.h
index 0a8b09b6f3c..8320702acbc 100644
--- a/src/mame/includes/wiping.h
+++ b/src/mame/includes/wiping.h
@@ -1,8 +1,8 @@
class wiping_state : public driver_device
{
public:
- wiping_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wiping_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_sharedram1;
UINT8 *m_sharedram2;
diff --git a/src/mame/includes/wiz.h b/src/mame/includes/wiz.h
index f177f1e1e08..ac84ae94862 100644
--- a/src/mame/includes/wiz.h
+++ b/src/mame/includes/wiz.h
@@ -1,8 +1,8 @@
class wiz_state : public driver_device
{
public:
- wiz_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wiz_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
int m_dsc0;
diff --git a/src/mame/includes/wolfpack.h b/src/mame/includes/wolfpack.h
index 29558e5b592..6d3a9a5d824 100644
--- a/src/mame/includes/wolfpack.h
+++ b/src/mame/includes/wolfpack.h
@@ -1,8 +1,8 @@
class wolfpack_state : public driver_device
{
public:
- wolfpack_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wolfpack_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_collision;
UINT8* m_alpha_num_ram;
diff --git a/src/mame/includes/wrally.h b/src/mame/includes/wrally.h
index dff1eb55122..dc2ded6157e 100644
--- a/src/mame/includes/wrally.h
+++ b/src/mame/includes/wrally.h
@@ -1,8 +1,8 @@
class wrally_state : public driver_device
{
public:
- wrally_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wrally_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_shareram;
tilemap_t *m_pant[2];
diff --git a/src/mame/includes/wwfsstar.h b/src/mame/includes/wwfsstar.h
index 6d8c760c9d6..8d8e943b00a 100644
--- a/src/mame/includes/wwfsstar.h
+++ b/src/mame/includes/wwfsstar.h
@@ -1,8 +1,8 @@
class wwfsstar_state : public driver_device
{
public:
- wwfsstar_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wwfsstar_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_vblank;
int m_scrollx;
diff --git a/src/mame/includes/wwfwfest.h b/src/mame/includes/wwfwfest.h
index f9e74d9f10e..8c9b040e4dc 100644
--- a/src/mame/includes/wwfwfest.h
+++ b/src/mame/includes/wwfwfest.h
@@ -1,8 +1,8 @@
class wwfwfest_state : public driver_device
{
public:
- wwfwfest_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ wwfwfest_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_fg0_videoram;
UINT16 *m_bg0_videoram;
diff --git a/src/mame/includes/xain.h b/src/mame/includes/xain.h
index 7815006d222..4eb7a425651 100644
--- a/src/mame/includes/xain.h
+++ b/src/mame/includes/xain.h
@@ -1,8 +1,8 @@
class xain_state : public driver_device
{
public:
- xain_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ xain_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_vblank;
int m_from_main;
diff --git a/src/mame/includes/xexex.h b/src/mame/includes/xexex.h
index 9552bc815b2..6ba8ee66539 100644
--- a/src/mame/includes/xexex.h
+++ b/src/mame/includes/xexex.h
@@ -7,8 +7,8 @@
class xexex_state : public driver_device
{
public:
- xexex_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ xexex_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_workram;
diff --git a/src/mame/includes/xmen.h b/src/mame/includes/xmen.h
index 89b68946a99..88a5d7b60f1 100644
--- a/src/mame/includes/xmen.h
+++ b/src/mame/includes/xmen.h
@@ -2,8 +2,8 @@
class xmen_state : public driver_device
{
public:
- xmen_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ xmen_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
// UINT16 * m_paletteram; // currently this uses generic palette handling
diff --git a/src/mame/includes/xorworld.h b/src/mame/includes/xorworld.h
index 6b0e584e8f0..0f0d366df5c 100644
--- a/src/mame/includes/xorworld.h
+++ b/src/mame/includes/xorworld.h
@@ -1,8 +1,8 @@
class xorworld_state : public driver_device
{
public:
- xorworld_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ xorworld_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT16 *m_videoram;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/includes/xxmissio.h b/src/mame/includes/xxmissio.h
index b508fb709ae..c4a9cb80f8d 100644
--- a/src/mame/includes/xxmissio.h
+++ b/src/mame/includes/xxmissio.h
@@ -1,8 +1,8 @@
class xxmissio_state : public driver_device
{
public:
- xxmissio_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ xxmissio_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 m_status;
UINT8 *m_bgram;
diff --git a/src/mame/includes/xybots.h b/src/mame/includes/xybots.h
index f95af2ad0a3..1775d66dfd5 100644
--- a/src/mame/includes/xybots.h
+++ b/src/mame/includes/xybots.h
@@ -9,8 +9,8 @@
class xybots_state : public atarigen_state
{
public:
- xybots_state(running_machine &machine, const driver_device_config_base &config)
- : atarigen_state(machine, config) { }
+ xybots_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atarigen_state(mconfig, type, tag) { }
UINT16 m_h256;
};
diff --git a/src/mame/includes/xyonix.h b/src/mame/includes/xyonix.h
index ae1990b4d55..2f95c9470b6 100644
--- a/src/mame/includes/xyonix.h
+++ b/src/mame/includes/xyonix.h
@@ -1,8 +1,8 @@
class xyonix_state : public driver_device
{
public:
- xyonix_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ xyonix_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_vidram;
tilemap_t *m_tilemap;
diff --git a/src/mame/includes/yiear.h b/src/mame/includes/yiear.h
index d7f5e5299ec..9ad3bb0bbfa 100644
--- a/src/mame/includes/yiear.h
+++ b/src/mame/includes/yiear.h
@@ -1,8 +1,8 @@
class yiear_state : public driver_device
{
public:
- yiear_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ yiear_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_videoram;
diff --git a/src/mame/includes/yunsun16.h b/src/mame/includes/yunsun16.h
index 9eb0b193e73..758268833a6 100644
--- a/src/mame/includes/yunsun16.h
+++ b/src/mame/includes/yunsun16.h
@@ -7,8 +7,8 @@
class yunsun16_state : public driver_device
{
public:
- yunsun16_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ yunsun16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_vram_0;
diff --git a/src/mame/includes/yunsung8.h b/src/mame/includes/yunsung8.h
index 24e39b12d10..0fdd3a7f04c 100644
--- a/src/mame/includes/yunsung8.h
+++ b/src/mame/includes/yunsung8.h
@@ -7,8 +7,8 @@
class yunsung8_state : public driver_device
{
public:
- yunsung8_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ yunsung8_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* video-related */
tilemap_t *m_tilemap_0;
diff --git a/src/mame/includes/zac2650.h b/src/mame/includes/zac2650.h
index c50b964152a..82c028684a4 100644
--- a/src/mame/includes/zac2650.h
+++ b/src/mame/includes/zac2650.h
@@ -1,8 +1,8 @@
class zac2650_state : public driver_device
{
public:
- zac2650_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ zac2650_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_videoram;
UINT8 *m_s2636_0_ram;
diff --git a/src/mame/includes/zaccaria.h b/src/mame/includes/zaccaria.h
index eb91543a5b8..ebf9da1c263 100644
--- a/src/mame/includes/zaccaria.h
+++ b/src/mame/includes/zaccaria.h
@@ -1,8 +1,8 @@
class zaccaria_state : public driver_device
{
public:
- zaccaria_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ zaccaria_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
int m_dsw;
int m_active_8910;
diff --git a/src/mame/includes/zaxxon.h b/src/mame/includes/zaxxon.h
index 44423726157..e53988d0c6b 100644
--- a/src/mame/includes/zaxxon.h
+++ b/src/mame/includes/zaxxon.h
@@ -7,8 +7,8 @@
class zaxxon_state : public driver_device
{
public:
- zaxxon_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ zaxxon_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 *m_colorram;
UINT8 *m_videoram;
diff --git a/src/mame/includes/zerozone.h b/src/mame/includes/zerozone.h
index 8d2dc6617e2..a516e8ac4c4 100644
--- a/src/mame/includes/zerozone.h
+++ b/src/mame/includes/zerozone.h
@@ -7,8 +7,8 @@
class zerozone_state : public driver_device
{
public:
- zerozone_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ zerozone_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT16 * m_videoram;
diff --git a/src/mame/includes/zodiack.h b/src/mame/includes/zodiack.h
index 8178deba6a2..62a84e98f58 100644
--- a/src/mame/includes/zodiack.h
+++ b/src/mame/includes/zodiack.h
@@ -1,8 +1,8 @@
class zodiack_state : public driver_device
{
public:
- zodiack_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ zodiack_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
UINT8 * m_videoram;
UINT8 * m_attributeram;
diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c
index 4279f9d9bac..a261a637912 100644
--- a/src/mame/machine/atarigen.c
+++ b/src/mame/machine/atarigen.c
@@ -116,7 +116,7 @@ void atarigen_init(running_machine &machine)
int i;
/* allocate timers for all screens */
- assert(machine.m_devicelist.count(SCREEN) <= ARRAY_LENGTH(state->m_screen_timer));
+ assert(machine.devicelist().count(SCREEN) <= ARRAY_LENGTH(state->m_screen_timer));
for (i = 0, screen = machine.first_screen(); screen != NULL; i++, screen = screen->next_screen())
{
state->m_screen_timer[i].screen = screen;
@@ -839,7 +839,7 @@ static TIMER_CALLBACK( delayed_6502_sound_w )
void atarigen_set_vol(running_machine &machine, int volume, device_type type)
{
device_sound_interface *sound = NULL;
- for (bool gotone = machine.m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = machine.devicelist().first(sound); gotone; gotone = sound->next(sound))
if (sound->device().type() == type)
sound->set_output_gain(ALL_OUTPUTS, volume / 100.0);
}
diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h
index 37297bc31e5..5a7c2b9ae86 100644
--- a/src/mame/machine/atarigen.h
+++ b/src/mame/machine/atarigen.h
@@ -94,8 +94,8 @@ struct _atarigen_screen_timer
class atarigen_state : public driver_device
{
public:
- atarigen_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config),
+ atarigen_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
m_earom(*this, "earom"),
m_eeprom(*this, "eeprom"),
m_eeprom_size(*this, "eeprom") { }
diff --git a/src/mame/machine/cdicdic.c b/src/mame/machine/cdicdic.c
index 2edc37e1606..80cfbc5a593 100644
--- a/src/mame/machine/cdicdic.c
+++ b/src/mame/machine/cdicdic.c
@@ -27,6 +27,9 @@ TODO:
#include "sound/cdda.h"
#include "imagedev/chd_cd.h"
+// device type definition
+const device_type MACHINE_CDICDIC = &device_creator<cdicdic_device>;
+
#if ENABLE_VERBOSE_LOG
INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
@@ -91,42 +94,6 @@ const INT32 cdicdic_device::s_cdic_adpcm_filter_coef[5][2] =
};
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// cdicdic_device_config - constructor
-//-------------------------------------------------
-
-cdicdic_device_config::cdicdic_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "CDICDIC", tag, owner, clock)
-{
-
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *cdicdic_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(cdicdic_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *cdicdic_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, cdicdic_device(machine, *this));
-}
-
-
-//**************************************************************************
// INLINES
//**************************************************************************
@@ -1201,9 +1168,8 @@ void cdicdic_device::register_write(const UINT32 offset, const UINT16 data, cons
// cdicdic_device - constructor
//-------------------------------------------------
-cdicdic_device::cdicdic_device(running_machine &_machine, const cdicdic_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+cdicdic_device::cdicdic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MACHINE_CDICDIC, "CDICDIC", tag, owner, clock)
{
init();
}
@@ -1308,5 +1274,3 @@ UINT16 cdicdic_device::ram_read(const UINT32 offset, const UINT16 mem_mask)
verboselog(machine(), 5, "cdic_ram_r: %08x = %04x & %04x\n", 0x00300000 + offset * 2, m_ram[offset], mem_mask);
return m_ram[offset];
}
-
-const device_type MACHINE_CDICDIC = cdicdic_device_config::static_alloc_device_config;
diff --git a/src/mame/machine/cdicdic.h b/src/mame/machine/cdicdic.h
index 10aa1d90cde..a3531d13c1a 100644
--- a/src/mame/machine/cdicdic.h
+++ b/src/mame/machine/cdicdic.h
@@ -45,40 +45,14 @@ TODO:
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> cdicdic_device_config
-
-class cdicdic_device_config : public device_config
-{
- friend class cdicdic_device;
-
- // construction/destruction
- cdicdic_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration indexes go here (none yet)
-
-protected:
- // device_config overrides (none yet)
-
- // internal state goes here (none yet)
-};
-
-
-
// ======================> cdicdic_device
class cdicdic_device : public device_t
{
- friend class cdicdic_device_config;
-
+public:
// construction/destruction
- cdicdic_device(running_machine &_machine, const cdicdic_device_config &config);
+ cdicdic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-public:
// non-static internal members
void sample_trigger();
void process_delayed_command();
@@ -98,10 +72,8 @@ protected:
static TIMER_CALLBACK( audio_sample_trigger );
static TIMER_CALLBACK( trigger_readback_int );
- // internal state
- const cdicdic_device_config &m_config;
-
private:
+ // internal state
UINT16 m_command; // CDIC Command Register (0x303c00)
UINT32 m_time; // CDIC Time Register (0x303c02)
UINT16 m_file; // CDIC File Register (0x303c06)
diff --git a/src/mame/machine/cdislave.c b/src/mame/machine/cdislave.c
index f6f8d8bfb1b..917b95eaef2 100644
--- a/src/mame/machine/cdislave.c
+++ b/src/mame/machine/cdislave.c
@@ -25,6 +25,10 @@ TODO:
#include "machine/cdi070.h"
#include "includes/cdi.h"
+// device type definition
+const device_type MACHINE_CDISLAVE = &device_creator<cdislave_device>;
+
+
#if ENABLE_VERBOSE_LOG
INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
@@ -43,42 +47,6 @@ INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt,
#endif
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-//-------------------------------------------------
-// cdislave_device_config - constructor
-//-------------------------------------------------
-
-cdislave_device_config::cdislave_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "CDISLAVE", tag, owner, clock)
-{
-
-}
-
-
-//-------------------------------------------------
-// static_alloc_device_config - allocate a new
-// configuration object
-//-------------------------------------------------
-
-device_config *cdislave_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(cdislave_device_config(mconfig, tag, owner, clock));
-}
-
-
-//-------------------------------------------------
-// alloc_device - allocate a new device object
-//-------------------------------------------------
-
-device_t *cdislave_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, cdislave_device(machine, *this));
-}
-
-
-//**************************************************************************
// MEMBER FUNCTIONS
//**************************************************************************
@@ -459,9 +427,8 @@ void cdislave_device::register_write(const UINT32 offset, const UINT16 data, con
// cdislave_device - constructor
//-------------------------------------------------
-cdislave_device::cdislave_device(running_machine &_machine, const cdislave_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+cdislave_device::cdislave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MACHINE_CDISLAVE, "CDISLAVE", tag, owner, clock)
{
init();
}
@@ -564,5 +531,3 @@ void cdislave_device::register_globals()
save_item(NAME(m_fake_mouse_x));
save_item(NAME(m_fake_mouse_y));
}
-
-const device_type MACHINE_CDISLAVE = cdislave_device_config::static_alloc_device_config;
diff --git a/src/mame/machine/cdislave.h b/src/mame/machine/cdislave.h
index a6350180ff6..0bb4dfe7126 100644
--- a/src/mame/machine/cdislave.h
+++ b/src/mame/machine/cdislave.h
@@ -40,40 +40,13 @@ TODO:
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> cdislave_device_config
-
-class cdislave_device_config : public device_config
-{
- friend class cdislave_device;
-
- // construction/destruction
- cdislave_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
- // inline configuration indexes go here (none yet)
-
-protected:
- // device_config overrides (none yet)
-
- // internal state goes here (none yet)
-};
-
-
-
// ======================> cdislave_device
class cdislave_device : public device_t
{
- friend class cdislave_device_config;
-
- // construction/destruction
- cdislave_device(running_machine &_machine, const cdislave_device_config &config);
-
public:
+ // construction/destruction
+ cdislave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// external callbacks
static INPUT_CHANGED( mouse_update );
@@ -93,10 +66,8 @@ protected:
// internal callbacks
static TIMER_CALLBACK( trigger_readback_int );
- // internal state
- const cdislave_device_config &m_config;
-
private:
+ // internal state
class channel_state
{
public:
diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c
index eefe162e8b9..3dbdfdca2cd 100644
--- a/src/mame/machine/decocass.c
+++ b/src/mame/machine/decocass.c
@@ -2172,8 +2172,8 @@ static DEVICE_START( decocass_tape )
/* validate some basic stuff */
assert(device != NULL);
- assert(device->baseconfig().static_config() == NULL);
- assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() == NULL);
+ assert(device->static_config() == NULL);
+ assert(downcast<const legacy_device_base *>(device)->inline_config() == NULL);
/* fetch the data pointer */
tape->timer = device->machine().scheduler().timer_alloc(FUNC(tape_clock_callback), (void *)device);
diff --git a/src/mame/machine/decocass.h b/src/mame/machine/decocass.h
index 2b3ba17ab24..90d9336e760 100644
--- a/src/mame/machine/decocass.h
+++ b/src/mame/machine/decocass.h
@@ -19,8 +19,8 @@ DECLARE_LEGACY_DEVICE(DECOCASS_TAPE, decocass_tape);
class decocass_state : public driver_device
{
public:
- decocass_state(running_machine &machine, const driver_device_config_base &config)
- : driver_device(machine, config) { }
+ decocass_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
/* memory pointers */
UINT8 * m_rambase;
diff --git a/src/mame/machine/gaelco3d.c b/src/mame/machine/gaelco3d.c
index d17dc954181..b4b72c81387 100644
--- a/src/mame/machine/gaelco3d.c
+++ b/src/mame/machine/gaelco3d.c
@@ -215,7 +215,7 @@ INLINE const gaelco_serial_interface *get_interface(device_t *device)
{
assert(device != NULL);
assert(device->type() == GAELCO_SERIAL);
- return (gaelco_serial_interface *) downcast<legacy_device_base *>(device)->baseconfig().static_config();
+ return (gaelco_serial_interface *) downcast<legacy_device_base *>(device)->static_config();
}
INLINE void shmem_lock(shmem_t *shmem)
diff --git a/src/mame/machine/namco06.c b/src/mame/machine/namco06.c
index a92c2a05fa2..1bcebeb198f 100644
--- a/src/mame/machine/namco06.c
+++ b/src/mame/machine/namco06.c
@@ -220,7 +220,7 @@ WRITE8_DEVICE_HANDLER( namco_06xx_ctrl_w )
static DEVICE_START( namco_06xx )
{
- const namco_06xx_config *config = (const namco_06xx_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ const namco_06xx_config *config = (const namco_06xx_config *)downcast<const legacy_device_base *>(device)->inline_config();
namco_06xx_state *state = get_safe_token(device);
int devnum;
diff --git a/src/mame/machine/namco51.c b/src/mame/machine/namco51.c
index 37740b077cb..ca75edf7202 100644
--- a/src/mame/machine/namco51.c
+++ b/src/mame/machine/namco51.c
@@ -379,7 +379,7 @@ ROM_END
static DEVICE_START( namco_51xx )
{
- const namco_51xx_interface *config = (const namco_51xx_interface *)device->baseconfig().static_config();
+ const namco_51xx_interface *config = (const namco_51xx_interface *)device->static_config();
namco_51xx_state *state = get_safe_token(device);
astring tempstring;
diff --git a/src/mame/machine/namco53.c b/src/mame/machine/namco53.c
index 2df87e25429..83a3003e848 100644
--- a/src/mame/machine/namco53.c
+++ b/src/mame/machine/namco53.c
@@ -170,7 +170,7 @@ ROM_END
static DEVICE_START( namco_53xx )
{
- const namco_53xx_interface *config = (const namco_53xx_interface *)device->baseconfig().static_config();
+ const namco_53xx_interface *config = (const namco_53xx_interface *)device->static_config();
namco_53xx_state *state = get_safe_token(device);
astring tempstring;
diff --git a/src/mame/machine/namco62.c b/src/mame/machine/namco62.c
index 32eb97055aa..bee8ea26a63 100644
--- a/src/mame/machine/namco62.c
+++ b/src/mame/machine/namco62.c
@@ -63,7 +63,7 @@ ROM_END
static DEVICE_START( namco_62xx )
{
- const namco_62xx_interface *config = (const namco_62xx_interface *)device->baseconfig().static_config();
+ const namco_62xx_interface *config = (const namco_62xx_interface *)device->static_config();
namco_62xx_state *state = get_safe_token(device);
astring tempstring;
diff --git a/src/mame/machine/namcoio.c b/src/mame/machine/namcoio.c
index 89351fd5939..d1e28b7654c 100644
--- a/src/mame/machine/namcoio.c
+++ b/src/mame/machine/namcoio.c
@@ -151,7 +151,7 @@ INLINE const namcoio_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert(device->type() == NAMCO56XX || device->type() == NAMCO58XX || device->type() == NAMCO59XX);
- return (const namcoio_interface *) device->baseconfig().static_config();
+ return (const namcoio_interface *) device->static_config();
}
diff --git a/src/mame/machine/naomibd.c b/src/mame/machine/naomibd.c
index 193bd74b015..276dfc92bc9 100644
--- a/src/mame/machine/naomibd.c
+++ b/src/mame/machine/naomibd.c
@@ -339,7 +339,7 @@ INLINE naomibd_state *get_safe_token(device_t *device)
int naomibd_interrupt_callback(device_t *device, naomibd_interrupt_func callback)
{
- naomibd_config *config = (naomibd_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ naomibd_config *config = (naomibd_config *)downcast<const legacy_device_base *>(device)->inline_config();
config->interrupt = callback;
return 0;
}
@@ -2007,13 +2007,13 @@ static UINT16 block_decrypt(UINT32 game_key, UINT16 sequence_key, UINT16 counter
static DEVICE_START( naomibd )
{
- const naomibd_config *config = (const naomibd_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ const naomibd_config *config = (const naomibd_config *)downcast<const legacy_device_base *>(device)->inline_config();
naomibd_state *v = get_safe_token(device);
int i;
/* validate some basic stuff */
- assert(device->baseconfig().static_config() == NULL);
- assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
+ assert(device->static_config() == NULL);
+ assert(downcast<const legacy_device_base *>(device)->inline_config() != NULL);
/* validate configuration */
assert(config->type >= ROM_BOARD && config->type < MAX_NAOMIBD_TYPES);
@@ -2058,7 +2058,7 @@ static DEVICE_START( naomibd )
}
/* set the type */
- v->index = device->machine().m_devicelist.indexof(device->type(), device->tag());
+ v->index = device->machine().devicelist().indexof(device->type(), device->tag());
v->type = config->type;
/* initialize some registers */
@@ -2104,7 +2104,7 @@ static DEVICE_RESET( naomibd )
DEVICE_GET_INFO( naomibd )
{
- const naomibd_config *config = (device != NULL) ? (const naomibd_config *)downcast<const legacy_device_config_base *>(device)->inline_config() : NULL;
+ const naomibd_config *config = (device != NULL) ? (const naomibd_config *)downcast<const legacy_device_base *>(device)->inline_config() : NULL;
switch (state)
{
/* --- the following bits of info are returned as 64-bit signed integers --- */
diff --git a/src/mame/machine/nmk112.c b/src/mame/machine/nmk112.c
index 60f6ac45283..c029cdae8f9 100644
--- a/src/mame/machine/nmk112.c
+++ b/src/mame/machine/nmk112.c
@@ -41,7 +41,7 @@ INLINE const nmk112_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == NMK112));
- return (const nmk112_interface *) device->baseconfig().static_config();
+ return (const nmk112_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/mame/machine/segaic16.c b/src/mame/machine/segaic16.c
index 4cb2111b3ff..02019c7b5ea 100644
--- a/src/mame/machine/segaic16.c
+++ b/src/mame/machine/segaic16.c
@@ -665,7 +665,7 @@ INLINE const ic_315_5250_interface *_315_5250_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == _315_5250));
- return (const ic_315_5250_interface *) device->baseconfig().static_config();
+ return (const ic_315_5250_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/mame/machine/taitoio.c b/src/mame/machine/taitoio.c
index b2c1454111c..c2698541e3e 100644
--- a/src/mame/machine/taitoio.c
+++ b/src/mame/machine/taitoio.c
@@ -81,7 +81,7 @@ INLINE const tc0220ioc_interface *tc0220ioc_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == TC0220IOC));
- return (const tc0220ioc_interface *) device->baseconfig().static_config();
+ return (const tc0220ioc_interface *) device->static_config();
}
/*****************************************************************************
@@ -238,7 +238,7 @@ INLINE const tc0510nio_interface *tc0510nio_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == TC0510NIO));
- return (const tc0510nio_interface *) device->baseconfig().static_config();
+ return (const tc0510nio_interface *) device->static_config();
}
/*****************************************************************************
@@ -389,7 +389,7 @@ INLINE const tc0640fio_interface *tc0640fio_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == TC0640FIO));
- return (const tc0640fio_interface *) device->baseconfig().static_config();
+ return (const tc0640fio_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/mame/machine/ticket.c b/src/mame/machine/ticket.c
index f0018eaf8ce..d5865dc8c50 100644
--- a/src/mame/machine/ticket.c
+++ b/src/mame/machine/ticket.c
@@ -121,7 +121,7 @@ WRITE8_DEVICE_HANDLER( ticket_dispenser_w )
static DEVICE_START( ticket )
{
- const ticket_config *config = (const ticket_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
+ const ticket_config *config = (const ticket_config *)downcast<const legacy_device_base *>(device)->inline_config();
ticket_state *state = get_safe_token(device);
assert(config != NULL);
diff --git a/src/mame/machine/zs01.c b/src/mame/machine/zs01.c
index 007ad070af4..529b12fbf20 100644
--- a/src/mame/machine/zs01.c
+++ b/src/mame/machine/zs01.c
@@ -22,36 +22,21 @@ inline void ATTR_PRINTF(3,4) zs01_device::verboselog(int n_level, const char *s_
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("zs01 %s %s: %s", config.tag(), machine().describe_context(), buf);
+ logerror("zs01 %s %s: %s", tag(), machine().describe_context(), buf);
}
}
-const device_type ZS01 = zs01_device_config::static_alloc_device_config;
+// device type definition
+const device_type ZS01 = &device_creator<zs01_device>;
-zs01_device_config::zs01_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_secure_serial_flash_config(mconfig, static_alloc_device_config, "ZS01", tag, owner, clock)
+void zs01_device::static_set_ds2401_tag(device_t &device, const char *ds2401_tag)
{
+ zs01_device &zs01 = downcast<zs01_device &>(device);
+ zs01.ds2401_tag = ds2401_tag;
}
-void zs01_device_config::static_set_ds2401_tag(device_config *device, const char *ds2401_tag)
-{
- zs01_device_config *zs01 = downcast<zs01_device_config *>(device);
- zs01->ds2401_tag = ds2401_tag;
-}
-
-device_config *zs01_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(zs01_device_config(mconfig, tag, owner, clock));
-}
-
-device_t *zs01_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, zs01_device(machine, *this));
-}
-
-zs01_device::zs01_device(running_machine &_machine, const zs01_device_config &_config)
- : device_secure_serial_flash(_machine, _config),
- config(_config)
+zs01_device::zs01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_secure_serial_flash(mconfig, ZS01, "ZS01", tag, owner, clock)
{
}
@@ -90,7 +75,7 @@ void zs01_device::nvram_default()
// Ensure the size is correct though
if(m_region->bytes() != SIZE_RESPONSE_TO_RESET+SIZE_KEY+SIZE_KEY+SIZE_DATA)
logerror("zs01 %s: Wrong region length for initialization data, expected 0x%x, got 0x%x\n",
- config.tag(),
+ tag(),
SIZE_RESPONSE_TO_RESET+SIZE_KEY+SIZE_KEY+SIZE_DATA,
m_region->bytes());
else {
@@ -106,7 +91,7 @@ void zs01_device::nvram_default()
// That chip isn't really usable without the passwords, so bitch
// if there's no region
- logerror("zs01 %s: Warning, no default data provided, chip is unusable.\n", config.tag());
+ logerror("zs01 %s: Warning, no default data provided, chip is unusable.\n", tag());
memset(response_to_reset, 0, SIZE_RESPONSE_TO_RESET);
memset(command_key, 0, SIZE_KEY);
memset(data_key, 0, SIZE_KEY);
@@ -427,7 +412,7 @@ void zs01_device::scl_1()
switch(write_buffer[1]) {
case 0xfd: {
/* TODO: use read/write to talk to the ds2401, which will require a timer. */
- ds2401_device *ds2401 = machine().device<ds2401_device>(config.ds2401_tag);
+ ds2401_device *ds2401 = machine().device<ds2401_device>(ds2401_tag);
for(int i = 0; i < SIZE_DATA_BUFFER; i++)
read_buffer[2+i] = ds2401->direct_read(SIZE_DATA_BUFFER-i-1);
break;
diff --git a/src/mame/machine/zs01.h b/src/mame/machine/zs01.h
index 2cbf0dff583..5576641fc17 100644
--- a/src/mame/machine/zs01.h
+++ b/src/mame/machine/zs01.h
@@ -10,37 +10,18 @@
#define MCFG_ZS01_ADD(_tag, ds2401_tag) \
MCFG_DEVICE_ADD(_tag, ZS01, 0) \
- zs01_device_config::static_set_ds2401_tag(device, ds2401_tag); \
+ zs01_device::static_set_ds2401_tag(*device, ds2401_tag); \
#include "machine/secflash.h"
-class zs01_device_config : public device_secure_serial_flash_config
+class zs01_device : public device_secure_serial_flash
{
- friend class zs01_device;
-
- // construction/destruction
- zs01_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
public:
- // allocators
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
+ // construction/destruction
+ zs01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// inline configuration helpers
- static void static_set_ds2401_tag(device_config *device, const char *ds2401_tag);
-
- virtual device_t *alloc_device(running_machine &machine) const;
-
-protected:
- // internal state
- const char *ds2401_tag;
-};
-
-class zs01_device : public device_secure_serial_flash
-{
- friend class zs01_device_config;
-
- // construction/destruction
- zs01_device(running_machine &_machine, const zs01_device_config &config);
+ static void static_set_ds2401_tag(device_t &device, const char *ds2401_tag);
protected:
// device-level overrides
@@ -63,7 +44,7 @@ protected:
virtual void sda_1();
// internal state
- const zs01_device_config &config;
+ const char *ds2401_tag;
enum {
SIZE_WRITE_BUFFER = 12,
diff --git a/src/mame/video/atarirle.c b/src/mame/video/atarirle.c
index bf1d830c39a..9b2a40d965e 100644
--- a/src/mame/video/atarirle.c
+++ b/src/mame/video/atarirle.c
@@ -272,7 +272,7 @@ static DEVICE_START( atarirle )
{
atarirle_data *mo = get_safe_token(device);
running_machine &machine = device->machine();
- const atarirle_desc *desc = (const atarirle_desc *)device->baseconfig().static_config();
+ const atarirle_desc *desc = (const atarirle_desc *)device->static_config();
const UINT16 *base = (const UINT16 *)machine.region(desc->region)->base();
int i, width, height;
diff --git a/src/mame/video/decbac06.c b/src/mame/video/decbac06.c
index cbcf12fca4d..7ab35fcc241 100644
--- a/src/mame/video/decbac06.c
+++ b/src/mame/video/decbac06.c
@@ -63,37 +63,21 @@ Priority word (Midres):
#include "emu.h"
#include "decbac06.h"
-deco_bac06_device_config::deco_bac06_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "decbac06_device", tag, owner, clock)
+void deco_bac06_device::set_gfx_region_wide(device_t &device, int region8x8, int region16x16, int wide)
{
- m_gfxregion8x8 = m_gfxregion16x16 = m_wide = 0;
-}
-
-device_config *deco_bac06_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(deco_bac06_device_config(mconfig, tag, owner, clock));
-}
-
-device_t *deco_bac06_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, deco_bac06_device(machine, *this));
-}
-
-void deco_bac06_device_config::set_gfx_region_wide(device_config *device, int region8x8, int region16x16, int wide)
-{
- deco_bac06_device_config *dev = downcast<deco_bac06_device_config *>(device);
- dev->m_gfxregion8x8 = region8x8;
- dev->m_gfxregion16x16 = region16x16;
- dev->m_wide = wide;
+ deco_bac06_device &dev = downcast<deco_bac06_device &>(device);
+ dev.m_gfxregion8x8 = region8x8;
+ dev.m_gfxregion16x16 = region16x16;
+ dev.m_wide = wide;
}
+const device_type DECO_BAC06 = &device_creator<deco_bac06_device>;
-deco_bac06_device::deco_bac06_device(running_machine &_machine, const deco_bac06_device_config &config)
- : device_t(_machine, config),
- m_config(config),
- m_gfxregion8x8(m_config.m_gfxregion8x8),
- m_gfxregion16x16(m_config.m_gfxregion16x16),
- m_wide(m_config.m_wide)
+deco_bac06_device::deco_bac06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DECO_BAC06, "decbac06_device", tag, owner, clock),
+ m_gfxregion8x8(0),
+ m_gfxregion16x16(0),
+ m_wide(0)
{
}
diff --git a/src/mame/video/decbac06.h b/src/mame/video/decbac06.h
index 8010258b10e..19c592b3fb6 100644
--- a/src/mame/video/decbac06.h
+++ b/src/mame/video/decbac06.h
@@ -1,26 +1,13 @@
/* BAC06 */
-class deco_bac06_device_config : public device_config
+class deco_bac06_device : public device_t
{
- friend class deco_bac06_device;
- deco_bac06_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
- static void set_gfx_region_wide(device_config *device, int region8x8, int region16x16, int wide);
+ deco_bac06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-protected:
- UINT8 m_gfxregion8x8;
- UINT8 m_gfxregion16x16;
- int m_wide;
-};
+ static void set_gfx_region_wide(device_t &device, int region8x8, int region16x16, int wide);
-class deco_bac06_device : public device_t
-{
- friend class deco_bac06_device_config;
- deco_bac06_device(running_machine &_machine, const deco_bac06_device_config &config);
-public:
void set_gfxregion(int region8x8, int region16x16) { m_gfxregion8x8 = region8x8; m_gfxregion16x16 = region16x16; };
@@ -46,7 +33,6 @@ public:
protected:
virtual void device_start();
virtual void device_reset();
- const deco_bac06_device_config &m_config;
UINT8 m_gfxregion8x8;
UINT8 m_gfxregion16x16;
@@ -105,6 +91,6 @@ WRITE8_DEVICE_HANDLER( deco_bac06_pf_data_8bit_swap_w );
READ8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_r );
WRITE8_DEVICE_HANDLER( deco_bac06_pf_rowscroll_8bit_swap_w );
-const device_type deco_bac06_ = deco_bac06_device_config::static_alloc_device_config;
+extern const device_type DECO_BAC06;
diff --git a/src/mame/video/deckarn.c b/src/mame/video/deckarn.c
index 5b1ad977e63..be3700b28c6 100644
--- a/src/mame/video/deckarn.c
+++ b/src/mame/video/deckarn.c
@@ -4,33 +4,17 @@
#include "emu.h"
#include "deckarn.h"
-deco_karnovsprites_device_config::deco_karnovsprites_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "karnovsprites_device", tag, owner, clock)
+void deco_karnovsprites_device::set_gfx_region(device_t &device, int region)
{
- m_gfxregion = 0;
-}
-
-device_config *deco_karnovsprites_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(deco_karnovsprites_device_config(mconfig, tag, owner, clock));
-}
-
-device_t *deco_karnovsprites_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, deco_karnovsprites_device(machine, *this));
-}
-
-void deco_karnovsprites_device_config::set_gfx_region(device_config *device, int region)
-{
- deco_karnovsprites_device_config *dev = downcast<deco_karnovsprites_device_config *>(device);
- dev->m_gfxregion = region;
+ deco_karnovsprites_device &dev = downcast<deco_karnovsprites_device &>(device);
+ dev.m_gfxregion = region;
}
+const device_type DECO_KARNOVSPRITES = &device_creator<deco_karnovsprites_device>;
-deco_karnovsprites_device::deco_karnovsprites_device(running_machine &_machine, const deco_karnovsprites_device_config &config)
- : device_t(_machine, config),
- m_config(config),
- m_gfxregion(m_config.m_gfxregion)
+deco_karnovsprites_device::deco_karnovsprites_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DECO_KARNOVSPRITES, "karnovsprites_device", tag, owner, clock),
+ m_gfxregion(0)
{
}
diff --git a/src/mame/video/deckarn.h b/src/mame/video/deckarn.h
index 4ccc78ff6be..2a6734862da 100644
--- a/src/mame/video/deckarn.h
+++ b/src/mame/video/deckarn.h
@@ -1,36 +1,22 @@
-class deco_karnovsprites_device_config : public device_config
-{
- friend class deco_karnovsprites_device;
- deco_karnovsprites_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
- static void set_gfx_region(device_config *device, int region);
-
-protected:
- UINT8 m_gfxregion;
-};
-
class deco_karnovsprites_device : public device_t
{
- friend class deco_karnovsprites_device_config;
- deco_karnovsprites_device(running_machine &_machine, const deco_karnovsprites_device_config &config);
public:
+ deco_karnovsprites_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
void set_gfxregion(int region) { m_gfxregion = region; };
void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int size, int priority );
+ static void set_gfx_region(device_t &device, int region);
protected:
virtual void device_start();
virtual void device_reset();
- const deco_karnovsprites_device_config &m_config;
UINT8 m_gfxregion;
private:
};
-const device_type deco_karnovsprites_ = deco_karnovsprites_device_config::static_alloc_device_config;
+extern const device_type DECO_KARNOVSPRITES;
diff --git a/src/mame/video/decmxc06.c b/src/mame/video/decmxc06.c
index ba8b2564294..b2c1ec5c60a 100644
--- a/src/mame/video/decmxc06.c
+++ b/src/mame/video/decmxc06.c
@@ -38,33 +38,18 @@ todo:
#include "emu.h"
#include "decmxc06.h"
-deco_mxc06_device_config::deco_mxc06_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "decmxc06_device", tag, owner, clock)
+void deco_mxc06_device::set_gfx_region(device_t &device, int region)
{
- m_gfxregion = 0;
+ deco_mxc06_device &dev = downcast<deco_mxc06_device &>(device);
+ dev.m_gfxregion = region;
}
-device_config *deco_mxc06_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(deco_mxc06_device_config(mconfig, tag, owner, clock));
-}
-
-device_t *deco_mxc06_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, deco_mxc06_device(machine, *this));
-}
-
-void deco_mxc06_device_config::set_gfx_region(device_config *device, int region)
-{
- deco_mxc06_device_config *dev = downcast<deco_mxc06_device_config *>(device);
- dev->m_gfxregion = region;
-}
+const device_type DECO_MXC06 = &device_creator<deco_mxc06_device>;
-deco_mxc06_device::deco_mxc06_device(running_machine &_machine, const deco_mxc06_device_config &config)
- : device_t(_machine, config),
- m_config(config),
- m_gfxregion(m_config.m_gfxregion)
+deco_mxc06_device::deco_mxc06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DECO_MXC06, "decmxc06_device", tag, owner, clock),
+ m_gfxregion(0)
{
}
diff --git a/src/mame/video/decmxc06.h b/src/mame/video/decmxc06.h
index 3b66120d210..e4121e86f40 100644
--- a/src/mame/video/decmxc06.h
+++ b/src/mame/video/decmxc06.h
@@ -1,31 +1,17 @@
/* MXC06 */
-class deco_mxc06_device_config : public device_config
-{
- friend class deco_mxc06_device;
- deco_mxc06_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
- static void set_gfx_region(device_config *device, int region);
-
-protected:
- UINT8 m_gfxregion;
-};
-
class deco_mxc06_device : public device_t
{
- friend class deco_mxc06_device_config;
- deco_mxc06_device(running_machine &_machine, const deco_mxc06_device_config &config);
public:
+ deco_mxc06_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ static void set_gfx_region(device_t &device, int region);
void set_gfxregion(int region) { m_gfxregion = region; };
void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram16, int pri_mask, int pri_val, int col_mask );
void set_pri_type( int type ) { m_priority_type = type; }
protected:
virtual void device_start();
virtual void device_reset();
- const deco_mxc06_device_config &m_config;
UINT8 m_gfxregion;
int m_priority_type; // just so we can support the existing drivers without converting everything to pdrawgfx just yet
@@ -35,6 +21,6 @@ private:
};
-const device_type deco_mxc06_ = deco_mxc06_device_config::static_alloc_device_config;
+extern const device_type DECO_MXC06;
diff --git a/src/mame/video/deco16ic.c b/src/mame/video/deco16ic.c
index 5d93e2cb624..b07bb758da3 100644
--- a/src/mame/video/deco16ic.c
+++ b/src/mame/video/deco16ic.c
@@ -208,7 +208,7 @@ INLINE const deco16ic_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == DECO16IC));
- return (const deco16ic_interface *) device->baseconfig().static_config();
+ return (const deco16ic_interface *) device->static_config();
}
/*****************************************************************************************/
diff --git a/src/mame/video/decocomn.c b/src/mame/video/decocomn.c
index 98adaa01d1b..ec581505a0c 100644
--- a/src/mame/video/decocomn.c
+++ b/src/mame/video/decocomn.c
@@ -36,7 +36,7 @@ INLINE const decocomn_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == DECOCOMN));
- return (const decocomn_interface *) device->baseconfig().static_config();
+ return (const decocomn_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/mame/video/decospr.c b/src/mame/video/decospr.c
index c54a0253433..728a2a4249e 100644
--- a/src/mame/video/decospr.c
+++ b/src/mame/video/decospr.c
@@ -117,42 +117,27 @@ todo: basic blend mixing
#include "decospr.h"
-decospr_device_config::decospr_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "decospr_device", tag, owner, clock)
+void decospr_device::set_gfx_region(device_t &device, int gfxregion)
{
- m_gfxregion = 0;
- m_pricallback = NULL;
+ decospr_device &dev = downcast<decospr_device &>(device);
+ dev.m_gfxregion = gfxregion;
+// printf("decospr_device::set_gfx_region()\n");
}
-device_config *decospr_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
+void decospr_device::set_pri_callback(device_t &device, decospr_priority_callback_func callback)
{
- return global_alloc(decospr_device_config(mconfig, tag, owner, clock));
+ decospr_device &dev = downcast<decospr_device &>(device);
+ dev.m_pricallback = callback;
+// printf("decospr_device::set_pri_callback()\n");
}
-device_t *decospr_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, decospr_device(machine, *this));
-}
-void decospr_device_config::set_gfx_region(device_config *device, int gfxregion)
-{
- decospr_device_config *dev = downcast<decospr_device_config *>(device);
- dev->m_gfxregion = gfxregion;
-// printf("decospr_device_config::set_gfx_region()\n");
-}
-
-void decospr_device_config::set_pri_callback(device_config *device, decospr_priority_callback_func callback)
-{
- decospr_device_config *dev = downcast<decospr_device_config *>(device);
- dev->m_pricallback = callback;
-// printf("decospr_device_config::set_pri_callback()\n");
-}
+const device_type DECO_SPRITE = &device_creator<decospr_device>;
-decospr_device::decospr_device(running_machine &_machine, const decospr_device_config &config)
- : device_t(_machine, config),
- m_config(config),
- m_gfxregion(m_config.m_gfxregion),
- m_pricallback(m_config.m_pricallback)
+decospr_device::decospr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, DECO_SPRITE, "decospr_device", tag, owner, clock),
+ m_gfxregion(0),
+ m_pricallback(NULL)
{
}
diff --git a/src/mame/video/decospr.h b/src/mame/video/decospr.h
index 96cb36dc383..0144d0888ed 100644
--- a/src/mame/video/decospr.h
+++ b/src/mame/video/decospr.h
@@ -1,26 +1,12 @@
typedef UINT16 (*decospr_priority_callback_func)(UINT16 pri);
-class decospr_device_config : public device_config
-{
- friend class decospr_device;
- decospr_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
- static void set_gfx_region(device_config *device, int gfxregion);
- static void set_pri_callback(device_config *device, decospr_priority_callback_func callback);
-
-protected:
- UINT8 m_gfxregion;
- decospr_priority_callback_func m_pricallback;
-};
-
class decospr_device : public device_t
{
- friend class decospr_device_config;
- decospr_device(running_machine &_machine, const decospr_device_config &config);
public:
+ decospr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ static void set_gfx_region(device_t &device, int gfxregion);
+ static void set_pri_callback(device_t &device, decospr_priority_callback_func callback);
//void decospr_sprite_kludge(int x, int y);
void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT16* spriteram, int sizewords, bool invert_flip = false );
void set_pri_callback(decospr_priority_callback_func callback);
@@ -35,7 +21,6 @@ public:
protected:
virtual void device_start();
virtual void device_reset();
- const decospr_device_config &m_config;
UINT8 m_gfxregion;
decospr_priority_callback_func m_pricallback;
bitmap_t *m_sprite_bitmap;// optional sprite bitmap (should be INDEXED16)
@@ -46,7 +31,7 @@ private:
};
-const device_type decospr_ = decospr_device_config::static_alloc_device_config;
+extern const device_type DECO_SPRITE;
diff --git a/src/mame/video/gottlieb.c b/src/mame/video/gottlieb.c
index 91b96cf8be9..167934c3b7c 100644
--- a/src/mame/video/gottlieb.c
+++ b/src/mame/video/gottlieb.c
@@ -75,7 +75,7 @@ WRITE8_HANDLER( gottlieb_video_control_w )
WRITE8_HANDLER( gottlieb_laserdisc_video_control_w )
{
gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
- device_t *laserdisc = space->machine().m_devicelist.first(LASERDISC);
+ device_t *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/gp9001.c b/src/mame/video/gp9001.c
index a9093a53ff5..a34a00377e1 100644
--- a/src/mame/video/gp9001.c
+++ b/src/mame/video/gp9001.c
@@ -208,49 +208,34 @@ static ADDRESS_MAP_START( gp9001vdp_map, AS_0, 16 )
ADDRESS_MAP_END
-gp9001vdp_device_config::gp9001vdp_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "gp9001vdp_", tag, owner, clock),
- device_config_memory_interface(mconfig, *this),
- m_space_config("gp9001vdp", ENDIANNESS_BIG, 16,14, 0, NULL, *ADDRESS_MAP_NAME(gp9001vdp_map))
-{
-}
-
-device_config *gp9001vdp_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(gp9001vdp_device_config(mconfig, tag, owner, clock));
-}
+const device_type GP9001_VDP = &device_creator<gp9001vdp_device>;
-device_t *gp9001vdp_device_config::alloc_device(running_machine &machine) const
+gp9001vdp_device::gp9001vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, GP9001_VDP, "GP9001_VDP", tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ m_space_config("gp9001vdp", ENDIANNESS_BIG, 16,14, 0, NULL, *ADDRESS_MAP_NAME(gp9001vdp_map)),
+ m_gfxregion(0)
{
- return auto_alloc(machine, gp9001vdp_device(machine, *this));
}
-void gp9001vdp_device_config::static_set_gfx_region(device_config *device, int gfxregion)
+void gp9001vdp_device::static_set_gfx_region(device_t &device, int gfxregion)
{
- gp9001vdp_device_config *vdp = downcast<gp9001vdp_device_config *>(device);
- vdp->m_gfxregion = gfxregion;
+ gp9001vdp_device &vdp = downcast<gp9001vdp_device &>(device);
+ vdp.m_gfxregion = gfxregion;
}
-bool gp9001vdp_device_config::device_validity_check(emu_options &options, const game_driver &driver) const
+bool gp9001vdp_device::device_validity_check(emu_options &options, const game_driver &driver) const
{
bool error = false;
return error;
}
-const address_space_config *gp9001vdp_device_config::memory_space_config(address_spacenum spacenum) const
+const address_space_config *gp9001vdp_device::memory_space_config(address_spacenum spacenum) const
{
return (spacenum == 0) ? &m_space_config : NULL;
}
-gp9001vdp_device::gp9001vdp_device(running_machine &_machine, const gp9001vdp_device_config &config)
- : device_t(_machine, config),
- device_memory_interface(_machine, config, *this),
- m_config(config),
- m_gfxregion(m_config.m_gfxregion)
-{
-}
-
static TILE_GET_INFO_DEVICE( get_top0_tile_info )
diff --git a/src/mame/video/gp9001.h b/src/mame/video/gp9001.h
index a546a255db8..d633ab828a8 100644
--- a/src/mame/video/gp9001.h
+++ b/src/mame/video/gp9001.h
@@ -1,21 +1,5 @@
/* GP9001 Video Controller */
-class gp9001vdp_device_config : public device_config,
- public device_config_memory_interface
-{
- friend class gp9001vdp_device;
- gp9001vdp_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
- static void static_set_gfx_region(device_config *device, int gfxregion);
-protected:
- virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
- address_space_config m_space_config;
- UINT8 m_gfxregion;
-};
-
struct gp9001layeroffsets
{
int normal;
@@ -49,9 +33,11 @@ struct gp9001spritelayer : gp9001layer
class gp9001vdp_device : public device_t,
public device_memory_interface
{
- friend class gp9001vdp_device_config;
- gp9001vdp_device(running_machine &_machine, const gp9001vdp_device_config &config);
public:
+ gp9001vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ static void static_set_gfx_region(device_t &device, int gfxregion);
+
UINT16 gp9001_voffs;
UINT16 gp9001_scroll_reg;
@@ -78,14 +64,17 @@ public:
bitmap_t *custom_priority_bitmap;
protected:
+ virtual bool device_validity_check(emu_options &options, const game_driver &driver) const;
virtual void device_start();
virtual void device_reset();
- const gp9001vdp_device_config &m_config;
- UINT8 m_gfxregion;
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
+
+ address_space_config m_space_config;
+ UINT8 m_gfxregion;
};
-const device_type gp9001vdp_ = gp9001vdp_device_config::static_alloc_device_config;
+extern const device_type GP9001_VDP;
#define GP9001_BG_VRAM_SIZE 0x1000 /* Background RAM size */
#define GP9001_FG_VRAM_SIZE 0x1000 /* Foreground RAM size */
@@ -98,13 +87,13 @@ const device_type gp9001vdp_ = gp9001vdp_device_config::static_alloc_device_conf
/* vdp map 0, gfx region 0 */
#define MCFG_DEVICE_ADD_VDP0 \
- MCFG_DEVICE_ADD("gp9001vdp0", gp9001vdp_, 0) \
- gp9001vdp_device_config::static_set_gfx_region(device, 0); \
+ MCFG_DEVICE_ADD("gp9001vdp0", GP9001_VDP, 0) \
+ gp9001vdp_device::static_set_gfx_region(*device, 0); \
/* vdp map 1, gfx region 2 */
#define MCFG_DEVICE_ADD_VDP1 \
- MCFG_DEVICE_ADD("gp9001vdp1", gp9001vdp_, 0) \
- gp9001vdp_device_config::static_set_gfx_region(device, 2); \
+ MCFG_DEVICE_ADD("gp9001vdp1", GP9001_VDP, 0) \
+ gp9001vdp_device::static_set_gfx_region(*device, 2); \
// access to VDP
diff --git a/src/mame/video/kan_pand.c b/src/mame/video/kan_pand.c
index 7550a430775..ed89b112d29 100644
--- a/src/mame/video/kan_pand.c
+++ b/src/mame/video/kan_pand.c
@@ -78,7 +78,7 @@ INLINE const kaneko_pandora_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == KANEKO_PANDORA));
- return (const kaneko_pandora_interface *) device->baseconfig().static_config();
+ return (const kaneko_pandora_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/mame/video/konicdev.c b/src/mame/video/konicdev.c
index d15a7bbbd9b..ee1cb3627db 100644
--- a/src/mame/video/konicdev.c
+++ b/src/mame/video/konicdev.c
@@ -1619,7 +1619,7 @@ INLINE const k007342_interface *k007342_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K007342));
- return (const k007342_interface *) device->baseconfig().static_config();
+ return (const k007342_interface *) device->static_config();
}
/*****************************************************************************
@@ -1903,7 +1903,7 @@ INLINE const k007420_interface *k007420_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K007420));
- return (const k007420_interface *) device->baseconfig().static_config();
+ return (const k007420_interface *) device->static_config();
}
/*****************************************************************************
@@ -2180,7 +2180,7 @@ INLINE const k052109_interface *k052109_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K052109));
- return (const k052109_interface *) device->baseconfig().static_config();
+ return (const k052109_interface *) device->static_config();
}
/*****************************************************************************
@@ -2815,7 +2815,7 @@ INLINE const k051960_interface *k051960_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K051960));
- return (const k051960_interface *) device->baseconfig().static_config();
+ return (const k051960_interface *) device->static_config();
}
/*****************************************************************************
@@ -3357,7 +3357,7 @@ INLINE const k05324x_interface *k05324x_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K053244 || device->type() == K053245));
- return (const k05324x_interface *) device->baseconfig().static_config();
+ return (const k05324x_interface *) device->static_config();
}
/*****************************************************************************
@@ -4147,7 +4147,7 @@ INLINE const k053247_interface *k053247_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K053246 || device->type() == K053247 || device->type() == K055673));
- return (const k053247_interface *) device->baseconfig().static_config();
+ return (const k053247_interface *) device->static_config();
}
/*****************************************************************************
@@ -5138,7 +5138,7 @@ INLINE const k051316_interface *k051316_get_interface( device_t *device )
{
assert(device != NULL);
assert(device->type() == K051316);
- return (const k051316_interface *) device->baseconfig().static_config();
+ return (const k051316_interface *) device->static_config();
}
/*****************************************************************************
@@ -5426,7 +5426,7 @@ INLINE const k053936_interface *k053936_get_interface( device_t *device )
{
assert(device != NULL);
assert(device->type() == K053936);
- return (const k053936_interface *) device->baseconfig().static_config();
+ return (const k053936_interface *) device->static_config();
}
/*****************************************************************************
@@ -6119,7 +6119,7 @@ INLINE const k056832_interface *k056832_get_interface( device_t *device )
{
assert(device != NULL);
assert(device->type() == K056832);
- return (const k056832_interface *) device->baseconfig().static_config();
+ return (const k056832_interface *) device->static_config();
}
/*****************************************************************************
@@ -8165,7 +8165,7 @@ INLINE const k054338_interface *k054338_get_interface( device_t *device )
{
assert(device != NULL);
assert(device->type() == K054338);
- return (const k054338_interface *) device->baseconfig().static_config();
+ return (const k054338_interface *) device->static_config();
}
/*****************************************************************************
@@ -8468,7 +8468,7 @@ INLINE const k053250_interface *k053250_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K053250));
- return (const k053250_interface *) device->baseconfig().static_config();
+ return (const k053250_interface *) device->static_config();
}
@@ -9097,7 +9097,7 @@ INLINE const k001006_interface *k001006_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K001006));
- return (const k001006_interface *) device->baseconfig().static_config();
+ return (const k001006_interface *) device->static_config();
}
/*****************************************************************************
@@ -9307,7 +9307,7 @@ INLINE const k001005_interface *k001005_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K001005));
- return (const k001005_interface *) device->baseconfig().static_config();
+ return (const k001005_interface *) device->static_config();
}
/*****************************************************************************
@@ -10199,7 +10199,7 @@ INLINE const k001604_interface *k001604_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K001604));
- return (const k001604_interface *) device->baseconfig().static_config();
+ return (const k001604_interface *) device->static_config();
}
/*****************************************************************************
@@ -10612,7 +10612,7 @@ INLINE const k037122_interface *k037122_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == K037122));
- return (const k037122_interface *) device->baseconfig().static_config();
+ return (const k037122_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c
index a627c21974a..97a8b9c0cb5 100644
--- a/src/mame/video/ppu2c0x.c
+++ b/src/mame/video/ppu2c0x.c
@@ -150,7 +150,7 @@ INLINE const ppu2c0x_interface *get_interface( device_t *device )
|| (device->type() == PPU_2C04) || (device->type() == PPU_2C05_01)
|| (device->type() == PPU_2C05_02) || (device->type() == PPU_2C05_03)
|| (device->type() == PPU_2C05_04) || (device->type() == PPU_2C07));
- return (const ppu2c0x_interface *) device->baseconfig().static_config();
+ return (const ppu2c0x_interface *) device->static_config();
}
diff --git a/src/mame/video/sega16sp.c b/src/mame/video/sega16sp.c
index 3a150b6905c..6e528289081 100644
--- a/src/mame/video/sega16sp.c
+++ b/src/mame/video/sega16sp.c
@@ -24,7 +24,7 @@ INLINE const sega16sp_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == SEGA16SP));
- return (const sega16sp_interface *) device->baseconfig().static_config();
+ return (const sega16sp_interface *) device->static_config();
}
/*******************************************************************************************
diff --git a/src/mame/video/segaic24.c b/src/mame/video/segaic24.c
index 26370443091..2dcab9e743c 100644
--- a/src/mame/video/segaic24.c
+++ b/src/mame/video/segaic24.c
@@ -16,69 +16,20 @@ System 24 68000x2 315-5292 315-5293 315-5294 315-5242 ym2151 da
#include "segaic24.h"
-const device_type S24TILE = segas24_tile_config::static_alloc_device_config;
-const device_type S24SPRITE = segas24_sprite_config::static_alloc_device_config;
-const device_type S24MIXER = segas24_mixer_config::static_alloc_device_config;
+const device_type S24TILE = &device_creator<segas24_tile>;
+const device_type S24SPRITE = &device_creator<segas24_sprite>;
+const device_type S24MIXER = &device_creator<segas24_mixer>;
-segas24_tile_config::segas24_tile_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "S24TILE", tag, owner, clock)
-{
-}
-
-device_config *segas24_tile_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(segas24_tile_config(mconfig, tag, owner, clock));
-}
-
-void segas24_tile_config::static_set_tile_mask(device_config *device, UINT16 _tile_mask)
-{
- segas24_tile_config *dev = downcast<segas24_tile_config *>(device);
- dev->tile_mask = _tile_mask;
-}
-
-device_t *segas24_tile_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, segas24_tile(machine, *this));
-}
-
-
-segas24_sprite_config::segas24_sprite_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "S24SPRITE", tag, owner, clock)
-{
-}
-device_config *segas24_sprite_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
+segas24_tile::segas24_tile(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, S24TILE, "S24TILE", tag, owner, clock)
{
- return global_alloc(segas24_sprite_config(mconfig, tag, owner, clock));
}
-device_t *segas24_sprite_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, segas24_sprite(machine, *this));
-}
-
-
-segas24_mixer_config::segas24_mixer_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "S24MIXER", tag, owner, clock)
-{
-}
-
-device_config *segas24_mixer_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(segas24_mixer_config(mconfig, tag, owner, clock));
-}
-
-device_t *segas24_mixer_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, segas24_mixer(machine, *this));
-}
-
-
-
-segas24_tile::segas24_tile(running_machine &_machine, const segas24_tile_config &_config)
- : device_t(_machine, _config),
- config(_config)
+void segas24_tile::static_set_tile_mask(device_t &device, UINT16 _tile_mask)
{
+ segas24_tile &dev = downcast<segas24_tile &>(device);
+ dev.tile_mask = _tile_mask;
}
#define XOR(a) WORD_XOR_BE(a)
@@ -97,7 +48,7 @@ void segas24_tile::tile_info(int offset, tile_data *tileinfo, tilemap_memory_ind
{
UINT16 val = tile_ram[tile_index|offset];
tileinfo->category = (val & 0x8000) != 0;
- tileinfo_set(machine(), tileinfo, char_gfx_index, val & config.tile_mask, (val >> 7) & 0xff, 0);
+ tileinfo_set(machine(), tileinfo, char_gfx_index, val & tile_mask, (val >> 7) & 0xff, 0);
}
TILE_GET_INFO_DEVICE( segas24_tile::tile_info_0s )
@@ -626,9 +577,8 @@ WRITE32_MEMBER(segas24_tile::char32_w)
}
-segas24_sprite::segas24_sprite(running_machine &_machine, const segas24_sprite_config &_config)
- : device_t(_machine, _config),
- config(_config)
+segas24_sprite::segas24_sprite(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, S24SPRITE, "S24SPRITE", tag, owner, clock)
{
}
@@ -873,9 +823,8 @@ READ16_MEMBER(segas24_sprite::read)
}
-segas24_mixer::segas24_mixer(running_machine &_machine, const segas24_mixer_config &_config)
- : device_t(_machine, _config),
- config(_config)
+segas24_mixer::segas24_mixer(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, S24MIXER, "S24MIXER", tag, owner, clock)
{
}
diff --git a/src/mame/video/segaic24.h b/src/mame/video/segaic24.h
index 3774632d895..44c1933dd4c 100644
--- a/src/mame/video/segaic24.h
+++ b/src/mame/video/segaic24.h
@@ -3,7 +3,7 @@
#define MCFG_S24TILE_DEVICE_ADD(_tag, tile_mask) \
MCFG_DEVICE_ADD(_tag, S24TILE, 0) \
- segas24_tile_config::static_set_tile_mask(device, tile_mask);
+ segas24_tile::static_set_tile_mask(*device, tile_mask);
#define MCFG_S24SPRITE_DEVICE_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, S24SPRITE, 0)
@@ -11,59 +11,15 @@
#define MCFG_S24MIXER_DEVICE_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, S24MIXER, 0)
-class segas24_tile;
-class segas24_sprite;
-class segas24_mixer;
-
-class segas24_tile_config : public device_config
-{
- friend class segas24_tile;
-
-protected:
- segas24_tile_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- static void static_set_tile_mask(device_config *device, UINT16 tile_mask);
-
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-
-private:
- UINT16 tile_mask;
-};
-
-class segas24_sprite_config : public device_config
-{
- friend class segas24_sprite;
-
-protected:
- segas24_sprite_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
-class segas24_mixer_config : public device_config
-{
- friend class segas24_mixer;
-
-protected:
- segas24_mixer_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-
-public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-};
-
-
class segas24_tile : public device_t
{
friend class segas24_tile_config;
- segas24_tile(running_machine &_machine, const segas24_tile_config &config);
-
public:
+ segas24_tile(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ static void static_set_tile_mask(device_t &device, UINT16 tile_mask);
+
DECLARE_READ16_MEMBER(tile_r);
DECLARE_WRITE16_MEMBER(tile_w);
DECLARE_READ16_MEMBER(char_r);
@@ -79,8 +35,6 @@ public:
protected:
virtual void device_start();
- const segas24_tile_config &config;
-
private:
enum {
SYS24_TILES = 0x4000
@@ -89,6 +43,7 @@ private:
UINT16 *char_ram, *tile_ram;
int char_gfx_index;
tilemap_t *tile_layer[4];
+ UINT16 tile_mask;
static const gfx_layout char_layout;
@@ -109,9 +64,9 @@ class segas24_sprite : public device_t
{
friend class segas24_sprite_config;
- segas24_sprite(running_machine &_machine, const segas24_sprite_config &config);
-
public:
+ segas24_sprite(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
DECLARE_READ16_MEMBER(read);
DECLARE_WRITE16_MEMBER(write);
@@ -120,8 +75,6 @@ public:
protected:
virtual void device_start();
- const segas24_sprite_config &config;
-
private:
UINT16 *sprite_ram;
};
@@ -131,9 +84,9 @@ class segas24_mixer : public device_t
{
friend class segas24_mixer_config;
- segas24_mixer(running_machine &_machine, const segas24_mixer_config &config);
-
public:
+ segas24_mixer(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
DECLARE_READ16_MEMBER(read);
DECLARE_WRITE16_MEMBER(write);
@@ -142,12 +95,12 @@ public:
protected:
virtual void device_start();
- const segas24_mixer_config &config;
-
private:
UINT16 mixer_reg[16];
};
-extern const device_type S24TILE, S24SPRITE, S24MIXER;
+extern const device_type S24TILE;
+extern const device_type S24SPRITE;
+extern const device_type S24MIXER;
#endif
diff --git a/src/mame/video/sknsspr.c b/src/mame/video/sknsspr.c
index 84a051f0c4a..261f26676a0 100644
--- a/src/mame/video/sknsspr.c
+++ b/src/mame/video/sknsspr.c
@@ -15,25 +15,11 @@
#include "emu.h"
#include "sknsspr.h"
+const device_type SKNS_SPRITE = &device_creator<sknsspr_device>;
-sknsspr_device_config::sknsspr_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
- : device_config(mconfig, static_alloc_device_config, "sknsspr_device", tag, owner, clock)
-{
-}
-
-device_config *sknsspr_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
-{
- return global_alloc(sknsspr_device_config(mconfig, tag, owner, clock));
-}
-
-device_t *sknsspr_device_config::alloc_device(running_machine &machine) const
-{
- return auto_alloc(machine, sknsspr_device(machine, *this));
-}
-sknsspr_device::sknsspr_device(running_machine &_machine, const sknsspr_device_config &config)
- : device_t(_machine, config),
- m_config(config)
+sknsspr_device::sknsspr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SKNS_SPRITE, "sknsspr_device", tag, owner, clock)
{
}
diff --git a/src/mame/video/sknsspr.h b/src/mame/video/sknsspr.h
index 6785b002e5c..8fee164007d 100644
--- a/src/mame/video/sknsspr.h
+++ b/src/mame/video/sknsspr.h
@@ -1,26 +1,14 @@
-class sknsspr_device_config : public device_config
-{
- friend class sknsspr_device;
- sknsspr_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
-public:
- static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
- virtual device_t *alloc_device(running_machine &machine) const;
-protected:
-};
-
class sknsspr_device : public device_t
{
- friend class sknsspr_device_config;
- sknsspr_device(running_machine &_machine, const sknsspr_device_config &config);
public:
+ sknsspr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
void skns_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32* spriteram_source, size_t spriteram_size, UINT8* gfx_source, size_t gfx_length, UINT32* sprite_regs);
void skns_sprite_kludge(int x, int y);
protected:
virtual void device_start();
virtual void device_reset();
- const sknsspr_device_config &m_config;
private:
int sprite_kludge_x, sprite_kludge_y;
#define SUPRNOVA_DECODE_BUFFER_SIZE 0x2000
@@ -28,7 +16,7 @@ private:
int skns_rle_decode ( running_machine &machine, int romoffset, int size, UINT8*gfx_source, size_t gfx_length );
};
-const device_type sknsspr_ = sknsspr_device_config::static_alloc_device_config;
+extern const device_type SKNS_SPRITE;
diff --git a/src/mame/video/taitoic.c b/src/mame/video/taitoic.c
index fab012c7cf4..ba64d906eb3 100644
--- a/src/mame/video/taitoic.c
+++ b/src/mame/video/taitoic.c
@@ -579,7 +579,7 @@ INLINE const pc080sn_interface *pc080sn_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == PC080SN));
- return (const pc080sn_interface *) device->baseconfig().static_config();
+ return (const pc080sn_interface *) device->static_config();
}
/*****************************************************************************
@@ -1072,7 +1072,7 @@ INLINE const pc090oj_interface *pc090oj_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == PC090OJ));
- return (const pc090oj_interface *) device->baseconfig().static_config();
+ return (const pc090oj_interface *) device->static_config();
}
/*****************************************************************************
@@ -1280,7 +1280,7 @@ INLINE const tc0080vco_interface *tc0080vco_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == TC0080VCO));
- return (const tc0080vco_interface *) device->baseconfig().static_config();
+ return (const tc0080vco_interface *) device->static_config();
}
/*****************************************************************************
@@ -1964,7 +1964,7 @@ INLINE const tc0100scn_interface *tc0100scn_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == TC0100SCN));
- return (const tc0100scn_interface *) device->baseconfig().static_config();
+ return (const tc0100scn_interface *) device->static_config();
}
/*****************************************************************************
@@ -2570,7 +2570,7 @@ INLINE const tc0280grd_interface *tc0280grd_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == TC0280GRD) || (device->type() == TC0430GRW));
- return (const tc0280grd_interface *) device->baseconfig().static_config();
+ return (const tc0280grd_interface *) device->static_config();
}
/*****************************************************************************
@@ -2832,7 +2832,7 @@ INLINE const tc0480scp_interface *tc0480scp_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == TC0480SCP));
- return (const tc0480scp_interface *) device->baseconfig().static_config();
+ return (const tc0480scp_interface *) device->static_config();
}
/*****************************************************************************
@@ -3774,7 +3774,7 @@ INLINE const tc0150rod_interface *tc0150rod_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == TC0150ROD));
- return (const tc0150rod_interface *) device->baseconfig().static_config();
+ return (const tc0150rod_interface *) device->static_config();
}
/*****************************************************************************
@@ -4584,7 +4584,7 @@ INLINE const tc0110pcr_interface *tc0110pcr_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == TC0110PCR));
- return (const tc0110pcr_interface *) device->baseconfig().static_config();
+ return (const tc0110pcr_interface *) device->static_config();
}
/*****************************************************************************
@@ -4814,7 +4814,7 @@ INLINE const tc0180vcu_interface *tc0180vcu_get_interface( device_t *device )
{
assert(device != NULL);
assert((device->type() == TC0180VCU));
- return (const tc0180vcu_interface *) device->baseconfig().static_config();
+ return (const tc0180vcu_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/mame/video/vertigo.c b/src/mame/video/vertigo.c
index 7d54fa6799f..c79231d9cef 100644
--- a/src/mame/video/vertigo.c
+++ b/src/mame/video/vertigo.c
@@ -133,6 +133,7 @@ void vertigo_vproc_init(running_machine &machine)
state_save_register_item(machine, "vector_proc", NULL, 0, state->m_bsp.f);
state_save_register_item(machine, "vector_proc", NULL, 0, state->m_bsp.y);
+ state->m_vgen.set_machine(machine);
state_save_register_item(machine, "vector_proc", NULL, 0, state->m_vgen.sreg);
state_save_register_item(machine, "vector_proc", NULL, 0, state->m_vgen.l1);
state_save_register_item(machine, "vector_proc", NULL, 0, state->m_vgen.l2);
diff --git a/src/mame/video/vrender0.c b/src/mame/video/vrender0.c
index 63461bde6ab..2858eb4fa79 100644
--- a/src/mame/video/vrender0.c
+++ b/src/mame/video/vrender0.c
@@ -102,7 +102,7 @@ INLINE const vr0video_interface *get_interface( device_t *device )
{
assert(device != NULL);
assert(device->type() == VIDEO_VRENDER0);
- return (const vr0video_interface *) device->baseconfig().static_config();
+ return (const vr0video_interface *) device->static_config();
}
/*****************************************************************************
diff --git a/src/osd/windows/drawd3d.c b/src/osd/windows/drawd3d.c
index 02aa6faa72d..fc95edf6eda 100644
--- a/src/osd/windows/drawd3d.c
+++ b/src/osd/windows/drawd3d.c
@@ -1285,9 +1285,9 @@ static void pick_best_mode(win_window_info *window)
int modenum;
// determine the refresh rate of the primary screen
- const screen_device_config *primary_screen = window->machine().config().first_screen();
+ const screen_device *primary_screen = window->machine().config().first_screen();
if (primary_screen != NULL)
- target_refresh = ATTOSECONDS_TO_HZ(primary_screen->refresh());
+ target_refresh = ATTOSECONDS_TO_HZ(primary_screen->refresh_attoseconds());
// determine the minimum width/height for the selected target
// note: technically we should not be calling this from an alternate window
diff --git a/src/osd/windows/drawdd.c b/src/osd/windows/drawdd.c
index e1957094f32..d1ea6e481d2 100644
--- a/src/osd/windows/drawdd.c
+++ b/src/osd/windows/drawdd.c
@@ -1328,9 +1328,9 @@ static void pick_best_mode(win_window_info *window)
// determine the refresh rate of the primary screen
einfo.target_refresh = 60.0;
- const screen_device_config *primary_screen = window->machine().config().first_screen();
+ const screen_device *primary_screen = window->machine().config().first_screen();
if (primary_screen != NULL)
- einfo.target_refresh = ATTOSECONDS_TO_HZ(primary_screen->refresh());
+ einfo.target_refresh = ATTOSECONDS_TO_HZ(primary_screen->refresh_attoseconds());
printf("Target refresh = %f\n", einfo.target_refresh);
// if we're not stretching, allow some slop on the minimum since we can handle it