summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-01-10 00:29:26 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-01-10 00:29:26 +0000
commit4498faacd93cbb7f204d1b47e5d12bd417cf43b3 (patch)
treeeebf7c70b83ce57ba2707407872a01fe3ef7bb3c
parent43d93150b5bc214537d5198cd9e7f01f2020eff8 (diff)
First round of an attempted cleanup of header files in the system.
- Created new central header "emu.h"; this should be included by pretty much any driver or device as the first include. This file in turn includes pretty much everything a driver or device will need, minus any other devices it references. Note that emu.h should *never* be included by another header file. - Updated all files in the core (src/emu) to use emu.h. - Removed a ton of redundant and poorly-tracked header includes from within other header files. - Temporarily changed driver.h to map to emu.h until we update files outside of the core. Added class wrapper around tagmap so it can be directly included and accessed within objects that need it. Updated all users to embed tagmap objects and changed them to call through the class. Added nicer functions for finding devices, ports, and regions in a machine: machine->device("tag") -- return the named device, or NULL machine->port("tag") -- return the named port, or NULL machine->region("tag"[, &length[, &flags]]) -- return the named region and optionally its length and flags Made the device tag an astring. This required touching a lot of code that printed the device to explicitly fetch the C-string from it. (Thank you gcc for flagging that issue!)
-rw-r--r--.gitattributes4
-rw-r--r--src/emu/attotime.c2
-rw-r--r--src/emu/attotime.h2
-rw-r--r--src/emu/audio/generic.h2
-rw-r--r--src/emu/audit.c4
-rw-r--r--src/emu/audit.h1
-rw-r--r--src/emu/cheat.c3
-rw-r--r--src/emu/cheat.h2
-rw-r--r--src/emu/clifront.c5
-rw-r--r--src/emu/clifront.h2
-rw-r--r--src/emu/config.c3
-rw-r--r--src/emu/config.h2
-rw-r--r--src/emu/cpu/adsp2100/2100dasm.c1
-rw-r--r--src/emu/cpu/adsp2100/adsp2100.c2
-rw-r--r--src/emu/cpu/adsp2100/adsp2100.h2
-rw-r--r--src/emu/cpu/alph8201/8201dasm.c4
-rw-r--r--src/emu/cpu/alph8201/alph8201.c1
-rw-r--r--src/emu/cpu/alph8201/alph8201.h2
-rw-r--r--src/emu/cpu/apexc/apexc.c2
-rw-r--r--src/emu/cpu/apexc/apexcdsm.c2
-rw-r--r--src/emu/cpu/arm/arm.c3
-rw-r--r--src/emu/cpu/arm/arm.h2
-rw-r--r--src/emu/cpu/arm/armdasm.c1
-rw-r--r--src/emu/cpu/arm7/arm7.c3
-rw-r--r--src/emu/cpu/arm7/arm7.h1
-rw-r--r--src/emu/cpu/arm7/arm7core.c2
-rw-r--r--src/emu/cpu/arm7/arm7core.h1
-rw-r--r--src/emu/cpu/arm7/arm7dasm.c1
-rw-r--r--src/emu/cpu/asap/asap.c1
-rw-r--r--src/emu/cpu/asap/asap.h2
-rw-r--r--src/emu/cpu/asap/asapdasm.c1
-rw-r--r--src/emu/cpu/avr8/avr8.c2
-rw-r--r--src/emu/cpu/avr8/avr8dasm.c2
-rw-r--r--src/emu/cpu/ccpu/ccpu.c1
-rw-r--r--src/emu/cpu/ccpu/ccpu.h2
-rw-r--r--src/emu/cpu/ccpu/ccpudasm.c1
-rw-r--r--src/emu/cpu/cdp1802/1802dasm.c2
-rw-r--r--src/emu/cpu/cdp1802/cdp1802.c4
-rw-r--r--src/emu/cpu/cdp1802/cdp1802.h3
-rw-r--r--src/emu/cpu/cop400/cop400.c3
-rw-r--r--src/emu/cpu/cop400/cop410ds.c2
-rw-r--r--src/emu/cpu/cop400/cop420ds.c2
-rw-r--r--src/emu/cpu/cop400/cop440ds.c2
-rw-r--r--src/emu/cpu/cp1610/1610dasm.c2
-rw-r--r--src/emu/cpu/cp1610/cp1610.c2
-rw-r--r--src/emu/cpu/cp1610/cp1610.h2
-rw-r--r--src/emu/cpu/cubeqcpu/cubedasm.c3
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.c2
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.h2
-rw-r--r--src/emu/cpu/drcbec.c5
-rw-r--r--src/emu/cpu/drcbeut.c1
-rw-r--r--src/emu/cpu/drcbex64.c6
-rw-r--r--src/emu/cpu/drcbex86.c6
-rw-r--r--src/emu/cpu/drccache.c3
-rw-r--r--src/emu/cpu/drcfe.c4
-rw-r--r--src/emu/cpu/drcuml.c4
-rw-r--r--src/emu/cpu/drcuml.h1
-rw-r--r--src/emu/cpu/dsp32/dsp32.c1
-rw-r--r--src/emu/cpu/dsp32/dsp32.h5
-rw-r--r--src/emu/cpu/dsp32/dsp32dis.c1
-rw-r--r--src/emu/cpu/dsp56k/dsp56dsm.c1
-rw-r--r--src/emu/cpu/dsp56k/dsp56k.c1
-rw-r--r--src/emu/cpu/dsp56k/dsp56k.h1
-rw-r--r--src/emu/cpu/e132xs/32xsdasm.c2
-rw-r--r--src/emu/cpu/e132xs/e132xs.c3
-rw-r--r--src/emu/cpu/e132xs/e132xs.h1
-rw-r--r--src/emu/cpu/esrip/esrip.c1
-rw-r--r--src/emu/cpu/esrip/esrip.h2
-rw-r--r--src/emu/cpu/esrip/esripdsm.c1
-rw-r--r--src/emu/cpu/f8/f8.c1
-rw-r--r--src/emu/cpu/f8/f8.h1
-rw-r--r--src/emu/cpu/f8/f8dasm.c2
-rw-r--r--src/emu/cpu/g65816/g65816.c1
-rw-r--r--src/emu/cpu/g65816/g65816.h2
-rw-r--r--src/emu/cpu/g65816/g65816cm.h1
-rw-r--r--src/emu/cpu/g65816/g65816ds.c2
-rw-r--r--src/emu/cpu/g65816/g65816o0.c2
-rw-r--r--src/emu/cpu/g65816/g65816o1.c2
-rw-r--r--src/emu/cpu/g65816/g65816o2.c2
-rw-r--r--src/emu/cpu/g65816/g65816o3.c2
-rw-r--r--src/emu/cpu/g65816/g65816o4.c2
-rw-r--r--src/emu/cpu/h6280/6280dasm.c2
-rw-r--r--src/emu/cpu/h6280/h6280.c1
-rw-r--r--src/emu/cpu/h6280/h6280.h1
-rw-r--r--src/emu/cpu/h83002/h8.h1
-rw-r--r--src/emu/cpu/h83002/h8_16.c1
-rw-r--r--src/emu/cpu/h83002/h8_8.c1
-rw-r--r--src/emu/cpu/h83002/h8disasm.c1
-rw-r--r--src/emu/cpu/h83002/h8periph.c6
-rw-r--r--src/emu/cpu/hd6309/6309dasm.c1
-rw-r--r--src/emu/cpu/hd6309/hd6309.c5
-rw-r--r--src/emu/cpu/hd6309/hd6309.h1
-rw-r--r--src/emu/cpu/i386/i386.c1
-rw-r--r--src/emu/cpu/i386/i386.h1
-rw-r--r--src/emu/cpu/i386/i386dasm.c2
-rw-r--r--src/emu/cpu/i386/i386priv.h1
-rw-r--r--src/emu/cpu/i4004/4004dasm.c2
-rw-r--r--src/emu/cpu/i4004/i4004.c1
-rw-r--r--src/emu/cpu/i4004/i4004.h1
-rw-r--r--src/emu/cpu/i8008/8008dasm.c2
-rw-r--r--src/emu/cpu/i8008/i8008.c1
-rw-r--r--src/emu/cpu/i8008/i8008.h1
-rw-r--r--src/emu/cpu/i8085/8085dasm.c2
-rw-r--r--src/emu/cpu/i8085/i8085.c1
-rw-r--r--src/emu/cpu/i8085/i8085.h2
-rw-r--r--src/emu/cpu/i86/host.h1
-rw-r--r--src/emu/cpu/i86/i286.c1
-rw-r--r--src/emu/cpu/i86/i86.c2
-rw-r--r--src/emu/cpu/i86/i86.h1
-rw-r--r--src/emu/cpu/i860/i860.c1
-rw-r--r--src/emu/cpu/i860/i860.h2
-rw-r--r--src/emu/cpu/i860/i860dec.c8
-rw-r--r--src/emu/cpu/i860/i860dis.c1
-rw-r--r--src/emu/cpu/i960/i960.c2
-rw-r--r--src/emu/cpu/i960/i960.h1
-rw-r--r--src/emu/cpu/i960/i960dis.c1
-rw-r--r--src/emu/cpu/jaguar/jagdasm.c1
-rw-r--r--src/emu/cpu/jaguar/jaguar.c2
-rw-r--r--src/emu/cpu/jaguar/jaguar.h1
-rw-r--r--src/emu/cpu/konami/knmidasm.c1
-rw-r--r--src/emu/cpu/konami/konami.c1
-rw-r--r--src/emu/cpu/konami/konami.h1
-rw-r--r--src/emu/cpu/lh5801/5801dasm.c2
-rw-r--r--src/emu/cpu/lh5801/lh5801.c1
-rw-r--r--src/emu/cpu/lh5801/lh5801.h1
-rw-r--r--src/emu/cpu/lr35902/lr35902.c1
-rw-r--r--src/emu/cpu/lr35902/lr35902.h1
-rw-r--r--src/emu/cpu/lr35902/lr35902d.c1
-rw-r--r--src/emu/cpu/m37710/m37710.c2
-rw-r--r--src/emu/cpu/m37710/m37710cm.h2
-rw-r--r--src/emu/cpu/m37710/m37710o0.c2
-rw-r--r--src/emu/cpu/m37710/m37710o1.c2
-rw-r--r--src/emu/cpu/m37710/m37710o2.c2
-rw-r--r--src/emu/cpu/m37710/m37710o3.c2
-rw-r--r--src/emu/cpu/m37710/m7700ds.c2
-rw-r--r--src/emu/cpu/m6502/6502dasm.c1
-rw-r--r--src/emu/cpu/m6502/m4510.c11
-rw-r--r--src/emu/cpu/m6502/m6502.c33
-rw-r--r--src/emu/cpu/m6502/m6502.h1
-rw-r--r--src/emu/cpu/m6502/m6509.c13
-rw-r--r--src/emu/cpu/m6502/m65ce02.c11
-rw-r--r--src/emu/cpu/m6502/ops02.h4
-rw-r--r--src/emu/cpu/m6502/opsce02.h6
-rw-r--r--src/emu/cpu/m6800/6800dasm.c1
-rw-r--r--src/emu/cpu/m6800/m6800.c21
-rw-r--r--src/emu/cpu/m6800/m6800.h1
-rw-r--r--src/emu/cpu/m68000/m68000.h1
-rw-r--r--src/emu/cpu/m68000/m68k_in.c16
-rw-r--r--src/emu/cpu/m68000/m68kcpu.c3
-rw-r--r--src/emu/cpu/m68000/m68kcpu.h2
-rw-r--r--src/emu/cpu/m68000/m68kdasm.c1
-rw-r--r--src/emu/cpu/m6805/6805dasm.c1
-rw-r--r--src/emu/cpu/m6805/m6805.c1
-rw-r--r--src/emu/cpu/m6805/m6805.h1
-rw-r--r--src/emu/cpu/m6809/6809dasm.c1
-rw-r--r--src/emu/cpu/m6809/m6809.c5
-rw-r--r--src/emu/cpu/m6809/m6809.h1
-rw-r--r--src/emu/cpu/mb86233/mb86233.c3
-rw-r--r--src/emu/cpu/mb86233/mb86233.h1
-rw-r--r--src/emu/cpu/mb86233/mb86233d.c1
-rw-r--r--src/emu/cpu/mb88xx/mb88dasm.c1
-rw-r--r--src/emu/cpu/mb88xx/mb88xx.c1
-rw-r--r--src/emu/cpu/mb88xx/mb88xx.h1
-rw-r--r--src/emu/cpu/mc68hc11/hc11dasm.c3
-rw-r--r--src/emu/cpu/mc68hc11/mc68hc11.c1
-rw-r--r--src/emu/cpu/mc68hc11/mc68hc11.h1
-rw-r--r--src/emu/cpu/mcs48/mcs48.c2
-rw-r--r--src/emu/cpu/mcs48/mcs48.h1
-rw-r--r--src/emu/cpu/mcs48/mcs48dsm.c2
-rw-r--r--src/emu/cpu/mcs51/mcs51.c11
-rw-r--r--src/emu/cpu/mcs51/mcs51.h1
-rw-r--r--src/emu/cpu/mcs51/mcs51dasm.c1
-rw-r--r--src/emu/cpu/mcs51/mcs51ops.c2
-rw-r--r--src/emu/cpu/minx/minx.c3
-rw-r--r--src/emu/cpu/minx/minx.h3
-rw-r--r--src/emu/cpu/minx/minxd.c1
-rw-r--r--src/emu/cpu/mips/mips3.c1
-rw-r--r--src/emu/cpu/mips/mips3.h1
-rw-r--r--src/emu/cpu/mips/mips3com.c3
-rw-r--r--src/emu/cpu/mips/mips3com.h2
-rw-r--r--src/emu/cpu/mips/mips3drc.c4
-rw-r--r--src/emu/cpu/mips/mips3dsm.c2
-rw-r--r--src/emu/cpu/mips/mips3fe.c3
-rw-r--r--src/emu/cpu/mips/psx.c1
-rw-r--r--src/emu/cpu/mips/psx.h1
-rw-r--r--src/emu/cpu/mips/psxdasm.c2
-rw-r--r--src/emu/cpu/mips/r3000.c1
-rw-r--r--src/emu/cpu/mips/r3000.h1
-rw-r--r--src/emu/cpu/mips/r3kdasm.c2
-rw-r--r--src/emu/cpu/nec/nec.c3
-rw-r--r--src/emu/cpu/nec/nec.h71
-rw-r--r--src/emu/cpu/nec/necdasm.c2
-rw-r--r--src/emu/cpu/nec/nechost.h1
-rw-r--r--src/emu/cpu/nec/necpriv.h1
-rw-r--r--src/emu/cpu/pdp1/pdp1.c1
-rw-r--r--src/emu/cpu/pdp1/pdp1.h1
-rw-r--r--src/emu/cpu/pdp1/pdp1dasm.c1
-rw-r--r--src/emu/cpu/pdp1/tx0.c2
-rw-r--r--src/emu/cpu/pdp1/tx0.h1
-rw-r--r--src/emu/cpu/pdp1/tx0dasm.c1
-rw-r--r--src/emu/cpu/pic16c5x/16c5xdsm.c6
-rw-r--r--src/emu/cpu/pic16c5x/pic16c5x.c1
-rw-r--r--src/emu/cpu/pic16c5x/pic16c5x.h1
-rw-r--r--src/emu/cpu/pic16c62x/16c62xdsm.c6
-rw-r--r--src/emu/cpu/pic16c62x/pic16c62x.c1
-rw-r--r--src/emu/cpu/pic16c62x/pic16c62x.h1
-rw-r--r--src/emu/cpu/powerpc/ppc.c3
-rw-r--r--src/emu/cpu/powerpc/ppc.h1
-rw-r--r--src/emu/cpu/powerpc/ppc_dasm.c2
-rw-r--r--src/emu/cpu/powerpc/ppccom.c3
-rw-r--r--src/emu/cpu/powerpc/ppccom.h2
-rw-r--r--src/emu/cpu/powerpc/ppcdrc.c3
-rw-r--r--src/emu/cpu/powerpc/ppcfe.c3
-rw-r--r--src/emu/cpu/rsp/rsp.c2
-rw-r--r--src/emu/cpu/rsp/rsp.h1
-rw-r--r--src/emu/cpu/rsp/rsp_dasm.c3
-rw-r--r--src/emu/cpu/rsp/rspdrc.c2
-rw-r--r--src/emu/cpu/rsp/rspfe.c3
-rw-r--r--src/emu/cpu/s2650/2650dasm.c2
-rw-r--r--src/emu/cpu/s2650/s2650.c1
-rw-r--r--src/emu/cpu/s2650/s2650.h1
-rw-r--r--src/emu/cpu/saturn/satops.c24
-rw-r--r--src/emu/cpu/saturn/sattable.c8
-rw-r--r--src/emu/cpu/saturn/saturn.c9
-rw-r--r--src/emu/cpu/saturn/saturn.h1
-rw-r--r--src/emu/cpu/saturn/saturnds.c2
-rw-r--r--src/emu/cpu/sc61860/sc61860.c1
-rw-r--r--src/emu/cpu/sc61860/sc61860.h1
-rw-r--r--src/emu/cpu/sc61860/scdasm.c2
-rw-r--r--src/emu/cpu/scmp/scmp.c1
-rw-r--r--src/emu/cpu/scmp/scmp.h2
-rw-r--r--src/emu/cpu/scmp/scmpdasm.c2
-rw-r--r--src/emu/cpu/se3208/se3208.c1
-rw-r--r--src/emu/cpu/se3208/se3208.h1
-rw-r--r--src/emu/cpu/se3208/se3208dis.c1
-rw-r--r--src/emu/cpu/sh2/sh2.c1
-rw-r--r--src/emu/cpu/sh2/sh2.h1
-rw-r--r--src/emu/cpu/sh2/sh2comn.c32
-rw-r--r--src/emu/cpu/sh2/sh2comn.h1
-rw-r--r--src/emu/cpu/sh2/sh2dasm.c1
-rw-r--r--src/emu/cpu/sh2/sh2drc.c2
-rw-r--r--src/emu/cpu/sh2/sh2fe.c2
-rw-r--r--src/emu/cpu/sh4/sh4.c1
-rw-r--r--src/emu/cpu/sh4/sh4.h1
-rw-r--r--src/emu/cpu/sh4/sh4comn.c20
-rw-r--r--src/emu/cpu/sh4/sh4dasm.c1
-rw-r--r--src/emu/cpu/sharc/sharc.c3
-rw-r--r--src/emu/cpu/sharc/sharc.h1
-rw-r--r--src/emu/cpu/sharc/sharcdsm.c3
-rw-r--r--src/emu/cpu/sm8500/sm8500.c1
-rw-r--r--src/emu/cpu/sm8500/sm8500.h1
-rw-r--r--src/emu/cpu/sm8500/sm8500d.c2
-rw-r--r--src/emu/cpu/spc700/spc700.c1
-rw-r--r--src/emu/cpu/spc700/spc700.h1
-rw-r--r--src/emu/cpu/spc700/spc700ds.c2
-rw-r--r--src/emu/cpu/spc700/spc700ds.h1
-rw-r--r--src/emu/cpu/ssem/ssem.c2
-rw-r--r--src/emu/cpu/ssem/ssemdasm.c3
-rw-r--r--src/emu/cpu/ssp1601/ssp1601.c1
-rw-r--r--src/emu/cpu/ssp1601/ssp1601.h1
-rw-r--r--src/emu/cpu/ssp1601/ssp1601d.c3
-rw-r--r--src/emu/cpu/superfx/sfx_dasm.c3
-rw-r--r--src/emu/cpu/superfx/superfx.c2
-rw-r--r--src/emu/cpu/superfx/superfx.h1
-rw-r--r--src/emu/cpu/t11/t11.c1
-rw-r--r--src/emu/cpu/t11/t11.h1
-rw-r--r--src/emu/cpu/t11/t11dasm.c1
-rw-r--r--src/emu/cpu/tlcs90/tlcs90.c2
-rw-r--r--src/emu/cpu/tlcs90/tlcs90.h1
-rw-r--r--src/emu/cpu/tlcs900/dasm900.c2
-rw-r--r--src/emu/cpu/tlcs900/tlcs900.c1
-rw-r--r--src/emu/cpu/tlcs900/tlcs900.h2
-rw-r--r--src/emu/cpu/tms0980/tms0980.c1
-rw-r--r--src/emu/cpu/tms0980/tms0980.h1
-rw-r--r--src/emu/cpu/tms0980/tms0980d.c1
-rw-r--r--src/emu/cpu/tms32010/32010dsm.c7
-rw-r--r--src/emu/cpu/tms32010/tms32010.c1
-rw-r--r--src/emu/cpu/tms32010/tms32010.h2
-rw-r--r--src/emu/cpu/tms32025/32025dsm.c6
-rw-r--r--src/emu/cpu/tms32025/tms32025.c1
-rw-r--r--src/emu/cpu/tms32025/tms32025.h2
-rw-r--r--src/emu/cpu/tms32031/dis32031.c1
-rw-r--r--src/emu/cpu/tms32031/tms32031.c2
-rw-r--r--src/emu/cpu/tms32031/tms32031.h2
-rw-r--r--src/emu/cpu/tms32051/dis32051.c3
-rw-r--r--src/emu/cpu/tms32051/tms32051.c2
-rw-r--r--src/emu/cpu/tms34010/34010dsm.c2
-rw-r--r--src/emu/cpu/tms34010/34010ops.h1
-rw-r--r--src/emu/cpu/tms34010/dis34010.c2
-rw-r--r--src/emu/cpu/tms34010/tms34010.c23
-rw-r--r--src/emu/cpu/tms34010/tms34010.h3
-rw-r--r--src/emu/cpu/tms57002/57002dsm.c3
-rw-r--r--src/emu/cpu/tms57002/tms57002.c3
-rw-r--r--src/emu/cpu/tms57002/tms57002.h2
-rw-r--r--src/emu/cpu/tms7000/7000dasm.c1
-rw-r--r--src/emu/cpu/tms7000/tms7000.c5
-rw-r--r--src/emu/cpu/tms7000/tms7000.h1
-rw-r--r--src/emu/cpu/tms7000/tms70op.c2
-rw-r--r--src/emu/cpu/tms9900/9900dasm.c1
-rw-r--r--src/emu/cpu/tms9900/99xxcore.h2
-rw-r--r--src/emu/cpu/tms9900/ti990_10.c2
-rw-r--r--src/emu/cpu/tms9900/tms9900.c2
-rw-r--r--src/emu/cpu/tms9900/tms9900.h1
-rw-r--r--src/emu/cpu/tms9900/tms9980a.c2
-rw-r--r--src/emu/cpu/tms9900/tms9995.c2
-rw-r--r--src/emu/cpu/upd7810/7810dasm.c1
-rw-r--r--src/emu/cpu/upd7810/7810ops.c12
-rw-r--r--src/emu/cpu/upd7810/upd7810.c1
-rw-r--r--src/emu/cpu/upd7810/upd7810.h1
-rw-r--r--src/emu/cpu/v30mz/nec.h1
-rw-r--r--src/emu/cpu/v30mz/nechost.h1
-rw-r--r--src/emu/cpu/v30mz/v30mz.c1
-rw-r--r--src/emu/cpu/v60/v60.c1
-rw-r--r--src/emu/cpu/v60/v60.h1
-rw-r--r--src/emu/cpu/v60/v60d.c1
-rw-r--r--src/emu/cpu/v810/v810.c1
-rw-r--r--src/emu/cpu/v810/v810.h1
-rw-r--r--src/emu/cpu/v810/v810dasm.c2
-rw-r--r--src/emu/cpu/vtlb.c2
-rw-r--r--src/emu/cpu/vtlb.h1
-rw-r--r--src/emu/cpu/x86log.c4
-rw-r--r--src/emu/cpu/x86log.h1
-rw-r--r--src/emu/cpu/z180/z180.c298
-rw-r--r--src/emu/cpu/z180/z180.h1
-rw-r--r--src/emu/cpu/z180/z180dasm.c1
-rw-r--r--src/emu/cpu/z180/z180dd.c2
-rw-r--r--src/emu/cpu/z180/z180ed.c2
-rw-r--r--src/emu/cpu/z180/z180op.c10
-rw-r--r--src/emu/cpu/z180/z180ops.h2
-rw-r--r--src/emu/cpu/z8/z8.c2
-rw-r--r--src/emu/cpu/z8/z8.h1
-rw-r--r--src/emu/cpu/z8/z8dasm.c2
-rw-r--r--src/emu/cpu/z80/z80.c18
-rw-r--r--src/emu/cpu/z80/z80.h1
-rw-r--r--src/emu/cpu/z80/z80daisy.c2
-rw-r--r--src/emu/cpu/z80/z80daisy.h1
-rw-r--r--src/emu/cpu/z80/z80dasm.c1
-rw-r--r--src/emu/cpu/z8000/8000dasm.c2
-rw-r--r--src/emu/cpu/z8000/z8000.c15
-rw-r--r--src/emu/cpu/z8000/z8000.h1
-rw-r--r--src/emu/cpu/z8000/z8000ops.c30
-rw-r--r--src/emu/cpuexec.c26
-rw-r--r--src/emu/cpuexec.h7
-rw-r--r--src/emu/cpuintrf.h9
-rw-r--r--src/emu/crsshair.c5
-rw-r--r--src/emu/debug/debugcmd.c35
-rw-r--r--src/emu/debug/debugcmt.c3
-rw-r--r--src/emu/debug/debugcon.c16
-rw-r--r--src/emu/debug/debugcon.h1
-rw-r--r--src/emu/debug/debugcpu.c6
-rw-r--r--src/emu/debug/debugcpu.h1
-rw-r--r--src/emu/debug/debugvw.c8
-rw-r--r--src/emu/debug/express.h1
-rw-r--r--src/emu/debugger.c2
-rw-r--r--src/emu/debugger.h2
-rw-r--r--src/emu/deprecat.h3
-rw-r--r--src/emu/devcb.c45
-rw-r--r--src/emu/devcb.h11
-rw-r--r--src/emu/devintrf.c33
-rw-r--r--src/emu/devintrf.h47
-rw-r--r--src/emu/drawgfx.c2
-rw-r--r--src/emu/drawgfx.h13
-rw-r--r--src/emu/drawgfxm.h2
-rw-r--r--src/emu/driver.c2
-rw-r--r--src/emu/driver.h133
-rw-r--r--src/emu/emu.h112
-rw-r--r--src/emu/emucore.c6
-rw-r--r--src/emu/emucore.h250
-rw-r--r--src/emu/emuopts.c4
-rw-r--r--src/emu/emuopts.h1
-rw-r--r--src/emu/emupal.c6
-rw-r--r--src/emu/emupal.h10
-rw-r--r--src/emu/fileio.c5
-rw-r--r--src/emu/fileio.h7
-rw-r--r--src/emu/hash.c9
-rw-r--r--src/emu/info.c6
-rw-r--r--src/emu/info.h2
-rw-r--r--src/emu/inptport.c38
-rw-r--r--src/emu/inptport.h23
-rw-r--r--src/emu/input.c3
-rw-r--r--src/emu/input.h7
-rw-r--r--src/emu/inputseq.c2
-rw-r--r--src/emu/inputseq.h6
-rw-r--r--src/emu/machine/6522via.c18
-rw-r--r--src/emu/machine/6522via.h1
-rw-r--r--src/emu/machine/6526cia.h1
-rw-r--r--src/emu/machine/6532riot.c5
-rw-r--r--src/emu/machine/6532riot.h1
-rw-r--r--src/emu/machine/6821pia.c73
-rw-r--r--src/emu/machine/6821pia.h3
-rw-r--r--src/emu/machine/6840ptm.c34
-rw-r--r--src/emu/machine/6840ptm.h1
-rw-r--r--src/emu/machine/6850acia.h1
-rw-r--r--src/emu/machine/68681.c9
-rw-r--r--src/emu/machine/74123.c10
-rw-r--r--src/emu/machine/8237dma.h1
-rw-r--r--src/emu/machine/8255ppi.h1
-rw-r--r--src/emu/machine/8257dma.c1
-rw-r--r--src/emu/machine/8257dma.h1
-rw-r--r--src/emu/machine/adc083x.c34
-rw-r--r--src/emu/machine/adc083x.h1
-rw-r--r--src/emu/machine/adc1038.h1
-rw-r--r--src/emu/machine/adc1213x.h1
-rw-r--r--src/emu/machine/cdp1852.h1
-rw-r--r--src/emu/machine/eeprom.c8
-rw-r--r--src/emu/machine/generic.c3
-rw-r--r--src/emu/machine/generic.h2
-rw-r--r--src/emu/machine/i8243.c1
-rw-r--r--src/emu/machine/i8243.h1
-rw-r--r--src/emu/machine/i8255a.c38
-rw-r--r--src/emu/machine/i8255a.h1
-rw-r--r--src/emu/machine/idectrl.c2
-rw-r--r--src/emu/machine/k033906.h1
-rw-r--r--src/emu/machine/k056230.h1
-rw-r--r--src/emu/machine/latch8.c8
-rw-r--r--src/emu/machine/ldcore.c3
-rw-r--r--src/emu/machine/ldcore.h1
-rw-r--r--src/emu/machine/ldpr8210.c1
-rw-r--r--src/emu/machine/ldv1000.c1
-rw-r--r--src/emu/machine/ldvp931.c1
-rw-r--r--src/emu/machine/mb14241.h1
-rw-r--r--src/emu/machine/mb87078.h1
-rw-r--r--src/emu/machine/mc146818.c2
-rw-r--r--src/emu/machine/pci.c4
-rw-r--r--src/emu/machine/scsi.c1
-rw-r--r--src/emu/machine/scsi.h1
-rw-r--r--src/emu/machine/scsicd.c2
-rw-r--r--src/emu/machine/scsidev.c3
-rw-r--r--src/emu/machine/scsihd.c2
-rw-r--r--src/emu/machine/z80ctc.h1
-rw-r--r--src/emu/machine/z80dma.h1
-rw-r--r--src/emu/machine/z80pio.h1
-rw-r--r--src/emu/mame.c50
-rw-r--r--src/emu/mame.h80
-rw-r--r--src/emu/mconfig.c5
-rw-r--r--src/emu/mconfig.h90
-rw-r--r--src/emu/memory.c103
-rw-r--r--src/emu/memory.h13
-rw-r--r--src/emu/output.c3
-rw-r--r--src/emu/output.h6
-rw-r--r--src/emu/profiler.c5
-rw-r--r--src/emu/profiler.h1
-rw-r--r--src/emu/render.c7
-rw-r--r--src/emu/render.h2
-rw-r--r--src/emu/rendfont.c2
-rw-r--r--src/emu/rendfont.h1
-rw-r--r--src/emu/rendlay.c3
-rw-r--r--src/emu/rendlay.h2
-rw-r--r--src/emu/rendutil.c1
-rw-r--r--src/emu/rendutil.h1
-rw-r--r--src/emu/romload.c6
-rw-r--r--src/emu/romload.h11
-rw-r--r--src/emu/sndintrf.h23
-rw-r--r--src/emu/sound.c10
-rw-r--r--src/emu/sound.h6
-rw-r--r--src/emu/sound/2151intf.c2
-rw-r--r--src/emu/sound/2203intf.c2
-rw-r--r--src/emu/sound/2413intf.c2
-rw-r--r--src/emu/sound/2608intf.c2
-rw-r--r--src/emu/sound/2610intf.c4
-rw-r--r--src/emu/sound/2612intf.c2
-rw-r--r--src/emu/sound/262intf.c2
-rw-r--r--src/emu/sound/3526intf.c3
-rw-r--r--src/emu/sound/3812intf.c3
-rw-r--r--src/emu/sound/8950intf.c3
-rw-r--r--src/emu/sound/aica.c3
-rw-r--r--src/emu/sound/aicadsp.c3
-rw-r--r--src/emu/sound/astrocde.c2
-rw-r--r--src/emu/sound/ay8910.c20
-rw-r--r--src/emu/sound/ay8910.h2
-rw-r--r--src/emu/sound/beep.c4
-rw-r--r--src/emu/sound/bsmt2000.c2
-rw-r--r--src/emu/sound/c140.c2
-rw-r--r--src/emu/sound/c352.c3
-rw-r--r--src/emu/sound/c6280.c4
-rw-r--r--src/emu/sound/cdda.c4
-rw-r--r--src/emu/sound/cdp1863.c3
-rw-r--r--src/emu/sound/cdp1864.c5
-rw-r--r--src/emu/sound/cdp1864.h1
-rw-r--r--src/emu/sound/cdp1869.c3
-rw-r--r--src/emu/sound/cdp1869.h1
-rw-r--r--src/emu/sound/cem3394.c3
-rw-r--r--src/emu/sound/dac.c3
-rw-r--r--src/emu/sound/digitalk.c3
-rw-r--r--src/emu/sound/disc_sys.c4
-rw-r--r--src/emu/sound/discrete.c7
-rw-r--r--src/emu/sound/dmadac.c2
-rw-r--r--src/emu/sound/es5503.c7
-rw-r--r--src/emu/sound/es5506.c7
-rw-r--r--src/emu/sound/es8712.c6
-rw-r--r--src/emu/sound/filter.c2
-rw-r--r--src/emu/sound/flt_rc.c2
-rw-r--r--src/emu/sound/flt_vol.c2
-rw-r--r--src/emu/sound/fm.c13
-rw-r--r--src/emu/sound/fm2612.c13
-rw-r--r--src/emu/sound/fmopl.c3
-rw-r--r--src/emu/sound/gaelco.c3
-rw-r--r--src/emu/sound/hc55516.c3
-rw-r--r--src/emu/sound/ics2115.c5
-rw-r--r--src/emu/sound/iremga20.c4
-rw-r--r--src/emu/sound/k005289.c2
-rw-r--r--src/emu/sound/k007232.c3
-rw-r--r--src/emu/sound/k051649.c2
-rw-r--r--src/emu/sound/k053260.c4
-rw-r--r--src/emu/sound/k054539.c3
-rw-r--r--src/emu/sound/k056800.c2
-rw-r--r--src/emu/sound/k056800.h1
-rw-r--r--src/emu/sound/msm5205.c4
-rw-r--r--src/emu/sound/msm5232.c4
-rw-r--r--src/emu/sound/multipcm.c3
-rw-r--r--src/emu/sound/n63701x.c2
-rw-r--r--src/emu/sound/namco.c2
-rw-r--r--src/emu/sound/nes_apu.c4
-rw-r--r--src/emu/sound/nes_apu.h1
-rw-r--r--src/emu/sound/nile.c4
-rw-r--r--src/emu/sound/okim6258.c4
-rw-r--r--src/emu/sound/okim6295.c8
-rw-r--r--src/emu/sound/okim6376.c6
-rw-r--r--src/emu/sound/pokey.c84
-rw-r--r--src/emu/sound/pokey.h3
-rw-r--r--src/emu/sound/psx.c5
-rw-r--r--src/emu/sound/qsound.c3
-rw-r--r--src/emu/sound/rf5c400.c2
-rw-r--r--src/emu/sound/rf5c68.c3
-rw-r--r--src/emu/sound/s14001a.c2
-rw-r--r--src/emu/sound/saa1099.c11
-rw-r--r--src/emu/sound/samples.c3
-rw-r--r--src/emu/sound/scsp.c4
-rw-r--r--src/emu/sound/scspdsp.c4
-rw-r--r--src/emu/sound/segapcm.c2
-rw-r--r--src/emu/sound/sid.c2
-rw-r--r--src/emu/sound/sid6581.c2
-rw-r--r--src/emu/sound/sid6581.h1
-rw-r--r--src/emu/sound/sidenvel.c2
-rw-r--r--src/emu/sound/sidvoice.c2
-rw-r--r--src/emu/sound/sidvoice.h1
-rw-r--r--src/emu/sound/sn76477.c69
-rw-r--r--src/emu/sound/sn76496.c2
-rw-r--r--src/emu/sound/snkwave.c2
-rw-r--r--src/emu/sound/sp0250.c5
-rw-r--r--src/emu/sound/sp0256.c4
-rw-r--r--src/emu/sound/sp0256.h1
-rw-r--r--src/emu/sound/speaker.c2
-rw-r--r--src/emu/sound/st0016.c4
-rw-r--r--src/emu/sound/t6w28.c2
-rw-r--r--src/emu/sound/tiaintf.c2
-rw-r--r--src/emu/sound/tiasound.c2
-rw-r--r--src/emu/sound/tms3615.c2
-rw-r--r--src/emu/sound/tms36xx.c2
-rw-r--r--src/emu/sound/tms5110.c2
-rw-r--r--src/emu/sound/tms5220.c2
-rw-r--r--src/emu/sound/tms5220.h1
-rw-r--r--src/emu/sound/upd7759.c4
-rw-r--r--src/emu/sound/vlm5030.c2
-rw-r--r--src/emu/sound/votrax.c2
-rw-r--r--src/emu/sound/vrender0.c3
-rw-r--r--src/emu/sound/wave.c2
-rw-r--r--src/emu/sound/x1_010.c3
-rw-r--r--src/emu/sound/ym2151.c4
-rw-r--r--src/emu/sound/ym2413.c3
-rw-r--r--src/emu/sound/ymdeltat.c2
-rw-r--r--src/emu/sound/ymf262.c3
-rw-r--r--src/emu/sound/ymf271.c3
-rw-r--r--src/emu/sound/ymf271.h1
-rw-r--r--src/emu/sound/ymf278b.c4
-rw-r--r--src/emu/sound/ymz280b.c4
-rw-r--r--src/emu/sound/ymz280b.h1
-rw-r--r--src/emu/state.c4
-rw-r--r--src/emu/state.h6
-rw-r--r--src/emu/streams.c2
-rw-r--r--src/emu/streams.h1
-rw-r--r--src/emu/tilemap.c3
-rw-r--r--src/emu/tilemap.h7
-rw-r--r--src/emu/timer.c3
-rw-r--r--src/emu/timer.h8
-rw-r--r--src/emu/ui.c10
-rw-r--r--src/emu/ui.h2
-rw-r--r--src/emu/uigfx.c1
-rw-r--r--src/emu/uigfx.h1
-rw-r--r--src/emu/uiinput.c3
-rw-r--r--src/emu/uiinput.h2
-rw-r--r--src/emu/uimenu.c4
-rw-r--r--src/emu/uimenu.h1
-rw-r--r--src/emu/validity.c101
-rw-r--r--src/emu/validity.h2
-rw-r--r--src/emu/video.c11
-rw-r--r--src/emu/video.h13
-rw-r--r--src/emu/video/generic.h2
-rw-r--r--src/emu/video/mc6845.c1
-rw-r--r--src/emu/video/mc6845.h2
-rw-r--r--src/emu/video/poly.c2
-rw-r--r--src/emu/video/poly.h2
-rw-r--r--src/emu/video/s2636.h1
-rw-r--r--src/emu/video/saa5050.h2
-rw-r--r--src/emu/video/tms9927.c1
-rw-r--r--src/emu/video/vector.c2
-rw-r--r--src/emu/watchdog.c3
-rw-r--r--src/emu/watchdog.h4
-rw-r--r--src/lib/util/tagmap.h41
-rw-r--r--src/mame/drivers/btime.c12
-rw-r--r--src/mame/drivers/cybertnk.c2
-rw-r--r--src/mame/drivers/firefox.c1
-rw-r--r--src/mame/drivers/galpani2.c4
-rw-r--r--src/mame/drivers/galpani3.c8
-rw-r--r--src/mame/drivers/igs011.c2
-rw-r--r--src/mame/drivers/jchan.c2
-rw-r--r--src/mame/drivers/konamim2.c2
-rw-r--r--src/mame/drivers/namcos12.c4
-rw-r--r--src/mame/drivers/route16.c2
-rw-r--r--src/mame/drivers/segas24.c8
-rw-r--r--src/mame/drivers/stv.c16
-rw-r--r--src/mame/drivers/vcombat.c6
-rw-r--r--src/mame/machine/atari.c4
-rw-r--r--src/mame/machine/atari_vg.c1
-rw-r--r--src/mame/machine/atarigen.c2
-rw-r--r--src/mame/machine/decocass.c14
-rw-r--r--src/mame/machine/kaneko16.c2
-rw-r--r--src/mame/machine/mathbox.c1
-rw-r--r--src/mame/machine/namco06.c16
-rw-r--r--src/mame/machine/namcos1.c30
-rw-r--r--src/mame/machine/pckeybrd.c6
-rw-r--r--src/mame/machine/segas24.c8
-rw-r--r--src/mame/mamedriv.c2
-rw-r--r--src/mame/video/dkong.c2
-rw-r--r--src/mame/video/ppu2c0x.c2
-rw-r--r--src/mame/video/stvvdp1.c4
-rw-r--r--src/mame/video/stvvdp2.c2
-rw-r--r--src/mame/video/vdc.h1
-rw-r--r--src/osd/osdepend.h7
-rw-r--r--src/osd/windows/d3d8intf.c2
-rw-r--r--src/osd/windows/d3d9intf.c2
-rw-r--r--src/osd/windows/drawd3d.c2
-rw-r--r--src/osd/windows/drawdd.c1
-rw-r--r--src/osd/windows/sound.c2
-rw-r--r--src/osd/windows/video.c3
-rw-r--r--src/osd/windows/window.c2
-rw-r--r--src/osd/windows/winmain.c1
-rw-r--r--src/osd/windows/winmain.h2
-rw-r--r--src/tools/romcmp.c1
-rw-r--r--src/tools/unidasm.c5
640 files changed, 1822 insertions, 2049 deletions
diff --git a/.gitattributes b/.gitattributes
index b24333c549f..a48f011326a 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -296,7 +296,7 @@ src/emu/cpu/mips/r3000.c svneol=native#text/plain
src/emu/cpu/mips/r3000.h svneol=native#text/plain
src/emu/cpu/mips/r3kdasm.c svneol=native#text/plain
src/emu/cpu/nec/nec.c svneol=native#text/plain
-src/emu/cpu/nec/nec.h svneol=native#text/plain
+src/emu/cpu/nec/nec.h -text svneol=native#text/plain
src/emu/cpu/nec/necdasm.c svneol=native#text/plain
src/emu/cpu/nec/necea.h svneol=native#text/plain
src/emu/cpu/nec/nechost.h svneol=native#text/plain
@@ -563,6 +563,7 @@ src/emu/drivers/xtal.h svneol=native#text/plain
src/emu/eigccppc.h svneol=native#text/plain
src/emu/eigccx86.h svneol=native#text/plain
src/emu/eminline.h svneol=native#text/plain
+src/emu/emu.h svneol=native#text/plain
src/emu/emu.mak svneol=native#text/plain
src/emu/emualloc.c svneol=native#text/plain
src/emu/emualloc.h svneol=native#text/plain
@@ -769,7 +770,6 @@ src/emu/rendutil.c svneol=native#text/plain
src/emu/rendutil.h svneol=native#text/plain
src/emu/romload.c svneol=native#text/plain
src/emu/romload.h svneol=native#text/plain
-src/emu/sndintrf.h svneol=native#text/plain
src/emu/sound.c svneol=native#text/plain
src/emu/sound.h svneol=native#text/plain
src/emu/sound/2151intf.c svneol=native#text/plain
diff --git a/src/emu/attotime.c b/src/emu/attotime.c
index 6febd5a0439..f961da0fd4c 100644
--- a/src/emu/attotime.c
+++ b/src/emu/attotime.c
@@ -10,8 +10,8 @@
***************************************************************************/
#include "emucore.h"
-#include "attotime.h"
#include "eminline.h"
+#include "attotime.h"
/***************************************************************************
diff --git a/src/emu/attotime.h b/src/emu/attotime.h
index fab20277b04..60b4f827d67 100644
--- a/src/emu/attotime.h
+++ b/src/emu/attotime.h
@@ -36,8 +36,6 @@
#ifndef __ATTOTIME_H__
#define __ATTOTIME_H__
-#include "emucore.h"
-#include "eminline.h"
#include <math.h>
diff --git a/src/emu/audio/generic.h b/src/emu/audio/generic.h
index c8d83ca0ece..319eb2d450f 100644
--- a/src/emu/audio/generic.h
+++ b/src/emu/audio/generic.h
@@ -14,8 +14,6 @@
#ifndef __SOUND_GENERIC_H__
#define __SOUND_GENERIC_H__
-#include "memory.h"
-
/***************************************************************************
diff --git a/src/emu/audit.c b/src/emu/audit.c
index afca856eefe..afe11173ac2 100644
--- a/src/emu/audit.c
+++ b/src/emu/audit.c
@@ -9,8 +9,8 @@
***************************************************************************/
-#include <stdarg.h>
-#include "driver.h"
+#include "emu.h"
+#include "emuopts.h"
#include "hash.h"
#include "audit.h"
#include "harddisk.h"
diff --git a/src/emu/audit.h b/src/emu/audit.h
index 779faf5cacc..10639f1dcc2 100644
--- a/src/emu/audit.h
+++ b/src/emu/audit.h
@@ -14,7 +14,6 @@
#ifndef __AUDIT_H__
#define __AUDIT_H__
-#include "emucore.h"
#include "hash.h"
diff --git a/src/emu/cheat.c b/src/emu/cheat.c
index 91b4a329c73..2e1d7628c60 100644
--- a/src/emu/cheat.c
+++ b/src/emu/cheat.c
@@ -73,7 +73,8 @@
*********************************************************************/
-#include "driver.h"
+#include "emu.h"
+#include "emuopts.h"
#include "xmlfile.h"
#include "ui.h"
#include "uimenu.h"
diff --git a/src/emu/cheat.h b/src/emu/cheat.h
index 5f9af834d85..6d2d99600cd 100644
--- a/src/emu/cheat.h
+++ b/src/emu/cheat.h
@@ -14,8 +14,6 @@
#ifndef __CHEAT_H__
#define __CHEAT_H__
-#include "emucore.h"
-
/***************************************************************************
diff --git a/src/emu/clifront.c b/src/emu/clifront.c
index 4c772a348aa..6701e4f2234 100644
--- a/src/emu/clifront.c
+++ b/src/emu/clifront.c
@@ -9,14 +9,13 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "emuopts.h"
#include "hash.h"
#include "jedparse.h"
#include "audit.h"
#include "info.h"
#include "unzip.h"
-#include "romload.h"
#include "validity.h"
#include "sound/samples.h"
#include "clifront.h"
@@ -671,7 +670,7 @@ int cli_info_listdevices(core_options *options, const char *gamename)
case DEVICE_CLASS_TIMER: printf(" Timer: "); break;
default: printf(" Other: "); break;
}
- printf("%s ('%s')", device_get_name(device), device->tag);
+ printf("%s ('%s')", device_get_name(device), device->tag.cstr());
if (device->clock >= 1000000000)
printf(" @ %d.%02d GHz\n", device->clock / 1000000000, (device->clock / 10000000) % 100);
else if (device->clock >= 1000000)
diff --git a/src/emu/clifront.h b/src/emu/clifront.h
index e48ca62719e..7e60a046183 100644
--- a/src/emu/clifront.h
+++ b/src/emu/clifront.h
@@ -14,6 +14,8 @@
#ifndef __CLIFRONT_H__
#define __CLIFRONT_H__
+#include "options.h"
+
/***************************************************************************
CONSTANTS
diff --git a/src/emu/config.c b/src/emu/config.c
index 72061ce6905..d71ed5c1ef4 100644
--- a/src/emu/config.c
+++ b/src/emu/config.c
@@ -9,7 +9,8 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
+#include "emuopts.h"
#include "config.h"
#include "xmlfile.h"
diff --git a/src/emu/config.h b/src/emu/config.h
index 11d6daa802b..61fb9f58862 100644
--- a/src/emu/config.h
+++ b/src/emu/config.h
@@ -14,8 +14,6 @@
#ifndef __CONFIG_H__
#define __CONFIG_H__
-#include "mame.h"
-#include "input.h"
#include "xmlfile.h"
diff --git a/src/emu/cpu/adsp2100/2100dasm.c b/src/emu/cpu/adsp2100/2100dasm.c
index 75ead4fad40..48bb28e04b6 100644
--- a/src/emu/cpu/adsp2100/2100dasm.c
+++ b/src/emu/cpu/adsp2100/2100dasm.c
@@ -1,3 +1,4 @@
+#include "emu.h"
#include "adsp2100.h"
static const char *const flag_change[] = { "", "TOGGLE %s ", "RESET %s ", "SET %s " };
diff --git a/src/emu/cpu/adsp2100/adsp2100.c b/src/emu/cpu/adsp2100/adsp2100.c
index aabb5349239..d980942a4f5 100644
--- a/src/emu/cpu/adsp2100/adsp2100.c
+++ b/src/emu/cpu/adsp2100/adsp2100.c
@@ -95,9 +95,9 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "adsp2100.h"
-#include <stddef.h>
/***************************************************************************
diff --git a/src/emu/cpu/adsp2100/adsp2100.h b/src/emu/cpu/adsp2100/adsp2100.h
index 625057cbd2c..b45a1b6fc73 100644
--- a/src/emu/cpu/adsp2100/adsp2100.h
+++ b/src/emu/cpu/adsp2100/adsp2100.h
@@ -11,8 +11,6 @@
#ifndef __ADSP2100_H__
#define __ADSP2100_H__
-#include "cpuintrf.h"
-
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/emu/cpu/alph8201/8201dasm.c b/src/emu/cpu/alph8201/8201dasm.c
index e2990a73d37..4cdd76075a0 100644
--- a/src/emu/cpu/alph8201/8201dasm.c
+++ b/src/emu/cpu/alph8201/8201dasm.c
@@ -6,9 +6,9 @@
****************************************************************************/
-#include <ctype.h>
+#include "emu.h"
-#include "cpuintrf.h"
+#include <ctype.h>
typedef unsigned char byte;
diff --git a/src/emu/cpu/alph8201/alph8201.c b/src/emu/cpu/alph8201/alph8201.c
index b0afc3abd12..a1217c7a47e 100644
--- a/src/emu/cpu/alph8201/alph8201.c
+++ b/src/emu/cpu/alph8201/alph8201.c
@@ -147,6 +147,7 @@ Timming
****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "alph8201.h"
diff --git a/src/emu/cpu/alph8201/alph8201.h b/src/emu/cpu/alph8201/alph8201.h
index 43f02a1e264..1e0359c147e 100644
--- a/src/emu/cpu/alph8201/alph8201.h
+++ b/src/emu/cpu/alph8201/alph8201.h
@@ -12,8 +12,6 @@
#ifndef __ALPH8201_H__
#define __ALPH8201_H__
-#include "cpuintrf.h"
-
enum
{
ALPHA8201_PC=1,
diff --git a/src/emu/cpu/apexc/apexc.c b/src/emu/cpu/apexc/apexc.c
index 4ea286612f5..42cfae47304 100644
--- a/src/emu/cpu/apexc/apexc.c
+++ b/src/emu/cpu/apexc/apexc.c
@@ -323,7 +323,7 @@ field: X address D Function Y address D (part 2)
another track.
*/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "apexc.h"
diff --git a/src/emu/cpu/apexc/apexcdsm.c b/src/emu/cpu/apexc/apexcdsm.c
index 63454cafe52..280e183745c 100644
--- a/src/emu/cpu/apexc/apexcdsm.c
+++ b/src/emu/cpu/apexc/apexcdsm.c
@@ -7,7 +7,7 @@
*/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "apexc.h"
diff --git a/src/emu/cpu/arm/arm.c b/src/emu/cpu/arm/arm.c
index 788ca8b6077..c62851325ce 100644
--- a/src/emu/cpu/arm/arm.c
+++ b/src/emu/cpu/arm/arm.c
@@ -15,8 +15,9 @@
*/
-#include "arm.h"
+#include "emu.h"
#include "debugger.h"
+#include "arm.h"
CPU_DISASSEMBLE( arm );
diff --git a/src/emu/cpu/arm/arm.h b/src/emu/cpu/arm/arm.h
index 6d88da7dba4..8b83df0469b 100644
--- a/src/emu/cpu/arm/arm.h
+++ b/src/emu/cpu/arm/arm.h
@@ -3,8 +3,6 @@
#ifndef __ARM_H__
#define __ARM_H__
-#include "cpuintrf.h"
-
/****************************************************************************************************
* INTERRUPT CONSTANTS
***************************************************************************************************/
diff --git a/src/emu/cpu/arm/armdasm.c b/src/emu/cpu/arm/armdasm.c
index 50209a6cf6e..fe1f4132502 100644
--- a/src/emu/cpu/arm/armdasm.c
+++ b/src/emu/cpu/arm/armdasm.c
@@ -4,6 +4,7 @@
(c) 2002-2006 Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino
*/
+#include "emu.h"
#include "arm.h"
static char *WriteImmediateOperand( char *pBuf, UINT32 opcode )
diff --git a/src/emu/cpu/arm7/arm7.c b/src/emu/cpu/arm7/arm7.c
index b5e24575b61..5123c25005b 100644
--- a/src/emu/cpu/arm7/arm7.c
+++ b/src/emu/cpu/arm7/arm7.c
@@ -34,8 +34,9 @@
See the notes in the arm7core.c file itself regarding issues/limitations of the arm7 core.
**
*****************************************************************************/
-#include "arm7.h"
+#include "emu.h"
#include "debugger.h"
+#include "arm7.h"
#include "arm7core.h" //include arm7 core
#if 0
diff --git a/src/emu/cpu/arm7/arm7.h b/src/emu/cpu/arm7/arm7.h
index 99da16bb5a1..fc1a89c70e4 100644
--- a/src/emu/cpu/arm7/arm7.h
+++ b/src/emu/cpu/arm7/arm7.h
@@ -33,7 +33,6 @@
#ifndef __ARM7_H__
#define __ARM7_H__
-#include "cpuintrf.h"
/****************************************************************************************************
* PUBLIC FUNCTIONS
diff --git a/src/emu/cpu/arm7/arm7core.c b/src/emu/cpu/arm7/arm7core.c
index bf2b403db5e..7b41acbb34d 100644
--- a/src/emu/cpu/arm7/arm7core.c
+++ b/src/emu/cpu/arm7/arm7core.c
@@ -77,8 +77,6 @@
By Bryan McPhail (bmcphail@tendril.co.uk) and Phil Stroffolino
*****************************************************************************/
-#include <stdarg.h>
-
#define ARM7_DEBUG_CORE 0
/* Prototypes */
diff --git a/src/emu/cpu/arm7/arm7core.h b/src/emu/cpu/arm7/arm7core.h
index 81bab53ea77..1af9e0060cf 100644
--- a/src/emu/cpu/arm7/arm7core.h
+++ b/src/emu/cpu/arm7/arm7core.h
@@ -33,7 +33,6 @@
#ifndef __ARM7CORE_H__
#define __ARM7CORE_H__
-#include "cpuintrf.h"
/****************************************************************************************************
* INTERRUPT LINES/EXCEPTIONS
diff --git a/src/emu/cpu/arm7/arm7dasm.c b/src/emu/cpu/arm7/arm7dasm.c
index 762fbc8caaa..168aa271c53 100644
--- a/src/emu/cpu/arm7/arm7dasm.c
+++ b/src/emu/cpu/arm7/arm7dasm.c
@@ -32,6 +32,7 @@
* implement the ARM7TDMI guideline format is used
******************************************************************************/
+#include "emu.h"
#include "arm7core.h"
static char *WritePadding( char *pBuf, const char *pBuf0 )
diff --git a/src/emu/cpu/asap/asap.c b/src/emu/cpu/asap/asap.c
index 23850125663..de3b75bbbf3 100644
--- a/src/emu/cpu/asap/asap.c
+++ b/src/emu/cpu/asap/asap.c
@@ -9,6 +9,7 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "asap.h"
diff --git a/src/emu/cpu/asap/asap.h b/src/emu/cpu/asap/asap.h
index 2e5d407eca0..c261b7108a6 100644
--- a/src/emu/cpu/asap/asap.h
+++ b/src/emu/cpu/asap/asap.h
@@ -11,8 +11,6 @@
#ifndef __ASAP_H__
#define __ASAP_H__
-#include "cpuintrf.h"
-
/***************************************************************************
REGISTER ENUMERATION
diff --git a/src/emu/cpu/asap/asapdasm.c b/src/emu/cpu/asap/asapdasm.c
index 6b6a677653a..d88ad7b3a6f 100644
--- a/src/emu/cpu/asap/asapdasm.c
+++ b/src/emu/cpu/asap/asapdasm.c
@@ -6,6 +6,7 @@
***************************************************************************/
+#include "emu.h"
#include "asap.h"
diff --git a/src/emu/cpu/avr8/avr8.c b/src/emu/cpu/avr8/avr8.c
index 780a7bfc990..d810b8cd70e 100644
--- a/src/emu/cpu/avr8/avr8.c
+++ b/src/emu/cpu/avr8/avr8.c
@@ -17,7 +17,7 @@
Written by MooglyGuy
*/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "avr8.h"
diff --git a/src/emu/cpu/avr8/avr8dasm.c b/src/emu/cpu/avr8/avr8dasm.c
index a70483f383a..53487a95a08 100644
--- a/src/emu/cpu/avr8/avr8dasm.c
+++ b/src/emu/cpu/avr8/avr8dasm.c
@@ -4,7 +4,7 @@
Written by MooglyGuy
*/
-#include "cpuintrf.h"
+#include "emu.h"
#include "avr8.h"
#define RD2(op) (((op) >> 4) & 0x0003)
diff --git a/src/emu/cpu/ccpu/ccpu.c b/src/emu/cpu/ccpu/ccpu.c
index c317053aa60..71c153488c7 100644
--- a/src/emu/cpu/ccpu/ccpu.c
+++ b/src/emu/cpu/ccpu/ccpu.c
@@ -8,6 +8,7 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "ccpu.h"
diff --git a/src/emu/cpu/ccpu/ccpu.h b/src/emu/cpu/ccpu/ccpu.h
index 595e9609477..820347b874c 100644
--- a/src/emu/cpu/ccpu/ccpu.h
+++ b/src/emu/cpu/ccpu/ccpu.h
@@ -13,8 +13,6 @@
#ifndef __CCPU_H__
#define __CCPU_H__
-#include "cpuintrf.h"
-
/***************************************************************************
REGISTER ENUMERATION
diff --git a/src/emu/cpu/ccpu/ccpudasm.c b/src/emu/cpu/ccpu/ccpudasm.c
index 2388c52cbb9..24c1107f55d 100644
--- a/src/emu/cpu/ccpu/ccpudasm.c
+++ b/src/emu/cpu/ccpu/ccpudasm.c
@@ -8,6 +8,7 @@
***************************************************************************/
+#include "emu.h"
#include "ccpu.h"
diff --git a/src/emu/cpu/cdp1802/1802dasm.c b/src/emu/cpu/cdp1802/1802dasm.c
index 0851998ebf2..9271c3bcbc6 100644
--- a/src/emu/cpu/cdp1802/1802dasm.c
+++ b/src/emu/cpu/cdp1802/1802dasm.c
@@ -19,7 +19,7 @@
*
*****************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "cdp1802.h"
diff --git a/src/emu/cpu/cdp1802/cdp1802.c b/src/emu/cpu/cdp1802/cdp1802.c
index cbaeb282d6a..2ea8d4bf4a0 100644
--- a/src/emu/cpu/cdp1802/cdp1802.c
+++ b/src/emu/cpu/cdp1802/cdp1802.c
@@ -1,4 +1,4 @@
-#include "driver.h"
+#include "emu.h"
#include "debugger.h"
#include "cdp1802.h"
@@ -923,7 +923,7 @@ static CPU_EXECUTE( cdp1802 )
{
case CDP1802_MODE_LOAD:
// RUN mode cannot be initiated from LOAD mode
- logerror("CDP1802 '%s' Tried to initiate RUN mode from LOAD mode\n", device->tag);
+ logerror("CDP1802 '%s' Tried to initiate RUN mode from LOAD mode\n", device->tag.cstr());
cpustate->mode = CDP1802_MODE_LOAD;
break;
diff --git a/src/emu/cpu/cdp1802/cdp1802.h b/src/emu/cpu/cdp1802/cdp1802.h
index dcbeb879898..58237556799 100644
--- a/src/emu/cpu/cdp1802/cdp1802.h
+++ b/src/emu/cpu/cdp1802/cdp1802.h
@@ -17,9 +17,6 @@
*/
-#include "cpuintrf.h"
-#include "devcb.h"
-
enum
{
CDP1802_INPUT_LINE_INT,
diff --git a/src/emu/cpu/cop400/cop400.c b/src/emu/cpu/cop400/cop400.c
index 65b1718897e..9efc69007cc 100644
--- a/src/emu/cpu/cop400/cop400.c
+++ b/src/emu/cpu/cop400/cop400.c
@@ -64,8 +64,7 @@
*/
-#include "driver.h"
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "cop400.h"
diff --git a/src/emu/cpu/cop400/cop410ds.c b/src/emu/cpu/cop400/cop410ds.c
index 2fb7975d2e5..9680c10cf0b 100644
--- a/src/emu/cpu/cop400/cop410ds.c
+++ b/src/emu/cpu/cop400/cop410ds.c
@@ -9,7 +9,7 @@
***************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
CPU_DISASSEMBLE( cop410 )
{
diff --git a/src/emu/cpu/cop400/cop420ds.c b/src/emu/cpu/cop400/cop420ds.c
index 038cb432e43..9ed207ea66a 100644
--- a/src/emu/cpu/cop400/cop420ds.c
+++ b/src/emu/cpu/cop400/cop420ds.c
@@ -9,7 +9,7 @@
***************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
CPU_DISASSEMBLE( cop420 )
{
diff --git a/src/emu/cpu/cop400/cop440ds.c b/src/emu/cpu/cop400/cop440ds.c
index ba63973868c..05e47e3bd4b 100644
--- a/src/emu/cpu/cop400/cop440ds.c
+++ b/src/emu/cpu/cop400/cop440ds.c
@@ -9,7 +9,7 @@
***************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
CPU_DISASSEMBLE( cop444 )
{
diff --git a/src/emu/cpu/cp1610/1610dasm.c b/src/emu/cpu/cp1610/1610dasm.c
index 88d07b37ce8..573c63f4dba 100644
--- a/src/emu/cpu/cp1610/1610dasm.c
+++ b/src/emu/cpu/cp1610/1610dasm.c
@@ -1,4 +1,4 @@
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "cp1610.h"
diff --git a/src/emu/cpu/cp1610/cp1610.c b/src/emu/cpu/cp1610/cp1610.c
index 2035dc696a1..51882c29eee 100644
--- a/src/emu/cpu/cp1610/cp1610.c
+++ b/src/emu/cpu/cp1610/cp1610.c
@@ -21,7 +21,7 @@
*
*****************************************************************************/
-#include "cpuexec.h"
+#include "emu.h"
#include "debugger.h"
#include "cp1610.h"
diff --git a/src/emu/cpu/cp1610/cp1610.h b/src/emu/cpu/cp1610/cp1610.h
index 2965b90970f..fc8d5eccda6 100644
--- a/src/emu/cpu/cp1610/cp1610.h
+++ b/src/emu/cpu/cp1610/cp1610.h
@@ -22,8 +22,6 @@
#ifndef __CP1610_H__
#define __CP1610_H__
-#include "cpuintrf.h"
-
enum
{
CP1610_R0=1, CP1610_R1, CP1610_R2, CP1610_R3,
diff --git a/src/emu/cpu/cubeqcpu/cubedasm.c b/src/emu/cpu/cubeqcpu/cubedasm.c
index 0e7fc64d40b..8a808fd9e95 100644
--- a/src/emu/cpu/cubeqcpu/cubedasm.c
+++ b/src/emu/cpu/cubeqcpu/cubedasm.c
@@ -6,9 +6,8 @@
***************************************************************************/
-#include "debugger.h"
+#include "emu.h"
#include "cubeqcpu.h"
-#include "driver.h"
/***************************************************************************
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.c b/src/emu/cpu/cubeqcpu/cubeqcpu.c
index f52ae9379f7..32db0c2e997 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.c
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.c
@@ -10,9 +10,9 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "cubeqcpu.h"
-#include "driver.h"
CPU_DISASSEMBLE( cquestsnd );
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.h b/src/emu/cpu/cubeqcpu/cubeqcpu.h
index 5f1d0d9fbf5..0aec41a4edc 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.h
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.h
@@ -9,8 +9,6 @@
#ifndef _CUBEQCPU_H
#define _CUBEQCPU_H
-#include "cpuintrf.h"
-
/***************************************************************************
COMPILE-TIME DEFINITIONS
diff --git a/src/emu/cpu/drcbec.c b/src/emu/cpu/drcbec.c
index 73a05902c15..5a0b707f38c 100644
--- a/src/emu/cpu/drcbec.c
+++ b/src/emu/cpu/drcbec.c
@@ -10,11 +10,10 @@
***************************************************************************/
+#include "emu.h"
+#include "debugger.h"
#include "drcuml.h"
#include "drcbeut.h"
-#include "eminline.h"
-#include "debugger.h"
-#include <math.h>
#ifdef _MSC_VER
#include <float.h>
diff --git a/src/emu/cpu/drcbeut.c b/src/emu/cpu/drcbeut.c
index 8c98bfb32e7..67fd333bed2 100644
--- a/src/emu/cpu/drcbeut.c
+++ b/src/emu/cpu/drcbeut.c
@@ -10,6 +10,7 @@
***************************************************************************/
+#include "emu.h"
#include "drcbeut.h"
diff --git a/src/emu/cpu/drcbex64.c b/src/emu/cpu/drcbex64.c
index 463a38110c5..6da8aa2024a 100644
--- a/src/emu/cpu/drcbex64.c
+++ b/src/emu/cpu/drcbex64.c
@@ -168,14 +168,12 @@
***************************************************************************/
+#include "emu.h"
+#include "debugger.h"
#include "drcuml.h"
#include "drcbeut.h"
-#include "debugger.h"
#include "x86emit.h"
-#include "eminline.h"
#include "x86log.h"
-#include <math.h>
-#include <stddef.h>
diff --git a/src/emu/cpu/drcbex86.c b/src/emu/cpu/drcbex86.c
index 99c8aeeb77b..2581c99aed4 100644
--- a/src/emu/cpu/drcbex86.c
+++ b/src/emu/cpu/drcbex86.c
@@ -84,14 +84,12 @@
***************************************************************************/
+#include "emu.h"
+#include "debugger.h"
#include "drcuml.h"
#include "drcbeut.h"
-#include "debugger.h"
#include "x86emit.h"
-#include "eminline.h"
#include "x86log.h"
-#include <math.h>
-#include <stddef.h>
diff --git a/src/emu/cpu/drccache.c b/src/emu/cpu/drccache.c
index d0356e2853f..fbb424b15ed 100644
--- a/src/emu/cpu/drccache.c
+++ b/src/emu/cpu/drccache.c
@@ -10,8 +10,7 @@
***************************************************************************/
-#include <stddef.h>
-#include "cpuintrf.h"
+#include "emu.h"
#include "drccache.h"
diff --git a/src/emu/cpu/drcfe.c b/src/emu/cpu/drcfe.c
index 0be7c4c65a9..28c97311968 100644
--- a/src/emu/cpu/drcfe.c
+++ b/src/emu/cpu/drcfe.c
@@ -17,9 +17,7 @@
***************************************************************************/
-#include <stddef.h>
-#include "cpuintrf.h"
-#include "mame.h"
+#include "emu.h"
#include "drcfe.h"
diff --git a/src/emu/cpu/drcuml.c b/src/emu/cpu/drcuml.c
index d0ecfd2066c..9ab8b2870ff 100644
--- a/src/emu/cpu/drcuml.c
+++ b/src/emu/cpu/drcuml.c
@@ -36,11 +36,9 @@
***************************************************************************/
+#include "emu.h"
#include "drcuml.h"
#include "drcumlsh.h"
-#include "eminline.h"
-#include "mame.h"
-#include <stdarg.h>
#include <setjmp.h>
diff --git a/src/emu/cpu/drcuml.h b/src/emu/cpu/drcuml.h
index 0352ff480df..b0c40727d63 100644
--- a/src/emu/cpu/drcuml.h
+++ b/src/emu/cpu/drcuml.h
@@ -15,7 +15,6 @@
#ifndef __DRCUML_H__
#define __DRCUML_H__
-#include "cpuintrf.h"
#include "drccache.h"
#include <setjmp.h>
diff --git a/src/emu/cpu/dsp32/dsp32.c b/src/emu/cpu/dsp32/dsp32.c
index 2e67a012576..f951c8b00e7 100644
--- a/src/emu/cpu/dsp32/dsp32.c
+++ b/src/emu/cpu/dsp32/dsp32.c
@@ -27,6 +27,7 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "dsp32.h"
diff --git a/src/emu/cpu/dsp32/dsp32.h b/src/emu/cpu/dsp32/dsp32.h
index a043853471f..fe633bb0a68 100644
--- a/src/emu/cpu/dsp32/dsp32.h
+++ b/src/emu/cpu/dsp32/dsp32.h
@@ -9,10 +9,7 @@
#pragma once
#ifndef __DSP32_H__
-#define _DSP32_H
-
-#include "cpuintrf.h"
-
+#define __DSP32_H__
/***************************************************************************
diff --git a/src/emu/cpu/dsp32/dsp32dis.c b/src/emu/cpu/dsp32/dsp32dis.c
index 2354c380479..80d0c2ea11a 100644
--- a/src/emu/cpu/dsp32/dsp32dis.c
+++ b/src/emu/cpu/dsp32/dsp32dis.c
@@ -6,6 +6,7 @@
***************************************************************************/
+#include "emu.h"
#include "dsp32.h"
diff --git a/src/emu/cpu/dsp56k/dsp56dsm.c b/src/emu/cpu/dsp56k/dsp56dsm.c
index 9ed61a38f66..80537190db7 100644
--- a/src/emu/cpu/dsp56k/dsp56dsm.c
+++ b/src/emu/cpu/dsp56k/dsp56dsm.c
@@ -12,6 +12,7 @@
and need to be tested on real hardware before this disassembler is considered 100% complete.
*/
+#include "emu.h"
#include "dsp56k.h"
/*******************/
diff --git a/src/emu/cpu/dsp56k/dsp56k.c b/src/emu/cpu/dsp56k/dsp56k.c
index 524df464b1f..0152c85b6b0 100644
--- a/src/emu/cpu/dsp56k/dsp56k.c
+++ b/src/emu/cpu/dsp56k/dsp56k.c
@@ -29,6 +29,7 @@
- 1-21 Vectored exception requests on the Host Interface!
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "dsp56k.h"
diff --git a/src/emu/cpu/dsp56k/dsp56k.h b/src/emu/cpu/dsp56k/dsp56k.h
index af6c580e1d6..41d10458ade 100644
--- a/src/emu/cpu/dsp56k/dsp56k.h
+++ b/src/emu/cpu/dsp56k/dsp56k.h
@@ -12,7 +12,6 @@
#ifndef __DSP56K_H__
#define __DSP56K_H__
-#include "cpuintrf.h"
/***************************************************************************
REGISTER ENUMERATION
diff --git a/src/emu/cpu/e132xs/32xsdasm.c b/src/emu/cpu/e132xs/32xsdasm.c
index 537e230ba5b..fa89acc69f4 100644
--- a/src/emu/cpu/e132xs/32xsdasm.c
+++ b/src/emu/cpu/e132xs/32xsdasm.c
@@ -5,7 +5,7 @@
*/
-#include <math.h>
+#include "emu.h"
#include "debugger.h"
#include "e132xs.h"
diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c
index 8a70742ea1d..45ad01f1d5f 100644
--- a/src/emu/cpu/e132xs/e132xs.c
+++ b/src/emu/cpu/e132xs/e132xs.c
@@ -211,9 +211,8 @@
*********************************************************************/
+#include "emu.h"
#include "debugger.h"
-#include "cpuexec.h"
-#include "eminline.h"
#include "e132xs.h"
#ifdef MAME_DEBUG
diff --git a/src/emu/cpu/e132xs/e132xs.h b/src/emu/cpu/e132xs/e132xs.h
index 300fbec2e2b..f564675fdf6 100644
--- a/src/emu/cpu/e132xs/e132xs.h
+++ b/src/emu/cpu/e132xs/e132xs.h
@@ -3,7 +3,6 @@
#ifndef __E132XS_H__
#define __E132XS_H__
-#include "cpuintrf.h"
/*
A note about clock multipliers and dividers:
diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c
index 89cbe3d2d8a..591a11091c7 100644
--- a/src/emu/cpu/esrip/esrip.c
+++ b/src/emu/cpu/esrip/esrip.c
@@ -7,6 +7,7 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "esrip.h"
diff --git a/src/emu/cpu/esrip/esrip.h b/src/emu/cpu/esrip/esrip.h
index 487559b4539..70826681261 100644
--- a/src/emu/cpu/esrip/esrip.h
+++ b/src/emu/cpu/esrip/esrip.h
@@ -9,8 +9,6 @@
#ifndef _ESRIP_H
#define _ESRIP_H
-#include "cpuintrf.h"
-
/***************************************************************************
COMPILE-TIME DEFINITIONS
diff --git a/src/emu/cpu/esrip/esripdsm.c b/src/emu/cpu/esrip/esripdsm.c
index 1e389007041..84f8882ad72 100644
--- a/src/emu/cpu/esrip/esripdsm.c
+++ b/src/emu/cpu/esrip/esripdsm.c
@@ -7,6 +7,7 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
diff --git a/src/emu/cpu/f8/f8.c b/src/emu/cpu/f8/f8.c
index 5b179dcdcdf..5509a9d80cf 100644
--- a/src/emu/cpu/f8/f8.c
+++ b/src/emu/cpu/f8/f8.c
@@ -26,6 +26,7 @@
added interrupt functionality
*/
+#include "emu.h"
#include "debugger.h"
#include "f8.h"
diff --git a/src/emu/cpu/f8/f8.h b/src/emu/cpu/f8/f8.h
index c48d710f7dd..22f62b16660 100644
--- a/src/emu/cpu/f8/f8.h
+++ b/src/emu/cpu/f8/f8.h
@@ -24,7 +24,6 @@
#ifndef __F8_H__
#define _F8_H
-#include "cpuintrf.h"
#ifdef __cplusplus
extern "C" {
diff --git a/src/emu/cpu/f8/f8dasm.c b/src/emu/cpu/f8/f8dasm.c
index a037792248b..ad21ab43ec6 100644
--- a/src/emu/cpu/f8/f8dasm.c
+++ b/src/emu/cpu/f8/f8dasm.c
@@ -1,4 +1,4 @@
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "f8.h"
diff --git a/src/emu/cpu/g65816/g65816.c b/src/emu/cpu/g65816/g65816.c
index 24f8f9fa8cf..97bfeba13db 100644
--- a/src/emu/cpu/g65816/g65816.c
+++ b/src/emu/cpu/g65816/g65816.c
@@ -88,6 +88,7 @@ TODO general:
/* ================================= DATA ================================= */
/* ======================================================================== */
+#include "emu.h"
#include "g65816.h"
INLINE g65816i_cpu_struct *get_safe_token(const device_config *device)
diff --git a/src/emu/cpu/g65816/g65816.h b/src/emu/cpu/g65816/g65816.h
index c58144e3f25..afb34596676 100644
--- a/src/emu/cpu/g65816/g65816.h
+++ b/src/emu/cpu/g65816/g65816.h
@@ -3,8 +3,6 @@
#ifndef __G65816_H__
#define __G65816_H__
-#include "cpuintrf.h"
-#include "debugger.h"
#include "g65816cm.h"
/* ======================================================================== */
diff --git a/src/emu/cpu/g65816/g65816cm.h b/src/emu/cpu/g65816/g65816cm.h
index 97629f925bc..bf34cf1b20c 100644
--- a/src/emu/cpu/g65816/g65816cm.h
+++ b/src/emu/cpu/g65816/g65816cm.h
@@ -3,7 +3,6 @@
#ifndef __G65816CM_H__
#define __G65816CM_H__
-#include "cpuexec.h"
#define g65816i_branching(A)
#define g65816i_jumping(A)
diff --git a/src/emu/cpu/g65816/g65816ds.c b/src/emu/cpu/g65816/g65816ds.c
index 560294be2b7..545132b46e2 100644
--- a/src/emu/cpu/g65816/g65816ds.c
+++ b/src/emu/cpu/g65816/g65816ds.c
@@ -16,7 +16,7 @@ author (Karl Stenerud) at karl@higashiyama-unet.ocn.ne.jp.
*/
-#include "cpuintrf.h"
+#include "emu.h"
#include "g65816ds.h"
#ifdef SEC
diff --git a/src/emu/cpu/g65816/g65816o0.c b/src/emu/cpu/g65816/g65816o0.c
index af30b89cf35..38872d15915 100644
--- a/src/emu/cpu/g65816/g65816o0.c
+++ b/src/emu/cpu/g65816/g65816o0.c
@@ -1,3 +1,5 @@
+#include "emu.h"
+#include "debugger.h"
#include "g65816.h"
#include "g65816cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M0X0
diff --git a/src/emu/cpu/g65816/g65816o1.c b/src/emu/cpu/g65816/g65816o1.c
index 09bac5aed47..8c31596c947 100644
--- a/src/emu/cpu/g65816/g65816o1.c
+++ b/src/emu/cpu/g65816/g65816o1.c
@@ -1,3 +1,5 @@
+#include "emu.h"
+#include "debugger.h"
#include "g65816.h"
#include "g65816cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M0X1
diff --git a/src/emu/cpu/g65816/g65816o2.c b/src/emu/cpu/g65816/g65816o2.c
index 96285a9c500..bc8c0103abd 100644
--- a/src/emu/cpu/g65816/g65816o2.c
+++ b/src/emu/cpu/g65816/g65816o2.c
@@ -1,3 +1,5 @@
+#include "emu.h"
+#include "debugger.h"
#include "g65816.h"
#include "g65816cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M1X0
diff --git a/src/emu/cpu/g65816/g65816o3.c b/src/emu/cpu/g65816/g65816o3.c
index c310db777a3..d2b8697efe6 100644
--- a/src/emu/cpu/g65816/g65816o3.c
+++ b/src/emu/cpu/g65816/g65816o3.c
@@ -1,3 +1,5 @@
+#include "emu.h"
+#include "debugger.h"
#include "g65816.h"
#include "g65816cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M1X1
diff --git a/src/emu/cpu/g65816/g65816o4.c b/src/emu/cpu/g65816/g65816o4.c
index 53b09053695..a66ba011d38 100644
--- a/src/emu/cpu/g65816/g65816o4.c
+++ b/src/emu/cpu/g65816/g65816o4.c
@@ -1,3 +1,5 @@
+#include "emu.h"
+#include "debugger.h"
#include "g65816.h"
#include "g65816cm.h"
#define EXECUTION_MODE EXECUTION_MODE_E
diff --git a/src/emu/cpu/h6280/6280dasm.c b/src/emu/cpu/h6280/6280dasm.c
index c1fcfb247ec..e20f831766f 100644
--- a/src/emu/cpu/h6280/6280dasm.c
+++ b/src/emu/cpu/h6280/6280dasm.c
@@ -16,7 +16,7 @@
******************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#define RDOP(addr) (oprom[addr - pc])
#define RDBYTE(addr) (opram[addr - pc])
diff --git a/src/emu/cpu/h6280/h6280.c b/src/emu/cpu/h6280/h6280.c
index 3032fb8046d..7531c1803ac 100644
--- a/src/emu/cpu/h6280/h6280.c
+++ b/src/emu/cpu/h6280/h6280.c
@@ -108,6 +108,7 @@
******************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "h6280.h"
diff --git a/src/emu/cpu/h6280/h6280.h b/src/emu/cpu/h6280/h6280.h
index 3f40ddcf03e..8fc4068ea6f 100644
--- a/src/emu/cpu/h6280/h6280.h
+++ b/src/emu/cpu/h6280/h6280.h
@@ -15,7 +15,6 @@
#ifndef __H6280_H__
#define __H6280_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/h83002/h8.h b/src/emu/cpu/h83002/h8.h
index 9080b9ce4c1..d867ca62676 100644
--- a/src/emu/cpu/h83002/h8.h
+++ b/src/emu/cpu/h83002/h8.h
@@ -9,7 +9,6 @@
#ifndef __H83002_H__
#define __H83002_H__
-#include "cpuintrf.h"
#define IFLAG 0x80
#define UIFLAG 0x40
diff --git a/src/emu/cpu/h83002/h8_16.c b/src/emu/cpu/h83002/h8_16.c
index 9020a655795..5f8ab2184d2 100644
--- a/src/emu/cpu/h83002/h8_16.c
+++ b/src/emu/cpu/h83002/h8_16.c
@@ -13,6 +13,7 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "h8.h"
#include "h8priv.h"
diff --git a/src/emu/cpu/h83002/h8_8.c b/src/emu/cpu/h83002/h8_8.c
index 2a083196ef2..50d8693d1f1 100644
--- a/src/emu/cpu/h83002/h8_8.c
+++ b/src/emu/cpu/h83002/h8_8.c
@@ -9,6 +9,7 @@
****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "h8.h"
#include "h8priv.h"
diff --git a/src/emu/cpu/h83002/h8disasm.c b/src/emu/cpu/h83002/h8disasm.c
index d7c77d27335..8370f992a32 100644
--- a/src/emu/cpu/h83002/h8disasm.c
+++ b/src/emu/cpu/h83002/h8disasm.c
@@ -8,6 +8,7 @@
****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "h8.h"
diff --git a/src/emu/cpu/h83002/h8periph.c b/src/emu/cpu/h83002/h8periph.c
index 29bc6e7382f..dcc239b65fd 100644
--- a/src/emu/cpu/h83002/h8periph.c
+++ b/src/emu/cpu/h83002/h8periph.c
@@ -8,8 +8,8 @@
****************************************************************************/
+#include "emu.h"
#include "debugger.h"
-#include "cpuexec.h"
#include "h8.h"
#include "h8priv.h"
@@ -749,7 +749,7 @@ UINT8 h8_3007_register1_read8(h83xx_state *h8, UINT32 address)
case 0xfee018: return h8->per_regs[0xF8]; // IPRA
}
- logerror("cpu '%s' (PC=%08X): unmapped I/O(1) byte read from %08X\n",h8->device->tag,h8->pc,address);
+ logerror("cpu '%s' (PC=%08X): unmapped I/O(1) byte read from %08X\n",h8->device->tag.cstr(),h8->pc,address);
return 0;
}
@@ -761,7 +761,7 @@ void h8_3007_register1_write8(h83xx_state *h8, UINT32 address, UINT8 val)
case 0xfee016: h8_ISR_w(h8, val); return; // ISR
case 0xfee018: h8->per_regs[0xF8] = val; return; // IPRA
}
- logerror("cpu '%s' (PC=%08X): unmapped I/O(1) byte write to %08X = %02X\n",h8->device->tag,h8->pc,address,val);
+ logerror("cpu '%s' (PC=%08X): unmapped I/O(1) byte write to %08X = %02X\n",h8->device->tag.cstr(),h8->pc,address,val);
}
void h8_3007_itu_init(h83xx_state *h8)
diff --git a/src/emu/cpu/hd6309/6309dasm.c b/src/emu/cpu/hd6309/6309dasm.c
index dda24be2645..f15405368c5 100644
--- a/src/emu/cpu/hd6309/6309dasm.c
+++ b/src/emu/cpu/hd6309/6309dasm.c
@@ -20,6 +20,7 @@
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "hd6309.h"
diff --git a/src/emu/cpu/hd6309/hd6309.c b/src/emu/cpu/hd6309/hd6309.c
index 7e710a2f511..9a3ff66cd1b 100644
--- a/src/emu/cpu/hd6309/hd6309.c
+++ b/src/emu/cpu/hd6309/hd6309.c
@@ -102,6 +102,7 @@
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "hd6309.h"
@@ -583,7 +584,7 @@ static void set_irq_line(m68_state_t *m68_state, int irqline, int state)
{
if (m68_state->nmi_state == state) return;
m68_state->nmi_state = state;
- LOG(("HD6309 '%s' set_irq_line (NMI) %d (PC=%4.4X)\n", m68_state->device->tag, state, pPC.d));
+ LOG(("HD6309 '%s' set_irq_line (NMI) %d (PC=%4.4X)\n", m68_state->device->tag.cstr(), state, pPC.d));
if( state == CLEAR_LINE ) return;
/* if the stack was not yet initialized */
@@ -621,7 +622,7 @@ static void set_irq_line(m68_state_t *m68_state, int irqline, int state)
}
else if (irqline < 2)
{
- LOG(("HD6309 '%s' set_irq_line %d, %d (PC=%4.4X)\n", m68_state->device->tag, irqline, state, pPC.d));
+ LOG(("HD6309 '%s' set_irq_line %d, %d (PC=%4.4X)\n", m68_state->device->tag.cstr(), irqline, state, pPC.d));
m68_state->irq_state[irqline] = state;
if (state == CLEAR_LINE) return;
check_irq_lines(m68_state);
diff --git a/src/emu/cpu/hd6309/hd6309.h b/src/emu/cpu/hd6309/hd6309.h
index beffe8cf995..91898fd6ab0 100644
--- a/src/emu/cpu/hd6309/hd6309.h
+++ b/src/emu/cpu/hd6309/hd6309.h
@@ -5,7 +5,6 @@
#ifndef __HD6309_H__
#define __HD6309_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/i386/i386.c b/src/emu/cpu/i386/i386.c
index 7067677af89..8165f83472b 100644
--- a/src/emu/cpu/i386/i386.c
+++ b/src/emu/cpu/i386/i386.c
@@ -10,6 +10,7 @@
Cyrix MediaGX
*/
+#include "emu.h"
#include "debugger.h"
#include "i386priv.h"
#include "i386.h"
diff --git a/src/emu/cpu/i386/i386.h b/src/emu/cpu/i386/i386.h
index 9244c27b81f..548441b0e3b 100644
--- a/src/emu/cpu/i386/i386.h
+++ b/src/emu/cpu/i386/i386.h
@@ -5,7 +5,6 @@
#define INPUT_LINE_A20 1
-#include "cpuintrf.h"
// mingw has this defined for 32-bit compiles
#undef i386
diff --git a/src/emu/cpu/i386/i386dasm.c b/src/emu/cpu/i386/i386dasm.c
index d27c4dc3c95..d11be0ddc21 100644
--- a/src/emu/cpu/i386/i386dasm.c
+++ b/src/emu/cpu/i386/i386dasm.c
@@ -4,7 +4,7 @@
Written by Ville Linde
*/
-#include "cpuintrf.h"
+#include "emu.h"
enum
{
diff --git a/src/emu/cpu/i386/i386priv.h b/src/emu/cpu/i386/i386priv.h
index 9c94078df4d..4b5c37288ec 100644
--- a/src/emu/cpu/i386/i386priv.h
+++ b/src/emu/cpu/i386/i386priv.h
@@ -4,7 +4,6 @@
#define __I386_H__
#include "i386.h"
-#include "cpuintrf.h"
#define I386OP(XX) i386_##XX
#define I486OP(XX) i486_##XX
diff --git a/src/emu/cpu/i4004/4004dasm.c b/src/emu/cpu/i4004/4004dasm.c
index 1e5a478b231..bf94e274e92 100644
--- a/src/emu/cpu/i4004/4004dasm.c
+++ b/src/emu/cpu/i4004/4004dasm.c
@@ -8,7 +8,7 @@
*
*****************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#define OP(A) oprom[(A) - PC]
#define ARG(A) opram[(A) - PC]
diff --git a/src/emu/cpu/i4004/i4004.c b/src/emu/cpu/i4004/i4004.c
index ed88991b53b..180dd6cad37 100644
--- a/src/emu/cpu/i4004/i4004.c
+++ b/src/emu/cpu/i4004/i4004.c
@@ -7,6 +7,7 @@
* Initial version by Miodrag Milanovic
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "i4004.h"
diff --git a/src/emu/cpu/i4004/i4004.h b/src/emu/cpu/i4004/i4004.h
index ac974efc4f2..3c5fba3dfeb 100644
--- a/src/emu/cpu/i4004/i4004.h
+++ b/src/emu/cpu/i4004/i4004.h
@@ -1,7 +1,6 @@
#ifndef __I4004_H__
#define __I4004_H__
-#include "cpuintrf.h"
/***************************************************************************
diff --git a/src/emu/cpu/i8008/8008dasm.c b/src/emu/cpu/i8008/8008dasm.c
index eb10e391786..50cb5d7b994 100644
--- a/src/emu/cpu/i8008/8008dasm.c
+++ b/src/emu/cpu/i8008/8008dasm.c
@@ -8,7 +8,7 @@
*
*****************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#define OP(A) oprom[(A) - PC]
#define ARG(A) opram[(A) - PC]
diff --git a/src/emu/cpu/i8008/i8008.c b/src/emu/cpu/i8008/i8008.c
index 90978c29e5c..b0bca7cb967 100644
--- a/src/emu/cpu/i8008/i8008.c
+++ b/src/emu/cpu/i8008/i8008.c
@@ -7,6 +7,7 @@
* Initial version by Miodrag Milanovic
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "i8008.h"
diff --git a/src/emu/cpu/i8008/i8008.h b/src/emu/cpu/i8008/i8008.h
index 5687bb03cf4..81083179fc8 100644
--- a/src/emu/cpu/i8008/i8008.h
+++ b/src/emu/cpu/i8008/i8008.h
@@ -1,7 +1,6 @@
#ifndef __I8008_H__
#define __I8008_H__
-#include "cpuintrf.h"
/***************************************************************************
diff --git a/src/emu/cpu/i8085/8085dasm.c b/src/emu/cpu/i8085/8085dasm.c
index 53a871d61f3..5ce3d81dc58 100644
--- a/src/emu/cpu/i8085/8085dasm.c
+++ b/src/emu/cpu/i8085/8085dasm.c
@@ -42,7 +42,7 @@
*
*****************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
/* 8080/8085A mnemonics were more irritation than information
What would you guess "CP $3456" to mean? It's not compare,
diff --git a/src/emu/cpu/i8085/i8085.c b/src/emu/cpu/i8085/i8085.c
index a4d14f51e7c..bb008e29052 100644
--- a/src/emu/cpu/i8085/i8085.c
+++ b/src/emu/cpu/i8085/i8085.c
@@ -139,6 +139,7 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "i8085.h"
#include "i8085cpu.h"
diff --git a/src/emu/cpu/i8085/i8085.h b/src/emu/cpu/i8085/i8085.h
index f6b077ec198..3fb704c839a 100644
--- a/src/emu/cpu/i8085/i8085.h
+++ b/src/emu/cpu/i8085/i8085.h
@@ -1,8 +1,6 @@
#ifndef __I8085_H__
#define __I8085_H__
-#include "cpuintrf.h"
-#include "devcb.h"
/***************************************************************************
CONSTANTS
diff --git a/src/emu/cpu/i86/host.h b/src/emu/cpu/i86/host.h
index 44c8c48c621..c31cd8b20c1 100644
--- a/src/emu/cpu/i86/host.h
+++ b/src/emu/cpu/i86/host.h
@@ -4,7 +4,6 @@
/*#define BIGCASE*/
-#include "cpuintrf.h"
typedef UINT8 BOOLEAN;
diff --git a/src/emu/cpu/i86/i286.c b/src/emu/cpu/i86/i286.c
index 199b8be6484..b8f5cd4d5f9 100644
--- a/src/emu/cpu/i86/i286.c
+++ b/src/emu/cpu/i86/i286.c
@@ -3,6 +3,7 @@
* (initial work based on David Hedley's pcemu) *
****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "host.h"
diff --git a/src/emu/cpu/i86/i86.c b/src/emu/cpu/i86/i86.c
index 89d98c1e51d..dbd170d9e4e 100644
--- a/src/emu/cpu/i86/i86.c
+++ b/src/emu/cpu/i86/i86.c
@@ -4,8 +4,8 @@
****************************************************************************/
/* 26.March 2000 PeT changed set_irq_line */
+#include "emu.h"
#include "debugger.h"
-#include "cpuintrf.h"
#include "host.h"
#include "i86priv.h"
diff --git a/src/emu/cpu/i86/i86.h b/src/emu/cpu/i86/i86.h
index 893df00ad73..4b7ac5a6834 100644
--- a/src/emu/cpu/i86/i86.h
+++ b/src/emu/cpu/i86/i86.h
@@ -4,7 +4,6 @@
#ifndef __I86INTF_H__
#define __I86INTF_H__
-#include "cpuintrf.h"
#define INPUT_LINE_TEST 20 /* PJB 03/05 */
diff --git a/src/emu/cpu/i860/i860.c b/src/emu/cpu/i860/i860.c
index 173e2e2d0e5..0645696fa7b 100644
--- a/src/emu/cpu/i860/i860.c
+++ b/src/emu/cpu/i860/i860.c
@@ -18,6 +18,7 @@ TODO: Separate out i860XR and i860XP (make different types, etc).
Hook IRQ lines into MAME core (they're custom functions atm).
*/
+#include "emu.h"
#include "debugger.h"
#include "i860.h"
diff --git a/src/emu/cpu/i860/i860.h b/src/emu/cpu/i860/i860.h
index 968d1015214..a2210188195 100644
--- a/src/emu/cpu/i860/i860.h
+++ b/src/emu/cpu/i860/i860.h
@@ -18,8 +18,6 @@
#ifndef __I860_H__
#define __I860_H__
-#include "cpuintrf.h"
-#include "debugger.h"
/***************************************************************************
REGISTER ENUMERATION
diff --git a/src/emu/cpu/i860/i860dec.c b/src/emu/cpu/i860/i860dec.c
index d7485ccd61d..8533f17377c 100644
--- a/src/emu/cpu/i860/i860dec.c
+++ b/src/emu/cpu/i860/i860dec.c
@@ -4437,7 +4437,7 @@ void reset_i860 (i860s *cpustate)
/* MAME execution hook for i860 emulator. */
/*=================================================================*/
-#include "cpuintrf.h"
+#include "emu.h"
static CPU_EXECUTE( i860 )
{
@@ -4465,13 +4465,13 @@ static CPU_EXECUTE( i860 )
if (cpustate->pc == 0xfffc0370 ||
cpustate->pc == 0xfffc03a4)
{
- fprintf(stderr, "(%s) 0x%08x: snag 0x20000000\n", cpustate->device->tag, cpustate->pc);
+ fprintf(stderr, "(%s) 0x%08x: snag 0x20000000\n", cpustate->device->tag.cstr(), cpustate->pc);
cpustate->single_stepping = 0;
}
else if (cpustate->pc == 0xfffc0384 ||
cpustate->pc == 0xfffc03b8)
{
- fprintf(stderr, "(%s) 0x%08x: passed 0x20000000\n", cpustate->device->tag, cpustate->pc);
+ fprintf(stderr, "(%s) 0x%08x: passed 0x20000000\n", cpustate->device->tag.cstr(), cpustate->pc);
cpustate->single_stepping = 0;
}
#endif
@@ -4551,7 +4551,7 @@ static void disasm (i860s *cpustate, UINT32 addr, int len)
/* Note that we print the incoming (possibly virtual) address as the
PC rather than the translated address. */
- fprintf (stderr, " (%s) 0x%08x: ", cpustate->device->tag, addr);
+ fprintf (stderr, " (%s) 0x%08x: ", cpustate->device->tag.cstr(), addr);
insn = memory_read_dword_64le(cpustate->program, phys_addr);
#ifdef HOST_MSB
BYTE_REV32 (insn);
diff --git a/src/emu/cpu/i860/i860dis.c b/src/emu/cpu/i860/i860dis.c
index e26ab7308bd..d5f2497b797 100644
--- a/src/emu/cpu/i860/i860dis.c
+++ b/src/emu/cpu/i860/i860dis.c
@@ -13,6 +13,7 @@
***************************************************************************/
+#include "emu.h"
#include "i860.h"
#include <string.h>
diff --git a/src/emu/cpu/i960/i960.c b/src/emu/cpu/i960/i960.c
index b6f0264a781..66c16bf0418 100644
--- a/src/emu/cpu/i960/i960.c
+++ b/src/emu/cpu/i960/i960.c
@@ -1,6 +1,6 @@
+#include "emu.h"
#include "debugger.h"
#include "i960.h"
-#include <math.h>
CPU_DISASSEMBLE( i960 );
diff --git a/src/emu/cpu/i960/i960.h b/src/emu/cpu/i960/i960.h
index 4ea749be825..7afc616488b 100644
--- a/src/emu/cpu/i960/i960.h
+++ b/src/emu/cpu/i960/i960.h
@@ -3,7 +3,6 @@
#ifndef __I960_H__
#define __I960_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/i960/i960dis.c b/src/emu/cpu/i960/i960dis.c
index fb271953236..13e2f91760c 100644
--- a/src/emu/cpu/i960/i960dis.c
+++ b/src/emu/cpu/i960/i960dis.c
@@ -4,6 +4,7 @@
By Farfetch'd and R. Belmont
*/
+#include "emu.h"
#include "i960.h"
#include "i960dis.h"
diff --git a/src/emu/cpu/jaguar/jagdasm.c b/src/emu/cpu/jaguar/jagdasm.c
index 060a780b1e4..cc0a8f678b0 100644
--- a/src/emu/cpu/jaguar/jagdasm.c
+++ b/src/emu/cpu/jaguar/jagdasm.c
@@ -6,6 +6,7 @@
***************************************************************************/
+#include "emu.h"
#include "jaguar.h"
diff --git a/src/emu/cpu/jaguar/jaguar.c b/src/emu/cpu/jaguar/jaguar.c
index f272a2a419e..4dafa042c5e 100644
--- a/src/emu/cpu/jaguar/jaguar.c
+++ b/src/emu/cpu/jaguar/jaguar.c
@@ -6,8 +6,8 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
-#include "cpuexec.h"
#include "jaguar.h"
CPU_DISASSEMBLE( jaguargpu );
diff --git a/src/emu/cpu/jaguar/jaguar.h b/src/emu/cpu/jaguar/jaguar.h
index a5c64a174b7..e82d4c57ca5 100644
--- a/src/emu/cpu/jaguar/jaguar.h
+++ b/src/emu/cpu/jaguar/jaguar.h
@@ -11,7 +11,6 @@
#ifndef __JAGUAR_H__
#define __JAGUAR_H__
-#include "cpuintrf.h"
/***************************************************************************
diff --git a/src/emu/cpu/konami/knmidasm.c b/src/emu/cpu/konami/knmidasm.c
index 14672795924..a3def422110 100644
--- a/src/emu/cpu/konami/knmidasm.c
+++ b/src/emu/cpu/konami/knmidasm.c
@@ -1,3 +1,4 @@
+#include "emu.h"
#include "debugger.h"
#include "konami.h"
diff --git a/src/emu/cpu/konami/konami.c b/src/emu/cpu/konami/konami.c
index e7cda95d990..1e19cbf3802 100644
--- a/src/emu/cpu/konami/konami.c
+++ b/src/emu/cpu/konami/konami.c
@@ -34,6 +34,7 @@
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "konami.h"
diff --git a/src/emu/cpu/konami/konami.h b/src/emu/cpu/konami/konami.h
index 0b792566397..e049c74e38b 100644
--- a/src/emu/cpu/konami/konami.h
+++ b/src/emu/cpu/konami/konami.h
@@ -5,7 +5,6 @@
#ifndef __KONAMI_H__
#define __KONAMI_H__
-#include "cpuintrf.h"
typedef void (*konami_set_lines_func)(const device_config *device, int lines);
diff --git a/src/emu/cpu/lh5801/5801dasm.c b/src/emu/cpu/lh5801/5801dasm.c
index 63112920184..840205042fd 100644
--- a/src/emu/cpu/lh5801/5801dasm.c
+++ b/src/emu/cpu/lh5801/5801dasm.c
@@ -19,7 +19,7 @@
*
*****************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "lh5801.h"
diff --git a/src/emu/cpu/lh5801/lh5801.c b/src/emu/cpu/lh5801/lh5801.c
index 8fb559c6714..e9655be9b97 100644
--- a/src/emu/cpu/lh5801/lh5801.c
+++ b/src/emu/cpu/lh5801/lh5801.c
@@ -18,6 +18,7 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "lh5801.h"
diff --git a/src/emu/cpu/lh5801/lh5801.h b/src/emu/cpu/lh5801/lh5801.h
index 1460322a83e..cc592d42ab8 100644
--- a/src/emu/cpu/lh5801/lh5801.h
+++ b/src/emu/cpu/lh5801/lh5801.h
@@ -63,7 +63,6 @@ pb 8bit io
pc 8bit
*/
-#include "cpuintrf.h"
typedef UINT8 (*lh5801_in_func)(const device_config *device);
diff --git a/src/emu/cpu/lr35902/lr35902.c b/src/emu/cpu/lr35902/lr35902.c
index 92456920725..da0396e3591 100644
--- a/src/emu/cpu/lr35902/lr35902.c
+++ b/src/emu/cpu/lr35902/lr35902.c
@@ -37,6 +37,7 @@
/** **/
/*************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "lr35902.h"
diff --git a/src/emu/cpu/lr35902/lr35902.h b/src/emu/cpu/lr35902/lr35902.h
index 5c21f5860c6..0e538bba41c 100644
--- a/src/emu/cpu/lr35902/lr35902.h
+++ b/src/emu/cpu/lr35902/lr35902.h
@@ -3,7 +3,6 @@
#ifndef __LR35902_H__
#define __LR35902_H__
-#include "cpuintrf.h"
typedef void (*lr35902_timer_fired_func)(const device_config *device, int cycles);
diff --git a/src/emu/cpu/lr35902/lr35902d.c b/src/emu/cpu/lr35902/lr35902d.c
index aac11e2aa38..174eb766a7c 100644
--- a/src/emu/cpu/lr35902/lr35902d.c
+++ b/src/emu/cpu/lr35902/lr35902d.c
@@ -19,6 +19,7 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "lr35902.h"
diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c
index af38dbdde09..aab3226e265 100644
--- a/src/emu/cpu/m37710/m37710.c
+++ b/src/emu/cpu/m37710/m37710.c
@@ -51,8 +51,8 @@
added save state support.
*/
+#include "emu.h"
#include "debugger.h"
-#include "cpuexec.h"
#include "m37710.h"
#include "m37710cm.h"
diff --git a/src/emu/cpu/m37710/m37710cm.h b/src/emu/cpu/m37710/m37710cm.h
index c4ff4255be5..0268dcf9b0b 100644
--- a/src/emu/cpu/m37710/m37710cm.h
+++ b/src/emu/cpu/m37710/m37710cm.h
@@ -12,8 +12,6 @@
/* ======================================================================== */
#include <limits.h>
-#include "cpuintrf.h"
-#include "debugger.h"
#include "m37710.h"
diff --git a/src/emu/cpu/m37710/m37710o0.c b/src/emu/cpu/m37710/m37710o0.c
index 14a01e909bd..7ba636a03c0 100644
--- a/src/emu/cpu/m37710/m37710o0.c
+++ b/src/emu/cpu/m37710/m37710o0.c
@@ -1,3 +1,5 @@
+#include "emu.h"
+#include "debugger.h"
#include "m37710cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M0X0
#include "m37710op.h"
diff --git a/src/emu/cpu/m37710/m37710o1.c b/src/emu/cpu/m37710/m37710o1.c
index 123c03d1506..3c1c0bfe6f7 100644
--- a/src/emu/cpu/m37710/m37710o1.c
+++ b/src/emu/cpu/m37710/m37710o1.c
@@ -1,3 +1,5 @@
+#include "emu.h"
+#include "debugger.h"
#include "m37710cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M0X1
#include "m37710op.h"
diff --git a/src/emu/cpu/m37710/m37710o2.c b/src/emu/cpu/m37710/m37710o2.c
index 5d4e8f25ff3..7c9c558568a 100644
--- a/src/emu/cpu/m37710/m37710o2.c
+++ b/src/emu/cpu/m37710/m37710o2.c
@@ -1,3 +1,5 @@
+#include "emu.h"
+#include "debugger.h"
#include "m37710cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M1X0
#include "m37710op.h"
diff --git a/src/emu/cpu/m37710/m37710o3.c b/src/emu/cpu/m37710/m37710o3.c
index 038ed9d90db..cd513fc1bb2 100644
--- a/src/emu/cpu/m37710/m37710o3.c
+++ b/src/emu/cpu/m37710/m37710o3.c
@@ -1,3 +1,5 @@
+#include "emu.h"
+#include "debugger.h"
#include "m37710cm.h"
#define EXECUTION_MODE EXECUTION_MODE_M1X1
#include "m37710op.h"
diff --git a/src/emu/cpu/m37710/m7700ds.c b/src/emu/cpu/m37710/m7700ds.c
index 819dd7f2116..2930a38d84c 100644
--- a/src/emu/cpu/m37710/m7700ds.c
+++ b/src/emu/cpu/m37710/m7700ds.c
@@ -7,7 +7,7 @@ Based on G65C816 CPU Emulator by Karl Stenerud
*/
-#include "cpuintrf.h"
+#include "emu.h"
#include "m7700ds.h"
#ifdef SEC
diff --git a/src/emu/cpu/m6502/6502dasm.c b/src/emu/cpu/m6502/6502dasm.c
index 25e620e264d..f8343f40715 100644
--- a/src/emu/cpu/m6502/6502dasm.c
+++ b/src/emu/cpu/m6502/6502dasm.c
@@ -27,6 +27,7 @@
/* 18.April 2008 Roberto Fresca fixed bbr, bbs, rmb & smb displayment,
showing the correct bit to operate */
+#include "emu.h"
#include "debugger.h"
#include "m6502.h"
#include "m65ce02.h"
diff --git a/src/emu/cpu/m6502/m4510.c b/src/emu/cpu/m6502/m4510.c
index 37d5ee674bc..851f980875c 100644
--- a/src/emu/cpu/m6502/m4510.c
+++ b/src/emu/cpu/m6502/m4510.c
@@ -100,6 +100,7 @@ z: xxxx address bits a19 .. a16 for memory accesses with a15 1 ?
1 map 8000-9fff
*/
+#include "emu.h"
#include "debugger.h"
#include "m6502.h"
#include "m4510.h"
@@ -271,7 +272,7 @@ INLINE void m4510_take_irq(m4510_Regs *cpustate)
P = (P & ~F_D) | F_I; /* knock out D and set I flag */
PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1);
- LOG(("M4510 '%s' takes IRQ ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M4510 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
/* call back the cpuintrf to let it clear the line */
if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
}
@@ -301,7 +302,7 @@ static CPU_EXECUTE( m4510 )
/* check if the I flag was just reset (interrupts enabled) */
if( cpustate->after_cli )
{
- LOG(("M4510 '%s' after_cli was >0", cpustate->device->tag));
+ LOG(("M4510 '%s' after_cli was >0", cpustate->device->tag.cstr()));
cpustate->after_cli = 0;
if (cpustate->irq_state != CLEAR_LINE)
{
@@ -330,7 +331,7 @@ static void m4510_set_irq_line(m4510_Regs *cpustate, int irqline, int state)
cpustate->nmi_state = state;
if( state != CLEAR_LINE )
{
- LOG(("M4510 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag));
+ LOG(("M4510 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
EAD = M4510_NMI_VEC;
cpustate->icount -= 7;
PUSH(PCH);
@@ -339,7 +340,7 @@ static void m4510_set_irq_line(m4510_Regs *cpustate, int irqline, int state)
P = (P & ~F_D) | F_I; /* knock out D and set I flag */
PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1);
- LOG(("M4510 '%s' takes NMI ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M4510 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
}
}
else
@@ -347,7 +348,7 @@ static void m4510_set_irq_line(m4510_Regs *cpustate, int irqline, int state)
cpustate->irq_state = state;
if( state != CLEAR_LINE )
{
- LOG(("M4510 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag));
+ LOG(("M4510 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
cpustate->pending_irq = 1;
}
}
diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c
index 6085aa4a750..29355334dac 100644
--- a/src/emu/cpu/m6502/m6502.c
+++ b/src/emu/cpu/m6502/m6502.c
@@ -24,6 +24,7 @@
/* 10.March 2000 PeT added 6502 set overflow input line */
/* 13.September 2000 PeT N2A03 jmp indirect */
+#include "emu.h"
#include "debugger.h"
#include "m6502.h"
#include "ops02.h"
@@ -215,7 +216,7 @@ INLINE void m6502_take_irq(m6502_Regs *cpustate)
P |= F_I; /* set I flag */
PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1);
- LOG(("M6502 '%s' takes IRQ ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M6502 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
/* call back the cpuintrf to let it clear the line */
if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
}
@@ -245,7 +246,7 @@ static CPU_EXECUTE( m6502 )
/* check if the I flag was just reset (interrupts enabled) */
if( cpustate->after_cli )
{
- LOG(("M6502 '%s' after_cli was >0", cpustate->device->tag));
+ LOG(("M6502 '%s' after_cli was >0", cpustate->device->tag.cstr()));
cpustate->after_cli = 0;
if (cpustate->irq_state != CLEAR_LINE)
{
@@ -283,7 +284,7 @@ static void m6502_set_irq_line(m6502_Regs *cpustate, int irqline, int state)
cpustate->nmi_state = state;
if( state != CLEAR_LINE )
{
- LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag));
+ LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
EAD = M6502_NMI_VEC;
cpustate->icount -= 2;
PUSH(PCH);
@@ -292,7 +293,7 @@ static void m6502_set_irq_line(m6502_Regs *cpustate, int irqline, int state)
P |= F_I; /* set I flag */
PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1);
- LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
}
}
else
@@ -301,7 +302,7 @@ static void m6502_set_irq_line(m6502_Regs *cpustate, int irqline, int state)
{
if( cpustate->so_state && !state )
{
- LOG(( "M6502 '%s' set overflow\n", cpustate->device->tag));
+ LOG(( "M6502 '%s' set overflow\n", cpustate->device->tag.cstr()));
P|=F_V;
}
cpustate->so_state=state;
@@ -310,7 +311,7 @@ static void m6502_set_irq_line(m6502_Regs *cpustate, int irqline, int state)
cpustate->irq_state = state;
if( state != CLEAR_LINE )
{
- LOG(( "M6502 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag));
+ LOG(( "M6502 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
cpustate->pending_irq = 1;
// cpustate->pending_irq = 2;
cpustate->int_occured = cpustate->icount;
@@ -436,7 +437,7 @@ INLINE void m65c02_take_irq(m6502_Regs *cpustate)
P = (P & ~F_D) | F_I; /* knock out D and set I flag */
PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1);
- LOG(("M65c02 '%s' takes IRQ ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M65c02 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
/* call back the cpuintrf to let it clear the line */
if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
}
@@ -467,7 +468,7 @@ static CPU_EXECUTE( m65c02 )
/* check if the I flag was just reset (interrupts enabled) */
if( cpustate->after_cli )
{
- LOG(("M6502 '%s' after_cli was >0", cpustate->device->tag));
+ LOG(("M6502 '%s' after_cli was >0", cpustate->device->tag.cstr()));
cpustate->after_cli = 0;
if (cpustate->irq_state != CLEAR_LINE)
{
@@ -496,7 +497,7 @@ static void m65c02_set_irq_line(m6502_Regs *cpustate, int irqline, int state)
cpustate->nmi_state = state;
if( state != CLEAR_LINE )
{
- LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag));
+ LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
EAD = M6502_NMI_VEC;
cpustate->icount -= 2;
PUSH(PCH);
@@ -505,7 +506,7 @@ static void m65c02_set_irq_line(m6502_Regs *cpustate, int irqline, int state)
P = (P & ~F_D) | F_I; /* knock out D and set I flag */
PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1);
- LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
}
}
else
@@ -561,7 +562,7 @@ INLINE void deco16_take_irq(m6502_Regs *cpustate)
P |= F_I; /* set I flag */
PCL = RDMEM(EAD+1);
PCH = RDMEM(EAD);
- LOG(("M6502 '%s' takes IRQ ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M6502 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
/* call back the cpuintrf to let it clear the line */
if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
}
@@ -576,7 +577,7 @@ static void deco16_set_irq_line(m6502_Regs *cpustate, int irqline, int state)
cpustate->nmi_state = state;
if( state != CLEAR_LINE )
{
- LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag));
+ LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
EAD = DECO16_NMI_VEC;
cpustate->icount -= 7;
PUSH(PCH);
@@ -585,7 +586,7 @@ static void deco16_set_irq_line(m6502_Regs *cpustate, int irqline, int state)
P |= F_I; /* set I flag */
PCL = RDMEM(EAD+1);
PCH = RDMEM(EAD);
- LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
}
}
else
@@ -594,7 +595,7 @@ static void deco16_set_irq_line(m6502_Regs *cpustate, int irqline, int state)
{
if( cpustate->so_state && !state )
{
- LOG(( "M6502 '%s' set overflow\n", cpustate->device->tag));
+ LOG(( "M6502 '%s' set overflow\n", cpustate->device->tag.cstr()));
P|=F_V;
}
cpustate->so_state=state;
@@ -603,7 +604,7 @@ static void deco16_set_irq_line(m6502_Regs *cpustate, int irqline, int state)
cpustate->irq_state = state;
if( state != CLEAR_LINE )
{
- LOG(( "M6502 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag));
+ LOG(( "M6502 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
cpustate->pending_irq = 1;
}
}
@@ -633,7 +634,7 @@ static CPU_EXECUTE( deco16 )
/* check if the I flag was just reset (interrupts enabled) */
if( cpustate->after_cli )
{
- LOG(("M6502 %s after_cli was >0", cpustate->device->tag));
+ LOG(("M6502 %s after_cli was >0", cpustate->device->tag.cstr()));
cpustate->after_cli = 0;
if (cpustate->irq_state != CLEAR_LINE)
{
diff --git a/src/emu/cpu/m6502/m6502.h b/src/emu/cpu/m6502/m6502.h
index 5fc4dfd5ad7..dd3a3ef4b7b 100644
--- a/src/emu/cpu/m6502/m6502.h
+++ b/src/emu/cpu/m6502/m6502.h
@@ -27,7 +27,6 @@
#ifndef __M6502_H__
#define __M6502_H__
-#include "cpuintrf.h"
/* set to 1 to test cur_mrhard/cur_wmhard to avoid calls */
#define FAST_MEMORY 0
diff --git a/src/emu/cpu/m6502/m6509.c b/src/emu/cpu/m6502/m6509.c
index 45b402e7b76..0d6c4a2838e 100644
--- a/src/emu/cpu/m6502/m6509.c
+++ b/src/emu/cpu/m6502/m6509.c
@@ -37,6 +37,7 @@ addresses take place.
*/
+#include "emu.h"
#include "debugger.h"
#include "m6509.h"
@@ -199,7 +200,7 @@ INLINE void m6509_take_irq( m6509_Regs *cpustate)
P |= F_I; /* knock out D and set I flag */
PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1);
- LOG(("M6509 '%s' takes IRQ ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M6509 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
/* call back the cpuintrf to let it clear the line */
if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
}
@@ -229,7 +230,7 @@ static CPU_EXECUTE( m6509 )
/* check if the I flag was just reset (interrupts enabled) */
if( cpustate->after_cli )
{
- LOG(("M6509 '%s' after_cli was >0", cpustate->device->tag));
+ LOG(("M6509 '%s' after_cli was >0", cpustate->device->tag.cstr()));
cpustate->after_cli = 0;
if (cpustate->irq_state != CLEAR_LINE)
{
@@ -258,7 +259,7 @@ static void m6509_set_irq_line(m6509_Regs *cpustate, int irqline, int state)
cpustate->nmi_state = state;
if( state != CLEAR_LINE )
{
- LOG(( "M6509 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag));
+ LOG(( "M6509 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
EAD = M6509_NMI_VEC;
EAWH = PBWH;
cpustate->icount -= 2;
@@ -268,7 +269,7 @@ static void m6509_set_irq_line(m6509_Regs *cpustate, int irqline, int state)
P |= F_I; /* knock out D and set I flag */
PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1);
- LOG(("M6509 '%s' takes NMI ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M6509 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
}
}
else
@@ -277,7 +278,7 @@ static void m6509_set_irq_line(m6509_Regs *cpustate, int irqline, int state)
{
if( cpustate->so_state && !state )
{
- LOG(( "M6509 '%s' set overflow\n", cpustate->device->tag));
+ LOG(( "M6509 '%s' set overflow\n", cpustate->device->tag.cstr()));
P|=F_V;
}
cpustate->so_state=state;
@@ -286,7 +287,7 @@ static void m6509_set_irq_line(m6509_Regs *cpustate, int irqline, int state)
cpustate->irq_state = state;
if( state != CLEAR_LINE )
{
- LOG(( "M6509 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag));
+ LOG(( "M6509 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
cpustate->pending_irq = 1;
}
}
diff --git a/src/emu/cpu/m6502/m65ce02.c b/src/emu/cpu/m6502/m65ce02.c
index 80f20189c2b..610f535ba1d 100644
--- a/src/emu/cpu/m6502/m65ce02.c
+++ b/src/emu/cpu/m6502/m65ce02.c
@@ -37,6 +37,7 @@
*/
+#include "emu.h"
#include "debugger.h"
#include "m65ce02.h"
@@ -158,7 +159,7 @@ INLINE void m65ce02_take_irq(m65ce02_Regs *cpustate)
P = (P & ~F_D) | F_I; /* knock out D and set I flag */
PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1);
- LOG(("M65ce02 '%s' takes IRQ ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M65ce02 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
/* call back the cpuintrf to let it clear the line */
if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
}
@@ -188,7 +189,7 @@ static CPU_EXECUTE( m65ce02 )
/* check if the I flag was just reset (interrupts enabled) */
if( cpustate->after_cli )
{
- LOG(("M65ce02 '%s' after_cli was >0", cpustate->device->tag));
+ LOG(("M65ce02 '%s' after_cli was >0", cpustate->device->tag.cstr()));
cpustate->after_cli = 0;
if (cpustate->irq_state != CLEAR_LINE)
{
@@ -217,7 +218,7 @@ static void m65ce02_set_irq_line(m65ce02_Regs *cpustate, int irqline, int state)
cpustate->nmi_state = state;
if( state != CLEAR_LINE )
{
- LOG(("M65ce02 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag));
+ LOG(("M65ce02 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
EAD = M65CE02_NMI_VEC;
cpustate->icount -= 7;
PUSH(PCH);
@@ -226,7 +227,7 @@ static void m65ce02_set_irq_line(m65ce02_Regs *cpustate, int irqline, int state)
P = (P & ~F_D) | F_I; /* knock out D and set I flag */
PCL = RDMEM(EAD);
PCH = RDMEM(EAD+1);
- LOG(("M65ce02 '%s' takes NMI ($%04x)\n", cpustate->device->tag, PCD));
+ LOG(("M65ce02 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
}
}
else
@@ -234,7 +235,7 @@ static void m65ce02_set_irq_line(m65ce02_Regs *cpustate, int irqline, int state)
cpustate->irq_state = state;
if( state != CLEAR_LINE )
{
- LOG(("M65ce02 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag));
+ LOG(("M65ce02 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
cpustate->pending_irq = 1;
}
}
diff --git a/src/emu/cpu/m6502/ops02.h b/src/emu/cpu/m6502/ops02.h
index 4d42ea1d3d6..f97f8f2c02a 100644
--- a/src/emu/cpu/m6502/ops02.h
+++ b/src/emu/cpu/m6502/ops02.h
@@ -623,7 +623,7 @@
if ( P & F_I ) { \
PULL(P); \
if ((cpustate->irq_state != CLEAR_LINE) && !(P & F_I)) { \
- LOG(("M6502 '%s' PLP sets after_cli\n",cpustate->device->tag)); \
+ LOG(("M6502 '%s' PLP sets after_cli\n",cpustate->device->tag.cstr())); \
cpustate->after_cli = 1; \
} \
} else { \
@@ -665,7 +665,7 @@
P |= F_T | F_B; \
if( (cpustate->irq_state != CLEAR_LINE) && !(P & F_I) ) \
{ \
- LOG(("M6502 '%s' RTI sets after_cli\n",cpustate->device->tag)); \
+ LOG(("M6502 '%s' RTI sets after_cli\n",cpustate->device->tag.cstr())); \
cpustate->after_cli = 1; \
}
diff --git a/src/emu/cpu/m6502/opsce02.h b/src/emu/cpu/m6502/opsce02.h
index 91a481f0755..c227872f3de 100644
--- a/src/emu/cpu/m6502/opsce02.h
+++ b/src/emu/cpu/m6502/opsce02.h
@@ -676,7 +676,7 @@
PULL(temp); \
P=(P&F_E)|F_B|(temp&~F_E); \
if( IRQ_STATE != CLEAR_LINE && !(P & F_I) ) { \
- LOG(("M65ce02 '%s' PLP sets after_cli\n", cpustate->device->tag)); \
+ LOG(("M65ce02 '%s' PLP sets after_cli\n", cpustate->device->tag.cstr())); \
AFTER_CLI = 1; \
} \
} else { \
@@ -756,7 +756,7 @@
PULL(PCH); \
if( IRQ_STATE != CLEAR_LINE && !(P & F_I) ) \
{ \
- LOG(("M65ce02 '%s' RTI sets after_cli\n", cpustate->device->tag)); \
+ LOG(("M65ce02 '%s' RTI sets after_cli\n", cpustate->device->tag.cstr())); \
AFTER_CLI = 1; \
}
@@ -787,7 +787,7 @@
PULL(PCL); \
PULL(PCH); \
if( IRQ_STATE != CLEAR_LINE && !(P & F_I) ) { \
- LOG(("M65ce02 '%s' RTI sets after_cli\n", cpustate->device->tag)); \
+ LOG(("M65ce02 '%s' RTI sets after_cli\n", cpustate->device->tag.cstr())); \
AFTER_CLI = 1; \
}
diff --git a/src/emu/cpu/m6800/6800dasm.c b/src/emu/cpu/m6800/6800dasm.c
index 4e2e5dd9013..6b9429679c7 100644
--- a/src/emu/cpu/m6800/6800dasm.c
+++ b/src/emu/cpu/m6800/6800dasm.c
@@ -17,6 +17,7 @@
*
*/
+#include "emu.h"
#include "debugger.h"
#include "m6800.h"
diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c
index fd4197d12bc..84abae3d118 100644
--- a/src/emu/cpu/m6800/m6800.c
+++ b/src/emu/cpu/m6800/m6800.c
@@ -73,6 +73,7 @@ TODO:
*/
+#include "emu.h"
#include "debugger.h"
#include "m6800.h"
@@ -545,7 +546,7 @@ INLINE void WM16(m6800_state *cpustate, UINT32 Addr, PAIR *p )
/* IRQ enter */
static void enter_interrupt(m6800_state *cpustate, const char *message,UINT16 irq_vector)
{
- LOG((message, cpustate->device->tag));
+ LOG((message, cpustate->device->tag.cstr()));
if( cpustate->wai_state & (M6800_WAI|M6800_SLP) )
{
if( cpustate->wai_state & M6800_WAI )
@@ -964,7 +965,7 @@ static void set_irq_line(m6800_state *cpustate, int irqline, int state)
{
//int eddge;
- LOG(("M6800 '%s' set_irq_line %d,%d\n", cpustate->device->tag, irqline, state));
+ LOG(("M6800 '%s' set_irq_line %d,%d\n", cpustate->device->tag.cstr(), irqline, state));
cpustate->irq_state[irqline] = state;
if (irqline == M6800_TIN_LINE && state != cpustate->irq_state[irqline])
@@ -2410,7 +2411,7 @@ static READ8_HANDLER( m6803_internal_registers_r )
case 0x0e:
return (cpustate->input_capture >> 8) & 0xff;
case 0x0f:
- logerror("CPU '%s' PC %04x: warning - read from unsupported register %02x\n",space->cpu->tag,cpu_get_pc(space->cpu),offset);
+ logerror("CPU '%s' PC %04x: warning - read from unsupported register %02x\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),offset);
return 0;
case 0x10:
return cpustate->rmcr;
@@ -2427,7 +2428,7 @@ static READ8_HANDLER( m6803_internal_registers_r )
case 0x13:
return cpustate->tdr;
case 0x14:
- logerror("CPU '%s' PC %04x: read RAM control register\n",space->cpu->tag,cpu_get_pc(space->cpu));
+ logerror("CPU '%s' PC %04x: read RAM control register\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu));
return cpustate->ram_ctrl;
case 0x15:
case 0x16:
@@ -2441,7 +2442,7 @@ static READ8_HANDLER( m6803_internal_registers_r )
case 0x1e:
case 0x1f:
default:
- logerror("CPU '%s' PC %04x: warning - read from reserved internal register %02x\n",space->cpu->tag,cpu_get_pc(space->cpu),offset);
+ logerror("CPU '%s' PC %04x: warning - read from reserved internal register %02x\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),offset);
return 0;
}
}
@@ -2474,7 +2475,7 @@ static WRITE8_HANDLER( m6803_internal_registers_w )
| (memory_read_byte_8be(cpustate->io, M6803_PORT2) & (cpustate->port2_ddr ^ 0xff)));
if (cpustate->port2_ddr & 2)
- logerror("CPU '%s' PC %04x: warning - port 2 bit 1 set as output (OLVL) - not supported\n",space->cpu->tag,cpu_get_pc(space->cpu));
+ logerror("CPU '%s' PC %04x: warning - port 2 bit 1 set as output (OLVL) - not supported\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu));
}
break;
case 0x02:
@@ -2573,10 +2574,10 @@ static WRITE8_HANDLER( m6803_internal_registers_w )
case 0x0d:
case 0x0e:
case 0x12:
- logerror("CPU '%s' PC %04x: warning - write %02x to read only internal register %02x\n",space->cpu->tag,cpu_get_pc(space->cpu),data,offset);
+ logerror("CPU '%s' PC %04x: warning - write %02x to read only internal register %02x\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),data,offset);
break;
case 0x0f:
- logerror("CPU '%s' PC %04x: warning - write %02x to unsupported internal register %02x\n",space->cpu->tag,cpu_get_pc(space->cpu),data,offset);
+ logerror("CPU '%s' PC %04x: warning - write %02x to unsupported internal register %02x\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),data,offset);
break;
case 0x10:
cpustate->rmcr = data & 0x0f;
@@ -2616,7 +2617,7 @@ static WRITE8_HANDLER( m6803_internal_registers_w )
cpustate->tdr = data;
break;
case 0x14:
- logerror("CPU '%s' PC %04x: write %02x to RAM control register\n",space->cpu->tag,cpu_get_pc(space->cpu),data);
+ logerror("CPU '%s' PC %04x: write %02x to RAM control register\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),data);
cpustate->ram_ctrl = data;
break;
case 0x15:
@@ -2631,7 +2632,7 @@ static WRITE8_HANDLER( m6803_internal_registers_w )
case 0x1e:
case 0x1f:
default:
- logerror("CPU '%s' PC %04x: warning - write %02x to reserved internal register %02x\n",space->cpu->tag,cpu_get_pc(space->cpu),data,offset);
+ logerror("CPU '%s' PC %04x: warning - write %02x to reserved internal register %02x\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),data,offset);
break;
}
}
diff --git a/src/emu/cpu/m6800/m6800.h b/src/emu/cpu/m6800/m6800.h
index 96d6a4e9cbf..2a03a1889d1 100644
--- a/src/emu/cpu/m6800/m6800.h
+++ b/src/emu/cpu/m6800/m6800.h
@@ -5,7 +5,6 @@
#ifndef __M6800_H__
#define __M6800_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/m68000/m68000.h b/src/emu/cpu/m68000/m68000.h
index 80eba3bb2e0..eb283cf2948 100644
--- a/src/emu/cpu/m68000/m68000.h
+++ b/src/emu/cpu/m68000/m68000.h
@@ -3,7 +3,6 @@
#ifndef __M68000_H__
#define __M68000_H__
-#include "cpuintrf.h"
/* There are 7 levels of interrupt to the 68K.
* A transition from < 7 to 7 will cause a non-maskable interrupt (NMI).
diff --git a/src/emu/cpu/m68000/m68k_in.c b/src/emu/cpu/m68000/m68k_in.c
index cecb5385bb1..cb2df7bb1f7 100644
--- a/src/emu/cpu/m68000/m68k_in.c
+++ b/src/emu/cpu/m68000/m68k_in.c
@@ -258,8 +258,8 @@ void m68ki_build_opcode_table(void)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
M68KMAKE_OPCODE_HANDLER_HEADER
+#include "emu.h"
#include "m68kcpu.h"
-#include "mame.h"
extern void m68040_fpu_op0(m68ki_cpu_core *m68k);
extern void m68040_fpu_op1(m68ki_cpu_core *m68k);
extern void m68881_mmu_ops(m68ki_cpu_core *m68k);
@@ -3288,7 +3288,7 @@ M68KMAKE_OP(callm, 32, ., .)
REG_PC += 2;
(void)ea; /* just to avoid an 'unused variable' warning */
logerror("%s at %08x: called unimplemented instruction %04x (callm)\n",
- m68k->device->tag, REG_PC - 2, m68k->ir);
+ m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
return;
}
m68ki_exception_illegal(m68k);
@@ -4366,7 +4366,7 @@ M68KMAKE_OP(cpbcc, 32, ., .)
if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type))
{
logerror( "%s at %08x: called unimplemented instruction %04x (cpbcc)\n",
- m68k->device->tag, REG_PC - 2, m68k->ir);
+ m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
return;
}
m68ki_exception_1111(m68k);
@@ -4378,7 +4378,7 @@ M68KMAKE_OP(cpdbcc, 32, ., .)
if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type))
{
logerror("%s at %08x: called unimplemented instruction %04x (cpdbcc)\n",
- m68k->device->tag, REG_PC - 2, m68k->ir);
+ m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
return;
}
m68ki_exception_1111(m68k);
@@ -4390,7 +4390,7 @@ M68KMAKE_OP(cpgen, 32, ., .)
if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type))
{
logerror("%s at %08x: called unimplemented instruction %04x (cpgen)\n",
- m68k->device->tag, REG_PC - 2, m68k->ir);
+ m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
return;
}
m68ki_exception_1111(m68k);
@@ -4402,7 +4402,7 @@ M68KMAKE_OP(cpscc, 32, ., .)
if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type))
{
logerror("%s at %08x: called unimplemented instruction %04x (cpscc)\n",
- m68k->device->tag, REG_PC - 2, m68k->ir);
+ m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
return;
}
m68ki_exception_1111(m68k);
@@ -4414,7 +4414,7 @@ M68KMAKE_OP(cptrapcc, 32, ., .)
if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type))
{
logerror("%s at %08x: called unimplemented instruction %04x (cptrapcc)\n",
- m68k->device->tag, REG_PC - 2, m68k->ir);
+ m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
return;
}
m68ki_exception_1111(m68k);
@@ -8812,7 +8812,7 @@ M68KMAKE_OP(rtm, 32, ., .)
{
m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
logerror("%s at %08x: called unimplemented instruction %04x (rtm)\n",
- m68k->device->tag, REG_PC - 2, m68k->ir);
+ m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
return;
}
m68ki_exception_illegal(m68k);
diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c
index a40563c21e5..d3b6da3439a 100644
--- a/src/emu/cpu/m68000/m68kcpu.c
+++ b/src/emu/cpu/m68000/m68kcpu.c
@@ -32,11 +32,12 @@ static const char copyright_notice[] =
/* ================================ INCLUDES ============================== */
/* ======================================================================== */
+#include "emu.h"
+#include "debugger.h"
#include <setjmp.h>
#include "m68kcpu.h"
#include "m68kops.h"
#include "m68kfpu.c"
-#include "debugger.h"
#include "m68kmmu.h"
diff --git a/src/emu/cpu/m68000/m68kcpu.h b/src/emu/cpu/m68000/m68kcpu.h
index 1343d1acb4b..cdf9b3e6e47 100644
--- a/src/emu/cpu/m68000/m68kcpu.h
+++ b/src/emu/cpu/m68000/m68kcpu.h
@@ -27,7 +27,7 @@
typedef struct _m68ki_cpu_core m68ki_cpu_core;
-#include "cpuintrf.h"
+
#include "m68000.h"
#include <limits.h>
diff --git a/src/emu/cpu/m68000/m68kdasm.c b/src/emu/cpu/m68000/m68kdasm.c
index b807ed55e98..a190250a471 100644
--- a/src/emu/cpu/m68000/m68kdasm.c
+++ b/src/emu/cpu/m68000/m68kdasm.c
@@ -30,6 +30,7 @@
#include <string.h>
#define m68ki_cpu_core void
+#include "emu.h"
#include "m68000.h"
#ifndef DECL_SPEC
diff --git a/src/emu/cpu/m6805/6805dasm.c b/src/emu/cpu/m6805/6805dasm.c
index f2c47681c9a..74e9c740b7d 100644
--- a/src/emu/cpu/m6805/6805dasm.c
+++ b/src/emu/cpu/m6805/6805dasm.c
@@ -8,6 +8,7 @@
*
*/
+#include "emu.h"
#include "debugger.h"
#include "m6805.h"
diff --git a/src/emu/cpu/m6805/m6805.c b/src/emu/cpu/m6805/m6805.c
index ece6757145c..beda3d92b8a 100644
--- a/src/emu/cpu/m6805/m6805.c
+++ b/src/emu/cpu/m6805/m6805.c
@@ -30,6 +30,7 @@
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "m6805.h"
diff --git a/src/emu/cpu/m6805/m6805.h b/src/emu/cpu/m6805/m6805.h
index bdfb2071a68..2e84c35dae9 100644
--- a/src/emu/cpu/m6805/m6805.h
+++ b/src/emu/cpu/m6805/m6805.h
@@ -5,7 +5,6 @@
#ifndef __M6805_H__
#define __M6805_H__
-#include "cpuintrf.h"
enum { M6805_PC=1, M6805_S, M6805_CC, M6805_A, M6805_X, M6805_IRQ_STATE };
diff --git a/src/emu/cpu/m6809/6809dasm.c b/src/emu/cpu/m6809/6809dasm.c
index 4f01040e0c9..c4948c23f5b 100644
--- a/src/emu/cpu/m6809/6809dasm.c
+++ b/src/emu/cpu/m6809/6809dasm.c
@@ -15,6 +15,7 @@
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "m6809.h"
diff --git a/src/emu/cpu/m6809/m6809.c b/src/emu/cpu/m6809/m6809.c
index f06e2a28162..e5abc7a899b 100644
--- a/src/emu/cpu/m6809/m6809.c
+++ b/src/emu/cpu/m6809/m6809.c
@@ -70,6 +70,7 @@
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "m6809.h"
@@ -437,7 +438,7 @@ static void set_irq_line(m68_state_t *m68_state, int irqline, int state)
{
if (m68_state->nmi_state == state) return;
m68_state->nmi_state = state;
- LOG(("M6809 '%s' set_irq_line (NMI) %d\n", m68_state->device->tag, state));
+ LOG(("M6809 '%s' set_irq_line (NMI) %d\n", m68_state->device->tag.cstr(), state));
if( state == CLEAR_LINE ) return;
/* if the stack was not yet initialized */
@@ -468,7 +469,7 @@ static void set_irq_line(m68_state_t *m68_state, int irqline, int state)
}
else if (irqline < 2)
{
- LOG(("M6809 '%s' set_irq_line %d, %d\n", m68_state->device->tag, irqline, state));
+ LOG(("M6809 '%s' set_irq_line %d, %d\n", m68_state->device->tag.cstr(), irqline, state));
m68_state->irq_state[irqline] = state;
if (state == CLEAR_LINE) return;
check_irq_lines(m68_state);
diff --git a/src/emu/cpu/m6809/m6809.h b/src/emu/cpu/m6809/m6809.h
index caf5a9a244c..1553647e0ad 100644
--- a/src/emu/cpu/m6809/m6809.h
+++ b/src/emu/cpu/m6809/m6809.h
@@ -5,7 +5,6 @@
#ifndef __M6809_H__
#define __M6809_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/mb86233/mb86233.c b/src/emu/cpu/mb86233/mb86233.c
index a4deafcf376..3e420ed702f 100644
--- a/src/emu/cpu/mb86233/mb86233.c
+++ b/src/emu/cpu/mb86233/mb86233.c
@@ -13,8 +13,9 @@
***************************************************************************/
-#include "mb86233.h"
+#include "emu.h"
#include "debugger.h"
+#include "mb86233.h"
CPU_DISASSEMBLE( mb86233 );
diff --git a/src/emu/cpu/mb86233/mb86233.h b/src/emu/cpu/mb86233/mb86233.h
index 89f8ae2d8f1..73dd3d04375 100644
--- a/src/emu/cpu/mb86233/mb86233.h
+++ b/src/emu/cpu/mb86233/mb86233.h
@@ -3,7 +3,6 @@
#ifndef __MB86233_H__
#define __MB86233_H__
-#include "cpuintrf.h"
/***************************************************************************
REGISTER ENUMERATION
diff --git a/src/emu/cpu/mb86233/mb86233d.c b/src/emu/cpu/mb86233/mb86233d.c
index e468eb844e2..40c41adb410 100644
--- a/src/emu/cpu/mb86233/mb86233d.c
+++ b/src/emu/cpu/mb86233/mb86233d.c
@@ -1,3 +1,4 @@
+#include "emu.h"
#include "debugger.h"
#include "mb86233.h"
diff --git a/src/emu/cpu/mb88xx/mb88dasm.c b/src/emu/cpu/mb88xx/mb88dasm.c
index 570827954df..a0459a7cc20 100644
--- a/src/emu/cpu/mb88xx/mb88dasm.c
+++ b/src/emu/cpu/mb88xx/mb88dasm.c
@@ -7,6 +7,7 @@
*******************************************************************************/
+#include "emu.h"
#include "mb88xx.h"
diff --git a/src/emu/cpu/mb88xx/mb88xx.c b/src/emu/cpu/mb88xx/mb88xx.c
index 33350a63429..947bf66db2c 100644
--- a/src/emu/cpu/mb88xx/mb88xx.c
+++ b/src/emu/cpu/mb88xx/mb88xx.c
@@ -13,6 +13,7 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "mb88xx.h"
diff --git a/src/emu/cpu/mb88xx/mb88xx.h b/src/emu/cpu/mb88xx/mb88xx.h
index 48a5b25988c..9f0d0f15b1a 100644
--- a/src/emu/cpu/mb88xx/mb88xx.h
+++ b/src/emu/cpu/mb88xx/mb88xx.h
@@ -12,7 +12,6 @@
#ifndef __MB88XX_H__
#define __MB88XX_H__
-#include "cpuintrf.h"
/***************************************************************************
PORT ENUMERATION
diff --git a/src/emu/cpu/mc68hc11/hc11dasm.c b/src/emu/cpu/mc68hc11/hc11dasm.c
index 98fd050a71d..07c154c9e6d 100644
--- a/src/emu/cpu/mc68hc11/hc11dasm.c
+++ b/src/emu/cpu/mc68hc11/hc11dasm.c
@@ -4,8 +4,7 @@
Written by Ville Linde
*/
-#include "cpuintrf.h"
-#include <stdarg.h>
+#include "emu.h"
enum
{
diff --git a/src/emu/cpu/mc68hc11/mc68hc11.c b/src/emu/cpu/mc68hc11/mc68hc11.c
index e2b2d9d8b91..bcf1aad3d41 100644
--- a/src/emu/cpu/mc68hc11/mc68hc11.c
+++ b/src/emu/cpu/mc68hc11/mc68hc11.c
@@ -10,6 +10,7 @@ TODO:
*/
+#include "emu.h"
#include "debugger.h"
#include "mc68hc11.h"
diff --git a/src/emu/cpu/mc68hc11/mc68hc11.h b/src/emu/cpu/mc68hc11/mc68hc11.h
index c8a3d9ff3dd..0e5ff6901ce 100644
--- a/src/emu/cpu/mc68hc11/mc68hc11.h
+++ b/src/emu/cpu/mc68hc11/mc68hc11.h
@@ -3,7 +3,6 @@
#ifndef __MC68HC11_H__
#define __MC68HC11_H__
-#include "cpuintrf.h"
CPU_DISASSEMBLE( hc11 );
diff --git a/src/emu/cpu/mcs48/mcs48.c b/src/emu/cpu/mcs48/mcs48.c
index 59e64d32d32..c5291b9e97f 100644
--- a/src/emu/cpu/mcs48/mcs48.c
+++ b/src/emu/cpu/mcs48/mcs48.c
@@ -72,8 +72,8 @@ T0 output clock
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
-#include "timer.h"
#include "mcs48.h"
diff --git a/src/emu/cpu/mcs48/mcs48.h b/src/emu/cpu/mcs48/mcs48.h
index f0a5458cf2f..2a43834bd17 100644
--- a/src/emu/cpu/mcs48/mcs48.h
+++ b/src/emu/cpu/mcs48/mcs48.h
@@ -15,7 +15,6 @@
#ifndef __MCS48_H__
#define __MCS48_H__
-#include "cpuintrf.h"
/***************************************************************************
diff --git a/src/emu/cpu/mcs48/mcs48dsm.c b/src/emu/cpu/mcs48/mcs48dsm.c
index 1eeafa8186c..1e2e87eda51 100644
--- a/src/emu/cpu/mcs48/mcs48dsm.c
+++ b/src/emu/cpu/mcs48/mcs48dsm.c
@@ -7,7 +7,7 @@
***************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
static UINT32 common_dasm(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int upi41)
diff --git a/src/emu/cpu/mcs51/mcs51.c b/src/emu/cpu/mcs51/mcs51.c
index e82552901f0..990d1203c6b 100644
--- a/src/emu/cpu/mcs51/mcs51.c
+++ b/src/emu/cpu/mcs51/mcs51.c
@@ -137,6 +137,7 @@
* - more timer cleanups from manual
*/
+#include "emu.h"
#include "debugger.h"
#include "mcs51.h"
@@ -2025,7 +2026,7 @@ static void mcs51_sfr_write(mcs51_state_t *mcs51_state, size_t offset, UINT8 dat
case ADDR_SCON:
break;
default:
- LOG(("mcs51 '%s': attemping to write to an invalid/non-implemented SFR address: %x at 0x%04x, data=%x\n", mcs51_state->device->tag, (UINT32)offset,PC,data));
+ LOG(("mcs51 '%s': attemping to write to an invalid/non-implemented SFR address: %x at 0x%04x, data=%x\n", mcs51_state->device->tag.cstr(), (UINT32)offset,PC,data));
/* no write in this case according to manual */
return;
}
@@ -2065,7 +2066,7 @@ static UINT8 mcs51_sfr_read(mcs51_state_t *mcs51_state, size_t offset)
return memory_read_byte_8le(mcs51_state->data, (size_t) offset | 0x100);
/* Illegal or non-implemented sfr */
default:
- LOG(("mcs51 '%s': attemping to read an invalid/non-implemented SFR address: %x at 0x%04x\n", mcs51_state->device->tag, (UINT32)offset,PC));
+ LOG(("mcs51 '%s': attemping to read an invalid/non-implemented SFR address: %x at 0x%04x\n", mcs51_state->device->tag.cstr(), (UINT32)offset,PC));
/* according to the manual, the read may return random bits */
return 0xff;
}
@@ -2317,8 +2318,8 @@ static CPU_INIT( i80c31 )
****************************************************************************/
-#define DS5_LOGW(a, d) LOG(("ds5002fp '%s': write to " # a " register at 0x%04x, data=%x\n", mcs51_state->device->tag, PC, d))
-#define DS5_LOGR(a, d) LOG(("ds5002fp '%s': read from " # a " register at 0x%04x\n", mcs51_state->device->tag, PC))
+#define DS5_LOGW(a, d) LOG(("ds5002fp '%s': write to " # a " register at 0x%04x, data=%x\n", mcs51_state->device->tag.cstr(), PC, d))
+#define DS5_LOGR(a, d) LOG(("ds5002fp '%s': read from " # a " register at 0x%04x\n", mcs51_state->device->tag.cstr(), PC))
INLINE UINT8 ds5002fp_protected(mcs51_state_t *mcs51_state, size_t offset, UINT8 data, UINT8 ta_mask, UINT8 mask)
{
@@ -2344,7 +2345,7 @@ static void ds5002fp_sfr_write(mcs51_state_t *mcs51_state, size_t offset, UINT8
if ((data == 0xaa) && (mcs51_state->ds5002fp.ta_window == 0))
{
mcs51_state->ds5002fp.ta_window = 6; /* 4*12 + 2*12 */
- LOG(("ds5002fp '%s': TA window initiated at 0x%04x\n", mcs51_state->device->tag, PC));
+ LOG(("ds5002fp '%s': TA window initiated at 0x%04x\n", mcs51_state->device->tag.cstr(), PC));
}
break;
case ADDR_MCON: data = ds5002fp_protected(mcs51_state, ADDR_MCON, data, 0x0f, 0xf7); DS5_LOGW(MCON, data); break;
diff --git a/src/emu/cpu/mcs51/mcs51.h b/src/emu/cpu/mcs51/mcs51.h
index 68475c33605..55f20738c81 100644
--- a/src/emu/cpu/mcs51/mcs51.h
+++ b/src/emu/cpu/mcs51/mcs51.h
@@ -41,7 +41,6 @@
#ifndef __MCS51_H__
#define __MCS51_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/mcs51/mcs51dasm.c b/src/emu/cpu/mcs51/mcs51dasm.c
index 7682797ac8e..ee04e069357 100644
--- a/src/emu/cpu/mcs51/mcs51dasm.c
+++ b/src/emu/cpu/mcs51/mcs51dasm.c
@@ -33,6 +33,7 @@
* D52 8052 Disassembler - Copyright Jeffery L. Post
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "mcs51.h"
diff --git a/src/emu/cpu/mcs51/mcs51ops.c b/src/emu/cpu/mcs51/mcs51ops.c
index 31c6c87101c..0549f21f388 100644
--- a/src/emu/cpu/mcs51/mcs51ops.c
+++ b/src/emu/cpu/mcs51/mcs51ops.c
@@ -976,5 +976,5 @@ OPHANDLER( xrl_a_r )
//illegal opcodes
OPHANDLER( illegal )
{
- LOG(("i8051 '%s': illegal opcode at 0x%03x: %02x\n", mcs51_state->device->tag, PC-1, r));
+ LOG(("i8051 '%s': illegal opcode at 0x%03x: %02x\n", mcs51_state->device->tag.cstr(), PC-1, r));
}
diff --git a/src/emu/cpu/minx/minx.c b/src/emu/cpu/minx/minx.c
index 28be912102c..dfeedda4929 100644
--- a/src/emu/cpu/minx/minx.c
+++ b/src/emu/cpu/minx/minx.c
@@ -42,8 +42,9 @@ TODO:
*/
-#include "minx.h"
+#include "emu.h"
#include "debugger.h"
+#include "minx.h"
#define FLAG_I 0x80
#define FLAG_D 0x40
diff --git a/src/emu/cpu/minx/minx.h b/src/emu/cpu/minx/minx.h
index 7578b348d3f..27e7aba31ed 100644
--- a/src/emu/cpu/minx/minx.h
+++ b/src/emu/cpu/minx/minx.h
@@ -4,9 +4,6 @@
#define __MINX_H__
-#include "cpuintrf.h"
-#include "driver.h"
-
enum
{
MINX_PC=1, MINX_SP, MINX_BA, MINX_HL, MINX_X, MINX_Y,
diff --git a/src/emu/cpu/minx/minxd.c b/src/emu/cpu/minx/minxd.c
index 52632aab57e..c51f0f833d0 100644
--- a/src/emu/cpu/minx/minxd.c
+++ b/src/emu/cpu/minx/minxd.c
@@ -5,6 +5,7 @@
************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "minx.h"
diff --git a/src/emu/cpu/mips/mips3.c b/src/emu/cpu/mips/mips3.c
index a8a942d988a..c57914dca50 100644
--- a/src/emu/cpu/mips/mips3.c
+++ b/src/emu/cpu/mips/mips3.c
@@ -9,6 +9,7 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "mips3com.h"
diff --git a/src/emu/cpu/mips/mips3.h b/src/emu/cpu/mips/mips3.h
index 03121ac5a60..0a3666c410d 100644
--- a/src/emu/cpu/mips/mips3.h
+++ b/src/emu/cpu/mips/mips3.h
@@ -16,7 +16,6 @@
#ifndef __MIPS3_H__
#define __MIPS3_H__
-#include "cpuintrf.h"
/***************************************************************************
diff --git a/src/emu/cpu/mips/mips3com.c b/src/emu/cpu/mips/mips3com.c
index ac76b17bb5a..e9329d6306a 100644
--- a/src/emu/cpu/mips/mips3com.c
+++ b/src/emu/cpu/mips/mips3com.c
@@ -6,9 +6,8 @@
***************************************************************************/
+#include "emu.h"
#include "mips3com.h"
-#include "cpuexec.h"
-#include "mame.h"
/***************************************************************************
diff --git a/src/emu/cpu/mips/mips3com.h b/src/emu/cpu/mips/mips3com.h
index f613fac2b9e..a2658e8be1f 100644
--- a/src/emu/cpu/mips/mips3com.h
+++ b/src/emu/cpu/mips/mips3com.h
@@ -11,10 +11,8 @@
#ifndef __MIPS3COM_H__
#define __MIPS3COM_H__
-#include "cpuintrf.h"
#include "mips3.h"
#include "cpu/vtlb.h"
-#include "timer.h"
/***************************************************************************
diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c
index 549fd0b7c2a..5b3ef25fa04 100644
--- a/src/emu/cpu/mips/mips3drc.c
+++ b/src/emu/cpu/mips/mips3drc.c
@@ -25,11 +25,9 @@
***************************************************************************/
-#include <stddef.h>
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "profiler.h"
-#include "cpuexec.h"
#include "mips3com.h"
#include "mips3fe.h"
#include "cpu/drcfe.h"
diff --git a/src/emu/cpu/mips/mips3dsm.c b/src/emu/cpu/mips/mips3dsm.c
index 38266c640ea..a392ef69427 100644
--- a/src/emu/cpu/mips/mips3dsm.c
+++ b/src/emu/cpu/mips/mips3dsm.c
@@ -6,7 +6,7 @@
***************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#define USE_ABI_REG_NAMES (1)
diff --git a/src/emu/cpu/mips/mips3fe.c b/src/emu/cpu/mips/mips3fe.c
index 80894904ba9..8608ce9adb3 100644
--- a/src/emu/cpu/mips/mips3fe.c
+++ b/src/emu/cpu/mips/mips3fe.c
@@ -10,8 +10,7 @@
***************************************************************************/
-#include <stddef.h>
-#include "cpuintrf.h"
+#include "emu.h"
#include "mips3fe.h"
#include "mips3com.h"
diff --git a/src/emu/cpu/mips/psx.c b/src/emu/cpu/mips/psx.c
index 0035e4be83d..92cf3f4e346 100644
--- a/src/emu/cpu/mips/psx.c
+++ b/src/emu/cpu/mips/psx.c
@@ -63,6 +63,7 @@
*
*/
+#include "emu.h"
#include "debugger.h"
#include "psx.h"
diff --git a/src/emu/cpu/mips/psx.h b/src/emu/cpu/mips/psx.h
index 50f04818e2e..0683719653a 100644
--- a/src/emu/cpu/mips/psx.h
+++ b/src/emu/cpu/mips/psx.h
@@ -3,7 +3,6 @@
#ifndef __PSX_H__
#define __PSX_H__
-#include "cpuintrf.h"
#define PSXCPU_DELAYR_PC ( 32 )
#define PSXCPU_DELAYR_NOTPC ( 33 )
diff --git a/src/emu/cpu/mips/psxdasm.c b/src/emu/cpu/mips/psxdasm.c
index e5e9e50a140..fdb3107c4a6 100644
--- a/src/emu/cpu/mips/psxdasm.c
+++ b/src/emu/cpu/mips/psxdasm.c
@@ -3,8 +3,8 @@
*
*/
+#include "emu.h"
#include "psx.h"
-#include "driver.h"
static char *make_signed_hex_str_16( UINT32 value )
{
diff --git a/src/emu/cpu/mips/r3000.c b/src/emu/cpu/mips/r3000.c
index 7eb048c7531..f5f71af17b0 100644
--- a/src/emu/cpu/mips/r3000.c
+++ b/src/emu/cpu/mips/r3000.c
@@ -6,6 +6,7 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "r3000.h"
diff --git a/src/emu/cpu/mips/r3000.h b/src/emu/cpu/mips/r3000.h
index de357026240..f6a287ca58f 100644
--- a/src/emu/cpu/mips/r3000.h
+++ b/src/emu/cpu/mips/r3000.h
@@ -9,7 +9,6 @@
#ifndef __R3000_H__
#define __R3000_H__
-#include "cpuintrf.h"
/***************************************************************************
diff --git a/src/emu/cpu/mips/r3kdasm.c b/src/emu/cpu/mips/r3kdasm.c
index 3664c7e03ce..88a96c9fe3e 100644
--- a/src/emu/cpu/mips/r3kdasm.c
+++ b/src/emu/cpu/mips/r3kdasm.c
@@ -6,7 +6,7 @@
***************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
static const char *const reg[32] =
diff --git a/src/emu/cpu/nec/nec.c b/src/emu/cpu/nec/nec.c
index 8e6f71d08bd..6b04a0ff788 100644
--- a/src/emu/cpu/nec/nec.c
+++ b/src/emu/cpu/nec/nec.c
@@ -103,6 +103,7 @@
****************************************************************************/
+#include "emu.h"
#include "debugger.h"
typedef UINT8 BOOLEAN;
@@ -257,7 +258,7 @@ INLINE UINT16 fetchword(nec_state_t *nec_state)
static UINT8 parity_table[256];
-#include "cpuintrf.h"
+#include "emu.h"
static UINT8 fetchop(nec_state_t *nec_state)
{
diff --git a/src/emu/cpu/nec/nec.h b/src/emu/cpu/nec/nec.h
index f30c62de53e..a63709d81e3 100644
--- a/src/emu/cpu/nec/nec.h
+++ b/src/emu/cpu/nec/nec.h
@@ -1,36 +1,35 @@
-/* ASG 971222 -- rewrote this interface */
-#ifndef __NEC_H_
-#define __NEC_H_
-
-#include "cpuintrf.h"
-
-typedef struct _nec_config nec_config;
-struct _nec_config
-{
- const UINT8* v25v35_decryptiontable; // internal decryption table
-};
-
-#define NEC_INPUT_LINE_POLL 20
-
-enum
-{
- NEC_PC=0,
- NEC_IP, NEC_AW, NEC_CW, NEC_DW, NEC_BW, NEC_SP, NEC_BP, NEC_IX, NEC_IY,
- NEC_FLAGS, NEC_ES, NEC_CS, NEC_SS, NEC_DS,
- NEC_VECTOR, NEC_PENDING
-};
-
-/* Public functions */
-extern CPU_GET_INFO( v20 );
-extern CPU_GET_INFO( v25 );
-extern CPU_GET_INFO( v30 );
-extern CPU_GET_INFO( v33 );
-extern CPU_GET_INFO( v35 );
-
-#define CPU_V20 CPU_GET_INFO_NAME( v20 )
-#define CPU_V25 CPU_GET_INFO_NAME( v25 )
-#define CPU_V30 CPU_GET_INFO_NAME( v30 )
-#define CPU_V33 CPU_GET_INFO_NAME( v33 )
-#define CPU_V35 CPU_GET_INFO_NAME( v35 )
-
-#endif
+/* ASG 971222 -- rewrote this interface */
+#ifndef __NEC_H_
+#define __NEC_H_
+
+
+typedef struct _nec_config nec_config;
+struct _nec_config
+{
+ const UINT8* v25v35_decryptiontable; // internal decryption table
+};
+
+#define NEC_INPUT_LINE_POLL 20
+
+enum
+{
+ NEC_PC=0,
+ NEC_IP, NEC_AW, NEC_CW, NEC_DW, NEC_BW, NEC_SP, NEC_BP, NEC_IX, NEC_IY,
+ NEC_FLAGS, NEC_ES, NEC_CS, NEC_SS, NEC_DS,
+ NEC_VECTOR, NEC_PENDING
+};
+
+/* Public functions */
+extern CPU_GET_INFO( v20 );
+extern CPU_GET_INFO( v25 );
+extern CPU_GET_INFO( v30 );
+extern CPU_GET_INFO( v33 );
+extern CPU_GET_INFO( v35 );
+
+#define CPU_V20 CPU_GET_INFO_NAME( v20 )
+#define CPU_V25 CPU_GET_INFO_NAME( v25 )
+#define CPU_V30 CPU_GET_INFO_NAME( v30 )
+#define CPU_V33 CPU_GET_INFO_NAME( v33 )
+#define CPU_V35 CPU_GET_INFO_NAME( v35 )
+
+#endif
diff --git a/src/emu/cpu/nec/necdasm.c b/src/emu/cpu/nec/necdasm.c
index b9b4ed42a10..85b57ff901b 100644
--- a/src/emu/cpu/nec/necdasm.c
+++ b/src/emu/cpu/nec/necdasm.c
@@ -5,7 +5,7 @@
Converted to NEC-V by Aaron Giles
*/
-#include "cpuintrf.h"
+#include "emu.h"
typedef struct _nec_config nec_config;
struct _nec_config
diff --git a/src/emu/cpu/nec/nechost.h b/src/emu/cpu/nec/nechost.h
index 5752551f948..042d880c89d 100644
--- a/src/emu/cpu/nec/nechost.h
+++ b/src/emu/cpu/nec/nechost.h
@@ -3,7 +3,6 @@
#define BIGCASE
-#include "cpuintrf.h"
typedef char BOOLEAN;
diff --git a/src/emu/cpu/nec/necpriv.h b/src/emu/cpu/nec/necpriv.h
index 90852755510..7dfcbb1ea3b 100644
--- a/src/emu/cpu/nec/necpriv.h
+++ b/src/emu/cpu/nec/necpriv.h
@@ -1,4 +1,3 @@
-#include "cpuintrf.h"
typedef enum { DS1, PS, SS, DS0 } SREGS;
typedef enum { AW, CW, DW, BW, SP, BP, IX, IY } WREGS;
diff --git a/src/emu/cpu/pdp1/pdp1.c b/src/emu/cpu/pdp1/pdp1.c
index 10fbd995ed4..d326ad5cbc7 100644
--- a/src/emu/cpu/pdp1/pdp1.c
+++ b/src/emu/cpu/pdp1/pdp1.c
@@ -335,6 +335,7 @@
*/
+#include "emu.h"
#include "debugger.h"
#include "pdp1.h"
diff --git a/src/emu/cpu/pdp1/pdp1.h b/src/emu/cpu/pdp1/pdp1.h
index 1a33984bc51..444f2b49b6e 100644
--- a/src/emu/cpu/pdp1/pdp1.h
+++ b/src/emu/cpu/pdp1/pdp1.h
@@ -3,7 +3,6 @@
#ifndef __PDP1_H__
#define __PDP1_H__
-#include "cpuintrf.h"
/* register ids for pdp1_get_reg/pdp1_set_reg */
diff --git a/src/emu/cpu/pdp1/pdp1dasm.c b/src/emu/cpu/pdp1/pdp1dasm.c
index bcb0dc604be..bd86e130db4 100644
--- a/src/emu/cpu/pdp1/pdp1dasm.c
+++ b/src/emu/cpu/pdp1/pdp1dasm.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <string.h>
+#include "emu.h"
#include "cpu/pdp1/pdp1.h"
/* PDP1 registers */
diff --git a/src/emu/cpu/pdp1/tx0.c b/src/emu/cpu/pdp1/tx0.c
index 1c068ad9995..1cf80902857 100644
--- a/src/emu/cpu/pdp1/tx0.c
+++ b/src/emu/cpu/pdp1/tx0.c
@@ -8,7 +8,7 @@
Raphael Nabet 2004
*/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "tx0.h"
diff --git a/src/emu/cpu/pdp1/tx0.h b/src/emu/cpu/pdp1/tx0.h
index 1db1fc64932..df1c5ed9227 100644
--- a/src/emu/cpu/pdp1/tx0.h
+++ b/src/emu/cpu/pdp1/tx0.h
@@ -3,7 +3,6 @@
#ifndef __TX0_H__
#define __TX0_H__
-#include "cpuintrf.h"
/* register ids for tx0_get_reg/tx0_set_reg */
diff --git a/src/emu/cpu/pdp1/tx0dasm.c b/src/emu/cpu/pdp1/tx0dasm.c
index 08bf935e4fd..6d50c24a4ed 100644
--- a/src/emu/cpu/pdp1/tx0dasm.c
+++ b/src/emu/cpu/pdp1/tx0dasm.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <string.h>
+#include "emu.h"
#include "cpu/pdp1/tx0.h"
CPU_DISASSEMBLE( tx0_64kw )
diff --git a/src/emu/cpu/pic16c5x/16c5xdsm.c b/src/emu/cpu/pic16c5x/16c5xdsm.c
index 35b3e2a900c..2089b33bf3a 100644
--- a/src/emu/cpu/pic16c5x/16c5xdsm.c
+++ b/src/emu/cpu/pic16c5x/16c5xdsm.c
@@ -21,13 +21,9 @@
* *
\**************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "emu.h"
#include <ctype.h>
-#include "cpuintrf.h"
-#include "mame.h"
static const UINT8 *rombase;
static const UINT8 *rambase;
static offs_t pcbase;
diff --git a/src/emu/cpu/pic16c5x/pic16c5x.c b/src/emu/cpu/pic16c5x/pic16c5x.c
index e4ca5379999..69fa848050b 100644
--- a/src/emu/cpu/pic16c5x/pic16c5x.c
+++ b/src/emu/cpu/pic16c5x/pic16c5x.c
@@ -60,6 +60,7 @@
* *
\**************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "pic16c5x.h"
diff --git a/src/emu/cpu/pic16c5x/pic16c5x.h b/src/emu/cpu/pic16c5x/pic16c5x.h
index 704fd565a17..83b03061303 100644
--- a/src/emu/cpu/pic16c5x/pic16c5x.h
+++ b/src/emu/cpu/pic16c5x/pic16c5x.h
@@ -15,7 +15,6 @@
#define __PIC16C5X_H__
-#include "cpuintrf.h"
/**************************************************************************
diff --git a/src/emu/cpu/pic16c62x/16c62xdsm.c b/src/emu/cpu/pic16c62x/16c62xdsm.c
index 0ef3fe1351f..c0f6ff71b8c 100644
--- a/src/emu/cpu/pic16c62x/16c62xdsm.c
+++ b/src/emu/cpu/pic16c62x/16c62xdsm.c
@@ -24,13 +24,9 @@
* *
\**************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "emu.h"
#include <ctype.h>
-#include "cpuintrf.h"
-#include "mame.h"
static const UINT8 *rombase;
static const UINT8 *rambase;
static offs_t pcbase;
diff --git a/src/emu/cpu/pic16c62x/pic16c62x.c b/src/emu/cpu/pic16c62x/pic16c62x.c
index ed5d0d0bab7..28af39ec56b 100644
--- a/src/emu/cpu/pic16c62x/pic16c62x.c
+++ b/src/emu/cpu/pic16c62x/pic16c62x.c
@@ -50,6 +50,7 @@
* *
\**************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "pic16c62x.h"
diff --git a/src/emu/cpu/pic16c62x/pic16c62x.h b/src/emu/cpu/pic16c62x/pic16c62x.h
index 1b591e28df3..c2012d49b2c 100644
--- a/src/emu/cpu/pic16c62x/pic16c62x.h
+++ b/src/emu/cpu/pic16c62x/pic16c62x.h
@@ -17,7 +17,6 @@
#define __PIC16C62X_H__
-#include "cpuintrf.h"
/**************************************************************************
diff --git a/src/emu/cpu/powerpc/ppc.c b/src/emu/cpu/powerpc/ppc.c
index 52f7a3a460a..f250866e992 100644
--- a/src/emu/cpu/powerpc/ppc.c
+++ b/src/emu/cpu/powerpc/ppc.c
@@ -1,8 +1,9 @@
/* IBM/Motorola PowerPC 4xx/6xx Emulator */
#include <setjmp.h>
-#include "ppc.h"
+#include "emu.h"
#include "debugger.h"
+#include "ppc.h"
// PLL Configuration based on the table in MPC603EUM page 7-31
static const int mpc603e_pll_config[12][9] =
diff --git a/src/emu/cpu/powerpc/ppc.h b/src/emu/cpu/powerpc/ppc.h
index 0e0f63488ae..b8c3022cb8f 100644
--- a/src/emu/cpu/powerpc/ppc.h
+++ b/src/emu/cpu/powerpc/ppc.h
@@ -16,7 +16,6 @@
#ifndef __PPC_H__
#define __PPC_H__
-#include "cpuintrf.h"
/***************************************************************************
diff --git a/src/emu/cpu/powerpc/ppc_dasm.c b/src/emu/cpu/powerpc/ppc_dasm.c
index c399e682fff..10162931ff5 100644
--- a/src/emu/cpu/powerpc/ppc_dasm.c
+++ b/src/emu/cpu/powerpc/ppc_dasm.c
@@ -13,7 +13,7 @@
* PowerPC 403 opcodes and MAME conversion by Ville Linde
*/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "ppccom.h"
diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c
index 78367a4f0a2..c06c7251b85 100644
--- a/src/emu/cpu/powerpc/ppccom.c
+++ b/src/emu/cpu/powerpc/ppccom.c
@@ -6,9 +6,8 @@
***************************************************************************/
+#include "emu.h"
#include "ppccom.h"
-#include "cpuexec.h"
-#include "mame.h"
/***************************************************************************
diff --git a/src/emu/cpu/powerpc/ppccom.h b/src/emu/cpu/powerpc/ppccom.h
index 85e556cb9b4..37a36653e38 100644
--- a/src/emu/cpu/powerpc/ppccom.h
+++ b/src/emu/cpu/powerpc/ppccom.h
@@ -11,9 +11,7 @@
#ifndef __PPCCOM_H__
#define __PPCCOM_H__
-#include "cpuintrf.h"
#include "ppc.h"
-#include "timer.h"
#include "cpu/vtlb.h"
diff --git a/src/emu/cpu/powerpc/ppcdrc.c b/src/emu/cpu/powerpc/ppcdrc.c
index baccd2fb4ed..83434dfc860 100644
--- a/src/emu/cpu/powerpc/ppcdrc.c
+++ b/src/emu/cpu/powerpc/ppcdrc.c
@@ -16,8 +16,7 @@
***************************************************************************/
-#include <stddef.h>
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "profiler.h"
#include "ppccom.h"
diff --git a/src/emu/cpu/powerpc/ppcfe.c b/src/emu/cpu/powerpc/ppcfe.c
index e73ef555ac5..44307929903 100644
--- a/src/emu/cpu/powerpc/ppcfe.c
+++ b/src/emu/cpu/powerpc/ppcfe.c
@@ -10,8 +10,7 @@
***************************************************************************/
-#include <stddef.h>
-#include "cpuintrf.h"
+#include "emu.h"
#include "ppcfe.h"
#include "ppccom.h"
diff --git a/src/emu/cpu/rsp/rsp.c b/src/emu/cpu/rsp/rsp.c
index f2e6f1ff423..0af44c6f3a8 100644
--- a/src/emu/cpu/rsp/rsp.c
+++ b/src/emu/cpu/rsp/rsp.c
@@ -4,7 +4,7 @@
Written by Ville Linde
*/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "rsp.h"
diff --git a/src/emu/cpu/rsp/rsp.h b/src/emu/cpu/rsp/rsp.h
index 8065c1c43f1..709aa66778e 100644
--- a/src/emu/cpu/rsp/rsp.h
+++ b/src/emu/cpu/rsp/rsp.h
@@ -16,7 +16,6 @@
#ifndef __RSP_H__
#define __RSP_H__
-#include "cpuintrf.h"
/***************************************************************************
diff --git a/src/emu/cpu/rsp/rsp_dasm.c b/src/emu/cpu/rsp/rsp_dasm.c
index dcebc5d85f9..a23beaf38e5 100644
--- a/src/emu/cpu/rsp/rsp_dasm.c
+++ b/src/emu/cpu/rsp/rsp_dasm.c
@@ -4,8 +4,7 @@
Written by Ville Linde
*/
-#include "cpuintrf.h"
-#include <stdarg.h>
+#include "emu.h"
static const char *const reg[32] =
{
diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c
index e68f829f78b..f4ecfe1fea4 100644
--- a/src/emu/cpu/rsp/rspdrc.c
+++ b/src/emu/cpu/rsp/rspdrc.c
@@ -18,7 +18,7 @@
***************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "profiler.h"
#include "rsp.h"
diff --git a/src/emu/cpu/rsp/rspfe.c b/src/emu/cpu/rsp/rspfe.c
index f5537c4c013..304406bc814 100644
--- a/src/emu/cpu/rsp/rspfe.c
+++ b/src/emu/cpu/rsp/rspfe.c
@@ -10,8 +10,7 @@
***************************************************************************/
-#include <stddef.h>
-#include "cpuintrf.h"
+#include "emu.h"
#include "rspfe.h"
#include "rsp.h"
diff --git a/src/emu/cpu/s2650/2650dasm.c b/src/emu/cpu/s2650/2650dasm.c
index c52319cfd5b..1841ca2eba5 100644
--- a/src/emu/cpu/s2650/2650dasm.c
+++ b/src/emu/cpu/s2650/2650dasm.c
@@ -7,7 +7,7 @@
*
**************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
static const UINT8 *rambase;
static offs_t pcbase;
diff --git a/src/emu/cpu/s2650/s2650.c b/src/emu/cpu/s2650/s2650.c
index 7b5b09a0fc1..7e76bf179d6 100644
--- a/src/emu/cpu/s2650/s2650.c
+++ b/src/emu/cpu/s2650/s2650.c
@@ -12,6 +12,7 @@
*
*************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "s2650.h"
#include "s2650cpu.h"
diff --git a/src/emu/cpu/s2650/s2650.h b/src/emu/cpu/s2650/s2650.h
index e1a6dda2493..61c591ba92a 100644
--- a/src/emu/cpu/s2650/s2650.h
+++ b/src/emu/cpu/s2650/s2650.h
@@ -3,7 +3,6 @@
#ifndef __S2650_H__
#define __S2650_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/saturn/satops.c b/src/emu/cpu/saturn/satops.c
index 47136f5e756..69d3daf321e 100644
--- a/src/emu/cpu/saturn/satops.c
+++ b/src/emu/cpu/saturn/satops.c
@@ -1,7 +1,7 @@
#define IRQ_ADDRESS 0xf
#define saturn_assert(x) \
- do { if (!(x)) logerror("SATURN '%s' assertion failed: %s at %s:%i, pc=%05x\n", cpustate->device->tag, #x, __FILE__, __LINE__, cpustate->pc); } while (0)
+ do { if (!(x)) logerror("SATURN '%s' assertion failed: %s at %s:%i, pc=%05x\n", cpustate->device->tag.cstr(), #x, __FILE__, __LINE__, cpustate->pc); } while (0)
INLINE int READ_OP(saturn_state *cpustate)
{
@@ -186,24 +186,24 @@ INLINE void saturn_push(saturn_state *cpustate, SaturnAdr adr)
INLINE void saturn_interrupt_on(saturn_state *cpustate)
{
- LOG(( "SATURN '%s' at %05x: INTON\n", cpustate->device->tag, cpustate->pc-4 ));
+ LOG(( "SATURN '%s' at %05x: INTON\n", cpustate->device->tag.cstr(), cpustate->pc-4 ));
cpustate->irq_enable=1;
if (cpustate->irq_state)
{
- LOG(( "SATURN '%s' set_irq_line(ASSERT)\n", cpustate->device->tag));
+ LOG(( "SATURN '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
cpustate->pending_irq=1;
}
}
INLINE void saturn_interrupt_off(saturn_state *cpustate)
{
- LOG(( "SATURN '%s' at %05x: INTOFF\n", cpustate->device->tag, cpustate->pc-4 ));
+ LOG(( "SATURN '%s' at %05x: INTOFF\n", cpustate->device->tag.cstr(), cpustate->pc-4 ));
cpustate->irq_enable=0;
}
INLINE void saturn_reset_interrupt(saturn_state *cpustate)
{
- LOG(( "SATURN '%s' at %05x: RSI\n", cpustate->device->tag, cpustate->pc-5 ));
+ LOG(( "SATURN '%s' at %05x: RSI\n", cpustate->device->tag.cstr(), cpustate->pc-5 ));
if (cpustate->config&&cpustate->config->rsi) cpustate->config->rsi(cpustate->device);
}
@@ -234,27 +234,27 @@ INLINE void saturn_shutdown(saturn_state *cpustate)
{
cpustate->sleeping=1;
cpustate->irq_enable=1;
- LOG(( "SATURN '%s' at %05x: SHUTDN\n", cpustate->device->tag, cpustate->pc-3 ));
+ LOG(( "SATURN '%s' at %05x: SHUTDN\n", cpustate->device->tag.cstr(), cpustate->pc-3 ));
}
INLINE void saturn_bus_command_b(saturn_state *cpustate)
{
- logerror( "SATURN '%s' at %05x: BUSCB opcode not handled\n", cpustate->device->tag, cpustate->pc-4 );
+ logerror( "SATURN '%s' at %05x: BUSCB opcode not handled\n", cpustate->device->tag.cstr(), cpustate->pc-4 );
}
INLINE void saturn_bus_command_c(saturn_state *cpustate)
{
- logerror( "SATURN '%s' at %05x: BUSCC opcode not handled\n", cpustate->device->tag, cpustate->pc-3 );
+ logerror( "SATURN '%s' at %05x: BUSCC opcode not handled\n", cpustate->device->tag.cstr(), cpustate->pc-3 );
}
INLINE void saturn_bus_command_d(saturn_state *cpustate)
{
- logerror( "SATURN '%s' at %05x: BUSCD opcode not handled\n", cpustate->device->tag, cpustate->pc-4 );
+ logerror( "SATURN '%s' at %05x: BUSCD opcode not handled\n", cpustate->device->tag.cstr(), cpustate->pc-4 );
}
INLINE void saturn_serial_request(saturn_state *cpustate)
{
- logerror( "SATURN '%s' at %05x: SREQ? opcode not handled\n", cpustate->device->tag, cpustate->pc-3 );
+ logerror( "SATURN '%s' at %05x: SREQ? opcode not handled\n", cpustate->device->tag.cstr(), cpustate->pc-3 );
}
INLINE void saturn_out_c(saturn_state *cpustate)
@@ -275,7 +275,7 @@ INLINE void saturn_in(saturn_state *cpustate, int reg)
saturn_assert(reg>=0 && reg<9);
if (!(cpustate->pc&1))
logerror( "SATURN '%s' at %05x: reg=IN opcode at odd addresse\n",
- cpustate->device->tag, cpustate->pc-3 );
+ cpustate->device->tag.cstr(), cpustate->pc-3 );
if (cpustate->config&&cpustate->config->in) in = cpustate->config->in(cpustate->device);
S64_WRITE_WORD(cpustate, reg,in);
cpustate->monitor_in = in;
@@ -459,7 +459,7 @@ INLINE void saturn_return_carry_clear(saturn_state *cpustate)
INLINE void saturn_return_interrupt(saturn_state *cpustate)
{
- LOG(( "SATURN '%s' at %05x: RTI\n", cpustate->device->tag, cpustate->pc-2 ));
+ LOG(( "SATURN '%s' at %05x: RTI\n", cpustate->device->tag.cstr(), cpustate->pc-2 ));
cpustate->in_irq=0; /* set to 1 when an IRQ is taken */
cpustate->pc=saturn_pop(cpustate);
// cpustate->icount-=10;
diff --git a/src/emu/cpu/saturn/sattable.c b/src/emu/cpu/saturn/sattable.c
index 8b3f90eec9c..94b9faa5bbb 100644
--- a/src/emu/cpu/saturn/sattable.c
+++ b/src/emu/cpu/saturn/sattable.c
@@ -38,25 +38,25 @@ static const int sub_right[]={B,C,A,C, I,I,I,I, A,B,C,D, B,C,A,C};
static void saturn_invalid3( saturn_state *cpustate, int op1, int op2, int op3 )
{
logerror( "SATURN '%s' invalid opcode %x%x%x at %05x\n",
- cpustate->device->tag, op1, op2, op3, cpustate->pc-3 );
+ cpustate->device->tag.cstr(), op1, op2, op3, cpustate->pc-3 );
}
static void saturn_invalid4( saturn_state *cpustate, int op1, int op2, int op3, int op4 )
{
logerror( "SATURN '%s' invalid opcode %x%x%x%x at %05x\n",
- cpustate->device->tag, op1, op2, op3, op4, cpustate->pc-4 );
+ cpustate->device->tag.cstr(), op1, op2, op3, op4, cpustate->pc-4 );
}
static void saturn_invalid5( saturn_state *cpustate, int op1, int op2, int op3, int op4, int op5 )
{
logerror( "SATURN '%s' invalid opcode %x%x%x%x%x at %05x\n",
- cpustate->device->tag, op1, op2, op3, op4, op5, cpustate->pc-5 );
+ cpustate->device->tag.cstr(), op1, op2, op3, op4, op5, cpustate->pc-5 );
}
static void saturn_invalid6( saturn_state *cpustate, int op1, int op2, int op3, int op4, int op5, int op6 )
{
logerror( "SATURN '%s' invalid opcode %x%x%x%x%x%x at %05x\n",
- cpustate->device->tag, op1, op2, op3, op4, op5, op6, cpustate->pc-6 );
+ cpustate->device->tag.cstr(), op1, op2, op3, op4, op5, op6, cpustate->pc-6 );
}
diff --git a/src/emu/cpu/saturn/saturn.c b/src/emu/cpu/saturn/saturn.c
index 69f84e82722..54ad3d505b4 100644
--- a/src/emu/cpu/saturn/saturn.c
+++ b/src/emu/cpu/saturn/saturn.c
@@ -22,6 +22,7 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "saturn.h"
@@ -161,7 +162,7 @@ INLINE void saturn_take_irq(saturn_state *cpustate)
saturn_push(cpustate, cpustate->pc);
cpustate->pc=IRQ_ADDRESS;
- LOG(("Saturn '%s' takes IRQ ($%04x)\n", cpustate->device->tag, cpustate->pc));
+ LOG(("Saturn '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), cpustate->pc));
if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, SATURN_IRQ_LINE);
}
@@ -205,7 +206,7 @@ static void saturn_set_nmi_line(saturn_state *cpustate, int state)
cpustate->nmi_state = state;
if ( state != CLEAR_LINE )
{
- LOG(( "SATURN '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag));
+ LOG(( "SATURN '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
cpustate->pending_irq = 1;
}
}
@@ -216,7 +217,7 @@ static void saturn_set_irq_line(saturn_state *cpustate, int state)
cpustate->irq_state = state;
if ( state != CLEAR_LINE && cpustate->irq_enable )
{
- LOG(( "SATURN '%s' set_irq_line(ASSERT)\n", cpustate->device->tag));
+ LOG(( "SATURN '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
cpustate->pending_irq = 1;
}
}
@@ -225,7 +226,7 @@ static void saturn_set_wakeup_line(saturn_state *cpustate, int state)
{
if (cpustate->sleeping && state==1)
{
- LOG(( "SATURN '%s' set_wakeup_line(ASSERT)\n", cpustate->device->tag));
+ LOG(( "SATURN '%s' set_wakeup_line(ASSERT)\n", cpustate->device->tag.cstr()));
if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, SATURN_WAKEUP_LINE);
cpustate->sleeping = 0;
}
diff --git a/src/emu/cpu/saturn/saturn.h b/src/emu/cpu/saturn/saturn.h
index e505f2afbbe..1426faaceec 100644
--- a/src/emu/cpu/saturn/saturn.h
+++ b/src/emu/cpu/saturn/saturn.h
@@ -45,7 +45,6 @@ HP38G 09/??/95 1LT8 Yorke
#ifndef __SATURN_H__
#define _SATURN_H
-#include "cpuintrf.h"
#define SATURN_INT_NONE 0
#define SATURN_INT_IRQ 1
diff --git a/src/emu/cpu/saturn/saturnds.c b/src/emu/cpu/saturn/saturnds.c
index 9803d88413b..e0889250027 100644
--- a/src/emu/cpu/saturn/saturnds.c
+++ b/src/emu/cpu/saturn/saturnds.c
@@ -22,7 +22,7 @@
*
*****************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "saturn.h"
diff --git a/src/emu/cpu/sc61860/sc61860.c b/src/emu/cpu/sc61860/sc61860.c
index fe9392e5e66..a739a30e4bc 100644
--- a/src/emu/cpu/sc61860/sc61860.c
+++ b/src/emu/cpu/sc61860/sc61860.c
@@ -27,6 +27,7 @@
* Extended execute procudure with HLT-mode of CPU.
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "sc61860.h"
diff --git a/src/emu/cpu/sc61860/sc61860.h b/src/emu/cpu/sc61860/sc61860.h
index 7c854f610f3..a475afb6e43 100644
--- a/src/emu/cpu/sc61860/sc61860.h
+++ b/src/emu/cpu/sc61860/sc61860.h
@@ -36,7 +36,6 @@
only readable with special instructions and program execution
64 kb external ram (first 8kbyte not seen for program execution?) */
-#include "cpuintrf.h"
typedef struct _sc61860_cpu_core sc61860_cpu_core;
struct _sc61860_cpu_core
diff --git a/src/emu/cpu/sc61860/scdasm.c b/src/emu/cpu/sc61860/scdasm.c
index 768afab12a6..2a77e75d98b 100644
--- a/src/emu/cpu/sc61860/scdasm.c
+++ b/src/emu/cpu/sc61860/scdasm.c
@@ -20,7 +20,7 @@
*
*****************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "sc61860.h"
diff --git a/src/emu/cpu/scmp/scmp.c b/src/emu/cpu/scmp/scmp.c
index 8781ebc6065..85af04b4084 100644
--- a/src/emu/cpu/scmp/scmp.c
+++ b/src/emu/cpu/scmp/scmp.c
@@ -8,6 +8,7 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "scmp.h"
diff --git a/src/emu/cpu/scmp/scmp.h b/src/emu/cpu/scmp/scmp.h
index 5c8cf74b1e6..968e9685bda 100644
--- a/src/emu/cpu/scmp/scmp.h
+++ b/src/emu/cpu/scmp/scmp.h
@@ -1,8 +1,6 @@
#ifndef __SCMP_H__
#define __SCMP_H__
-#include "cpuintrf.h"
-#include "devcb.h"
/***************************************************************************
CONSTANTS
diff --git a/src/emu/cpu/scmp/scmpdasm.c b/src/emu/cpu/scmp/scmpdasm.c
index 2c685223fc9..86c7901c4fd 100644
--- a/src/emu/cpu/scmp/scmpdasm.c
+++ b/src/emu/cpu/scmp/scmpdasm.c
@@ -8,7 +8,7 @@
*
*****************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#define OP(A) oprom[(A) - PC]
#define ARG(A) opram[(A) - PC]
diff --git a/src/emu/cpu/se3208/se3208.c b/src/emu/cpu/se3208/se3208.c
index cdd5ec25aa8..640106d79ba 100644
--- a/src/emu/cpu/se3208/se3208.c
+++ b/src/emu/cpu/se3208/se3208.c
@@ -1,3 +1,4 @@
+#include "emu.h"
#include "debugger.h"
#include "se3208.h"
diff --git a/src/emu/cpu/se3208/se3208.h b/src/emu/cpu/se3208/se3208.h
index b6346fca4ef..b580e900ad4 100644
--- a/src/emu/cpu/se3208/se3208.h
+++ b/src/emu/cpu/se3208/se3208.h
@@ -1,4 +1,3 @@
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/se3208/se3208dis.c b/src/emu/cpu/se3208/se3208dis.c
index 66563ffcf5a..a348d2b070e 100644
--- a/src/emu/cpu/se3208/se3208dis.c
+++ b/src/emu/cpu/se3208/se3208dis.c
@@ -1,3 +1,4 @@
+#include "emu.h"
#include "debugger.h"
#include "se3208.h"
diff --git a/src/emu/cpu/sh2/sh2.c b/src/emu/cpu/sh2/sh2.c
index e18ce428525..35f162d4865 100644
--- a/src/emu/cpu/sh2/sh2.c
+++ b/src/emu/cpu/sh2/sh2.c
@@ -99,6 +99,7 @@
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "sh2.h"
#include "sh2comn.h"
diff --git a/src/emu/cpu/sh2/sh2.h b/src/emu/cpu/sh2/sh2.h
index ae75a732082..a89adb60801 100644
--- a/src/emu/cpu/sh2/sh2.h
+++ b/src/emu/cpu/sh2/sh2.h
@@ -30,7 +30,6 @@
#ifndef __SH2_H__
#define __SH2_H__
-#include "cpuintrf.h"
#define SH2_INT_NONE -1
#define SH2_INT_VBLIN 0
diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c
index d040a539ef9..865a471a0d2 100644
--- a/src/emu/cpu/sh2/sh2comn.c
+++ b/src/emu/cpu/sh2/sh2comn.c
@@ -6,8 +6,8 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
-#include "cpuexec.h"
#include "sh2.h"
#include "sh2comn.h"
@@ -101,7 +101,7 @@ static void sh2_timer_activate(SH2 *sh2)
sh2->frc_base = cpu_get_total_cycles(sh2->device);
timer_adjust_oneshot(sh2->timer, cpu_clocks_to_attotime(sh2->device, max_delta), 0);
} else {
- logerror("SH2.%s: Timer event in %d cycles of external clock", sh2->device->tag, max_delta);
+ logerror("SH2.%s: Timer event in %d cycles of external clock", sh2->device->tag.cstr(), max_delta);
}
}
}
@@ -138,7 +138,7 @@ static TIMER_CALLBACK( sh2_dmac_callback )
int dma = param & 1;
SH2 *sh2 = (SH2 *)ptr;
- LOG(("SH2.%s: DMA %d complete\n", sh2->device->tag, dma));
+ LOG(("SH2.%s: DMA %d complete\n", sh2->device->tag.cstr(), dma));
sh2->m[0x63+4*dma] |= 2;
sh2->dma_timer_active[dma] = 0;
sh2_recalc_irq(sh2);
@@ -306,7 +306,7 @@ WRITE32_HANDLER( sh2_internal_w )
case 0x04: // TIER, FTCSR, FRC
if((mem_mask & 0x00ffffff) != 0)
sh2_timer_resync(sh2);
-// printf("SH2.%s: TIER write %04x @ %04x\n", sh2->device->tag, data >> 16, mem_mask>>16);
+// printf("SH2.%s: TIER write %04x @ %04x\n", sh2->device->tag.cstr(), data >> 16, mem_mask>>16);
sh2->m[4] = (sh2->m[4] & ~(ICF|OCFA|OCFB|OVF)) | (old & sh2->m[4] & (ICF|OCFA|OCFB|OVF));
COMBINE_DATA(&sh2->frc);
if((mem_mask & 0x00ffffff) != 0)
@@ -314,7 +314,7 @@ WRITE32_HANDLER( sh2_internal_w )
sh2_recalc_irq(sh2);
break;
case 0x05: // OCRx, TCR, TOCR
-// printf("SH2.%s: TCR write %08x @ %08x\n", sh2->device->tag, data, mem_mask);
+// printf("SH2.%s: TCR write %08x @ %08x\n", sh2->device->tag.cstr(), data, mem_mask);
sh2_timer_resync(sh2);
if(sh2->m[5] & 0x10)
sh2->ocrb = (sh2->ocrb & (~mem_mask >> 16)) | ((data & mem_mask) >> 16);
@@ -358,7 +358,7 @@ WRITE32_HANDLER( sh2_internal_w )
{
INT32 a = sh2->m[0x41];
INT32 b = sh2->m[0x40];
- LOG(("SH2 '%s' div+mod %d/%d\n", sh2->device->tag, a, b));
+ LOG(("SH2 '%s' div+mod %d/%d\n", sh2->device->tag.cstr(), a, b));
if (b)
{
sh2->m[0x45] = a / b;
@@ -386,7 +386,7 @@ WRITE32_HANDLER( sh2_internal_w )
{
INT64 a = sh2->m[0x45] | ((UINT64)(sh2->m[0x44]) << 32);
INT64 b = (INT32)sh2->m[0x40];
- LOG(("SH2 '%s' div+mod %" I64FMT "d/%" I64FMT "d\n", sh2->device->tag, a, b));
+ LOG(("SH2 '%s' div+mod %" I64FMT "d/%" I64FMT "d\n", sh2->device->tag.cstr(), a, b));
if (b)
{
INT64 q = a / b;
@@ -536,7 +536,7 @@ void sh2_set_frt_input(const device_config *device, int state)
sh2_timer_resync(sh2);
sh2->icr = sh2->frc;
sh2->m[4] |= ICF;
- logerror("SH2.%s: ICF activated (%x)\n", sh2->device->tag, sh2->pc & AM);
+ logerror("SH2.%s: ICF activated (%x)\n", sh2->device->tag.cstr(), sh2->pc & AM);
sh2_recalc_irq(sh2);
}
@@ -550,11 +550,11 @@ void sh2_set_irq_line(SH2 *sh2, int irqline, int state)
if( state == CLEAR_LINE )
{
- LOG(("SH-2 '%s' cleared nmi\n", sh2->device->tag));
+ LOG(("SH-2 '%s' cleared nmi\n", sh2->device->tag.cstr()));
}
else
{
- LOG(("SH-2 '%s' assert nmi\n", sh2->device->tag));
+ LOG(("SH-2 '%s' assert nmi\n", sh2->device->tag.cstr()));
sh2_exception(sh2, "Set IRQ line", 16);
@@ -571,12 +571,12 @@ void sh2_set_irq_line(SH2 *sh2, int irqline, int state)
if( state == CLEAR_LINE )
{
- LOG(("SH-2 '%s' cleared irq #%d\n", sh2->device->tag, irqline));
+ LOG(("SH-2 '%s' cleared irq #%d\n", sh2->device->tag.cstr(), irqline));
sh2->pending_irq &= ~(1 << irqline);
}
else
{
- LOG(("SH-2 '%s' assert irq #%d\n", sh2->device->tag, irqline));
+ LOG(("SH-2 '%s' assert irq #%d\n", sh2->device->tag.cstr(), irqline));
sh2->pending_irq |= 1 << irqline;
#ifdef USE_SH2DRC
sh2->test_irq = 1;
@@ -647,27 +647,27 @@ void sh2_exception(SH2 *sh2, const char *message, int irqline)
if (sh2->internal_irq_level == irqline)
{
vector = sh2->internal_irq_vector;
- LOG(("SH-2 '%s' exception #%d (internal vector: $%x) after [%s]\n", sh2->device->tag, irqline, vector, message));
+ LOG(("SH-2 '%s' exception #%d (internal vector: $%x) after [%s]\n", sh2->device->tag.cstr(), irqline, vector, message));
}
else
{
if(sh2->m[0x38] & 0x00010000)
{
vector = sh2->irq_callback(sh2->device, irqline);
- LOG(("SH-2 '%s' exception #%d (external vector: $%x) after [%s]\n", sh2->device->tag, irqline, vector, message));
+ LOG(("SH-2 '%s' exception #%d (external vector: $%x) after [%s]\n", sh2->device->tag.cstr(), irqline, vector, message));
}
else
{
sh2->irq_callback(sh2->device, irqline);
vector = 64 + irqline/2;
- LOG(("SH-2 '%s' exception #%d (autovector: $%x) after [%s]\n", sh2->device->tag, irqline, vector, message));
+ LOG(("SH-2 '%s' exception #%d (autovector: $%x) after [%s]\n", sh2->device->tag.cstr(), irqline, vector, message));
}
}
}
else
{
vector = 11;
- LOG(("SH-2 '%s' nmi exception (autovector: $%x) after [%s]\n", sh2->device->tag, vector, message));
+ LOG(("SH-2 '%s' nmi exception (autovector: $%x) after [%s]\n", sh2->device->tag.cstr(), vector, message));
}
#ifdef USE_SH2DRC
diff --git a/src/emu/cpu/sh2/sh2comn.h b/src/emu/cpu/sh2/sh2comn.h
index ba0f197e8f1..2c48eafeacf 100644
--- a/src/emu/cpu/sh2/sh2comn.h
+++ b/src/emu/cpu/sh2/sh2comn.h
@@ -11,7 +11,6 @@
#ifndef __SH2COMN_H__
#define __SH2COMN_H__
-#include "timer.h"
#define USE_SH2DRC
diff --git a/src/emu/cpu/sh2/sh2dasm.c b/src/emu/cpu/sh2/sh2dasm.c
index f4d430a5714..bf051d844f5 100644
--- a/src/emu/cpu/sh2/sh2dasm.c
+++ b/src/emu/cpu/sh2/sh2dasm.c
@@ -1,3 +1,4 @@
+#include "emu.h"
#include "debugger.h"
#include "sh2.h"
diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c
index 0caa462e4d3..0acdb13c448 100644
--- a/src/emu/cpu/sh2/sh2drc.c
+++ b/src/emu/cpu/sh2/sh2drc.c
@@ -15,10 +15,10 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "sh2.h"
#include "sh2comn.h"
-#include "eminline.h"
#include "profiler.h"
CPU_DISASSEMBLE( sh2 );
diff --git a/src/emu/cpu/sh2/sh2fe.c b/src/emu/cpu/sh2/sh2fe.c
index 043340bb63c..89ea586004d 100644
--- a/src/emu/cpu/sh2/sh2fe.c
+++ b/src/emu/cpu/sh2/sh2fe.c
@@ -9,7 +9,7 @@
***************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#include "sh2.h"
#include "sh2comn.h"
#include "cpu/drcfe.h"
diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c
index 77ae140b0ea..8a8b44dd9ea 100644
--- a/src/emu/cpu/sh4/sh4.c
+++ b/src/emu/cpu/sh4/sh4.c
@@ -22,6 +22,7 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "sh4.h"
#include "sh4regs.h"
diff --git a/src/emu/cpu/sh4/sh4.h b/src/emu/cpu/sh4/sh4.h
index f1d251504b0..8bc2d370a60 100644
--- a/src/emu/cpu/sh4/sh4.h
+++ b/src/emu/cpu/sh4/sh4.h
@@ -11,7 +11,6 @@
#ifndef __SH4_H__
#define __SH4_H__
-#include "cpuintrf.h"
#define SH4_INT_NONE -1
enum
diff --git a/src/emu/cpu/sh4/sh4comn.c b/src/emu/cpu/sh4/sh4comn.c
index 83c434caee8..93ee5f542b8 100644
--- a/src/emu/cpu/sh4/sh4comn.c
+++ b/src/emu/cpu/sh4/sh4comn.c
@@ -6,8 +6,8 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
-#include "cpuexec.h"
#include "sh4.h"
#include "sh4regs.h"
#include "sh4comn.h"
@@ -179,7 +179,7 @@ void sh4_exception(SH4 *sh4, const char *message, int exception) // handle excep
sh4->m[INTEVT] = 0x1c0;
vector = 0x600;
sh4->irq_callback(sh4->device, INPUT_LINE_NMI);
- LOG(("SH-4 '%s' nmi exception after [%s]\n", sh4->device->tag, message));
+ LOG(("SH-4 '%s' nmi exception after [%s]\n", sh4->device->tag.cstr(), message));
} else {
// if ((sh4->m[ICR] & 0x4000) && (sh4->nmi_line_state == ASSERT_LINE))
// return;
@@ -193,7 +193,7 @@ void sh4_exception(SH4 *sh4, const char *message, int exception) // handle excep
sh4->irq_callback(sh4->device, SH4_INTC_IRL0-exception+SH4_IRL0);
else
sh4->irq_callback(sh4->device, SH4_IRL3+1);
- LOG(("SH-4 '%s' interrupt exception #%d after [%s]\n", sh4->device->tag, exception, message));
+ LOG(("SH-4 '%s' interrupt exception #%d after [%s]\n", sh4->device->tag.cstr(), exception, message));
}
sh4_exception_checkunrequest(sh4, exception);
@@ -407,7 +407,7 @@ static TIMER_CALLBACK( sh4_dmac_callback )
SH4 *sh4 = (SH4 *)ptr;
int channel = param;
- LOG(("SH4 '%s': DMA %d complete\n", sh4->device->tag, channel));
+ LOG(("SH4 '%s': DMA %d complete\n", sh4->device->tag.cstr(), channel));
sh4->dma_timer_active[channel] = 0;
switch (channel)
{
@@ -1028,7 +1028,7 @@ void sh4_set_frt_input(const device_config *device, int state)
sh4_timer_resync();
sh4->icr = sh4->frc;
sh4->m[4] |= ICF;
- logerror("SH4 '%s': ICF activated (%x)\n", sh4->device->tag, sh4->pc & AM);
+ logerror("SH4 '%s': ICF activated (%x)\n", sh4->device->tag.cstr(), sh4->pc & AM);
sh4_recalc_irq();
#endif
}
@@ -1056,7 +1056,7 @@ void sh4_set_irq_line(SH4 *sh4, int irqline, int state) // set state of external
{
if ((state == CLEAR_LINE) && (sh4->nmi_line_state == ASSERT_LINE)) // rising
{
- LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag));
+ LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag.cstr()));
sh4_exception_request(sh4, SH4_INTC_NMI);
sh4_dmac_nmi(sh4);
}
@@ -1065,7 +1065,7 @@ void sh4_set_irq_line(SH4 *sh4, int irqline, int state) // set state of external
{
if ((state == ASSERT_LINE) && (sh4->nmi_line_state == CLEAR_LINE)) // falling
{
- LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag));
+ LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag.cstr()));
sh4_exception_request(sh4, SH4_INTC_NMI);
sh4_dmac_nmi(sh4);
}
@@ -1088,12 +1088,12 @@ void sh4_set_irq_line(SH4 *sh4, int irqline, int state) // set state of external
if( state == CLEAR_LINE )
{
- LOG(("SH-4 '%s' cleared external irq IRL%d\n", sh4->device->tag, irqline));
+ LOG(("SH-4 '%s' cleared external irq IRL%d\n", sh4->device->tag.cstr(), irqline));
sh4_exception_unrequest(sh4, SH4_INTC_IRL0+irqline-SH4_IRL0);
}
else
{
- LOG(("SH-4 '%s' assert external irq IRL%d\n", sh4->device->tag, irqline));
+ LOG(("SH-4 '%s' assert external irq IRL%d\n", sh4->device->tag.cstr(), irqline));
sh4_exception_request(sh4, SH4_INTC_IRL0+irqline-SH4_IRL0);
}
}
@@ -1107,7 +1107,7 @@ void sh4_set_irq_line(SH4 *sh4, int irqline, int state) // set state of external
sh4_exception_unrequest(sh4, SH4_INTC_IRLn0+s);
if (sh4->irln < 15)
sh4_exception_request(sh4, SH4_INTC_IRLn0+sh4->irln);
- LOG(("SH-4 '%s' IRLn0-IRLn3 level #%d\n", sh4->device->tag, sh4->irln));
+ LOG(("SH-4 '%s' IRLn0-IRLn3 level #%d\n", sh4->device->tag.cstr(), sh4->irln));
}
}
if (sh4->test_irq && (!sh4->delay))
diff --git a/src/emu/cpu/sh4/sh4dasm.c b/src/emu/cpu/sh4/sh4dasm.c
index c01fc777cf9..a71334a51d7 100644
--- a/src/emu/cpu/sh4/sh4dasm.c
+++ b/src/emu/cpu/sh4/sh4dasm.c
@@ -1,3 +1,4 @@
+#include "emu.h"
#include "debugger.h"
#include "sh4.h"
diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c
index 14f1881862f..368f63fc517 100644
--- a/src/emu/cpu/sharc/sharc.c
+++ b/src/emu/cpu/sharc/sharc.c
@@ -3,8 +3,9 @@
Written by Ville Linde
*/
-#include "sharc.h"
+#include "emu.h"
#include "debugger.h"
+#include "sharc.h"
CPU_DISASSEMBLE( sharc );
diff --git a/src/emu/cpu/sharc/sharc.h b/src/emu/cpu/sharc/sharc.h
index 641db6647e0..83ea58ab173 100644
--- a/src/emu/cpu/sharc/sharc.h
+++ b/src/emu/cpu/sharc/sharc.h
@@ -3,7 +3,6 @@
#ifndef __SHARC_H__
#define __SHARC_H__
-#include "cpuintrf.h"
#define SHARC_INPUT_FLAG0 3
#define SHARC_INPUT_FLAG1 4
diff --git a/src/emu/cpu/sharc/sharcdsm.c b/src/emu/cpu/sharc/sharcdsm.c
index f5ab5c98318..1c97125aa43 100644
--- a/src/emu/cpu/sharc/sharcdsm.c
+++ b/src/emu/cpu/sharc/sharcdsm.c
@@ -4,9 +4,8 @@
Written by Ville Linde for use in MAME
*/
-#include "cpuintrf.h"
+#include "emu.h"
#include "sharcdsm.h"
-#include <stdarg.h>
static UINT32 (* sharcdasm_table[256])(UINT32, UINT64);
static int dasm_table_built = 0;
diff --git a/src/emu/cpu/sm8500/sm8500.c b/src/emu/cpu/sm8500/sm8500.c
index c720f5d55d2..d42dc1315c0 100644
--- a/src/emu/cpu/sm8500/sm8500.c
+++ b/src/emu/cpu/sm8500/sm8500.c
@@ -9,6 +9,7 @@
Code by Wilbert Pol
*/
+#include "emu.h"
#include "debugger.h"
#include "sm8500.h"
diff --git a/src/emu/cpu/sm8500/sm8500.h b/src/emu/cpu/sm8500/sm8500.h
index 444addbe408..b1d0bf4ccc3 100644
--- a/src/emu/cpu/sm8500/sm8500.h
+++ b/src/emu/cpu/sm8500/sm8500.h
@@ -3,7 +3,6 @@
#ifndef __SM8500_H__
#define __SM8500_H__
-#include "cpuintrf.h"
typedef struct {
void (*handle_dma)(const device_config *device, int cycles);
diff --git a/src/emu/cpu/sm8500/sm8500d.c b/src/emu/cpu/sm8500/sm8500d.c
index 1a7ab4e9237..4fc3677e753 100644
--- a/src/emu/cpu/sm8500/sm8500d.c
+++ b/src/emu/cpu/sm8500/sm8500d.c
@@ -7,7 +7,7 @@ Sharp sm8500 CPU disassembly
*******************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "sm8500.h"
diff --git a/src/emu/cpu/spc700/spc700.c b/src/emu/cpu/spc700/spc700.c
index b809894df60..236c77d80ce 100644
--- a/src/emu/cpu/spc700/spc700.c
+++ b/src/emu/cpu/spc700/spc700.c
@@ -61,6 +61,7 @@ Address Function Register R/W When Reset Remarks
/* ======================================================================== */
#include <limits.h>
+#include "emu.h"
#include "debugger.h"
#include "spc700.h"
diff --git a/src/emu/cpu/spc700/spc700.h b/src/emu/cpu/spc700/spc700.h
index 82c917be6c6..9e587c3998a 100644
--- a/src/emu/cpu/spc700/spc700.h
+++ b/src/emu/cpu/spc700/spc700.h
@@ -3,7 +3,6 @@
#ifndef __SPC700_H__
#define __SPC700_H__
-#include "cpuintrf.h"
extern CPU_GET_INFO( spc700 );
#define CPU_SPC700 CPU_GET_INFO_NAME( spc700 )
diff --git a/src/emu/cpu/spc700/spc700ds.c b/src/emu/cpu/spc700/spc700ds.c
index 2bdc376fc30..d975f31c2d6 100644
--- a/src/emu/cpu/spc700/spc700ds.c
+++ b/src/emu/cpu/spc700/spc700ds.c
@@ -15,7 +15,7 @@ author (Karl Stenerud) at karl@higashiyama-unet.ocn.ne.jp.
*/
-
+#include "emu.h"
#include "spc700ds.h"
diff --git a/src/emu/cpu/spc700/spc700ds.h b/src/emu/cpu/spc700/spc700ds.h
index bb03934f601..8dcbf56b629 100644
--- a/src/emu/cpu/spc700/spc700ds.h
+++ b/src/emu/cpu/spc700/spc700ds.h
@@ -19,7 +19,6 @@ author (Karl Stenerud) at karl@higashiyama-unet.ocn.ne.jp.
*/
-#include "cpuintrf.h"
CPU_DISASSEMBLE( spc700 );
diff --git a/src/emu/cpu/ssem/ssem.c b/src/emu/cpu/ssem/ssem.c
index cb710f4cee5..9643f3cec18 100644
--- a/src/emu/cpu/ssem/ssem.c
+++ b/src/emu/cpu/ssem/ssem.c
@@ -4,7 +4,7 @@
Written by MooglyGuy
*/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "ssem.h"
diff --git a/src/emu/cpu/ssem/ssemdasm.c b/src/emu/cpu/ssem/ssemdasm.c
index 9da5eeddd72..aa9c7d3c333 100644
--- a/src/emu/cpu/ssem/ssemdasm.c
+++ b/src/emu/cpu/ssem/ssemdasm.c
@@ -4,8 +4,7 @@
Written by MooglyGuy
*/
-#include "cpuintrf.h"
-#include <stdarg.h>
+#include "emu.h"
static char *output;
diff --git a/src/emu/cpu/ssp1601/ssp1601.c b/src/emu/cpu/ssp1601/ssp1601.c
index d4d4d474e38..788ce84baef 100644
--- a/src/emu/cpu/ssp1601/ssp1601.c
+++ b/src/emu/cpu/ssp1601/ssp1601.c
@@ -17,6 +17,7 @@
* ops not used by VR are not implemented
*/
+#include "emu.h"
#include "debugger.h"
#include "ssp1601.h"
diff --git a/src/emu/cpu/ssp1601/ssp1601.h b/src/emu/cpu/ssp1601/ssp1601.h
index f1dca8b270d..0297f337e94 100644
--- a/src/emu/cpu/ssp1601/ssp1601.h
+++ b/src/emu/cpu/ssp1601/ssp1601.h
@@ -3,7 +3,6 @@
#ifndef __SSP1601_H__
#define __SSP1601_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/ssp1601/ssp1601d.c b/src/emu/cpu/ssp1601/ssp1601d.c
index 4563eb7c202..9952afe6db5 100644
--- a/src/emu/cpu/ssp1601/ssp1601d.c
+++ b/src/emu/cpu/ssp1601/ssp1601d.c
@@ -6,9 +6,8 @@
*/
-#include <math.h>
+#include "emu.h"
#include "debugger.h"
-#include "cpuintrf.h"
static const char *const reg[16] =
diff --git a/src/emu/cpu/superfx/sfx_dasm.c b/src/emu/cpu/superfx/sfx_dasm.c
index 91e9a66e4c3..ce95f6e17a3 100644
--- a/src/emu/cpu/superfx/sfx_dasm.c
+++ b/src/emu/cpu/superfx/sfx_dasm.c
@@ -1,6 +1,5 @@
-#include "cpuintrf.h"
+#include "emu.h"
#include "superfx.h"
-#include <stdarg.h>
static char *output;
diff --git a/src/emu/cpu/superfx/superfx.c b/src/emu/cpu/superfx/superfx.c
index b72dc72a369..f51a6b0f1d3 100644
--- a/src/emu/cpu/superfx/superfx.c
+++ b/src/emu/cpu/superfx/superfx.c
@@ -1,4 +1,4 @@
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "superfx.h"
diff --git a/src/emu/cpu/superfx/superfx.h b/src/emu/cpu/superfx/superfx.h
index 4b308ec10d8..96043a8fde6 100644
--- a/src/emu/cpu/superfx/superfx.h
+++ b/src/emu/cpu/superfx/superfx.h
@@ -1,7 +1,6 @@
#ifndef __SUPERFX_H__
#define __SUPERFX_H__
-#include "devcb.h"
enum
{
diff --git a/src/emu/cpu/t11/t11.c b/src/emu/cpu/t11/t11.c
index d8f06f7983d..2cb09ee2e7f 100644
--- a/src/emu/cpu/t11/t11.c
+++ b/src/emu/cpu/t11/t11.c
@@ -11,6 +11,7 @@
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "t11.h"
diff --git a/src/emu/cpu/t11/t11.h b/src/emu/cpu/t11/t11.h
index bee6b0ac3e4..7fee036d816 100644
--- a/src/emu/cpu/t11/t11.h
+++ b/src/emu/cpu/t11/t11.h
@@ -5,7 +5,6 @@
#ifndef __T11_H__
#define __T11_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/t11/t11dasm.c b/src/emu/cpu/t11/t11dasm.c
index 60ab7533e2d..56402be9810 100644
--- a/src/emu/cpu/t11/t11dasm.c
+++ b/src/emu/cpu/t11/t11dasm.c
@@ -7,6 +7,7 @@
*
*/
+#include "emu.h"
#include "debugger.h"
#include "t11.h"
diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c
index 1d708e85e72..ee4beb713a1 100644
--- a/src/emu/cpu/tlcs90/tlcs90.c
+++ b/src/emu/cpu/tlcs90/tlcs90.c
@@ -6,8 +6,8 @@
*************************************************************************************************************/
+#include "emu.h"
#include "debugger.h"
-#include "cpuexec.h"
#include "tlcs90.h"
typedef enum { UNKNOWN, NOP, EX, EXX, LD, LDW, LDA, LDI, LDIR, LDD, LDDR, CPI, CPIR, CPD, CPDR, PUSH, POP, JP, JR, CALL, CALLR, RET, RETI, HALT, DI, EI, SWI, DAA, CPL, NEG, LDAR, RCF, SCF, CCF, TSET, BIT, SET, RES, INC, DEC, INCX, DECX, INCW, DECW, ADD, ADC, SUB, SBC, AND, XOR, OR, CP, RLC, RRC, RL, RR, SLA, SRA, SLL, SRL, RLD, RRD, DJNZ, MUL, DIV } _e_op;
diff --git a/src/emu/cpu/tlcs90/tlcs90.h b/src/emu/cpu/tlcs90/tlcs90.h
index 9b53b843131..7fc5c1d53e1 100644
--- a/src/emu/cpu/tlcs90/tlcs90.h
+++ b/src/emu/cpu/tlcs90/tlcs90.h
@@ -3,7 +3,6 @@
#ifndef __TLCS90_H__
#define __TLCS90_H__
-#include "cpuintrf.h"
CPU_GET_INFO( tmp90840 );
CPU_GET_INFO( tmp90841 );
diff --git a/src/emu/cpu/tlcs900/dasm900.c b/src/emu/cpu/tlcs900/dasm900.c
index 1ecbaf14837..8fd81f3ffb3 100644
--- a/src/emu/cpu/tlcs900/dasm900.c
+++ b/src/emu/cpu/tlcs900/dasm900.c
@@ -4,7 +4,7 @@ Toshiba TLCS-900/H disassembly
*******************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "tlcs900.h"
diff --git a/src/emu/cpu/tlcs900/tlcs900.c b/src/emu/cpu/tlcs900/tlcs900.c
index eb803d86ceb..b481eadabfe 100644
--- a/src/emu/cpu/tlcs900/tlcs900.c
+++ b/src/emu/cpu/tlcs900/tlcs900.c
@@ -13,6 +13,7 @@ TODO:
*******************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "tlcs900.h"
diff --git a/src/emu/cpu/tlcs900/tlcs900.h b/src/emu/cpu/tlcs900/tlcs900.h
index e83aa2b3745..5be5736637a 100644
--- a/src/emu/cpu/tlcs900/tlcs900.h
+++ b/src/emu/cpu/tlcs900/tlcs900.h
@@ -1,8 +1,6 @@
#ifndef __TLCS900_H__
#define __TLCS900_H__
-#include "cpuintrf.h"
-#include "devcb.h"
enum tlcs900_inputs
diff --git a/src/emu/cpu/tms0980/tms0980.c b/src/emu/cpu/tms0980/tms0980.c
index a123168341a..4de360fe38a 100644
--- a/src/emu/cpu/tms0980/tms0980.c
+++ b/src/emu/cpu/tms0980/tms0980.c
@@ -119,6 +119,7 @@ unknown cycle: CME, SSE, SSS
*/
+#include "emu.h"
#include "debugger.h"
#include "tms0980.h"
diff --git a/src/emu/cpu/tms0980/tms0980.h b/src/emu/cpu/tms0980/tms0980.h
index 78d2234ae48..03544ee83c6 100644
--- a/src/emu/cpu/tms0980/tms0980.h
+++ b/src/emu/cpu/tms0980/tms0980.h
@@ -1,7 +1,6 @@
#ifndef _TMS0980_H_
#define _TMS0980_H_
-#include "cpuintrf.h"
/* Registers */
enum {
diff --git a/src/emu/cpu/tms0980/tms0980d.c b/src/emu/cpu/tms0980/tms0980d.c
index 9062d744850..18fe46d9c87 100644
--- a/src/emu/cpu/tms0980/tms0980d.c
+++ b/src/emu/cpu/tms0980/tms0980d.c
@@ -5,6 +5,7 @@ TMS0980 disassembly
*******************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "tms0980.h"
diff --git a/src/emu/cpu/tms32010/32010dsm.c b/src/emu/cpu/tms32010/32010dsm.c
index 3d95a08f525..eec28572f96 100644
--- a/src/emu/cpu/tms32010/32010dsm.c
+++ b/src/emu/cpu/tms32010/32010dsm.c
@@ -24,14 +24,11 @@
* *
\**************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "emu.h"
+#include "debugger.h"
#include <ctype.h>
-#include "cpuintrf.h"
#include "tms32010.h"
-#include "debugger.h"
diff --git a/src/emu/cpu/tms32010/tms32010.c b/src/emu/cpu/tms32010/tms32010.c
index ef948c6b1aa..47baef8e637 100644
--- a/src/emu/cpu/tms32010/tms32010.c
+++ b/src/emu/cpu/tms32010/tms32010.c
@@ -52,6 +52,7 @@
\**************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "tms32010.h"
diff --git a/src/emu/cpu/tms32010/tms32010.h b/src/emu/cpu/tms32010/tms32010.h
index 602e9461872..07ba9371c95 100644
--- a/src/emu/cpu/tms32010/tms32010.h
+++ b/src/emu/cpu/tms32010/tms32010.h
@@ -17,8 +17,6 @@
#define __TMS32010_H__
-#include "cpuintrf.h"
-
/****************************************************************************
diff --git a/src/emu/cpu/tms32025/32025dsm.c b/src/emu/cpu/tms32025/32025dsm.c
index d06298f1b3d..5d8bf4f195d 100644
--- a/src/emu/cpu/tms32025/32025dsm.c
+++ b/src/emu/cpu/tms32025/32025dsm.c
@@ -28,13 +28,11 @@
* *
\**************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "emu.h"
+#include "debugger.h"
#include <ctype.h>
#include "tms32025.h"
-#include "debugger.h"
diff --git a/src/emu/cpu/tms32025/tms32025.c b/src/emu/cpu/tms32025/tms32025.c
index 5c2f723e615..8266e03e156 100644
--- a/src/emu/cpu/tms32025/tms32025.c
+++ b/src/emu/cpu/tms32025/tms32025.c
@@ -116,6 +116,7 @@ Table 3-2. TMS32025/26 Memory Blocks
*/
+#include "emu.h"
#include "debugger.h"
#include "tms32025.h"
diff --git a/src/emu/cpu/tms32025/tms32025.h b/src/emu/cpu/tms32025/tms32025.h
index 0334b687580..cc8174b9c29 100644
--- a/src/emu/cpu/tms32025/tms32025.h
+++ b/src/emu/cpu/tms32025/tms32025.h
@@ -21,8 +21,6 @@
#define __TMS32025_H__
-#include "cpuintrf.h"
-
#define TMS32025_BIO 0x10000 /* BIO input */
diff --git a/src/emu/cpu/tms32031/dis32031.c b/src/emu/cpu/tms32031/dis32031.c
index fa8c704307c..5684f293c4b 100644
--- a/src/emu/cpu/tms32031/dis32031.c
+++ b/src/emu/cpu/tms32031/dis32031.c
@@ -6,6 +6,7 @@
***************************************************************************/
+#include "emu.h"
#include "tms32031.h"
diff --git a/src/emu/cpu/tms32031/tms32031.c b/src/emu/cpu/tms32031/tms32031.c
index de930004515..eaf4db68a71 100644
--- a/src/emu/cpu/tms32031/tms32031.c
+++ b/src/emu/cpu/tms32031/tms32031.c
@@ -6,9 +6,9 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "tms32031.h"
-#include "eminline.h"
CPU_DISASSEMBLE( tms32031 );
diff --git a/src/emu/cpu/tms32031/tms32031.h b/src/emu/cpu/tms32031/tms32031.h
index 6662884a701..abb852ddb1a 100644
--- a/src/emu/cpu/tms32031/tms32031.h
+++ b/src/emu/cpu/tms32031/tms32031.h
@@ -11,8 +11,6 @@
#ifndef __TMS32031_H__
#define __TMS32031_H__
-#include "cpuintrf.h"
-
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/emu/cpu/tms32051/dis32051.c b/src/emu/cpu/tms32051/dis32051.c
index 2b49e25ed6c..82666e17052 100644
--- a/src/emu/cpu/tms32051/dis32051.c
+++ b/src/emu/cpu/tms32051/dis32051.c
@@ -1,5 +1,4 @@
-#include "cpuintrf.h"
-#include <stdarg.h>
+#include "emu.h"
diff --git a/src/emu/cpu/tms32051/tms32051.c b/src/emu/cpu/tms32051/tms32051.c
index 0d7eef12383..97a388578a6 100644
--- a/src/emu/cpu/tms32051/tms32051.c
+++ b/src/emu/cpu/tms32051/tms32051.c
@@ -4,8 +4,8 @@
Written by Ville Linde
*/
+#include "emu.h"
#include "debugger.h"
-#include "cpuintrf.h"
#include "tms32051.h"
#define INTERRUPT_INT1 0
diff --git a/src/emu/cpu/tms34010/34010dsm.c b/src/emu/cpu/tms34010/34010dsm.c
index d4b719e5fe8..af9f3683fda 100644
--- a/src/emu/cpu/tms34010/34010dsm.c
+++ b/src/emu/cpu/tms34010/34010dsm.c
@@ -5,7 +5,7 @@
*
*/
-#include "cpuintrf.h"
+#include "emu.h"
#ifdef STANDALONE
#define PC __pc + (offset << 3)
diff --git a/src/emu/cpu/tms34010/34010ops.h b/src/emu/cpu/tms34010/34010ops.h
index c54d3d6f610..bdf948651f1 100644
--- a/src/emu/cpu/tms34010/34010ops.h
+++ b/src/emu/cpu/tms34010/34010ops.h
@@ -12,7 +12,6 @@
#ifndef __34010OPS_H__
#define __34010OPS_H__
-#include "cpuintrf.h"
/* Size of the memory buffer allocated for the shiftr register */
#define SHIFTREG_SIZE (8 * 512 * sizeof(UINT16))
diff --git a/src/emu/cpu/tms34010/dis34010.c b/src/emu/cpu/tms34010/dis34010.c
index e2514b07810..8e67de99624 100644
--- a/src/emu/cpu/tms34010/dis34010.c
+++ b/src/emu/cpu/tms34010/dis34010.c
@@ -1,6 +1,6 @@
/* This program is based on DIS68k by Aaron Giles */
-#include "cpuintrf.h"
+#include "emu.h"
static UINT8 *filebuf;
static UINT32 offset;
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index 1b9319825e3..c34f79404d7 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -7,6 +7,7 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "tms34010.h"
@@ -598,7 +599,7 @@ static void check_interrupt(tms34010_state *tms)
/* check for NMI first */
if (IOREG(tms, REG_HSTCTLH) & 0x0100)
{
- LOG(("TMS34010 '%s' takes NMI\n", tms->device->tag));
+ LOG(("TMS34010 '%s' takes NMI\n", tms->device->tag.cstr()));
/* ack the NMI */
IOREG(tms, REG_HSTCTLH) &= ~0x0100;
@@ -625,28 +626,28 @@ static void check_interrupt(tms34010_state *tms)
/* host interrupt */
if (irq & TMS34010_HI)
{
- LOG(("TMS34010 '%s' takes HI\n", tms->device->tag));
+ LOG(("TMS34010 '%s' takes HI\n", tms->device->tag.cstr()));
vector = 0xfffffec0;
}
/* display interrupt */
else if (irq & TMS34010_DI)
{
- LOG(("TMS34010 '%s' takes DI\n", tms->device->tag));
+ LOG(("TMS34010 '%s' takes DI\n", tms->device->tag.cstr()));
vector = 0xfffffea0;
}
/* window violation interrupt */
else if (irq & TMS34010_WV)
{
- LOG(("TMS34010 '%s' takes WV\n", tms->device->tag));
+ LOG(("TMS34010 '%s' takes WV\n", tms->device->tag.cstr()));
vector = 0xfffffe80;
}
/* external 1 interrupt */
else if (irq & TMS34010_INT1)
{
- LOG(("TMS34010 '%s' takes INT1\n", tms->device->tag));
+ LOG(("TMS34010 '%s' takes INT1\n", tms->device->tag.cstr()));
vector = 0xffffffc0;
irqline = 0;
}
@@ -654,7 +655,7 @@ static void check_interrupt(tms34010_state *tms)
/* external 2 interrupt */
else if (irq & TMS34010_INT2)
{
- LOG(("TMS34010 '%s' takes INT2\n", tms->device->tag));
+ LOG(("TMS34010 '%s' takes INT2\n", tms->device->tag.cstr()));
vector = 0xffffffa0;
irqline = 1;
}
@@ -780,7 +781,7 @@ static CPU_EXIT( tms34010 )
static void set_irq_line(tms34010_state *tms, int irqline, int linestate)
{
- LOG(("TMS34010 '%s' set irq line %d state %d\n", tms->device->tag, irqline, linestate));
+ LOG(("TMS34010 '%s' set irq line %d state %d\n", tms->device->tag.cstr(), irqline, linestate));
/* set the pending interrupt */
switch (irqline)
@@ -814,7 +815,7 @@ static TIMER_CALLBACK( internal_interrupt_callback )
/* call through to the CPU to generate the int */
IOREG(tms, REG_INTPEND) |= type;
- LOG(("TMS34010 '%s' set internal interrupt $%04x\n", tms->device->tag, type));
+ LOG(("TMS34010 '%s' set internal interrupt $%04x\n", tms->device->tag.cstr(), type));
/* generate triggers so that spin loops can key off them */
cpu_triggerint(tms->device);
@@ -1150,7 +1151,7 @@ VIDEO_UPDATE( tms340x0 )
}
}
if (tms == NULL)
- fatalerror("Unable to locate matching CPU for screen '%s'\n", screen->tag);
+ fatalerror("Unable to locate matching CPU for screen '%s'\n", screen->tag.cstr());
/* get the display parameters for the screen */
tms34010_get_display_params(tms->device, &params);
@@ -1247,7 +1248,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
/* if the CPU is halting itself, stop execution right away */
if ((data & 0x8000) && !tms->external_host_access)
tms->icount = 0;
- cputag_set_input_line(tms->device->machine, tms->device->tag, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE);
+ cpu_set_input_line(tms->device, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE);
/* NMI issued? */
if (data & 0x0100)
@@ -1398,7 +1399,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
/* if the CPU is halting itself, stop execution right away */
if ((data & 0x8000) && !tms->external_host_access)
tms->icount = 0;
- cputag_set_input_line(tms->device->machine, tms->device->tag, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE);
+ cpu_set_input_line(tms->device, INPUT_LINE_HALT, (data & 0x8000) ? ASSERT_LINE : CLEAR_LINE);
/* NMI issued? */
if (data & 0x0100)
diff --git a/src/emu/cpu/tms34010/tms34010.h b/src/emu/cpu/tms34010/tms34010.h
index 3aaf6f00b00..4446ea8fc65 100644
--- a/src/emu/cpu/tms34010/tms34010.h
+++ b/src/emu/cpu/tms34010/tms34010.h
@@ -12,9 +12,6 @@
#ifndef __TMS34010_H__
#define __TMS34010_H__
-#include "cpuintrf.h"
-#include "driver.h"
-
/* register indexes for get_reg and set_reg */
enum
diff --git a/src/emu/cpu/tms57002/57002dsm.c b/src/emu/cpu/tms57002/57002dsm.c
index eb4bb585ff3..1d5a3778dbf 100644
--- a/src/emu/cpu/tms57002/57002dsm.c
+++ b/src/emu/cpu/tms57002/57002dsm.c
@@ -1,5 +1,6 @@
-#include "tms57002.h"
+#include "emu.h"
#include "debugger.h"
+#include "tms57002.h"
#ifdef __GNUC__
#define noinline __attribute__((noinline))
diff --git a/src/emu/cpu/tms57002/tms57002.c b/src/emu/cpu/tms57002/tms57002.c
index fb2308130ee..b17b3b71034 100644
--- a/src/emu/cpu/tms57002/tms57002.c
+++ b/src/emu/cpu/tms57002/tms57002.c
@@ -1,5 +1,6 @@
-#include "tms57002.h"
+#include "emu.h"
#include "debugger.h"
+#include "tms57002.h"
CPU_DISASSEMBLE(tms57002);
diff --git a/src/emu/cpu/tms57002/tms57002.h b/src/emu/cpu/tms57002/tms57002.h
index 7a8a2abe0ec..36f956363be 100644
--- a/src/emu/cpu/tms57002/tms57002.h
+++ b/src/emu/cpu/tms57002/tms57002.h
@@ -3,8 +3,6 @@
#ifndef __TMS57002_H__
#define __TMS57002_H__
-#include "cpuintrf.h"
-#include "driver.h"
enum {
TMS57002_PC=1
diff --git a/src/emu/cpu/tms7000/7000dasm.c b/src/emu/cpu/tms7000/7000dasm.c
index 5dee9c07c10..9dafd7faa5e 100644
--- a/src/emu/cpu/tms7000/7000dasm.c
+++ b/src/emu/cpu/tms7000/7000dasm.c
@@ -1,3 +1,4 @@
+#include "emu.h"
#include "debugger.h"
#include "tms7000.h"
diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c
index 2034cd6722e..d1f646d87db 100644
--- a/src/emu/cpu/tms7000/tms7000.c
+++ b/src/emu/cpu/tms7000/tms7000.c
@@ -28,8 +28,7 @@
// SJE: Fixed a mistake in tms70x0_pf_w where the wrong register was referenced
// SJE: Implemented internal register file
-#include "cpuintrf.h"
-#include "cpuexec.h"
+#include "emu.h"
#include "debugger.h"
#include "tms7000.h"
@@ -367,7 +366,7 @@ void tms7000_set_irq_line(tms7000_state *cpustate, int irqline, int state)
{ /* check for transition */
cpustate->irq_state[irqline] = state;
- LOG(("tms7000: (cpu '%s') set_irq_line (INT%d, state %d)\n", cpustate->device->tag, irqline+1, state));
+ LOG(("tms7000: (cpu '%s') set_irq_line (INT%d, state %d)\n", cpustate->device->tag.cstr(), irqline+1, state));
if (state == CLEAR_LINE)
{
diff --git a/src/emu/cpu/tms7000/tms7000.h b/src/emu/cpu/tms7000/tms7000.h
index d344951549e..0fcf1430bae 100644
--- a/src/emu/cpu/tms7000/tms7000.h
+++ b/src/emu/cpu/tms7000/tms7000.h
@@ -22,7 +22,6 @@
#ifndef __TMS7000_H__
#define __TMS7000_H__
-#include "cpuintrf.h"
enum { TMS7000_PC=1, TMS7000_SP, TMS7000_ST, TMS7000_IDLE, TMS7000_T1_CL, TMS7000_T1_PS, TMS7000_T1_DEC };
diff --git a/src/emu/cpu/tms7000/tms70op.c b/src/emu/cpu/tms7000/tms70op.c
index 7c918a8ae37..3fb84818782 100644
--- a/src/emu/cpu/tms7000/tms70op.c
+++ b/src/emu/cpu/tms7000/tms70op.c
@@ -19,7 +19,7 @@
//SJE: Changed all references to ICount to icount (to match MAME requirements)
-#include "cpuintrf.h"
+#include "emu.h"
static void illegal(tms7000_state *cpustate)
{
diff --git a/src/emu/cpu/tms9900/9900dasm.c b/src/emu/cpu/tms9900/9900dasm.c
index 2f10b8796ee..045d6431209 100644
--- a/src/emu/cpu/tms9900/9900dasm.c
+++ b/src/emu/cpu/tms9900/9900dasm.c
@@ -20,6 +20,7 @@
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "tms9900.h"
diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h
index 8b690e18b05..24ef8859e5e 100644
--- a/src/emu/cpu/tms9900/99xxcore.h
+++ b/src/emu/cpu/tms9900/99xxcore.h
@@ -85,8 +85,6 @@ Other references can be found on spies.com:
*/
-#include "debugger.h"
-#include "cpuexec.h"
#include "tms9900.h"
diff --git a/src/emu/cpu/tms9900/ti990_10.c b/src/emu/cpu/tms9900/ti990_10.c
index 1382503e6c9..31b46642499 100644
--- a/src/emu/cpu/tms9900/ti990_10.c
+++ b/src/emu/cpu/tms9900/ti990_10.c
@@ -2,6 +2,8 @@
Generate the tms9900 emulator
*/
+#include "emu.h"
+#include "debugger.h"
#include "tms9900.h"
#define TMS99XX_MODEL TI990_10_ID
diff --git a/src/emu/cpu/tms9900/tms9900.c b/src/emu/cpu/tms9900/tms9900.c
index 7850e477b48..480e026f02c 100644
--- a/src/emu/cpu/tms9900/tms9900.c
+++ b/src/emu/cpu/tms9900/tms9900.c
@@ -2,6 +2,8 @@
Generate the tms9900 emulator
*/
+#include "emu.h"
+#include "debugger.h"
#include "tms9900.h"
#define TMS99XX_MODEL TMS9900_ID
diff --git a/src/emu/cpu/tms9900/tms9900.h b/src/emu/cpu/tms9900/tms9900.h
index e0b8ce04014..3f84ed653b7 100644
--- a/src/emu/cpu/tms9900/tms9900.h
+++ b/src/emu/cpu/tms9900/tms9900.h
@@ -9,7 +9,6 @@
#ifndef __TMS9900_H__
#define __TMS9900_H__
-#include "cpuintrf.h"
/*#define TI990_9_ID 0*//* early implementation, used in a few real-world applications, 1974 */
/* very similar to mapper-less 990/10 and tms9900, but the Load process */
diff --git a/src/emu/cpu/tms9900/tms9980a.c b/src/emu/cpu/tms9900/tms9980a.c
index 0a3ef483ac4..cd79af38ff0 100644
--- a/src/emu/cpu/tms9900/tms9980a.c
+++ b/src/emu/cpu/tms9900/tms9980a.c
@@ -2,6 +2,8 @@
generate the tms9980a/tms9981 emulator
*/
+#include "emu.h"
+#include "debugger.h"
#include "tms9900.h"
#define TMS99XX_MODEL TMS9980_ID
diff --git a/src/emu/cpu/tms9900/tms9995.c b/src/emu/cpu/tms9900/tms9995.c
index e81a47e80da..9721094e43e 100644
--- a/src/emu/cpu/tms9900/tms9995.c
+++ b/src/emu/cpu/tms9900/tms9995.c
@@ -2,6 +2,8 @@
generate the tms9995 emulator
*/
+#include "emu.h"
+#include "debugger.h"
#include "tms9900.h"
#define TMS99XX_MODEL TMS9995_ID
diff --git a/src/emu/cpu/upd7810/7810dasm.c b/src/emu/cpu/upd7810/7810dasm.c
index 4b717e3c570..4bfe53fe67c 100644
--- a/src/emu/cpu/upd7810/7810dasm.c
+++ b/src/emu/cpu/upd7810/7810dasm.c
@@ -7,6 +7,7 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "upd7810.h"
diff --git a/src/emu/cpu/upd7810/7810ops.c b/src/emu/cpu/upd7810/7810ops.c
index 07b50d27feb..70369b76f56 100644
--- a/src/emu/cpu/upd7810/7810ops.c
+++ b/src/emu/cpu/upd7810/7810ops.c
@@ -9,12 +9,12 @@
static void illegal(upd7810_state *cpustate)
{
- logerror("uPD7810 '%s': illegal opcode %02x at PC:%04x\n", cpustate->device->tag, OP, PC);
+ logerror("uPD7810 '%s': illegal opcode %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, PC);
}
static void illegal2(upd7810_state *cpustate)
{
- logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag, OP, OP2, PC);
+ logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, OP2, PC);
}
/* prefix 48 */
@@ -8648,7 +8648,7 @@ static void SKN_bit(upd7810_state *cpustate)
val = RP( cpustate, UPD7807_PORTT );
break;
default:
- logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag, OP, imm, PC);
+ logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, imm, PC);
val = 0;
break;
}
@@ -8702,7 +8702,7 @@ static void SETB(upd7810_state *cpustate)
// PT is input only
// break;
default:
- logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag, OP, imm, PC);
+ logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, imm, PC);
break;
}
}
@@ -8752,7 +8752,7 @@ static void CLR(upd7810_state *cpustate)
// PT is input only
// break;
default:
- logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag, OP, imm, PC);
+ logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, imm, PC);
break;
}
}
@@ -8801,7 +8801,7 @@ static void SK_bit(upd7810_state *cpustate)
val = RP( cpustate, UPD7807_PORTT );
break;
default:
- logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag, OP, imm, PC);
+ logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, imm, PC);
val = 0;
break;
}
diff --git a/src/emu/cpu/upd7810/upd7810.c b/src/emu/cpu/upd7810/upd7810.c
index 6e376612160..3d50f863b53 100644
--- a/src/emu/cpu/upd7810/upd7810.c
+++ b/src/emu/cpu/upd7810/upd7810.c
@@ -404,6 +404,7 @@ STOP 01001000 10111011 12 stop
*/
+#include "emu.h"
#include "debugger.h"
#include "upd7810.h"
diff --git a/src/emu/cpu/upd7810/upd7810.h b/src/emu/cpu/upd7810/upd7810.h
index 95eb58368ce..e00a08a6d54 100644
--- a/src/emu/cpu/upd7810/upd7810.h
+++ b/src/emu/cpu/upd7810/upd7810.h
@@ -3,7 +3,6 @@
#ifndef __UPD7810_H__
#define __UPD7810_H__
-#include "cpuintrf.h"
/*
all types have internal ram at 0xff00-0xffff
diff --git a/src/emu/cpu/v30mz/nec.h b/src/emu/cpu/v30mz/nec.h
index 67ee0208de4..82859744de6 100644
--- a/src/emu/cpu/v30mz/nec.h
+++ b/src/emu/cpu/v30mz/nec.h
@@ -2,7 +2,6 @@
#ifndef __NECINTRF_H__
#define __NECINTRF_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/v30mz/nechost.h b/src/emu/cpu/v30mz/nechost.h
index f0d275f1d0f..042d880c89d 100644
--- a/src/emu/cpu/v30mz/nechost.h
+++ b/src/emu/cpu/v30mz/nechost.h
@@ -3,7 +3,6 @@
#define BIGCASE
-#include "emucore.h"
typedef char BOOLEAN;
diff --git a/src/emu/cpu/v30mz/v30mz.c b/src/emu/cpu/v30mz/v30mz.c
index d0856bcf874..0093f071a9a 100644
--- a/src/emu/cpu/v30mz/v30mz.c
+++ b/src/emu/cpu/v30mz/v30mz.c
@@ -40,6 +40,7 @@
****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#define PC(n) (((n)->sregs[CS]<<4)+(n)->ip)
diff --git a/src/emu/cpu/v60/v60.c b/src/emu/cpu/v60/v60.c
index d332df57cb8..e966b7bc9eb 100644
--- a/src/emu/cpu/v60/v60.c
+++ b/src/emu/cpu/v60/v60.c
@@ -3,6 +3,7 @@
// Main hacking and coding by Farfetch'd
// Portability fixes by Richter Belmont
+#include "emu.h"
#include "debugger.h"
#include "v60.h"
diff --git a/src/emu/cpu/v60/v60.h b/src/emu/cpu/v60/v60.h
index 05fc993b924..2f165bd2856 100644
--- a/src/emu/cpu/v60/v60.h
+++ b/src/emu/cpu/v60/v60.h
@@ -3,7 +3,6 @@
#ifndef __V60_H__
#define __V60_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/v60/v60d.c b/src/emu/cpu/v60/v60d.c
index 86ee907c0ae..1a181b448b2 100644
--- a/src/emu/cpu/v60/v60d.c
+++ b/src/emu/cpu/v60/v60d.c
@@ -1,4 +1,5 @@
+#include "emu.h"
#include "debugger.h"
#include "v60.h"
diff --git a/src/emu/cpu/v810/v810.c b/src/emu/cpu/v810/v810.c
index fa2019a1fd8..b35a1ff71f6 100644
--- a/src/emu/cpu/v810/v810.c
+++ b/src/emu/cpu/v810/v810.c
@@ -16,6 +16,7 @@
********************************************/
+#include "emu.h"
#include "debugger.h"
#include "v810.h"
diff --git a/src/emu/cpu/v810/v810.h b/src/emu/cpu/v810/v810.h
index b86e7589c1e..cbdf6b36fc6 100644
--- a/src/emu/cpu/v810/v810.h
+++ b/src/emu/cpu/v810/v810.h
@@ -3,7 +3,6 @@
#ifndef __V810_H__
#define __V810_H__
-#include "cpuintrf.h"
CPU_GET_INFO( v810 );
#define CPU_V810 CPU_GET_INFO_NAME( v810 )
diff --git a/src/emu/cpu/v810/v810dasm.c b/src/emu/cpu/v810/v810dasm.c
index ccf71c4ce8d..3503ae09a83 100644
--- a/src/emu/cpu/v810/v810dasm.c
+++ b/src/emu/cpu/v810/v810dasm.c
@@ -3,7 +3,7 @@
Tomasz Slanina - analog[at]op.pl
*******************************************/
-#include <math.h>
+#include "emu.h"
#include "debugger.h"
#include "v810.h"
diff --git a/src/emu/cpu/vtlb.c b/src/emu/cpu/vtlb.c
index 656321c69db..c64e987edb6 100644
--- a/src/emu/cpu/vtlb.c
+++ b/src/emu/cpu/vtlb.c
@@ -10,8 +10,8 @@
***************************************************************************/
+#include "emu.h"
#include "vtlb.h"
-#include "mame.h"
diff --git a/src/emu/cpu/vtlb.h b/src/emu/cpu/vtlb.h
index b539042fa15..7068bc77b87 100644
--- a/src/emu/cpu/vtlb.h
+++ b/src/emu/cpu/vtlb.h
@@ -15,7 +15,6 @@
#ifndef __VTLB_H__
#define __VTLB_H__
-#include "cpuintrf.h"
/***************************************************************************
diff --git a/src/emu/cpu/x86log.c b/src/emu/cpu/x86log.c
index e4727b132d2..1a824d64c0d 100644
--- a/src/emu/cpu/x86log.c
+++ b/src/emu/cpu/x86log.c
@@ -10,10 +10,8 @@
***************************************************************************/
+#include "emu.h"
#include "x86log.h"
-#include "mame.h"
-
-#include <stddef.h>
diff --git a/src/emu/cpu/x86log.h b/src/emu/cpu/x86log.h
index 7fbfba6ecee..ddaebfe43c6 100644
--- a/src/emu/cpu/x86log.h
+++ b/src/emu/cpu/x86log.h
@@ -15,7 +15,6 @@
#ifndef __X86LOG_H__
#define __X86LOG_H__
-#include "cpuintrf.h"
#include "x86emit.h"
diff --git a/src/emu/cpu/z180/z180.c b/src/emu/cpu/z180/z180.c
index d2bcd3898db..37b72297d3f 100644
--- a/src/emu/cpu/z180/z180.c
+++ b/src/emu/cpu/z180/z180.c
@@ -76,8 +76,8 @@ Hitachi HD647180 series:
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
-#include "driver.h"
#include "z180.h"
#include "cpu/z80/z80daisy.h"
@@ -937,68 +937,68 @@ static UINT8 z180_readcontrol(z180_state *cpustate, offs_t port)
{
case Z180_CNTLA0:
data = cpustate->IO_CNTLA0 & Z180_CNTLA0_RMASK;
- LOG(("Z180 '%s' CNTLA0 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' CNTLA0 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_CNTLA1:
data = cpustate->IO_CNTLA1 & Z180_CNTLA1_RMASK;
- LOG(("Z180 '%s' CNTLA1 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' CNTLA1 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_CNTLB0:
data = cpustate->IO_CNTLB0 & Z180_CNTLB0_RMASK;
- LOG(("Z180 '%s' CNTLB0 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' CNTLB0 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_CNTLB1:
data = cpustate->IO_CNTLB1 & Z180_CNTLB1_RMASK;
- LOG(("Z180 '%s' CNTLB1 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' CNTLB1 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_STAT0:
data = cpustate->IO_STAT0 & Z180_STAT0_RMASK;
data |= 0x02; // kludge for 20pacgal
- LOG(("Z180 '%s' STAT0 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' STAT0 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_STAT1:
data = cpustate->IO_STAT1 & Z180_STAT1_RMASK;
- LOG(("Z180 '%s' STAT1 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' STAT1 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_TDR0:
data = cpustate->IO_TDR0 & Z180_TDR0_RMASK;
- LOG(("Z180 '%s' TDR0 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' TDR0 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_TDR1:
data = cpustate->IO_TDR1 & Z180_TDR1_RMASK;
- LOG(("Z180 '%s' TDR1 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' TDR1 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_RDR0:
data = cpustate->IO_RDR0 & Z180_RDR0_RMASK;
- LOG(("Z180 '%s' RDR0 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' RDR0 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_RDR1:
data = cpustate->IO_RDR1 & Z180_RDR1_RMASK;
- LOG(("Z180 '%s' RDR1 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' RDR1 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_CNTR:
data = cpustate->IO_CNTR & Z180_CNTR_RMASK;
- LOG(("Z180 '%s' CNTR rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' CNTR rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_TRDR:
data = cpustate->IO_TRDR & Z180_TRDR_RMASK;
- LOG(("Z180 '%s' TRDR rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' TRDR rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_TMDR0L:
data = cpustate->tmdr_value[0] & Z180_TMDR0L_RMASK;
- LOG(("Z180 '%s' TMDR0L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' TMDR0L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
/* if timer is counting, latch the MSB and set the latch flag */
if ((cpustate->IO_TCR & Z180_TCR_TDE0) == 0)
{
@@ -1038,17 +1038,17 @@ data |= 0x02; // kludge for 20pacgal
{
cpustate->read_tcr_tmdr[0] = 1;
}
- LOG(("Z180 '%s' TMDR0H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' TMDR0H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_RLDR0L:
data = cpustate->IO_RLDR0L & Z180_RLDR0L_RMASK;
- LOG(("Z180 '%s' RLDR0L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' RLDR0L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_RLDR0H:
data = cpustate->IO_RLDR0H & Z180_RLDR0H_RMASK;
- LOG(("Z180 '%s' RLDR0H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' RLDR0H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_TCR:
@@ -1074,27 +1074,27 @@ data |= 0x02; // kludge for 20pacgal
cpustate->read_tcr_tmdr[1] = 1;
}
- LOG(("Z180 '%s' TCR rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' TCR rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IO11:
data = cpustate->IO_IO11 & Z180_IO11_RMASK;
- LOG(("Z180 '%s' IO11 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IO11 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_ASEXT0:
data = cpustate->IO_ASEXT0 & Z180_ASEXT0_RMASK;
- LOG(("Z180 '%s' ASEXT0 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' ASEXT0 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_ASEXT1:
data = cpustate->IO_ASEXT1 & Z180_ASEXT1_RMASK;
- LOG(("Z180 '%s' ASEXT1 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' ASEXT1 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_TMDR1L:
data = cpustate->tmdr_value[1] & Z180_TMDR1L_RMASK;
- LOG(("Z180 '%s' TMDR1L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' TMDR1L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
/* if timer is counting, latch the MSB and set the latch flag */
if ((cpustate->IO_TCR & Z180_TCR_TDE1) == 0)
{
@@ -1134,217 +1134,217 @@ data |= 0x02; // kludge for 20pacgal
{
cpustate->read_tcr_tmdr[1] = 1;
}
- LOG(("Z180 '%s' TMDR1H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' TMDR1H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_RLDR1L:
data = cpustate->IO_RLDR1L & Z180_RLDR1L_RMASK;
- LOG(("Z180 '%s' RLDR1L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' RLDR1L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_RLDR1H:
data = cpustate->IO_RLDR1H & Z180_RLDR1H_RMASK;
- LOG(("Z180 '%s' RLDR1H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' RLDR1H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_FRC:
data = cpustate->IO_FRC & Z180_FRC_RMASK;
- LOG(("Z180 '%s' FRC rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' FRC rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IO19:
data = cpustate->IO_IO19 & Z180_IO19_RMASK;
- LOG(("Z180 '%s' IO19 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IO19 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_ASTC0L:
data = cpustate->IO_ASTC0L & Z180_ASTC0L_RMASK;
- LOG(("Z180 '%s' ASTC0L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' ASTC0L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_ASTC0H:
data = cpustate->IO_ASTC0H & Z180_ASTC0H_RMASK;
- LOG(("Z180 '%s' ASTC0H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' ASTC0H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_ASTC1L:
data = cpustate->IO_ASTC1L & Z180_ASTC1L_RMASK;
- LOG(("Z180 '%s' ASTC1L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' ASTC1L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_ASTC1H:
data = cpustate->IO_ASTC1H & Z180_ASTC1H_RMASK;
- LOG(("Z180 '%s' ASTC1H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' ASTC1H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_CMR:
data = cpustate->IO_CMR & Z180_CMR_RMASK;
- LOG(("Z180 '%s' CMR rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' CMR rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_CCR:
data = cpustate->IO_CCR & Z180_CCR_RMASK;
- LOG(("Z180 '%s' CCR rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' CCR rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_SAR0L:
data = cpustate->IO_SAR0L & Z180_SAR0L_RMASK;
- LOG(("Z180 '%s' SAR0L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' SAR0L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_SAR0H:
data = cpustate->IO_SAR0H & Z180_SAR0H_RMASK;
- LOG(("Z180 '%s' SAR0H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' SAR0H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_SAR0B:
data = cpustate->IO_SAR0B & Z180_SAR0B_RMASK;
- LOG(("Z180 '%s' SAR0B rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' SAR0B rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_DAR0L:
data = cpustate->IO_DAR0L & Z180_DAR0L_RMASK;
- LOG(("Z180 '%s' DAR0L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' DAR0L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_DAR0H:
data = cpustate->IO_DAR0H & Z180_DAR0H_RMASK;
- LOG(("Z180 '%s' DAR0H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' DAR0H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_DAR0B:
data = cpustate->IO_DAR0B & Z180_DAR0B_RMASK;
- LOG(("Z180 '%s' DAR0B rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' DAR0B rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_BCR0L:
data = cpustate->IO_BCR0L & Z180_BCR0L_RMASK;
- LOG(("Z180 '%s' BCR0L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' BCR0L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_BCR0H:
data = cpustate->IO_BCR0H & Z180_BCR0H_RMASK;
- LOG(("Z180 '%s' BCR0H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' BCR0H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_MAR1L:
data = cpustate->IO_MAR1L & Z180_MAR1L_RMASK;
- LOG(("Z180 '%s' MAR1L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' MAR1L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_MAR1H:
data = cpustate->IO_MAR1H & Z180_MAR1H_RMASK;
- LOG(("Z180 '%s' MAR1H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' MAR1H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_MAR1B:
data = cpustate->IO_MAR1B & Z180_MAR1B_RMASK;
- LOG(("Z180 '%s' MAR1B rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' MAR1B rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IAR1L:
data = cpustate->IO_IAR1L & Z180_IAR1L_RMASK;
- LOG(("Z180 '%s' IAR1L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IAR1L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IAR1H:
data = cpustate->IO_IAR1H & Z180_IAR1H_RMASK;
- LOG(("Z180 '%s' IAR1H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IAR1H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IAR1B:
data = cpustate->IO_IAR1B & Z180_IAR1B_RMASK;
- LOG(("Z180 '%s' IAR1B rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IAR1B rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_BCR1L:
data = cpustate->IO_BCR1L & Z180_BCR1L_RMASK;
- LOG(("Z180 '%s' BCR1L rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' BCR1L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_BCR1H:
data = cpustate->IO_BCR1H & Z180_BCR1H_RMASK;
- LOG(("Z180 '%s' BCR1H rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' BCR1H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_DSTAT:
data = cpustate->IO_DSTAT & Z180_DSTAT_RMASK;
- LOG(("Z180 '%s' DSTAT rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' DSTAT rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_DMODE:
data = cpustate->IO_DMODE & Z180_DMODE_RMASK;
- LOG(("Z180 '%s' DMODE rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' DMODE rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_DCNTL:
data = cpustate->IO_DCNTL & Z180_DCNTL_RMASK;
- LOG(("Z180 '%s' DCNTL rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' DCNTL rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IL:
data = cpustate->IO_IL & Z180_IL_RMASK;
- LOG(("Z180 '%s' IL rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IL rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_ITC:
data = cpustate->IO_ITC & Z180_ITC_RMASK;
- LOG(("Z180 '%s' ITC rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' ITC rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IO35:
data = cpustate->IO_IO35 & Z180_IO35_RMASK;
- LOG(("Z180 '%s' IO35 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IO35 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_RCR:
data = cpustate->IO_RCR & Z180_RCR_RMASK;
- LOG(("Z180 '%s' RCR rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' RCR rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IO37:
data = cpustate->IO_IO37 & Z180_IO37_RMASK;
- LOG(("Z180 '%s' IO37 rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IO37 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_CBR:
data = cpustate->IO_CBR & Z180_CBR_RMASK;
- LOG(("Z180 '%s' CBR rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' CBR rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_BBR:
data = cpustate->IO_BBR & Z180_BBR_RMASK;
- LOG(("Z180 '%s' BBR rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' BBR rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_CBAR:
data = cpustate->IO_CBAR & Z180_CBAR_RMASK;
- LOG(("Z180 '%s' CBAR rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' CBAR rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IO3B:
data = cpustate->IO_IO3B & Z180_IO3B_RMASK;
- LOG(("Z180 '%s' IO3B rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IO3B rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IO3C:
data = cpustate->IO_IO3C & Z180_IO3C_RMASK;
- LOG(("Z180 '%s' IO3C rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IO3C rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IO3D:
data = cpustate->IO_IO3D & Z180_IO3D_RMASK;
- LOG(("Z180 '%s' IO3D rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IO3D rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_OMCR:
data = cpustate->IO_OMCR & Z180_OMCR_RMASK;
- LOG(("Z180 '%s' OMCR rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' OMCR rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
case Z180_IOCR:
data = cpustate->IO_IOCR & Z180_IOCR_RMASK;
- LOG(("Z180 '%s' IOCR rd $%02x ($%02x)\n", cpustate->device->tag, data, cpustate->io[port & 0x3f]));
+ LOG(("Z180 '%s' IOCR rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
break;
}
@@ -1364,251 +1364,251 @@ static void z180_writecontrol(z180_state *cpustate, offs_t port, UINT8 data)
switch (port + Z180_CNTLA0)
{
case Z180_CNTLA0:
- LOG(("Z180 '%s' CNTLA0 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_CNTLA0_WMASK));
+ LOG(("Z180 '%s' CNTLA0 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_CNTLA0_WMASK));
cpustate->IO_CNTLA0 = (cpustate->IO_CNTLA0 & ~Z180_CNTLA0_WMASK) | (data & Z180_CNTLA0_WMASK);
break;
case Z180_CNTLA1:
- LOG(("Z180 '%s' CNTLA1 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_CNTLA1_WMASK));
+ LOG(("Z180 '%s' CNTLA1 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_CNTLA1_WMASK));
cpustate->IO_CNTLA1 = (cpustate->IO_CNTLA1 & ~Z180_CNTLA1_WMASK) | (data & Z180_CNTLA1_WMASK);
break;
case Z180_CNTLB0:
- LOG(("Z180 '%s' CNTLB0 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_CNTLB0_WMASK));
+ LOG(("Z180 '%s' CNTLB0 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_CNTLB0_WMASK));
cpustate->IO_CNTLB0 = (cpustate->IO_CNTLB0 & ~Z180_CNTLB0_WMASK) | (data & Z180_CNTLB0_WMASK);
break;
case Z180_CNTLB1:
- LOG(("Z180 '%s' CNTLB1 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_CNTLB1_WMASK));
+ LOG(("Z180 '%s' CNTLB1 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_CNTLB1_WMASK));
cpustate->IO_CNTLB1 = (cpustate->IO_CNTLB1 & ~Z180_CNTLB1_WMASK) | (data & Z180_CNTLB1_WMASK);
break;
case Z180_STAT0:
- LOG(("Z180 '%s' STAT0 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_STAT0_WMASK));
+ LOG(("Z180 '%s' STAT0 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_STAT0_WMASK));
cpustate->IO_STAT0 = (cpustate->IO_STAT0 & ~Z180_STAT0_WMASK) | (data & Z180_STAT0_WMASK);
break;
case Z180_STAT1:
- LOG(("Z180 '%s' STAT1 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_STAT1_WMASK));
+ LOG(("Z180 '%s' STAT1 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_STAT1_WMASK));
cpustate->IO_STAT1 = (cpustate->IO_STAT1 & ~Z180_STAT1_WMASK) | (data & Z180_STAT1_WMASK);
break;
case Z180_TDR0:
- LOG(("Z180 '%s' TDR0 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_TDR0_WMASK));
+ LOG(("Z180 '%s' TDR0 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_TDR0_WMASK));
cpustate->IO_TDR0 = (cpustate->IO_TDR0 & ~Z180_TDR0_WMASK) | (data & Z180_TDR0_WMASK);
break;
case Z180_TDR1:
- LOG(("Z180 '%s' TDR1 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_TDR1_WMASK));
+ LOG(("Z180 '%s' TDR1 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_TDR1_WMASK));
cpustate->IO_TDR1 = (cpustate->IO_TDR1 & ~Z180_TDR1_WMASK) | (data & Z180_TDR1_WMASK);
break;
case Z180_RDR0:
- LOG(("Z180 '%s' RDR0 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_RDR0_WMASK));
+ LOG(("Z180 '%s' RDR0 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_RDR0_WMASK));
cpustate->IO_RDR0 = (cpustate->IO_RDR0 & ~Z180_RDR0_WMASK) | (data & Z180_RDR0_WMASK);
break;
case Z180_RDR1:
- LOG(("Z180 '%s' RDR1 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_RDR1_WMASK));
+ LOG(("Z180 '%s' RDR1 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_RDR1_WMASK));
cpustate->IO_RDR1 = (cpustate->IO_RDR1 & ~Z180_RDR1_WMASK) | (data & Z180_RDR1_WMASK);
break;
case Z180_CNTR:
- LOG(("Z180 '%s' CNTR wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_CNTR_WMASK));
+ LOG(("Z180 '%s' CNTR wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_CNTR_WMASK));
cpustate->IO_CNTR = (cpustate->IO_CNTR & ~Z180_CNTR_WMASK) | (data & Z180_CNTR_WMASK);
break;
case Z180_TRDR:
- LOG(("Z180 '%s' TRDR wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_TRDR_WMASK));
+ LOG(("Z180 '%s' TRDR wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_TRDR_WMASK));
cpustate->IO_TRDR = (cpustate->IO_TRDR & ~Z180_TRDR_WMASK) | (data & Z180_TRDR_WMASK);
break;
case Z180_TMDR0L:
- LOG(("Z180 '%s' TMDR0L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_TMDR0L_WMASK));
+ LOG(("Z180 '%s' TMDR0L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_TMDR0L_WMASK));
cpustate->IO_TMDR0L = data & Z180_TMDR0L_WMASK;
cpustate->tmdr_value[0] = (cpustate->tmdr_value[0] & 0xff00) | cpustate->IO_TMDR0L;
break;
case Z180_TMDR0H:
- LOG(("Z180 '%s' TMDR0H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_TMDR0H_WMASK));
+ LOG(("Z180 '%s' TMDR0H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_TMDR0H_WMASK));
cpustate->IO_TMDR0H = data & Z180_TMDR0H_WMASK;
cpustate->tmdr_value[0] = (cpustate->tmdr_value[0] & 0x00ff) | (cpustate->IO_TMDR0H << 8);
break;
case Z180_RLDR0L:
- LOG(("Z180 '%s' RLDR0L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_RLDR0L_WMASK));
+ LOG(("Z180 '%s' RLDR0L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_RLDR0L_WMASK));
cpustate->IO_RLDR0L = (cpustate->IO_RLDR0L & ~Z180_RLDR0L_WMASK) | (data & Z180_RLDR0L_WMASK);
break;
case Z180_RLDR0H:
- LOG(("Z180 '%s' RLDR0H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_RLDR0H_WMASK));
+ LOG(("Z180 '%s' RLDR0H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_RLDR0H_WMASK));
cpustate->IO_RLDR0H = (cpustate->IO_RLDR0H & ~Z180_RLDR0H_WMASK) | (data & Z180_RLDR0H_WMASK);
break;
case Z180_TCR:
- LOG(("Z180 '%s' TCR wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_TCR_WMASK));
+ LOG(("Z180 '%s' TCR wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_TCR_WMASK));
cpustate->IO_TCR = (cpustate->IO_TCR & ~Z180_TCR_WMASK) | (data & Z180_TCR_WMASK);
break;
case Z180_IO11:
- LOG(("Z180 '%s' IO11 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IO11_WMASK));
+ LOG(("Z180 '%s' IO11 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IO11_WMASK));
cpustate->IO_IO11 = (cpustate->IO_IO11 & ~Z180_IO11_WMASK) | (data & Z180_IO11_WMASK);
break;
case Z180_ASEXT0:
- LOG(("Z180 '%s' ASEXT0 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_ASEXT0_WMASK));
+ LOG(("Z180 '%s' ASEXT0 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_ASEXT0_WMASK));
cpustate->IO_ASEXT0 = (cpustate->IO_ASEXT0 & ~Z180_ASEXT0_WMASK) | (data & Z180_ASEXT0_WMASK);
break;
case Z180_ASEXT1:
- LOG(("Z180 '%s' ASEXT1 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_ASEXT1_WMASK));
+ LOG(("Z180 '%s' ASEXT1 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_ASEXT1_WMASK));
cpustate->IO_ASEXT1 = (cpustate->IO_ASEXT1 & ~Z180_ASEXT1_WMASK) | (data & Z180_ASEXT1_WMASK);
break;
case Z180_TMDR1L:
- LOG(("Z180 '%s' TMDR1L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_TMDR1L_WMASK));
+ LOG(("Z180 '%s' TMDR1L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_TMDR1L_WMASK));
cpustate->IO_TMDR1L = data & Z180_TMDR1L_WMASK;
cpustate->tmdr_value[1] = (cpustate->tmdr_value[1] & 0xff00) | cpustate->IO_TMDR1L;
break;
case Z180_TMDR1H:
- LOG(("Z180 '%s' TMDR1H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_TMDR1H_WMASK));
+ LOG(("Z180 '%s' TMDR1H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_TMDR1H_WMASK));
cpustate->IO_TMDR1H = data & Z180_TMDR1H_WMASK;
cpustate->tmdr_value[1] = (cpustate->tmdr_value[1] & 0x00ff) | cpustate->IO_TMDR1H;
break;
case Z180_RLDR1L:
- LOG(("Z180 '%s' RLDR1L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_RLDR1L_WMASK));
+ LOG(("Z180 '%s' RLDR1L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_RLDR1L_WMASK));
cpustate->IO_RLDR1L = (cpustate->IO_RLDR1L & ~Z180_RLDR1L_WMASK) | (data & Z180_RLDR1L_WMASK);
break;
case Z180_RLDR1H:
- LOG(("Z180 '%s' RLDR1H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_RLDR1H_WMASK));
+ LOG(("Z180 '%s' RLDR1H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_RLDR1H_WMASK));
cpustate->IO_RLDR1H = (cpustate->IO_RLDR1H & ~Z180_RLDR1H_WMASK) | (data & Z180_RLDR1H_WMASK);
break;
case Z180_FRC:
- LOG(("Z180 '%s' FRC wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_FRC_WMASK));
+ LOG(("Z180 '%s' FRC wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_FRC_WMASK));
cpustate->IO_FRC = (cpustate->IO_FRC & ~Z180_FRC_WMASK) | (data & Z180_FRC_WMASK);
break;
case Z180_IO19:
- LOG(("Z180 '%s' IO19 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IO19_WMASK));
+ LOG(("Z180 '%s' IO19 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IO19_WMASK));
cpustate->IO_IO19 = (cpustate->IO_IO19 & ~Z180_IO19_WMASK) | (data & Z180_IO19_WMASK);
break;
case Z180_ASTC0L:
- LOG(("Z180 '%s' ASTC0L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_ASTC0L_WMASK));
+ LOG(("Z180 '%s' ASTC0L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_ASTC0L_WMASK));
cpustate->IO_ASTC0L = (cpustate->IO_ASTC0L & ~Z180_ASTC0L_WMASK) | (data & Z180_ASTC0L_WMASK);
break;
case Z180_ASTC0H:
- LOG(("Z180 '%s' ASTC0H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_ASTC0H_WMASK));
+ LOG(("Z180 '%s' ASTC0H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_ASTC0H_WMASK));
cpustate->IO_ASTC0H = (cpustate->IO_ASTC0H & ~Z180_ASTC0H_WMASK) | (data & Z180_ASTC0H_WMASK);
break;
case Z180_ASTC1L:
- LOG(("Z180 '%s' ASTC1L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_ASTC1L_WMASK));
+ LOG(("Z180 '%s' ASTC1L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_ASTC1L_WMASK));
cpustate->IO_ASTC1L = (cpustate->IO_ASTC1L & ~Z180_ASTC1L_WMASK) | (data & Z180_ASTC1L_WMASK);
break;
case Z180_ASTC1H:
- LOG(("Z180 '%s' ASTC1H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_ASTC1H_WMASK));
+ LOG(("Z180 '%s' ASTC1H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_ASTC1H_WMASK));
cpustate->IO_ASTC1H = (cpustate->IO_ASTC1H & ~Z180_ASTC1H_WMASK) | (data & Z180_ASTC1H_WMASK);
break;
case Z180_CMR:
- LOG(("Z180 '%s' CMR wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_CMR_WMASK));
+ LOG(("Z180 '%s' CMR wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_CMR_WMASK));
cpustate->IO_CMR = (cpustate->IO_CMR & ~Z180_CMR_WMASK) | (data & Z180_CMR_WMASK);
break;
case Z180_CCR:
- LOG(("Z180 '%s' CCR wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_CCR_WMASK));
+ LOG(("Z180 '%s' CCR wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_CCR_WMASK));
cpustate->IO_CCR = (cpustate->IO_CCR & ~Z180_CCR_WMASK) | (data & Z180_CCR_WMASK);
break;
case Z180_SAR0L:
- LOG(("Z180 '%s' SAR0L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_SAR0L_WMASK));
+ LOG(("Z180 '%s' SAR0L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_SAR0L_WMASK));
cpustate->IO_SAR0L = (cpustate->IO_SAR0L & ~Z180_SAR0L_WMASK) | (data & Z180_SAR0L_WMASK);
break;
case Z180_SAR0H:
- LOG(("Z180 '%s' SAR0H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_SAR0H_WMASK));
+ LOG(("Z180 '%s' SAR0H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_SAR0H_WMASK));
cpustate->IO_SAR0H = (cpustate->IO_SAR0H & ~Z180_SAR0H_WMASK) | (data & Z180_SAR0H_WMASK);
break;
case Z180_SAR0B:
- LOG(("Z180 '%s' SAR0B wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_SAR0B_WMASK));
+ LOG(("Z180 '%s' SAR0B wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_SAR0B_WMASK));
cpustate->IO_SAR0B = (cpustate->IO_SAR0B & ~Z180_SAR0B_WMASK) | (data & Z180_SAR0B_WMASK);
break;
case Z180_DAR0L:
- LOG(("Z180 '%s' DAR0L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_DAR0L_WMASK));
+ LOG(("Z180 '%s' DAR0L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_DAR0L_WMASK));
cpustate->IO_DAR0L = (cpustate->IO_DAR0L & ~Z180_DAR0L_WMASK) | (data & Z180_DAR0L_WMASK);
break;
case Z180_DAR0H:
- LOG(("Z180 '%s' DAR0H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_DAR0H_WMASK));
+ LOG(("Z180 '%s' DAR0H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_DAR0H_WMASK));
cpustate->IO_DAR0H = (cpustate->IO_DAR0H & ~Z180_DAR0H_WMASK) | (data & Z180_DAR0H_WMASK);
break;
case Z180_DAR0B:
- LOG(("Z180 '%s' DAR0B wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_DAR0B_WMASK));
+ LOG(("Z180 '%s' DAR0B wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_DAR0B_WMASK));
cpustate->IO_DAR0B = (cpustate->IO_DAR0B & ~Z180_DAR0B_WMASK) | (data & Z180_DAR0B_WMASK);
break;
case Z180_BCR0L:
- LOG(("Z180 '%s' BCR0L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_BCR0L_WMASK));
+ LOG(("Z180 '%s' BCR0L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_BCR0L_WMASK));
cpustate->IO_BCR0L = (cpustate->IO_BCR0L & ~Z180_BCR0L_WMASK) | (data & Z180_BCR0L_WMASK);
break;
case Z180_BCR0H:
- LOG(("Z180 '%s' BCR0H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_BCR0H_WMASK));
+ LOG(("Z180 '%s' BCR0H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_BCR0H_WMASK));
cpustate->IO_BCR0H = (cpustate->IO_BCR0H & ~Z180_BCR0H_WMASK) | (data & Z180_BCR0H_WMASK);
break;
case Z180_MAR1L:
- LOG(("Z180 '%s' MAR1L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_MAR1L_WMASK));
+ LOG(("Z180 '%s' MAR1L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_MAR1L_WMASK));
cpustate->IO_MAR1L = (cpustate->IO_MAR1L & ~Z180_MAR1L_WMASK) | (data & Z180_MAR1L_WMASK);
break;
case Z180_MAR1H:
- LOG(("Z180 '%s' MAR1H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_MAR1H_WMASK));
+ LOG(("Z180 '%s' MAR1H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_MAR1H_WMASK));
cpustate->IO_MAR1H = (cpustate->IO_MAR1H & ~Z180_MAR1H_WMASK) | (data & Z180_MAR1H_WMASK);
break;
case Z180_MAR1B:
- LOG(("Z180 '%s' MAR1B wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_MAR1B_WMASK));
+ LOG(("Z180 '%s' MAR1B wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_MAR1B_WMASK));
cpustate->IO_MAR1B = (cpustate->IO_MAR1B & ~Z180_MAR1B_WMASK) | (data & Z180_MAR1B_WMASK);
break;
case Z180_IAR1L:
- LOG(("Z180 '%s' IAR1L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IAR1L_WMASK));
+ LOG(("Z180 '%s' IAR1L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IAR1L_WMASK));
cpustate->IO_IAR1L = (cpustate->IO_IAR1L & ~Z180_IAR1L_WMASK) | (data & Z180_IAR1L_WMASK);
break;
case Z180_IAR1H:
- LOG(("Z180 '%s' IAR1H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IAR1H_WMASK));
+ LOG(("Z180 '%s' IAR1H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IAR1H_WMASK));
cpustate->IO_IAR1H = (cpustate->IO_IAR1H & ~Z180_IAR1H_WMASK) | (data & Z180_IAR1H_WMASK);
break;
case Z180_IAR1B:
- LOG(("Z180 '%s' IAR1B wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IAR1B_WMASK));
+ LOG(("Z180 '%s' IAR1B wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IAR1B_WMASK));
cpustate->IO_IAR1B = (cpustate->IO_IAR1B & ~Z180_IAR1B_WMASK) | (data & Z180_IAR1B_WMASK);
break;
case Z180_BCR1L:
- LOG(("Z180 '%s' BCR1L wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_BCR1L_WMASK));
+ LOG(("Z180 '%s' BCR1L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_BCR1L_WMASK));
cpustate->IO_BCR1L = (cpustate->IO_BCR1L & ~Z180_BCR1L_WMASK) | (data & Z180_BCR1L_WMASK);
break;
case Z180_BCR1H:
- LOG(("Z180 '%s' BCR1H wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_BCR1H_WMASK));
+ LOG(("Z180 '%s' BCR1H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_BCR1H_WMASK));
cpustate->IO_BCR1H = (cpustate->IO_BCR1H & ~Z180_BCR1H_WMASK) | (data & Z180_BCR1H_WMASK);
break;
case Z180_DSTAT:
- LOG(("Z180 '%s' DSTAT wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_DSTAT_WMASK));
+ LOG(("Z180 '%s' DSTAT wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_DSTAT_WMASK));
cpustate->IO_DSTAT = (cpustate->IO_DSTAT & ~Z180_DSTAT_WMASK) | (data & Z180_DSTAT_WMASK);
if ((data & (Z180_DSTAT_DE1 | Z180_DSTAT_DWE1)) == Z180_DSTAT_DE1)
cpustate->IO_DSTAT |= Z180_DSTAT_DME; /* DMA enable */
@@ -1617,80 +1617,80 @@ static void z180_writecontrol(z180_state *cpustate, offs_t port, UINT8 data)
break;
case Z180_DMODE:
- LOG(("Z180 '%s' DMODE wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_DMODE_WMASK));
+ LOG(("Z180 '%s' DMODE wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_DMODE_WMASK));
cpustate->IO_DMODE = (cpustate->IO_DMODE & ~Z180_DMODE_WMASK) | (data & Z180_DMODE_WMASK);
break;
case Z180_DCNTL:
- LOG(("Z180 '%s' DCNTL wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_DCNTL_WMASK));
+ LOG(("Z180 '%s' DCNTL wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_DCNTL_WMASK));
cpustate->IO_DCNTL = (cpustate->IO_DCNTL & ~Z180_DCNTL_WMASK) | (data & Z180_DCNTL_WMASK);
break;
case Z180_IL:
- LOG(("Z180 '%s' IL wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IL_WMASK));
+ LOG(("Z180 '%s' IL wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IL_WMASK));
cpustate->IO_IL = (cpustate->IO_IL & ~Z180_IL_WMASK) | (data & Z180_IL_WMASK);
break;
case Z180_ITC:
- LOG(("Z180 '%s' ITC wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_ITC_WMASK));
+ LOG(("Z180 '%s' ITC wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_ITC_WMASK));
cpustate->IO_ITC = (cpustate->IO_ITC & ~Z180_ITC_WMASK) | (data & Z180_ITC_WMASK);
break;
case Z180_IO35:
- LOG(("Z180 '%s' IO35 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IO35_WMASK));
+ LOG(("Z180 '%s' IO35 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IO35_WMASK));
cpustate->IO_IO35 = (cpustate->IO_IO35 & ~Z180_IO35_WMASK) | (data & Z180_IO35_WMASK);
break;
case Z180_RCR:
- LOG(("Z180 '%s' RCR wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_RCR_WMASK));
+ LOG(("Z180 '%s' RCR wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_RCR_WMASK));
cpustate->IO_RCR = (cpustate->IO_RCR & ~Z180_RCR_WMASK) | (data & Z180_RCR_WMASK);
break;
case Z180_IO37:
- LOG(("Z180 '%s' IO37 wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IO37_WMASK));
+ LOG(("Z180 '%s' IO37 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IO37_WMASK));
cpustate->IO_IO37 = (cpustate->IO_IO37 & ~Z180_IO37_WMASK) | (data & Z180_IO37_WMASK);
break;
case Z180_CBR:
- LOG(("Z180 '%s' CBR wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_CBR_WMASK));
+ LOG(("Z180 '%s' CBR wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_CBR_WMASK));
cpustate->IO_CBR = (cpustate->IO_CBR & ~Z180_CBR_WMASK) | (data & Z180_CBR_WMASK);
z180_mmu(cpustate);
break;
case Z180_BBR:
- LOG(("Z180 '%s' BBR wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_BBR_WMASK));
+ LOG(("Z180 '%s' BBR wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_BBR_WMASK));
cpustate->IO_BBR = (cpustate->IO_BBR & ~Z180_BBR_WMASK) | (data & Z180_BBR_WMASK);
z180_mmu(cpustate);
break;
case Z180_CBAR:
- LOG(("Z180 '%s' CBAR wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_CBAR_WMASK));
+ LOG(("Z180 '%s' CBAR wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_CBAR_WMASK));
cpustate->IO_CBAR = (cpustate->IO_CBAR & ~Z180_CBAR_WMASK) | (data & Z180_CBAR_WMASK);
z180_mmu(cpustate);
break;
case Z180_IO3B:
- LOG(("Z180 '%s' IO3B wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IO3B_WMASK));
+ LOG(("Z180 '%s' IO3B wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IO3B_WMASK));
cpustate->IO_IO3B = (cpustate->IO_IO3B & ~Z180_IO3B_WMASK) | (data & Z180_IO3B_WMASK);
break;
case Z180_IO3C:
- LOG(("Z180 '%s' IO3C wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IO3C_WMASK));
+ LOG(("Z180 '%s' IO3C wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IO3C_WMASK));
cpustate->IO_IO3C = (cpustate->IO_IO3C & ~Z180_IO3C_WMASK) | (data & Z180_IO3C_WMASK);
break;
case Z180_IO3D:
- LOG(("Z180 '%s' IO3D wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IO3D_WMASK));
+ LOG(("Z180 '%s' IO3D wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IO3D_WMASK));
cpustate->IO_IO3D = (cpustate->IO_IO3D & ~Z180_IO3D_WMASK) | (data & Z180_IO3D_WMASK);
break;
case Z180_OMCR:
- LOG(("Z180 '%s' OMCR wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_OMCR_WMASK));
+ LOG(("Z180 '%s' OMCR wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_OMCR_WMASK));
cpustate->IO_OMCR = (cpustate->IO_OMCR & ~Z180_OMCR_WMASK) | (data & Z180_OMCR_WMASK);
break;
case Z180_IOCR:
- LOG(("Z180 '%s' IOCR wr $%02x ($%02x)\n", cpustate->device->tag, data, data & Z180_IOCR_WMASK));
+ LOG(("Z180 '%s' IOCR wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, data & Z180_IOCR_WMASK));
cpustate->IO_IOCR = (cpustate->IO_IOCR & ~Z180_IOCR_WMASK) | (data & Z180_IOCR_WMASK);
break;
}
@@ -1893,120 +1893,120 @@ static void z180_write_iolines(z180_state *cpustate, UINT32 data)
/* I/O asynchronous clock 0 (active high) or DREQ0 (mux) */
if (changes & Z180_CKA0)
{
- LOG(("Z180 '%s' CKA0 %d\n", cpustate->device->tag, data & Z180_CKA0 ? 1 : 0));
+ LOG(("Z180 '%s' CKA0 %d\n", cpustate->device->tag.cstr(), data & Z180_CKA0 ? 1 : 0));
cpustate->iol = (cpustate->iol & ~Z180_CKA0) | (data & Z180_CKA0);
}
/* I/O asynchronous clock 1 (active high) or TEND1 (mux) */
if (changes & Z180_CKA1)
{
- LOG(("Z180 '%s' CKA1 %d\n", cpustate->device->tag, data & Z180_CKA1 ? 1 : 0));
+ LOG(("Z180 '%s' CKA1 %d\n", cpustate->device->tag.cstr(), data & Z180_CKA1 ? 1 : 0));
cpustate->iol = (cpustate->iol & ~Z180_CKA1) | (data & Z180_CKA1);
}
/* I/O serial clock (active high) */
if (changes & Z180_CKS)
{
- LOG(("Z180 '%s' CKS %d\n", cpustate->device->tag, data & Z180_CKS ? 1 : 0));
+ LOG(("Z180 '%s' CKS %d\n", cpustate->device->tag.cstr(), data & Z180_CKS ? 1 : 0));
cpustate->iol = (cpustate->iol & ~Z180_CKS) | (data & Z180_CKS);
}
/* I clear to send 0 (active low) */
if (changes & Z180_CTS0)
{
- LOG(("Z180 '%s' CTS0 %d\n", cpustate->device->tag, data & Z180_CTS0 ? 1 : 0));
+ LOG(("Z180 '%s' CTS0 %d\n", cpustate->device->tag.cstr(), data & Z180_CTS0 ? 1 : 0));
cpustate->iol = (cpustate->iol & ~Z180_CTS0) | (data & Z180_CTS0);
}
/* I clear to send 1 (active low) or RXS (mux) */
if (changes & Z180_CTS1)
{
- LOG(("Z180 '%s' CTS1 %d\n", cpustate->device->tag, data & Z180_CTS1 ? 1 : 0));
+ LOG(("Z180 '%s' CTS1 %d\n", cpustate->device->tag.cstr(), data & Z180_CTS1 ? 1 : 0));
cpustate->iol = (cpustate->iol & ~Z180_CTS1) | (data & Z180_CTS1);
}
/* I data carrier detect (active low) */
if (changes & Z180_DCD0)
{
- LOG(("Z180 '%s' DCD0 %d\n", cpustate->device->tag, data & Z180_DCD0 ? 1 : 0));
+ LOG(("Z180 '%s' DCD0 %d\n", cpustate->device->tag.cstr(), data & Z180_DCD0 ? 1 : 0));
cpustate->iol = (cpustate->iol & ~Z180_DCD0) | (data & Z180_DCD0);
}
/* I data request DMA ch 0 (active low) or CKA0 (mux) */
if (changes & Z180_DREQ0)
{
- LOG(("Z180 '%s' DREQ0 %d\n", cpustate->device->tag, data & Z180_DREQ0 ? 1 : 0));
+ LOG(("Z180 '%s' DREQ0 %d\n", cpustate->device->tag.cstr(), data & Z180_DREQ0 ? 1 : 0));
cpustate->iol = (cpustate->iol & ~Z180_DREQ0) | (data & Z180_DREQ0);
}
/* I data request DMA ch 1 (active low) */
if (changes & Z180_DREQ1)
{
- LOG(("Z180 '%s' DREQ1 %d\n", cpustate->device->tag, data & Z180_DREQ1 ? 1 : 0));
+ LOG(("Z180 '%s' DREQ1 %d\n", cpustate->device->tag.cstr(), data & Z180_DREQ1 ? 1 : 0));
cpustate->iol = (cpustate->iol & ~Z180_DREQ1) | (data & Z180_DREQ1);
}
/* I asynchronous receive data 0 (active high) */
if (changes & Z180_RXA0)
{
- LOG(("Z180 '%s' RXA0 %d\n", cpustate->device->tag, data & Z180_RXA0 ? 1 : 0));
+ LOG(("Z180 '%s' RXA0 %d\n", cpustate->device->tag.cstr(), data & Z180_RXA0 ? 1 : 0));
cpustate->iol = (cpustate->iol & ~Z180_RXA0) | (data & Z180_RXA0);
}
/* I asynchronous receive data 1 (active high) */
if (changes & Z180_RXA1)
{
- LOG(("Z180 '%s' RXA1 %d\n", cpustate->device->tag, data & Z180_RXA1 ? 1 : 0));
+ LOG(("Z180 '%s' RXA1 %d\n", cpustate->device->tag.cstr(), data & Z180_RXA1 ? 1 : 0));
cpustate->iol = (cpustate->iol & ~Z180_RXA1) | (data & Z180_RXA1);
}
/* I clocked serial receive data (active high) or CTS1 (mux) */
if (changes & Z180_RXS)
{
- LOG(("Z180 '%s' RXS %d\n", cpustate->device->tag, data & Z180_RXS ? 1 : 0));
+ LOG(("Z180 '%s' RXS %d\n", cpustate->device->tag.cstr(), data & Z180_RXS ? 1 : 0));
cpustate->iol = (cpustate->iol & ~Z180_RXS) | (data & Z180_RXS);
}
/* O request to send (active low) */
if (changes & Z180_RTS0)
{
- LOG(("Z180 '%s' RTS0 won't change output\n", cpustate->device->tag));
+ LOG(("Z180 '%s' RTS0 won't change output\n", cpustate->device->tag.cstr()));
}
/* O transfer end 0 (active low) or CKA1 (mux) */
if (changes & Z180_TEND0)
{
- LOG(("Z180 '%s' TEND0 won't change output\n", cpustate->device->tag));
+ LOG(("Z180 '%s' TEND0 won't change output\n", cpustate->device->tag.cstr()));
}
/* O transfer end 1 (active low) */
if (changes & Z180_TEND1)
{
- LOG(("Z180 '%s' TEND1 won't change output\n", cpustate->device->tag));
+ LOG(("Z180 '%s' TEND1 won't change output\n", cpustate->device->tag.cstr()));
}
/* O transfer out (PRT channel, active low) or A18 (mux) */
if (changes & Z180_A18_TOUT)
{
- LOG(("Z180 '%s' TOUT won't change output\n", cpustate->device->tag));
+ LOG(("Z180 '%s' TOUT won't change output\n", cpustate->device->tag.cstr()));
}
/* O asynchronous transmit data 0 (active high) */
if (changes & Z180_TXA0)
{
- LOG(("Z180 '%s' TXA0 won't change output\n", cpustate->device->tag));
+ LOG(("Z180 '%s' TXA0 won't change output\n", cpustate->device->tag.cstr()));
}
/* O asynchronous transmit data 1 (active high) */
if (changes & Z180_TXA1)
{
- LOG(("Z180 '%s' TXA1 won't change output\n", cpustate->device->tag));
+ LOG(("Z180 '%s' TXA1 won't change output\n", cpustate->device->tag.cstr()));
}
/* O clocked serial transmit data (active high) */
if (changes & Z180_TXS)
{
- LOG(("Z180 '%s' TXS won't change output\n", cpustate->device->tag));
+ LOG(("Z180 '%s' TXS won't change output\n", cpustate->device->tag.cstr()));
}
}
@@ -2320,7 +2320,7 @@ static CPU_EXECUTE( z180 )
/* to just check here */
if (cpustate->nmi_pending)
{
- LOG(("Z180 '%s' take NMI\n", cpustate->device->tag));
+ LOG(("Z180 '%s' take NMI\n", cpustate->device->tag.cstr()));
cpustate->_PPC = -1; /* there isn't a valid previous program counter */
LEAVE_HALT(cpustate); /* Check if processor was halted */
@@ -2426,7 +2426,7 @@ static void set_irq_line(z180_state *cpustate, int irqline, int state)
}
else
{
- LOG(("Z180 '%s' set_irq_line %d = %d\n",cpustate->device->tag , irqline,state));
+ LOG(("Z180 '%s' set_irq_line %d = %d\n",cpustate->device->tag.cstr() , irqline,state));
/* update the IRQ state */
cpustate->irq_state[irqline] = state;
diff --git a/src/emu/cpu/z180/z180.h b/src/emu/cpu/z180/z180.h
index 33cc7c9ec9f..09d379cbd32 100644
--- a/src/emu/cpu/z180/z180.h
+++ b/src/emu/cpu/z180/z180.h
@@ -3,7 +3,6 @@
#ifndef __Z180_H__
#define __Z180_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/z180/z180dasm.c b/src/emu/cpu/z180/z180dasm.c
index c04e6f51628..a772bb0e2cf 100644
--- a/src/emu/cpu/z180/z180dasm.c
+++ b/src/emu/cpu/z180/z180dasm.c
@@ -43,6 +43,7 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "z180.h"
diff --git a/src/emu/cpu/z180/z180dd.c b/src/emu/cpu/z180/z180dd.c
index c2898097b4c..7611607543d 100644
--- a/src/emu/cpu/z180/z180dd.c
+++ b/src/emu/cpu/z180/z180dd.c
@@ -1,6 +1,6 @@
OP(illegal,1) {
logerror("Z180 '%s' ill. opcode $%02x $%02x\n",
- cpustate->device->tag, memory_decrypted_read_byte(cpustate->program, (cpustate->_PCD-1)&0xffff), memory_decrypted_read_byte(cpustate->program, cpustate->_PCD));
+ cpustate->device->tag.cstr(), memory_decrypted_read_byte(cpustate->program, (cpustate->_PCD-1)&0xffff), memory_decrypted_read_byte(cpustate->program, cpustate->_PCD));
}
/**********************************************************
diff --git a/src/emu/cpu/z180/z180ed.c b/src/emu/cpu/z180/z180ed.c
index 111c53c6515..ac3499fd2fa 100644
--- a/src/emu/cpu/z180/z180ed.c
+++ b/src/emu/cpu/z180/z180ed.c
@@ -1,7 +1,7 @@
OP(illegal,2)
{
logerror("Z180 '%s' ill. opcode $ed $%02x\n",
- cpustate->device->tag, memory_decrypted_read_byte(cpustate->program, (cpustate->_PCD-1)&0xffff));
+ cpustate->device->tag.cstr(), memory_decrypted_read_byte(cpustate->program, (cpustate->_PCD-1)&0xffff));
}
/**********************************************************
diff --git a/src/emu/cpu/z180/z180op.c b/src/emu/cpu/z180/z180op.c
index f3ea6b7cc5f..031865aded4 100644
--- a/src/emu/cpu/z180/z180op.c
+++ b/src/emu/cpu/z180/z180op.c
@@ -315,7 +315,7 @@ static void take_interrupt(z180_state *cpustate, int irq)
else
irq_vector = (*cpustate->irq_callback)(cpustate->device, 0);
- LOG(("Z180 '%s' single int. irq_vector $%02x\n", cpustate->device->tag, irq_vector));
+ LOG(("Z180 '%s' single int. irq_vector $%02x\n", cpustate->device->tag.cstr(), irq_vector));
/* Interrupt mode 2. Call [cpustate->I:databyte] */
if( cpustate->IM == 2 )
@@ -323,7 +323,7 @@ static void take_interrupt(z180_state *cpustate, int irq)
irq_vector = (irq_vector & 0xff) + (cpustate->I << 8);
PUSH(cpustate, PC );
RM16( cpustate, irq_vector, &cpustate->PC );
- LOG(("Z180 '%s' IM2 [$%04x] = $%04x\n",cpustate->device->tag , irq_vector, cpustate->_PCD));
+ LOG(("Z180 '%s' IM2 [$%04x] = $%04x\n",cpustate->device->tag.cstr() , irq_vector, cpustate->_PCD));
/* CALL opcode timing */
cpustate->icount -= cpustate->cc[Z180_TABLE_op][0xcd];
}
@@ -331,7 +331,7 @@ static void take_interrupt(z180_state *cpustate, int irq)
/* Interrupt mode 1. RST 38h */
if( cpustate->IM == 1 )
{
- LOG(("Z180 '%s' IM1 $0038\n",cpustate->device->tag ));
+ LOG(("Z180 '%s' IM1 $0038\n",cpustate->device->tag.cstr() ));
PUSH(cpustate, PC );
cpustate->_PCD = 0x0038;
/* RST $38 + 'interrupt latency' cycles */
@@ -342,7 +342,7 @@ static void take_interrupt(z180_state *cpustate, int irq)
/* Interrupt mode 0. We check for CALL and JP instructions, */
/* if neither of these were found we assume a 1 byte opcode */
/* was placed on the databus */
- LOG(("Z180 '%s' IM0 $%04x\n",cpustate->device->tag , irq_vector));
+ LOG(("Z180 '%s' IM0 $%04x\n",cpustate->device->tag.cstr() , irq_vector));
switch (irq_vector & 0xff0000)
{
case 0xcd0000: /* call */
@@ -371,7 +371,7 @@ static void take_interrupt(z180_state *cpustate, int irq)
irq_vector = (cpustate->I << 8) + (irq_vector & 0xff);
PUSH(cpustate, PC );
RM16( cpustate, irq_vector, &cpustate->PC );
- LOG(("Z180 '%s' INT%d [$%04x] = $%04x\n", cpustate->device->tag, irq, irq_vector, cpustate->_PCD));
+ LOG(("Z180 '%s' INT%d [$%04x] = $%04x\n", cpustate->device->tag.cstr(), irq, irq_vector, cpustate->_PCD));
/* CALL opcode timing */
cpustate->icount -= cpustate->cc[Z180_TABLE_op][0xcd];
}
diff --git a/src/emu/cpu/z180/z180ops.h b/src/emu/cpu/z180/z180ops.h
index 92820b2e6fb..9a977c91d49 100644
--- a/src/emu/cpu/z180/z180ops.h
+++ b/src/emu/cpu/z180/z180ops.h
@@ -236,7 +236,7 @@ INLINE UINT32 ARG16(z180_state *cpustate)
* RETN
***************************************************************/
#define RETN { \
- LOG(("Z180 '%s' RETN IFF1:%d IFF2:%d\n", cpustate->device->tag, cpustate->IFF1, cpustate->IFF2)); \
+ LOG(("Z180 '%s' RETN IFF1:%d IFF2:%d\n", cpustate->device->tag.cstr(), cpustate->IFF1, cpustate->IFF2)); \
POP(cpustate, PC); \
cpustate->IFF1 = cpustate->IFF2; \
}
diff --git a/src/emu/cpu/z8/z8.c b/src/emu/cpu/z8/z8.c
index a5b65b71072..43b86e7770b 100644
--- a/src/emu/cpu/z8/z8.c
+++ b/src/emu/cpu/z8/z8.c
@@ -21,7 +21,7 @@
*/
-#include "driver.h"
+#include "emu.h"
#include "debugger.h"
#include "z8.h"
diff --git a/src/emu/cpu/z8/z8.h b/src/emu/cpu/z8/z8.h
index 5467a6f744e..59309092f6e 100644
--- a/src/emu/cpu/z8/z8.h
+++ b/src/emu/cpu/z8/z8.h
@@ -12,7 +12,6 @@
#ifndef __Z8_H__
#define __Z8_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/z8/z8dasm.c b/src/emu/cpu/z8/z8dasm.c
index 3fbfd944d7d..1e8eba79c4d 100644
--- a/src/emu/cpu/z8/z8dasm.c
+++ b/src/emu/cpu/z8/z8dasm.c
@@ -1,4 +1,4 @@
-#include "cpuintrf.h"
+#include "emu.h"
#include "debugger.h"
#include "z8.h"
diff --git a/src/emu/cpu/z80/z80.c b/src/emu/cpu/z80/z80.c
index 61eeef4ed5e..c7a3a978d54 100644
--- a/src/emu/cpu/z80/z80.c
+++ b/src/emu/cpu/z80/z80.c
@@ -117,8 +117,8 @@
* http://www.msxnet.org/tech/z80-documented.pdf
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
-#include "driver.h"
#include "z80.h"
#include "z80daisy.h"
@@ -824,7 +824,7 @@ INLINE UINT32 ARG16(z80_state *z80)
***************************************************************/
#define RETN(Z) do { \
LOG(("Z80 '%s' RETN z80->iff1:%d z80->iff2:%d\n", \
- (Z)->device->tag, (Z)->iff1, (Z)->iff2)); \
+ (Z)->device->tag.cstr(), (Z)->iff1, (Z)->iff2)); \
POP((Z), pc); \
(Z)->WZ = (Z)->PC; \
(Z)->iff1 = (Z)->iff2; \
@@ -2093,7 +2093,7 @@ OP(xycb,ff) { z80->A = SET(7, RM(z80, z80->ea)); WM(z80, z80->ea,z80->A); } /*
OP(illegal,1) {
logerror("Z80 '%s' ill. opcode $%02x $%02x\n",
- z80->device->tag, memory_decrypted_read_byte(z80->program, (z80->PCD-1)&0xffff), memory_decrypted_read_byte(z80->program, z80->PCD));
+ z80->device->tag.cstr(), memory_decrypted_read_byte(z80->program, (z80->PCD-1)&0xffff), memory_decrypted_read_byte(z80->program, z80->PCD));
}
/**********************************************************
@@ -2681,7 +2681,7 @@ OP(fd,ff) { illegal_1(z80); op_ff(z80); } /* DB FD */
OP(illegal,2)
{
logerror("Z80 '%s' ill. opcode $ed $%02x\n",
- z80->device->tag, memory_decrypted_read_byte(z80->program, (z80->PCD-1)&0xffff));
+ z80->device->tag.cstr(), memory_decrypted_read_byte(z80->program, (z80->PCD-1)&0xffff));
}
/**********************************************************
@@ -3289,7 +3289,7 @@ static void take_interrupt(z80_state *z80)
else
irq_vector = (*z80->irq_callback)(z80->device, 0);
- LOG(("Z80 '%s' single int. irq_vector $%02x\n", z80->device->tag, irq_vector));
+ LOG(("Z80 '%s' single int. irq_vector $%02x\n", z80->device->tag.cstr(), irq_vector));
/* Interrupt mode 2. Call [i:databyte] */
if( z80->im == 2 )
@@ -3297,7 +3297,7 @@ static void take_interrupt(z80_state *z80)
irq_vector = (irq_vector & 0xff) | (z80->i << 8);
PUSH(z80, pc);
RM16(z80, irq_vector, &z80->pc);
- LOG(("Z80 '%s' IM2 [$%04x] = $%04x\n", z80->device->tag, irq_vector, z80->PCD));
+ LOG(("Z80 '%s' IM2 [$%04x] = $%04x\n", z80->device->tag.cstr(), irq_vector, z80->PCD));
/* CALL opcode timing + 'interrupt latency' cycles */
z80->icount -= z80->cc_op[0xcd] + z80->cc_ex[0xff];
}
@@ -3305,7 +3305,7 @@ static void take_interrupt(z80_state *z80)
/* Interrupt mode 1. RST 38h */
if( z80->im == 1 )
{
- LOG(("Z80 '%s' IM1 $0038\n", z80->device->tag));
+ LOG(("Z80 '%s' IM1 $0038\n", z80->device->tag.cstr()));
PUSH(z80, pc);
z80->PCD = 0x0038;
/* RST $38 + 'interrupt latency' cycles */
@@ -3316,7 +3316,7 @@ static void take_interrupt(z80_state *z80)
/* Interrupt mode 0. We check for CALL and JP instructions, */
/* if neither of these were found we assume a 1 byte opcode */
/* was placed on the databus */
- LOG(("Z80 '%s' IM0 $%04x\n", z80->device->tag, irq_vector));
+ LOG(("Z80 '%s' IM0 $%04x\n", z80->device->tag.cstr(), irq_vector));
/* check for nop */
if (irq_vector != 0x00)
@@ -3530,7 +3530,7 @@ static CPU_EXECUTE( z80 )
/* to just check here */
if (z80->nmi_pending)
{
- LOG(("Z80 '%s' take NMI\n", z80->device->tag));
+ LOG(("Z80 '%s' take NMI\n", z80->device->tag.cstr()));
z80->PRVPC = -1; /* there isn't a valid previous program counter */
LEAVE_HALT(z80); /* Check if processor was halted */
diff --git a/src/emu/cpu/z80/z80.h b/src/emu/cpu/z80/z80.h
index 08a27de5dc5..0d913c4c7f8 100644
--- a/src/emu/cpu/z80/z80.h
+++ b/src/emu/cpu/z80/z80.h
@@ -3,7 +3,6 @@
#ifndef __Z80_H__
#define __Z80_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/z80/z80daisy.c b/src/emu/cpu/z80/z80daisy.c
index 35da85ccb8b..1b75877ee25 100644
--- a/src/emu/cpu/z80/z80daisy.c
+++ b/src/emu/cpu/z80/z80daisy.c
@@ -6,7 +6,7 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "z80daisy.h"
diff --git a/src/emu/cpu/z80/z80daisy.h b/src/emu/cpu/z80/z80daisy.h
index efa4107e782..4d54e27cbc7 100644
--- a/src/emu/cpu/z80/z80daisy.h
+++ b/src/emu/cpu/z80/z80daisy.h
@@ -11,7 +11,6 @@
#ifndef __Z80DAISY_H__
#define __Z80DAISY_H__
-#include "devintrf.h"
/***************************************************************************
diff --git a/src/emu/cpu/z80/z80dasm.c b/src/emu/cpu/z80/z80dasm.c
index e4841550f9d..f0b494e67d0 100644
--- a/src/emu/cpu/z80/z80dasm.c
+++ b/src/emu/cpu/z80/z80dasm.c
@@ -19,6 +19,7 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "z80.h"
diff --git a/src/emu/cpu/z8000/8000dasm.c b/src/emu/cpu/z8000/8000dasm.c
index 09d9df43970..adc1c0e8814 100644
--- a/src/emu/cpu/z8000/8000dasm.c
+++ b/src/emu/cpu/z8000/8000dasm.c
@@ -44,9 +44,9 @@
*
*****************************************************************************/
+#include "emu.h"
#include "z8000.h"
#include "z8000cpu.h"
-#include "cpuintrf.h"
static int n[12]; /* opcode nibbles */
static int b[6]; /* opcode bytes */
diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c
index e77ffa13e1c..8e22e94a61d 100644
--- a/src/emu/cpu/z8000/z8000.c
+++ b/src/emu/cpu/z8000/z8000.c
@@ -43,6 +43,7 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "z8000.h"
@@ -232,7 +233,7 @@ INLINE void set_irq(z8000_state *cpustate, int type)
cpustate->irq_req = type;
break;
case Z8000_SYSCALL >> 8:
- LOG(("Z8K '%s' SYSCALL $%02x\n", cpustate->device->tag, type & 0xff));
+ LOG(("Z8K '%s' SYSCALL $%02x\n", cpustate->device->tag.cstr(), type & 0xff));
cpustate->irq_req = type;
break;
default:
@@ -270,7 +271,7 @@ INLINE void Interrupt(z8000_state *cpustate)
cpustate->irq_srv = cpustate->irq_req;
cpustate->irq_req &= ~Z8000_TRAP;
cpustate->pc = TRAP;
- LOG(("Z8K '%s' trap $%04x\n", cpustate->device->tag, cpustate->pc));
+ LOG(("Z8K '%s' trap $%04x\n", cpustate->device->tag.cstr(), cpustate->pc));
}
else
if (cpustate->irq_req & Z8000_SYSCALL)
@@ -282,7 +283,7 @@ INLINE void Interrupt(z8000_state *cpustate)
cpustate->irq_srv = cpustate->irq_req;
cpustate->irq_req &= ~Z8000_SYSCALL;
cpustate->pc = SYSCALL;
- LOG(("Z8K '%s' syscall $%04x\n", cpustate->device->tag, cpustate->pc));
+ LOG(("Z8K '%s' syscall $%04x\n", cpustate->device->tag.cstr(), cpustate->pc));
}
else
if (cpustate->irq_req & Z8000_SEGTRAP)
@@ -294,7 +295,7 @@ INLINE void Interrupt(z8000_state *cpustate)
cpustate->irq_srv = cpustate->irq_req;
cpustate->irq_req &= ~Z8000_SEGTRAP;
cpustate->pc = SEGTRAP;
- LOG(("Z8K '%s' segtrap $%04x\n", cpustate->device->tag, cpustate->pc));
+ LOG(("Z8K '%s' segtrap $%04x\n", cpustate->device->tag.cstr(), cpustate->pc));
}
else
if (cpustate->irq_req & Z8000_NMI)
@@ -309,7 +310,7 @@ INLINE void Interrupt(z8000_state *cpustate)
cpustate->irq_req &= ~Z8000_NMI;
CHANGE_FCW(cpustate, fcw);
cpustate->pc = NMI;
- LOG(("Z8K '%s' NMI $%04x\n", cpustate->device->tag, cpustate->pc));
+ LOG(("Z8K '%s' NMI $%04x\n", cpustate->device->tag.cstr(), cpustate->pc));
}
else
if ((cpustate->irq_req & Z8000_NVI) && (cpustate->fcw & F_NVIE))
@@ -323,7 +324,7 @@ INLINE void Interrupt(z8000_state *cpustate)
cpustate->pc = RDMEM_W(cpustate, NVI + 2);
cpustate->irq_req &= ~Z8000_NVI;
CHANGE_FCW(cpustate, fcw);
- LOG(("Z8K '%s' NVI $%04x\n", cpustate->device->tag, cpustate->pc));
+ LOG(("Z8K '%s' NVI $%04x\n", cpustate->device->tag.cstr(), cpustate->pc));
}
else
if ((cpustate->irq_req & Z8000_VI) && (cpustate->fcw & F_VIE))
@@ -337,7 +338,7 @@ INLINE void Interrupt(z8000_state *cpustate)
cpustate->pc = RDMEM_W(cpustate, VEC00 + 2 * (cpustate->irq_req & 0xff));
cpustate->irq_req &= ~Z8000_VI;
CHANGE_FCW(cpustate, fcw);
- LOG(("Z8K '%s' VI [$%04x/$%04x] fcw $%04x, pc $%04x\n", cpustate->device->tag, cpustate->irq_vec, VEC00 + VEC00 + 2 * (cpustate->irq_req & 0xff), cpustate->fcw, cpustate->pc));
+ LOG(("Z8K '%s' VI [$%04x/$%04x] fcw $%04x, pc $%04x\n", cpustate->device->tag.cstr(), cpustate->irq_vec, VEC00 + VEC00 + 2 * (cpustate->irq_req & 0xff), cpustate->fcw, cpustate->pc));
}
}
diff --git a/src/emu/cpu/z8000/z8000.h b/src/emu/cpu/z8000/z8000.h
index a9dc99e7426..d1a8dff1d47 100644
--- a/src/emu/cpu/z8000/z8000.h
+++ b/src/emu/cpu/z8000/z8000.h
@@ -3,7 +3,6 @@
#ifndef __Z8000_H__
#define __Z8000_H__
-#include "cpuintrf.h"
enum
{
diff --git a/src/emu/cpu/z8000/z8000ops.c b/src/emu/cpu/z8000/z8000ops.c
index 581f39ff6e5..77688549dbc 100644
--- a/src/emu/cpu/z8000/z8000ops.c
+++ b/src/emu/cpu/z8000/z8000ops.c
@@ -1530,7 +1530,7 @@ static void Z0D_ddN0_1001_imm16(z8000_state *cpustate)
static void Z0E_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: ext0e $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: ext0e $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
@@ -1544,7 +1544,7 @@ static void Z0E_imm8(z8000_state *cpustate)
static void Z0F_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: ext0f $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: ext0f $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
@@ -2272,7 +2272,7 @@ static void Z36_0000_0000(z8000_state *cpustate)
static void Z36_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: rsvd36 $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: rsvd36 $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
@@ -2310,7 +2310,7 @@ static void Z37_ddN0_ssss_imm16(z8000_state *cpustate)
static void Z38_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: rsvd38 $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: rsvd38 $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
@@ -4347,7 +4347,7 @@ static void Z77_ddN0_ssss_0000_xxxx_0000_0000(z8000_state *cpustate)
static void Z78_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: rsvd78 $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: rsvd78 $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
@@ -4404,7 +4404,7 @@ static void Z7B_0000_0000(z8000_state *cpustate)
cpustate->pc = POPW(cpustate, SP); /* get cpustate->pc */
cpustate->irq_srv &= ~tag; /* remove IRQ serviced flag */
CHANGE_FCW(cpustate, fcw); /* check for user/system mode change */
- LOG(("Z8K '%s' IRET tag $%04x, fcw $%04x, pc $%04x\n", cpustate->device->tag, tag, fcw, cpustate->pc));
+ LOG(("Z8K '%s' IRET tag $%04x, fcw $%04x, pc $%04x\n", cpustate->device->tag.cstr(), tag, fcw, cpustate->pc));
}
/******************************************
@@ -4489,7 +4489,7 @@ static void Z7D_dddd_0ccc(z8000_state *cpustate)
cpustate->RW(dst) = cpustate->nsp;
break;
default:
- LOG(("Z8K '%s' LDCTL R%d,%d\n", cpustate->device->tag, dst, imm3));
+ LOG(("Z8K '%s' LDCTL R%d,%d\n", cpustate->device->tag.cstr(), dst, imm3));
}
}
@@ -4519,7 +4519,7 @@ static void Z7D_ssss_1ccc(z8000_state *cpustate)
cpustate->nsp = cpustate->RW(src);
break;
default:
- LOG(("Z8K '%s' LDCTL %d,R%d\n", cpustate->device->tag, imm3, src));
+ LOG(("Z8K '%s' LDCTL %d,R%d\n", cpustate->device->tag.cstr(), imm3, src));
}
}
@@ -4530,7 +4530,7 @@ static void Z7D_ssss_1ccc(z8000_state *cpustate)
static void Z7E_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: rsvd7e $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: rsvd7e $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
@@ -4826,7 +4826,7 @@ static void Z8D_imm4_0101(z8000_state *cpustate)
static void Z8E_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: ext8e $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: ext8e $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
@@ -4840,7 +4840,7 @@ static void Z8E_imm8(z8000_state *cpustate)
static void Z8F_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: ext8f $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: ext8f $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
@@ -4998,7 +4998,7 @@ static void Z9C_dddd_1000(z8000_state *cpustate)
static void Z9D_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: rsvd9d $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: rsvd9d $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
@@ -5039,7 +5039,7 @@ static void Z9E_0000_cccc(z8000_state *cpustate)
static void Z9F_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: rsvd9f $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: rsvd9f $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
@@ -5740,7 +5740,7 @@ static void ZB8_ddN0_1100_0000_rrrr_ssN0_0000(z8000_state *cpustate)
static void ZB9_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: rsvdb9 $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: rsvdb9 $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
@@ -6398,7 +6398,7 @@ static void ZBE_aaaa_bbbb(z8000_state *cpustate)
static void ZBF_imm8(z8000_state *cpustate)
{
GET_IMM8(0);
- LOG(("Z8K '%s' %04x: rsvdbf $%02x\n", cpustate->device->tag, cpustate->pc, imm8));
+ LOG(("Z8K '%s' %04x: rsvdbf $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
if (cpustate->fcw & F_EPU) {
/* Z8001 EPU code goes here */
(void)imm8;
diff --git a/src/emu/cpuexec.c b/src/emu/cpuexec.c
index ee4ab292b50..56cfa11d721 100644
--- a/src/emu/cpuexec.c
+++ b/src/emu/cpuexec.c
@@ -9,11 +9,9 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "profiler.h"
-#include "eminline.h"
#include "debugger.h"
-#include "cpuexec.h"
/***************************************************************************
@@ -314,7 +312,7 @@ void cpuexec_timeslice(running_machine *machine)
{
/* compute how many cycles we want to execute */
ran = classdata->cycles_running = divu_64x32((UINT64)delta >> classdata->divshift, classdata->divisor);
- LOG((" cpu '%s': %d cycles\n", classdata->device->tag, classdata->cycles_running));
+ LOG((" cpu '%s': %d cycles\n", classdata->device->tag.cstr(), classdata->cycles_running));
/* if we're not suspended, actually execute */
if (classdata->suspend == 0)
@@ -425,7 +423,7 @@ const char *cpuexec_describe_context(running_machine *machine)
if (executingcpu != NULL)
{
const address_space *space = cpu_get_address_space(executingcpu, ADDRESS_SPACE_PROGRAM);
- sprintf(global->statebuf, "'%s' (%s)", executingcpu->tag, core_i64_hex_format(cpu_get_pc(executingcpu), space->logaddrchars));
+ sprintf(global->statebuf, "'%s' (%s)", executingcpu->tag.cstr(), core_i64_hex_format(cpu_get_pc(executingcpu), space->logaddrchars));
}
else
strcpy(global->statebuf, "(no context)");
@@ -532,9 +530,9 @@ static DEVICE_START( cpu )
/* if no state registered for saving, we can't save */
if (num_regs == 0)
{
- logerror("CPU '%s' did not register any state to save!\n", device->tag);
+ logerror("CPU '%s' did not register any state to save!\n", device->tag.cstr());
if (device->machine->gamedrv->flags & GAME_SUPPORTS_SAVE)
- fatalerror("CPU '%s' did not register any state to save!", device->tag);
+ fatalerror("CPU '%s' did not register any state to save!", device->tag.cstr());
}
/* register some internal states as well */
@@ -1188,7 +1186,7 @@ void cpu_set_input_line_vector(const device_config *device, int line, int vector
classdata->input[line].vector = vector;
return;
}
- LOG(("cpu_set_input_line_vector CPU '%s' line %d > max input lines\n", device->tag, line));
+ LOG(("cpu_set_input_line_vector CPU '%s' line %d > max input lines\n", device->tag.cstr(), line));
}
@@ -1204,7 +1202,7 @@ void cpu_set_input_line_and_vector(const device_config *device, int line, int st
/* catch errors where people use PULSE_LINE for CPUs that don't support it */
if (state == PULSE_LINE && line != INPUT_LINE_NMI && line != INPUT_LINE_RESET)
- fatalerror("CPU %s: PULSE_LINE can only be used for NMI and RESET lines\n", device->tag);
+ fatalerror("CPU %s: PULSE_LINE can only be used for NMI and RESET lines\n", device->tag.cstr());
if (line >= 0 && line < MAX_INPUT_LINES)
{
@@ -1212,7 +1210,7 @@ void cpu_set_input_line_and_vector(const device_config *device, int line, int st
INT32 input_event = (state & 0xff) | (vector << 8);
int event_index = inputline->qindex++;
- LOG(("cpu_set_input_line_and_vector('%s',%d,%d,%02x)\n", device->tag, line, state, vector));
+ LOG(("cpu_set_input_line_and_vector('%s',%d,%d,%02x)\n", device->tag.cstr(), line, state, vector));
/* if we're full of events, flush the queue and log a message */
if (event_index >= ARRAY_LENGTH(inputline->queue))
@@ -1220,7 +1218,7 @@ void cpu_set_input_line_and_vector(const device_config *device, int line, int st
inputline->qindex--;
empty_event_queue(device->machine, (void *)device, line);
event_index = inputline->qindex++;
- logerror("Exceeded pending input line event queue on CPU '%s'!\n", device->tag);
+ logerror("Exceeded pending input line event queue on CPU '%s'!\n", device->tag.cstr());
}
/* enqueue the event */
@@ -1517,7 +1515,7 @@ static TIMER_CALLBACK( empty_event_queue )
break;
default:
- logerror("empty_event_queue cpu '%s', line %d, unknown state %d\n", device->tag, param, state);
+ logerror("empty_event_queue cpu '%s', line %d, unknown state %d\n", device->tag.cstr(), param, state);
break;
}
@@ -1544,12 +1542,12 @@ static IRQ_CALLBACK( standard_irq_callback )
cpu_input_data *inputline = &classdata->input[irqline];
int vector = inputline->curvector;
- LOG(("standard_irq_callback('%s', %d) $%04x\n", device->tag, irqline, vector));
+ LOG(("standard_irq_callback('%s', %d) $%04x\n", device->tag.cstr(), irqline, vector));
/* if the IRQ state is HOLD_LINE, clear it */
if (inputline->curstate == HOLD_LINE)
{
- LOG(("->set_irq_line('%s',%d,%d)\n", device->tag, irqline, CLEAR_LINE));
+ LOG(("->set_irq_line('%s',%d,%d)\n", device->tag.cstr(), irqline, CLEAR_LINE));
cpu_set_info(device, CPUINFO_INT_INPUT_STATE + irqline, CLEAR_LINE);
inputline->curstate = CLEAR_LINE;
}
diff --git a/src/emu/cpuexec.h b/src/emu/cpuexec.h
index 4c468bbd3e1..94259209db1 100644
--- a/src/emu/cpuexec.h
+++ b/src/emu/cpuexec.h
@@ -11,12 +11,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __CPUEXEC_H__
#define __CPUEXEC_H__
-#include "cpuintrf.h"
-#include "timer.h"
-
/***************************************************************************
CONSTANTS
diff --git a/src/emu/cpuintrf.h b/src/emu/cpuintrf.h
index 2ef0f27500e..f82346c0c63 100644
--- a/src/emu/cpuintrf.h
+++ b/src/emu/cpuintrf.h
@@ -11,14 +11,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __CPUINTRF_H__
#define __CPUINTRF_H__
-#include "devintrf.h"
-#include "memory.h"
-#include "watchdog.h"
-#include "state.h"
-#include <stddef.h>
/***************************************************************************
diff --git a/src/emu/crsshair.c b/src/emu/crsshair.c
index eb987e23800..64c32df8c92 100644
--- a/src/emu/crsshair.c
+++ b/src/emu/crsshair.c
@@ -1,6 +1,6 @@
/***************************************************************************
- crsshair.h
+ crsshair.c
Crosshair handling.
@@ -9,7 +9,8 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
+#include "emuopts.h"
#include "rendutil.h"
#include "config.h"
#include "xmlfile.h"
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index 6db207d7fb7..073aded7a87 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -9,7 +9,8 @@
*********************************************************************/
-#include "driver.h"
+#include "emu.h"
+#include "emuopts.h"
#include "debugcmd.h"
#include "debugcmt.h"
#include "debugcon.h"
@@ -570,7 +571,7 @@ int debug_command_parameter_cpu_space(running_machine *machine, const char *para
*result = cpu_get_address_space(cpu, spacenum);
if (*result == NULL)
{
- debug_console_printf(machine, "No %s memory space found for CPU '%s'\n", address_space_names[spacenum], cpu->tag);
+ debug_console_printf(machine, "No %s memory space found for CPU '%s'\n", address_space_names[spacenum], cpu->tag.cstr());
return FALSE;
}
return TRUE;
@@ -986,7 +987,7 @@ static void execute_focus(running_machine *machine, int ref, int params, const c
for (scancpu = machine->firstcpu; scancpu != NULL; scancpu = cpu_next(scancpu))
if (scancpu != cpu)
debug_cpu_ignore_cpu(scancpu, 1);
- debug_console_printf(machine, "Now focused on CPU '%s'\n", cpu->tag);
+ debug_console_printf(machine, "Now focused on CPU '%s'\n", cpu->tag.cstr());
}
@@ -1014,9 +1015,9 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
if ((cpuinfo->flags & DEBUG_FLAG_OBSERVING) == 0)
{
if (buflen == 0)
- buflen += sprintf(&buffer[buflen], "Currently ignoring CPU '%s'", cpu->tag);
+ buflen += sprintf(&buffer[buflen], "Currently ignoring CPU '%s'", cpu->tag.cstr());
else
- buflen += sprintf(&buffer[buflen], ", '%s'", cpu->tag);
+ buflen += sprintf(&buffer[buflen], ", '%s'", cpu->tag.cstr());
}
}
@@ -1048,7 +1049,7 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
}
debug_cpu_ignore_cpu(cpuwhich[paramnum], 1);
- debug_console_printf(machine, "Now ignoring CPU '%s'\n", cpuwhich[paramnum]->tag);
+ debug_console_printf(machine, "Now ignoring CPU '%s'\n", cpuwhich[paramnum]->tag.cstr());
}
}
}
@@ -1078,9 +1079,9 @@ static void execute_observe(running_machine *machine, int ref, int params, const
if ((cpuinfo->flags & DEBUG_FLAG_OBSERVING) != 0)
{
if (buflen == 0)
- buflen += sprintf(&buffer[buflen], "Currently observing CPU '%s'", cpu->tag);
+ buflen += sprintf(&buffer[buflen], "Currently observing CPU '%s'", cpu->tag.cstr());
else
- buflen += sprintf(&buffer[buflen], ", '%s'", cpu->tag);
+ buflen += sprintf(&buffer[buflen], ", '%s'", cpu->tag.cstr());
}
}
@@ -1102,7 +1103,7 @@ static void execute_observe(running_machine *machine, int ref, int params, const
for (paramnum = 0; paramnum < params; paramnum++)
{
debug_cpu_ignore_cpu(cpuwhich[paramnum], 0);
- debug_console_printf(machine, "Now observing CPU '%s'\n", cpuwhich[paramnum]->tag);
+ debug_console_printf(machine, "Now observing CPU '%s'\n", cpuwhich[paramnum]->tag.cstr());
}
}
}
@@ -1308,7 +1309,7 @@ static void execute_bplist(running_machine *machine, int ref, int params, const
{
debug_cpu_breakpoint *bp;
- debug_console_printf(machine, "CPU '%s' breakpoints:\n", cpu->tag);
+ debug_console_printf(machine, "CPU '%s' breakpoints:\n", cpu->tag.cstr());
/* loop over the breakpoints */
for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next)
@@ -1496,7 +1497,7 @@ static void execute_wplist(running_machine *machine, int ref, int params, const
const address_space *space = cpu_get_address_space(cpu, spacenum);
debug_cpu_watchpoint *wp;
- debug_console_printf(machine, "CPU '%s' %s space watchpoints:\n", cpu->tag, address_space_names[spacenum]);
+ debug_console_printf(machine, "CPU '%s' %s space watchpoints:\n", cpu->tag.cstr(), address_space_names[spacenum]);
/* loop over the watchpoints */
for (wp = cpuinfo->wplist[spacenum]; wp != NULL; wp = wp->next)
@@ -1545,7 +1546,7 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const
if (cpuinfo->hotspots != NULL)
{
debug_cpu_hotspot_track(cpuinfo->device, 0, 0);
- debug_console_printf(machine, "Cleared hotspot tracking on CPU '%s'\n", cpu->tag);
+ debug_console_printf(machine, "Cleared hotspot tracking on CPU '%s'\n", cpu->tag.cstr());
cleared = TRUE;
}
}
@@ -1567,7 +1568,7 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const
/* attempt to install */
if (debug_cpu_hotspot_track(cpu, count, threshhold))
- debug_console_printf(machine, "Now tracking hotspots on CPU '%s' using %d slots with a threshhold of %d\n", cpu->tag, (int)count, (int)threshhold);
+ debug_console_printf(machine, "Now tracking hotspots on CPU '%s' using %d slots with a threshhold of %d\n", cpu->tag.cstr(), (int)count, (int)threshhold);
else
debug_console_printf(machine, "Error setting up the hotspot tracking\n");
}
@@ -2099,7 +2100,7 @@ static void execute_cheatlist(running_machine *machine, int ref, int params, con
active_cheat++;
fprintf(f, " <cheat desc=\"Possibility %d : %s (%s)\">\n", active_cheat, core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(value, cheat.width * 2));
fprintf(f, " <script state=\"run\">\n");
- fprintf(f, " <action>%s.p%c%c@%s=%s</action>\n", cpu->tag, spaceletter, sizeletter, core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(cheat_byte_swap(&cheat, cheat.cheatmap[cheatindex].first_value) & sizemask, cheat.width * 2));
+ fprintf(f, " <action>%s.p%c%c@%s=%s</action>\n", cpu->tag.cstr(), spaceletter, sizeletter, core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(cheat_byte_swap(&cheat, cheat.cheatmap[cheatindex].first_value) & sizemask, cheat.width * 2));
fprintf(f, " </script>\n");
fprintf(f, " </cheat>\n\n");
}
@@ -2398,9 +2399,9 @@ static void execute_trace_internal(running_machine *machine, int ref, int params
/* do it */
debug_cpu_trace(cpu, f, trace_over, action);
if (f)
- debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag, filename);
+ debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag.cstr(), filename);
else
- debug_console_printf(machine, "Stopped tracing on CPU '%s'\n", cpu->tag);
+ debug_console_printf(machine, "Stopped tracing on CPU '%s'\n", cpu->tag.cstr());
}
@@ -2621,7 +2622,7 @@ static void execute_symlist(running_machine *machine, int ref, int params, const
if (cpu != NULL)
{
symtable = debug_cpu_get_symtable(cpu);
- debug_console_printf(machine, "CPU '%s' symbols:\n", cpu->tag);
+ debug_console_printf(machine, "CPU '%s' symbols:\n", cpu->tag.cstr());
}
else
{
diff --git a/src/emu/debug/debugcmt.c b/src/emu/debug/debugcmt.c
index b5bffd50462..62486cb0294 100644
--- a/src/emu/debug/debugcmt.c
+++ b/src/emu/debug/debugcmt.c
@@ -20,7 +20,8 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
+#include "emuopts.h"
#include "xmlfile.h"
#include "debugcmt.h"
#include "debugcpu.h"
diff --git a/src/emu/debug/debugcon.c b/src/emu/debug/debugcon.c
index 262dc9a3da2..00d95708d8e 100644
--- a/src/emu/debug/debugcon.c
+++ b/src/emu/debug/debugcon.c
@@ -471,13 +471,14 @@ const char *debug_cmderr_to_string(CMDERR error)
void CLIB_DECL debug_console_printf(running_machine *machine, const char *format, ...)
{
+ astring buffer;
va_list arg;
va_start(arg, format);
- vsprintf(giant_string_buffer, format, arg);
+ buffer.vprintf(format, arg);
va_end(arg);
- text_buffer_print(console_textbuf, giant_string_buffer);
+ text_buffer_print(console_textbuf, buffer);
/* force an update of any console views */
debug_view_update_type(machine, DVT_CONSOLE);
@@ -492,8 +493,10 @@ void CLIB_DECL debug_console_printf(running_machine *machine, const char *format
void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *format, va_list args)
{
- vsprintf(giant_string_buffer, format, args);
- text_buffer_print(console_textbuf, giant_string_buffer);
+ astring buffer;
+
+ buffer.vprintf(format, args);
+ text_buffer_print(console_textbuf, buffer);
/* force an update of any console views */
debug_view_update_type(machine, DVT_CONSOLE);
@@ -508,13 +511,14 @@ void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *forma
void CLIB_DECL debug_console_printf_wrap(running_machine *machine, int wrapcol, const char *format, ...)
{
+ astring buffer;
va_list arg;
va_start(arg, format);
- vsprintf(giant_string_buffer, format, arg);
+ buffer.vprintf(format, arg);
va_end(arg);
- text_buffer_print_wrap(console_textbuf, giant_string_buffer, wrapcol);
+ text_buffer_print_wrap(console_textbuf, buffer, wrapcol);
/* force an update of any console views */
debug_view_update_type(machine, DVT_CONSOLE);
diff --git a/src/emu/debug/debugcon.h b/src/emu/debug/debugcon.h
index 9d271fd3b48..4197e108b70 100644
--- a/src/emu/debug/debugcon.h
+++ b/src/emu/debug/debugcon.h
@@ -13,7 +13,6 @@
#define __DEBUGCON_H__
#include "textbuf.h"
-#include <stdarg.h>
/***************************************************************************
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index 4038edd8883..519b00401f7 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -553,7 +553,7 @@ void debug_cpu_interrupt_hook(const device_config *device, int irqline)
if (info != NULL && (info->flags & DEBUG_FLAG_STOP_INTERRUPT) != 0 && (info->stopirq == -1 || info->stopirq == irqline))
{
global->execution_state = EXECUTION_STATE_STOPPED;
- debug_console_printf(device->machine, "Stopped on interrupt (CPU '%s', IRQ %d)\n", device->tag, irqline);
+ debug_console_printf(device->machine, "Stopped on interrupt (CPU '%s', IRQ %d)\n", device->tag.cstr(), irqline);
compute_debug_flags(device);
}
}
@@ -573,7 +573,7 @@ void debug_cpu_exception_hook(const device_config *device, int exception)
if ((info->flags & DEBUG_FLAG_STOP_EXCEPTION) != 0 && (info->stopexception == -1 || info->stopexception == exception))
{
global->execution_state = EXECUTION_STATE_STOPPED;
- debug_console_printf(device->machine, "Stopped on exception (CPU '%s', exception %d)\n", device->tag, exception);
+ debug_console_printf(device->machine, "Stopped on exception (CPU '%s', exception %d)\n", device->tag.cstr(), exception);
compute_debug_flags(device);
}
}
@@ -640,7 +640,7 @@ void debug_cpu_instruction_hook(const device_config *device, offs_t curpc)
/* check the temp running breakpoint and break if we hit it */
else if ((info->flags & DEBUG_FLAG_STOP_PC) != 0 && info->stopaddr == curpc)
{
- debug_console_printf(device->machine, "Stopped at temporary breakpoint %X on CPU '%s'\n", info->stopaddr, device->tag);
+ debug_console_printf(device->machine, "Stopped at temporary breakpoint %X on CPU '%s'\n", info->stopaddr, device->tag.cstr());
global->execution_state = EXECUTION_STATE_STOPPED;
}
diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h
index a29ba715137..772f7bea19a 100644
--- a/src/emu/debug/debugcpu.h
+++ b/src/emu/debug/debugcpu.h
@@ -14,7 +14,6 @@
#ifndef __DEBUGCPU_H__
#define __DEBUGCPU_H__
-#include "cpuintrf.h"
#include "express.h"
diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c
index 7b15f78b8e0..2dd822c00ef 100644
--- a/src/emu/debug/debugvw.c
+++ b/src/emu/debug/debugvw.c
@@ -1036,7 +1036,7 @@ static const registers_subview_item *registers_view_enumerate_subviews(running_m
registers_subview_item *subview;
/* determine the string and allocate a subview large enough */
- tempstring.printf("CPU '%s' (%s)", cpu->tag, cpu_get_name(cpu));
+ tempstring.printf("CPU '%s' (%s)", cpu->tag.cstr(), cpu_get_name(cpu));
subview = (registers_subview_item *)auto_alloc_array_clear(machine, UINT8, sizeof(*subview) + tempstring.len());
/* populate the subview */
@@ -1500,7 +1500,7 @@ static const disasm_subview_item *disasm_view_enumerate_subviews(running_machine
disasm_subview_item *subview;
/* determine the string and allocate a subview large enough */
- tempstring.printf("CPU '%s' (%s)", cpu->tag, cpu_get_name(cpu));
+ tempstring.printf("CPU '%s' (%s)", cpu->tag.cstr(), cpu_get_name(cpu));
subview = (disasm_subview_item *)auto_alloc_array_clear(machine, UINT8, sizeof(*subview) + tempstring.len());
/* populate the subview */
@@ -2382,9 +2382,9 @@ static const memory_subview_item *memory_view_enumerate_subviews(running_machine
/* determine the string and allocate a subview large enough */
if (device->type == CPU)
- tempstring.printf("CPU '%s' (%s) %s memory", device->tag, device_get_name(device), space->name);
+ tempstring.printf("CPU '%s' (%s) %s memory", device->tag.cstr(), device_get_name(device), space->name);
else
- tempstring.printf("%s '%s' space #%d memory", device_get_name(device), device->tag, spacenum);
+ tempstring.printf("%s '%s' space #%d memory", device_get_name(device), device->tag.cstr(), spacenum);
subview = (memory_subview_item *)auto_alloc_array_clear(machine, UINT8, sizeof(*subview) + tempstring.len());
/* populate the subview */
diff --git a/src/emu/debug/express.h b/src/emu/debug/express.h
index 3cd9c1db930..ba758b97181 100644
--- a/src/emu/debug/express.h
+++ b/src/emu/debug/express.h
@@ -12,6 +12,7 @@
#include "osdcore.h"
+
/***************************************************************************
CONSTANTS
***************************************************************************/
diff --git a/src/emu/debugger.c b/src/emu/debugger.c
index d88d089331c..b722425b9fe 100644
--- a/src/emu/debugger.c
+++ b/src/emu/debugger.c
@@ -9,7 +9,7 @@
*********************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "debugger.h"
#include "debug/debugcpu.h"
#include "debug/debugcmd.h"
diff --git a/src/emu/debugger.h b/src/emu/debugger.h
index 69a28a086c3..bc2827cddf6 100644
--- a/src/emu/debugger.h
+++ b/src/emu/debugger.h
@@ -14,8 +14,6 @@
#ifndef __DEBUGGER_H__
#define __DEBUGGER_H__
-#include "mame.h"
-#include "cpuexec.h"
#include "debug/debugcpu.h"
diff --git a/src/emu/deprecat.h b/src/emu/deprecat.h
index 5c01d54df04..9417923dd6b 100644
--- a/src/emu/deprecat.h
+++ b/src/emu/deprecat.h
@@ -15,9 +15,6 @@
#ifndef __DEPRECAT_H__
#define __DEPRECAT_H__
-#include "emucore.h"
-#include "devintrf.h"
-
/*************************************
*
diff --git a/src/emu/devcb.c b/src/emu/devcb.c
index 29ad2bb10e4..bc45d52c38f 100644
--- a/src/emu/devcb.c
+++ b/src/emu/devcb.c
@@ -9,8 +9,7 @@
***************************************************************************/
-#include "devcb.h"
-#include "driver.h"
+#include "emu.h"
@@ -42,9 +41,9 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
/* input port handlers */
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = input_port_by_tag(&device->machine->portlist, config->tag);
+ resolved->target = device->machine->port(config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
resolved->read = trampoline_read_port_to_read_line;
}
@@ -60,12 +59,12 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
cpu = devtag_get_device(device->machine, config->tag);
if (cpu == NULL)
- fatalerror("devcb_resolve_read_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_read_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
resolved->target = resolved;
resolved->read = trampoline_read8_to_read_line;
resolved->realtarget = memory_find_address_space(cpu, space);
if (resolved->realtarget == NULL)
- fatalerror("devcb_resolve_read_line: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[space], device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_read_line: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[space], device_get_name(device), device->tag.cstr());
resolved->real.readspace = config->readspace;
}
@@ -81,7 +80,7 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
resolved->target = devtag_get_device(device->machine, config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_read_line: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_read_line: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
/* read_line to read_line is direct */
if (config->readline != NULL)
@@ -129,9 +128,9 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = input_port_by_tag(&device->machine->portlist, config->tag);
+ resolved->target = device->machine->port(config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_write_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_write_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
resolved->write = trampoline_write_port_to_write_line;
}
@@ -147,12 +146,12 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
cpu = devtag_get_device(device->machine, config->tag);
if (cpu == NULL)
- fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
resolved->target = resolved;
resolved->write = trampoline_write8_to_write_line;
resolved->realtarget = memory_find_address_space(cpu, space);
if (resolved->realtarget == NULL)
- fatalerror("devcb_resolve_write_line: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[space], device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_write_line: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[space], device_get_name(device), device->tag.cstr());
resolved->real.writespace = config->writespace;
}
@@ -168,7 +167,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
cpu = devtag_get_device(device->machine, config->tag);
if (cpu == NULL)
- fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
resolved->target = resolved;
resolved->write = trampoline_writecpu_to_write_line;
resolved->realtarget = cpu;
@@ -187,7 +186,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
resolved->target = devtag_get_device(device->machine, config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_write_line: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_write_line: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
/* write_line to write_line is direct */
if (config->writeline != NULL)
@@ -229,9 +228,9 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
/* input port handlers */
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = input_port_by_tag(&device->machine->portlist, config->tag);
+ resolved->target = device->machine->port(config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_read8: unable to find input port '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_read8: unable to find input port '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
resolved->read = trampoline_read_port_to_read8;
}
@@ -247,10 +246,10 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
cpu = devtag_get_device(device->machine, config->tag);
if (cpu == NULL)
- fatalerror("devcb_resolve_read8: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_read8: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
resolved->target = memory_find_address_space(cpu, space);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_read8: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[space], device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_read8: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[space], device_get_name(device), device->tag.cstr());
resolved->read = (read8_device_func)config->readspace;
}
@@ -259,7 +258,7 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
{
resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_read8: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_read8: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
/* read8 to read8 is direct */
if (config->readdevice != NULL)
@@ -300,9 +299,9 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = input_port_by_tag(&device->machine->portlist, config->tag);
+ resolved->target = device->machine->port(config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
resolved->write = trampoline_write_port_to_write8;
}
@@ -318,10 +317,10 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
cpu = devtag_get_device(device->machine, config->tag);
if (cpu == NULL)
- fatalerror("devcb_resolve_write8: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_write8: unable to find CPU '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
resolved->target = memory_find_address_space(cpu, space);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_write8: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[space], device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_write8: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[space], device_get_name(device), device->tag.cstr());
resolved->write = (write8_device_func)config->writespace;
}
@@ -330,7 +329,7 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
{
resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : devtag_get_device(device->machine, config->tag);
if (resolved->target == NULL)
- fatalerror("devcb_resolve_write8: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag);
+ fatalerror("devcb_resolve_write8: unable to find device '%s' (requested by %s '%s')", config->tag, device_get_name(device), device->tag.cstr());
/* write8 to write8 is direct */
if (config->writedevice != NULL)
diff --git a/src/emu/devcb.h b/src/emu/devcb.h
index eabb19bbb2a..ba6cfe02730 100644
--- a/src/emu/devcb.h
+++ b/src/emu/devcb.h
@@ -36,12 +36,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __DEVCB_H__
#define __DEVCB_H__
-#include "devintrf.h"
-#include "memory.h"
-
/***************************************************************************
CONSTANTS
@@ -92,6 +93,10 @@
TYPE DEFINITIONS
***************************************************************************/
+/* forward declarations */
+class device_config;
+
+
/* read/write types for I/O lines (similar to read/write handlers but no offset) */
typedef int (*read_line_device_func)(const device_config *device);
typedef void (*write_line_device_func)(const device_config *device, int state);
diff --git a/src/emu/devintrf.c b/src/emu/devintrf.c
index 96f50319a23..f4145d5e163 100644
--- a/src/emu/devintrf.c
+++ b/src/emu/devintrf.c
@@ -9,9 +9,7 @@
***************************************************************************/
-#include "driver.h"
-#include "cpuintrf.h"
-#include "devintrf.h"
+#include "emu.h"
@@ -97,13 +95,6 @@ void device_list_init(device_list *devlist, int allocmap)
{
/* initialize fields */
devlist->head = NULL;
- devlist->map = NULL;
- if (allocmap)
- {
- devlist->map = tagmap_alloc();
- if (devlist->map == NULL)
- fatalerror("Out of memory for device list map");
- }
}
@@ -117,10 +108,6 @@ void device_list_deinit(device_list *devlist)
/* release all devices */
while (devlist->head != NULL)
device_list_remove(devlist, devlist->head->tag);
-
- /* release the map memory */
- if (devlist->map != NULL)
- tagmap_free(devlist->map);
}
@@ -137,29 +124,25 @@ device_config *device_list_add(device_list *devlist, const device_config *owner,
UINT32 configlen;
assert(devlist != NULL);
- assert(devlist->map != NULL);
assert(type != NULL);
assert(tag != NULL);
/* find the end of the list */
for (devptr = &devlist->head; *devptr != NULL; devptr = &(*devptr)->next) ;
- /* get the size of the inline config */
- configlen = (UINT32)devtype_get_info_int(type, DEVINFO_INT_INLINE_CONFIG_BYTES);
-
/* allocate a new device */
- device = (device_config *)global_alloc_array(UINT8, sizeof(*device) + strlen(tag));
+ device = global_alloc(device_config);
/* add to the map */
- tmerr = tagmap_add_unique_hash(devlist->map, tag, device, FALSE);
+ tmerr = devlist->map.add_unique_hash(tag, device, FALSE);
if (tmerr == TMERR_DUPLICATE)
{
- device_config *match = (device_config *)tagmap_find_hash_only(devlist->map, tag);
+ const device_config *match = devlist->map.find_hash_only(tag);
assert(match != NULL);
if (strcmp(tag, match->tag) == 0)
fatalerror("Attempted to add duplicate device: type=%s tag=%s\n", device_get_name(*devptr), tag);
else
- fatalerror("Two devices have tags which hash to the same value: '%s' and '%s'\n", tag, match->tag);
+ fatalerror("Two devices have tags which hash to the same value: '%s' and '%s'\n", tag, match->tag.cstr());
}
/* populate device relationships */
@@ -181,6 +164,7 @@ device_config *device_list_add(device_list *devlist, const device_config *owner,
device->clock = device->owner->clock * ((device->clock >> 12) & 0xfff) / ((device->clock >> 0) & 0xfff);
}
device->static_config = NULL;
+ configlen = (UINT32)devtype_get_info_int(type, DEVINFO_INT_INLINE_CONFIG_BYTES);
device->inline_config = (configlen == 0) ? NULL : global_alloc_array_clear(UINT8, configlen);
/* ensure live fields are all cleared */
@@ -194,7 +178,7 @@ device_config *device_list_add(device_list *devlist, const device_config *owner,
device->execute = NULL;
/* append the tag */
- strcpy(device->tag, tag);
+ device->tag.cpy(tag);
/* fetch function pointers to the core functions */
@@ -251,8 +235,7 @@ void device_list_remove(device_list *devlist, const char *tag)
*devptr = device->next;
/* and from the map */
- if (devlist->map != NULL)
- tagmap_remove(devlist->map, device->tag);
+ devlist->map.remove(device->tag);
/* free the device object */
if (device->inline_config != NULL)
diff --git a/src/emu/devintrf.h b/src/emu/devintrf.h
index b283fcb5d63..a591813411e 100644
--- a/src/emu/devintrf.h
+++ b/src/emu/devintrf.h
@@ -11,19 +11,24 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __DEVINTRF_H__
#define __DEVINTRF_H__
-#include "emucore.h"
-#include "romload.h"
-#include "memory.h"
-#include "tagmap.h"
/***************************************************************************
CONSTANTS
***************************************************************************/
+/* forward references */
+struct rom_entry;
+union machine_config_token;
+
+
/* device classes */
enum _device_class
{
@@ -166,7 +171,7 @@ enum
#define DEVICE_VALIDITY_CHECK_CALL(name) DEVICE_VALIDITY_CHECK_NAME(name)(driver, device)
#define DEVICE_CUSTOM_CONFIG_NAME(name) device_custom_config_##name
-#define DEVICE_CUSTOM_CONFIG(name) const union _machine_config_token *DEVICE_CUSTOM_CONFIG_NAME(name)(const device_config *device, UINT32 entrytype, const union _machine_config_token *tokens)
+#define DEVICE_CUSTOM_CONFIG(name) const machine_config_token *DEVICE_CUSTOM_CONFIG_NAME(name)(const device_config *device, UINT32 entrytype, const machine_config_token *tokens)
#define DEVICE_CUSTOM_CONFIG_CALL(name) DEVICE_CUSTOM_CONFIG_NAME(name)(device, entrytype, tokens)
@@ -236,12 +241,12 @@ enum
***************************************************************************/
/* forward-declare these types */
-typedef union _deviceinfo deviceinfo;
+class device_config;
+union deviceinfo;
/* a device contract */
-typedef struct _device_contract device_contract;
-struct _device_contract
+struct device_contract
{
const char * name; /* name of this contract */
UINT32 size; /* size of this contract in bytes */
@@ -257,7 +262,7 @@ typedef INT32 (*device_execute_func)(const device_config *device, INT32 clocks);
typedef void (*device_reset_func)(const device_config *device);
typedef void (*device_nvram_func)(const device_config *device, mame_file *file, int read_or_write);
typedef int (*device_validity_check_func)(const game_driver *driver, const device_config *device);
-typedef const union _machine_config_token *(*device_custom_config_func)(const device_config *device, UINT32 entrytype, const union _machine_config_token *tokens);
+typedef const machine_config_token *(*device_custom_config_func)(const device_config *device, UINT32 entrytype, const machine_config_token *tokens);
/* a device_type is simply a pointer to its get_info function */
@@ -265,7 +270,7 @@ typedef device_get_info_func device_type;
/* the actual deviceinfo union */
-union _deviceinfo
+union deviceinfo
{
INT64 i; /* generic integers */
void * p; /* generic pointers */
@@ -280,7 +285,7 @@ union _deviceinfo
device_custom_config_func custom_config; /* DEVINFO_FCT_CUSTOM_CONFIG */
device_nvram_func nvram; /* DEVINFO_FCT_NVRAM */
const rom_entry * romregion; /* DEVINFO_PTR_ROM_REGION */
- const union _machine_config_token *machine_config; /* DEVINFO_PTR_MACHINE_CONFIG */
+ const machine_config_token *machine_config; /* DEVINFO_PTR_MACHINE_CONFIG */
const device_contract * contract_list; /* DEVINFO_PTR_CONTRACT_LIST */
const addrmap8_token * internal_map8; /* DEVINFO_PTR_INTERNAL_MEMORY_MAP */
const addrmap16_token * internal_map16; /* DEVINFO_PTR_INTERNAL_MEMORY_MAP */
@@ -294,8 +299,9 @@ union _deviceinfo
/* the configuration for a general device */
-struct _device_config
+class device_config
{
+public:
/* device relationships (always valid) */
device_config * next; /* next device (of any type/class) */
device_config * owner; /* device that owns us, or NULL if nobody */
@@ -303,6 +309,7 @@ struct _device_config
device_config * classnext; /* next device of the same class */
/* device properties (always valid) */
+ astring tag; /* tag for this instance */
device_type type; /* device type */
device_class devclass; /* device class */
@@ -323,18 +330,14 @@ struct _device_config
UINT32 regionbytes; /* size of the region, in bytes */
const address_space * space[ADDRESS_SPACES]; /* auto-discovered address spaces */
device_execute_func execute; /* quick pointer to execute callback */
-
- /* tag (always valid; at end because it is variable-length) */
- char tag[1]; /* tag for this instance */
};
/* an object that contains a list of devices */
-typedef struct _device_list device_list;
-struct _device_list
+struct device_list
{
- device_config * head; /* head of the list */
- tagmap * map; /* map for fast lookups */
+ device_config * head; /* head of the list */
+ tagmap_t<device_config *> map; /* map for fast lookups */
};
@@ -474,11 +477,7 @@ const char *devtype_get_info_string(device_type type, UINT32 state);
INLINE const device_config *device_list_find_by_tag(const device_list *devlist, const char *tag)
{
/* if we have a map, use it */
- if (devlist->map != NULL)
- return (const device_config *)tagmap_find_hash_only(devlist->map, tag);
-
- /* otherwise, go the slow route */
- return device_list_find_by_tag_slow(devlist, tag);
+ return devlist->map.find_hash_only(tag);
}
diff --git a/src/emu/drawgfx.c b/src/emu/drawgfx.c
index e633d77ffd6..3f4bde06098 100644
--- a/src/emu/drawgfx.c
+++ b/src/emu/drawgfx.c
@@ -9,7 +9,7 @@
*********************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "drawgfxm.h"
#include "drawgfx.h"
diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h
index a588fbc61eb..b5f15be9ecb 100644
--- a/src/emu/drawgfx.h
+++ b/src/emu/drawgfx.h
@@ -11,11 +11,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __DRAWGFX_H__
#define __DRAWGFX_H__
-#include "emucore.h"
-
/***************************************************************************
@@ -115,9 +117,9 @@ struct _gfx_layout
};
-/* In emucore.h: typedef struct _gfx_element gfx_element; */
-struct _gfx_element
+class gfx_element
{
+public:
UINT16 width; /* current pixel width of each element (changeble with source clipping) */
UINT16 height; /* current pixel height of each element (changeble with source clipping) */
UINT16 startx; /* current source clip X offset */
@@ -147,8 +149,7 @@ struct _gfx_element
};
-typedef struct _gfx_decode_entry gfx_decode_entry;
-struct _gfx_decode_entry
+struct gfx_decode_entry
{
const char * memory_region; /* memory region where the data resides */
UINT32 start; /* offset of beginning of data to decode */
diff --git a/src/emu/drawgfxm.h b/src/emu/drawgfxm.h
index a48d83d255f..7e527911bfe 100644
--- a/src/emu/drawgfxm.h
+++ b/src/emu/drawgfxm.h
@@ -374,7 +374,7 @@ while (0) \
#define DRAWGFX_CORE(PIXEL_TYPE, PIXEL_OP, PRIORITY_TYPE) \
do { \
- profiler_mark_start(PROFILER_DRAWGFX); \
+ profiler_mark_start(PROFILER_DRAWGFX); \
do { \
const UINT8 *srcdata; \
INT32 destendx, destendy; \
diff --git a/src/emu/driver.c b/src/emu/driver.c
index c22ca41b735..201268c4622 100644
--- a/src/emu/driver.c
+++ b/src/emu/driver.c
@@ -9,7 +9,7 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
#include <ctype.h>
diff --git a/src/emu/driver.h b/src/emu/driver.h
index 9f805d13a10..86bcbf9af7e 100644
--- a/src/emu/driver.h
+++ b/src/emu/driver.h
@@ -9,6 +9,11 @@
***************************************************************************/
+// temporary: redirect #include "driver.h" to #include "emu.h"
+#ifndef __EMU_H__
+#include "emu.h"
+#else
+
#pragma once
#ifndef __DRIVER_H__
@@ -16,118 +21,6 @@
/***************************************************************************
- MACROS (must be *before* the includes below)
-***************************************************************************/
-
-#include "devintrf.h"
-
-#define DRIVER_INIT_NAME(name) driver_init_##name
-#define DRIVER_INIT(name) void DRIVER_INIT_NAME(name)(running_machine *machine)
-#define DRIVER_INIT_CALL(name) DRIVER_INIT_NAME(name)(machine)
-
-#define NVRAM_HANDLER_NAME(name) nvram_handler_##name
-#define NVRAM_HANDLER(name) void NVRAM_HANDLER_NAME(name)(running_machine *machine, mame_file *file, int read_or_write)
-#define NVRAM_HANDLER_CALL(name) NVRAM_HANDLER_NAME(name)(machine, file, read_or_write)
-
-#define MEMCARD_HANDLER_NAME(name) memcard_handler_##name
-#define MEMCARD_HANDLER(name) void MEMCARD_HANDLER_NAME(name)(running_machine *machine, mame_file *file, int action)
-#define MEMCARD_HANDLER_CALL(name) MEMCARD_HANDLER_NAME(name)(machine, file, action)
-
-#define MACHINE_START_NAME(name) machine_start_##name
-#define MACHINE_START(name) void MACHINE_START_NAME(name)(running_machine *machine)
-#define MACHINE_START_CALL(name) MACHINE_START_NAME(name)(machine)
-
-#define MACHINE_RESET_NAME(name) machine_reset_##name
-#define MACHINE_RESET(name) void MACHINE_RESET_NAME(name)(running_machine *machine)
-#define MACHINE_RESET_CALL(name) MACHINE_RESET_NAME(name)(machine)
-
-#define SOUND_START_NAME(name) sound_start_##name
-#define SOUND_START(name) void SOUND_START_NAME(name)(running_machine *machine)
-#define SOUND_START_CALL(name) SOUND_START_NAME(name)(machine)
-
-#define SOUND_RESET_NAME(name) sound_reset_##name
-#define SOUND_RESET(name) void SOUND_RESET_NAME(name)(running_machine *machine)
-#define SOUND_RESET_CALL(name) SOUND_RESET_NAME(name)(machine)
-
-#define VIDEO_START_NAME(name) video_start_##name
-#define VIDEO_START(name) void VIDEO_START_NAME(name)(running_machine *machine)
-#define VIDEO_START_CALL(name) VIDEO_START_NAME(name)(machine)
-
-#define VIDEO_RESET_NAME(name) video_reset_##name
-#define VIDEO_RESET(name) void VIDEO_RESET_NAME(name)(running_machine *machine)
-#define VIDEO_RESET_CALL(name) VIDEO_RESET_NAME(name)(machine)
-
-#define PALETTE_INIT_NAME(name) palette_init_##name
-#define PALETTE_INIT(name) void PALETTE_INIT_NAME(name)(running_machine *machine, const UINT8 *color_prom)
-#define PALETTE_INIT_CALL(name) PALETTE_INIT_NAME(name)(machine, color_prom)
-
-#define VIDEO_EOF_NAME(name) video_eof_##name
-#define VIDEO_EOF(name) void VIDEO_EOF_NAME(name)(running_machine *machine)
-#define VIDEO_EOF_CALL(name) VIDEO_EOF_NAME(name)(machine)
-
-#define VIDEO_UPDATE_NAME(name) video_update_##name
-#define VIDEO_UPDATE(name) UINT32 VIDEO_UPDATE_NAME(name)(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect)
-#define VIDEO_UPDATE_CALL(name) VIDEO_UPDATE_NAME(name)(screen, bitmap, cliprect)
-
-
-/* NULL versions */
-#define driver_init_0 NULL
-#define nvram_handler_0 NULL
-#define memcard_handler_0 NULL
-#define machine_start_0 NULL
-#define machine_reset_0 NULL
-#define sound_start_0 NULL
-#define sound_reset_0 NULL
-#define video_start_0 NULL
-#define video_reset_0 NULL
-#define palette_init_0 NULL
-#define video_eof_0 NULL
-#define video_update_0 NULL
-
-
-typedef void (*driver_init_func)(running_machine *machine);
-typedef void (*nvram_handler_func)(running_machine *machine, mame_file *file, int read_or_write);
-typedef void (*memcard_handler_func)(running_machine *machine, mame_file *file, int action);
-typedef void (*machine_start_func)(running_machine *machine);
-typedef void (*machine_reset_func)(running_machine *machine);
-typedef void (*sound_start_func)(running_machine *machine);
-typedef void (*sound_reset_func)(running_machine *machine);
-typedef void (*video_start_func)(running_machine *machine);
-typedef void (*video_reset_func)(running_machine *machine);
-typedef void (*palette_init_func)(running_machine *machine, const UINT8 *color_prom);
-typedef void (*video_eof_func)(running_machine *machine);
-typedef UINT32 (*video_update_func)(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect);
-
-
-
-/***************************************************************************
- INCLUDES
-***************************************************************************/
-
-#include "cpuintrf.h"
-#include "sndintrf.h"
-#include "fileio.h"
-#include "drawgfx.h"
-#include "emupal.h"
-#include "sound.h"
-#include "input.h"
-#include "inptport.h"
-#include "output.h"
-#include "tilemap.h"
-#include "romload.h"
-#include "mconfig.h"
-#include "drivers/xtal.h"
-#include "machine/generic.h"
-#include "audio/generic.h"
-#include "video/generic.h"
-
-#ifdef MESS
-#include "messdrv.h"
-#endif
-
-
-
-/***************************************************************************
CONSTANTS
***************************************************************************/
@@ -169,8 +62,10 @@ typedef UINT32 (*video_update_func)(const device_config *screen, bitmap_t *bitma
TYPE DEFINITIONS
***************************************************************************/
-/* In emucore.h: typedef struct _game_driver game_driver; */
-struct _game_driver
+typedef void (*driver_init_func)(running_machine *machine);
+
+
+struct game_driver
{
const char * source_file; /* set this to __FILE__ */
const char * parent; /* if this is a clone, the name of the parent */
@@ -193,6 +88,14 @@ struct _game_driver
MACROS FOR BUILDING GAME DRIVERS
***************************************************************************/
+
+#define DRIVER_INIT_NAME(name) driver_init_##name
+#define DRIVER_INIT(name) void DRIVER_INIT_NAME(name)(running_machine *machine)
+#define DRIVER_INIT_CALL(name) DRIVER_INIT_NAME(name)(machine)
+
+#define driver_init_0 NULL
+
+
#define GAME_NAME(name) driver_##name
#define GAME_EXTERN(name) extern const game_driver GAME_NAME(name)
@@ -241,3 +144,5 @@ int driver_list_get_count(const game_driver * const driverlist[]);
#endif /* __DRIVER_H__ */
+
+#endif
diff --git a/src/emu/emu.h b/src/emu/emu.h
new file mode 100644
index 00000000000..2c2c869fc04
--- /dev/null
+++ b/src/emu/emu.h
@@ -0,0 +1,112 @@
+/***************************************************************************
+
+ emu.h
+
+ Core header file to be included by most files.
+
+ NOTE: The contents of this file are designed to meet the needs of
+ drivers and devices. In addition to this file, you will also need
+ to include the headers of any CPUs or other devices that are required.
+
+ If you find yourself needing something outside of this file in a
+ driver or device, think carefully about what you are doing.
+
+****************************************************************************
+
+ Copyright Aaron Giles
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+ * Neither the name 'MAME' nor the names of its contributors may be
+ used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __EMU_H__
+#define __EMU_H__
+
+// core emulator headers -- must be first
+#include "emucore.h"
+#include "eminline.h"
+
+// commonly-referenecd utilities imported from lib/util
+#include "chd.h"
+#include "palette.h"
+#include "tagmap.h"
+#include "unicode.h"
+
+// emulator-specific utilities
+#include "attotime.h"
+#include "fileio.h" // remove me once NVRAM is implemented as device
+#include "tokenize.h"
+
+// memory and address spaces
+#include "memory.h"
+
+// devices and callbacks
+#include "devintrf.h"
+#include "devcb.h"
+
+// I/O
+#include "input.h"
+#include "inputseq.h"
+#include "inptport.h"
+#include "output.h"
+
+// timers, CPU and scheduling
+#include "timer.h"
+#include "cpuintrf.h"
+#include "cpuexec.h"
+#include "watchdog.h"
+
+// machine and driver configuration
+#include "mconfig.h"
+#include "driver.h"
+
+// the running machine
+#include "mame.h"
+
+// machine-wide utilities
+#include "romload.h"
+#include "state.h"
+
+// video-related
+#include "drawgfx.h"
+#include "tilemap.h"
+#include "emupal.h"
+#include "video.h"
+
+// sound-related
+#include "sound.h"
+
+// generic helpers
+#include "drivers/xtal.h"
+#include "audio/generic.h"
+#include "machine/generic.h"
+#include "video/generic.h"
+
+#endif /* __EMU_H__ */
diff --git a/src/emu/emucore.c b/src/emu/emucore.c
index 869e68949ba..feea859693e 100644
--- a/src/emu/emucore.c
+++ b/src/emu/emucore.c
@@ -9,9 +9,3 @@
Visit http://mamedev.org for licensing and usage restrictions.
****************************************************************************/
-
-#include "emucore.h"
-#include <ctype.h>
-
-/* a giant string buffer for temporary strings */
-char giant_string_buffer[GIANT_STRING_BUFFER_SIZE] = { 0 };
diff --git a/src/emu/emucore.h b/src/emu/emucore.h
index 8ac07b50814..f802ed5a7b9 100644
--- a/src/emu/emucore.h
+++ b/src/emu/emucore.h
@@ -2,7 +2,7 @@
emucore.h
- General core utilities and macros used throughout MAME.
+ General core utilities and macros used throughout the emulator.
Copyright Nicola Salmoria and the MAME Team.
Visit http://mamedev.org for licensing and usage restrictions.
@@ -11,80 +11,81 @@
#pragma once
-#ifndef __MAMECORE_H__
-#define __MAMECORE_H__
+#ifndef __EMUCORE_H__
+#define __EMUCORE_H__
+// standard C includes
+#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
+
+// standard C++ includes
#include <exception>
+
+// core system includes
#include "osdcomm.h"
#include "emualloc.h"
-#include "bitmap.h"
-#include "coreutil.h"
#include "corestr.h"
+#include "astring.h"
+#include "bitmap.h"
+
/***************************************************************************
COMPILER-SPECIFIC NASTINESS
***************************************************************************/
-/* Suppress warnings about redefining the macro 'PPC' on LinuxPPC. */
-#ifdef PPC
+// Suppress warnings about redefining the macro 'PPC' on LinuxPPC.
#undef PPC
-#endif
-/* Suppress warnings about redefining the macro 'ARM' on ARM. */
-#ifdef ARM
+// Suppress warnings about redefining the macro 'ARM' on ARM.
#undef ARM
-#endif
/***************************************************************************
- COMMON TYPES
+ FUNDAMENTAL TYPES
***************************************************************************/
-/* genf is a type that can be used for function pointer casting in a way
- that doesn't confuse some compilers */
+// genf is a generic function pointer; cast function pointers to this instead of void *
typedef void genf(void);
-
-/* FPTR is a type that can be used to cast a pointer to a scalar */
-/* 64-bit platforms should define PTR64 */
+// FPTR is used to cast a pointer to a scalar
#ifdef PTR64
typedef UINT64 FPTR;
#else
typedef UINT32 FPTR;
#endif
-
-/* These are forward struct declarations that are used to break
- circular dependencies in the code */
-class running_machine;
-typedef struct _game_driver game_driver;
-typedef struct _machine_config machine_config;
-typedef struct _gfx_element gfx_element;
-typedef struct _mame_file mame_file;
-typedef struct _device_config device_config;
-
-
-/* pen_t is used to represent pixel values in bitmaps */
+// pen_t is used to represent pixel values in bitmaps
typedef UINT32 pen_t;
-/* stream_sample_t is used to represent a single sample in a sound stream */
+// stream_sample_t is used to represent a single sample in a sound stream
typedef INT32 stream_sample_t;
+// running_machine is core to pretty much everything
+class running_machine;
+
/***************************************************************************
- * Union of UINT8, UINT16 and UINT32 in native endianess of the target
- * This is used to access bytes and words in a machine independent manner.
- * The upper bytes h2 and h3 normally contain zero (16 bit CPU cores)
- * thus PAIR.d can be used to pass arguments to the memory system
- * which expects 'int' really.
+ USEFUL COMPOSITE TYPES
***************************************************************************/
+
+// generic_ptr is a union of pointers to various sizes
+union generic_ptr
+{
+ void * v;
+ UINT8 * u8;
+ UINT16 * u16;
+ UINT32 * u32;
+ UINT64 * u64;
+};
+
+
+// PAIR is an endian-safe union useful for representing 32-bit CPU registers
typedef union
{
#ifdef LSB_FIRST
@@ -103,11 +104,7 @@ typedef union
} PAIR;
-/***************************************************************************
- * Union of UINT8, UINT16, UINT32, and UINT64 in native endianess of
- * the target. This is used to access bytes and words in a machine
- * independent manner.
-***************************************************************************/
+// PAIR64 is a 64-bit extension of a PAIR
typedef union
{
#ifdef LSB_FIRST
@@ -130,26 +127,17 @@ typedef union
} PAIR64;
+
/***************************************************************************
COMMON CONSTANTS
***************************************************************************/
-/* this is not part of the C/C++ standards and is not present on */
-/* strict ANSI compilers or when compiling under GCC with -ansi */
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-
-/* Endianness constants */
-enum
-{
- ENDIANNESS_LITTLE = 0,
- ENDIANNESS_BIG
-};
+// constants for expression endianness
+#define ENDIANNESS_LITTLE 0
+#define ENDIANNESS_BIG 1
-/* Native endianness */
+// declare native endianness to be one or the other
#ifdef LSB_FIRST
#define ENDIANNESS_NATIVE ENDIANNESS_LITTLE
#else
@@ -157,7 +145,14 @@ enum
#endif
-/* orientation of bitmaps */
+// M_PI is not part of the C/C++ standards and is not present on
+// strict ANSI compilers or when compiling under GCC with -ansi
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+
+// orientation of bitmaps
#define ORIENTATION_FLIP_X 0x0001 /* mirror everything in the X direction */
#define ORIENTATION_FLIP_Y 0x0002 /* mirror everything in the Y direction */
#define ORIENTATION_SWAP_XY 0x0004 /* mirror along the top-left/bottom-right diagonal */
@@ -168,36 +163,27 @@ enum
#define ROT270 (ORIENTATION_SWAP_XY | ORIENTATION_FLIP_Y) /* rotate counter-clockwise 90 degrees */
-/* giant global string buffer */
-#define GIANT_STRING_BUFFER_SIZE 65536
-
-
/***************************************************************************
COMMON MACROS
***************************************************************************/
-// Macro for defining a copy constructor and assignment operator to
-// prevent copying
+// more for defining a copy constructor and assignment operator to prevent copying
#define DISABLE_COPYING(_Type) \
private: \
_Type(const _Type &); \
_Type &operator=(const _Type &) \
-/* Macro for declaring enumerator operators for easier porting */
-#ifdef __cplusplus
-#define DECLARE_ENUM_OPERATORS(type) \
-inline void operator++(type &value) { value = (type)((int)value + 1); } \
-inline void operator++(type &value, int) { value = (type)((int)value + 1); } \
-inline void operator--(type &value) { value = (type)((int)value - 1); } \
-inline void operator--(type &value, int) { value = (type)((int)value - 1); }
-#else
-#define DECLARE_ENUM_OPERATORS(type)
-#endif
+// macro for declaring enumerator operators that increment/decrement like plain old C
+#define DECLARE_ENUM_OPERATORS(_Type) \
+inline void operator++(_Type &value) { value = (_Type)((int)value + 1); } \
+inline void operator++(_Type &value, int) { value = (_Type)((int)value + 1); } \
+inline void operator--(_Type &value) { value = (_Type)((int)value - 1); } \
+inline void operator--(_Type &value, int) { value = (_Type)((int)value - 1); }
-/* Standard MAME assertion macros */
+// standard assertion macros
#undef assert
#undef assert_always
@@ -210,122 +196,62 @@ inline void operator--(type &value, int) { value = (type)((int)value - 1); }
#endif
-/* map mame_* helpers to core_* helpers */
+// map mame_* helpers to core_* helpers */
#define mame_stricmp core_stricmp
#define mame_strnicmp core_strnicmp
#define mame_strdup core_strdup
#define mame_strwildcmp core_strwildcmp
-/* prevent the use of rand() -- use mame_rand() instead */
-#define rand
+// prevent the use of rand() -- use mame_rand() instead
+#define rand __error_use_mame_rand_instead__
-/* macros to convert radians to degrees and degrees to radians */
+// macros to convert radians to degrees and degrees to radians
#define RADIAN_TO_DEGREE(x) ((180.0 / M_PI) * (x))
#define DEGREE_TO_RADIAN(x) ((M_PI / 180.0) * (x))
-/* endian-based value: first value is if 'endian' is little-endian, second is if 'endian' is big-endian */
+// endian-based value: first value is if 'endian' is little-endian, second is if 'endian' is big-endian
#define ENDIAN_VALUE_LE_BE(endian,leval,beval) (((endian) == ENDIANNESS_LITTLE) ? (leval) : (beval))
-/* endian-based value: first value is if native endianness is little-endian, second is if native is big-endian */
-#define NATIVE_ENDIAN_VALUE_LE_BE(leval,beval) ((ENDIANNESS_NATIVE == ENDIANNESS_LITTLE) ? (leval) : (beval))
+// endian-based value: first value is if native endianness is little-endian, second is if native is big-endian
+#define NATIVE_ENDIAN_VALUE_LE_BE(leval,beval) ENDIAN_VALUE_LE_BE(ENDIANNESS_NATIVE, leval, beval)
-/* endian-based value: first value is if 'endian' matches native, second is if 'endian' doesn't match native */
+// endian-based value: first value is if 'endian' matches native, second is if 'endian' doesn't match native
#define ENDIAN_VALUE_NE_NNE(endian,leval,beval) (((endian) == ENDIANNESS_NATIVE) ? (neval) : (nneval))
-/* Useful macros to deal with bit shuffling encryptions */
+// useful macros to deal with bit shuffling encryptions
#define BIT(x,n) (((x)>>(n))&1)
#define BITSWAP8(val,B7,B6,B5,B4,B3,B2,B1,B0) \
- ((BIT(val,B7) << 7) | \
- (BIT(val,B6) << 6) | \
- (BIT(val,B5) << 5) | \
- (BIT(val,B4) << 4) | \
- (BIT(val,B3) << 3) | \
- (BIT(val,B2) << 2) | \
- (BIT(val,B1) << 1) | \
- (BIT(val,B0) << 0))
+ ((BIT(val,B7) << 7) | (BIT(val,B6) << 6) | (BIT(val,B5) << 5) | (BIT(val,B4) << 4) | \
+ (BIT(val,B3) << 3) | (BIT(val,B2) << 2) | (BIT(val,B1) << 1) | (BIT(val,B0) << 0))
#define BITSWAP16(val,B15,B14,B13,B12,B11,B10,B9,B8,B7,B6,B5,B4,B3,B2,B1,B0) \
- ((BIT(val,B15) << 15) | \
- (BIT(val,B14) << 14) | \
- (BIT(val,B13) << 13) | \
- (BIT(val,B12) << 12) | \
- (BIT(val,B11) << 11) | \
- (BIT(val,B10) << 10) | \
- (BIT(val, B9) << 9) | \
- (BIT(val, B8) << 8) | \
- (BIT(val, B7) << 7) | \
- (BIT(val, B6) << 6) | \
- (BIT(val, B5) << 5) | \
- (BIT(val, B4) << 4) | \
- (BIT(val, B3) << 3) | \
- (BIT(val, B2) << 2) | \
- (BIT(val, B1) << 1) | \
- (BIT(val, B0) << 0))
+ ((BIT(val,B15) << 15) | (BIT(val,B14) << 14) | (BIT(val,B13) << 13) | (BIT(val,B12) << 12) | \
+ (BIT(val,B11) << 11) | (BIT(val,B10) << 10) | (BIT(val, B9) << 9) | (BIT(val, B8) << 8) | \
+ (BIT(val, B7) << 7) | (BIT(val, B6) << 6) | (BIT(val, B5) << 5) | (BIT(val, B4) << 4) | \
+ (BIT(val, B3) << 3) | (BIT(val, B2) << 2) | (BIT(val, B1) << 1) | (BIT(val, B0) << 0))
#define BITSWAP24(val,B23,B22,B21,B20,B19,B18,B17,B16,B15,B14,B13,B12,B11,B10,B9,B8,B7,B6,B5,B4,B3,B2,B1,B0) \
- ((BIT(val,B23) << 23) | \
- (BIT(val,B22) << 22) | \
- (BIT(val,B21) << 21) | \
- (BIT(val,B20) << 20) | \
- (BIT(val,B19) << 19) | \
- (BIT(val,B18) << 18) | \
- (BIT(val,B17) << 17) | \
- (BIT(val,B16) << 16) | \
- (BIT(val,B15) << 15) | \
- (BIT(val,B14) << 14) | \
- (BIT(val,B13) << 13) | \
- (BIT(val,B12) << 12) | \
- (BIT(val,B11) << 11) | \
- (BIT(val,B10) << 10) | \
- (BIT(val, B9) << 9) | \
- (BIT(val, B8) << 8) | \
- (BIT(val, B7) << 7) | \
- (BIT(val, B6) << 6) | \
- (BIT(val, B5) << 5) | \
- (BIT(val, B4) << 4) | \
- (BIT(val, B3) << 3) | \
- (BIT(val, B2) << 2) | \
- (BIT(val, B1) << 1) | \
- (BIT(val, B0) << 0))
+ ((BIT(val,B23) << 23) | (BIT(val,B22) << 22) | (BIT(val,B21) << 21) | (BIT(val,B20) << 20) | \
+ (BIT(val,B19) << 19) | (BIT(val,B18) << 18) | (BIT(val,B17) << 17) | (BIT(val,B16) << 16) | \
+ (BIT(val,B15) << 15) | (BIT(val,B14) << 14) | (BIT(val,B13) << 13) | (BIT(val,B12) << 12) | \
+ (BIT(val,B11) << 11) | (BIT(val,B10) << 10) | (BIT(val, B9) << 9) | (BIT(val, B8) << 8) | \
+ (BIT(val, B7) << 7) | (BIT(val, B6) << 6) | (BIT(val, B5) << 5) | (BIT(val, B4) << 4) | \
+ (BIT(val, B3) << 3) | (BIT(val, B2) << 2) | (BIT(val, B1) << 1) | (BIT(val, B0) << 0))
#define BITSWAP32(val,B31,B30,B29,B28,B27,B26,B25,B24,B23,B22,B21,B20,B19,B18,B17,B16,B15,B14,B13,B12,B11,B10,B9,B8,B7,B6,B5,B4,B3,B2,B1,B0) \
- ((BIT(val,B31) << 31) | \
- (BIT(val,B30) << 30) | \
- (BIT(val,B29) << 29) | \
- (BIT(val,B28) << 28) | \
- (BIT(val,B27) << 27) | \
- (BIT(val,B26) << 26) | \
- (BIT(val,B25) << 25) | \
- (BIT(val,B24) << 24) | \
- (BIT(val,B23) << 23) | \
- (BIT(val,B22) << 22) | \
- (BIT(val,B21) << 21) | \
- (BIT(val,B20) << 20) | \
- (BIT(val,B19) << 19) | \
- (BIT(val,B18) << 18) | \
- (BIT(val,B17) << 17) | \
- (BIT(val,B16) << 16) | \
- (BIT(val,B15) << 15) | \
- (BIT(val,B14) << 14) | \
- (BIT(val,B13) << 13) | \
- (BIT(val,B12) << 12) | \
- (BIT(val,B11) << 11) | \
- (BIT(val,B10) << 10) | \
- (BIT(val, B9) << 9) | \
- (BIT(val, B8) << 8) | \
- (BIT(val, B7) << 7) | \
- (BIT(val, B6) << 6) | \
- (BIT(val, B5) << 5) | \
- (BIT(val, B4) << 4) | \
- (BIT(val, B3) << 3) | \
- (BIT(val, B2) << 2) | \
- (BIT(val, B1) << 1) | \
- (BIT(val, B0) << 0))
+ ((BIT(val,B31) << 31) | (BIT(val,B30) << 30) | (BIT(val,B29) << 29) | (BIT(val,B28) << 28) | \
+ (BIT(val,B27) << 27) | (BIT(val,B26) << 26) | (BIT(val,B25) << 25) | (BIT(val,B24) << 24) | \
+ (BIT(val,B23) << 23) | (BIT(val,B22) << 22) | (BIT(val,B21) << 21) | (BIT(val,B20) << 20) | \
+ (BIT(val,B19) << 19) | (BIT(val,B18) << 18) | (BIT(val,B17) << 17) | (BIT(val,B16) << 16) | \
+ (BIT(val,B15) << 15) | (BIT(val,B14) << 14) | (BIT(val,B13) << 13) | (BIT(val,B12) << 12) | \
+ (BIT(val,B11) << 11) | (BIT(val,B10) << 10) | (BIT(val, B9) << 9) | (BIT(val, B8) << 8) | \
+ (BIT(val, B7) << 7) | (BIT(val, B6) << 6) | (BIT(val, B5) << 5) | (BIT(val, B4) << 4) | \
+ (BIT(val, B3) << 3) | (BIT(val, B2) << 2) | (BIT(val, B1) << 1) | (BIT(val, B0) << 0))
@@ -462,4 +388,4 @@ inline UINT64 d2u(double d)
return u.vv;
}
-#endif /* __MAMECORE_H__ */
+#endif /* __EMUCORE_H__ */
diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c
index e8c32bc40a5..8398a5daf7b 100644
--- a/src/emu/emuopts.c
+++ b/src/emu/emuopts.c
@@ -9,9 +9,7 @@
***************************************************************************/
-#include "emucore.h"
-#include "mame.h"
-#include "fileio.h"
+#include "emu.h"
#include "emuopts.h"
#include <ctype.h>
diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h
index 1a55ecfb58b..359edabf5b2 100644
--- a/src/emu/emuopts.h
+++ b/src/emu/emuopts.h
@@ -14,7 +14,6 @@
#ifndef __EMUOPTS_H__
#define __EMUOPTS_H__
-#include "emucore.h"
#include "options.h"
diff --git a/src/emu/emupal.c b/src/emu/emupal.c
index ba528a38660..e01f6061b62 100644
--- a/src/emu/emupal.c
+++ b/src/emu/emupal.c
@@ -9,8 +9,7 @@
******************************************************************************/
-#include "driver.h"
-#include "emupal.h"
+#include "emu.h"
#define VERBOSE 0
@@ -60,8 +59,9 @@ struct _palette_private
/* typedef struct _colortable_t colortable_t; */
-struct _colortable_t
+class colortable_t
{
+public:
running_machine * machine; /* associated machine */
UINT32 entries; /* number of entries */
UINT32 palentries; /* number of palette entries */
diff --git a/src/emu/emupal.h b/src/emu/emupal.h
index ec9b9ffa3cd..47f8a5ef67f 100644
--- a/src/emu/emupal.h
+++ b/src/emu/emupal.h
@@ -91,13 +91,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __EMUPAL_H__
#define __EMUPAL_H__
-#include "palette.h"
-#include "memory.h"
-#include "tilemap.h"
-
/***************************************************************************
CONSTANTS
@@ -112,7 +112,7 @@
TYPE DEFINITIONS
***************************************************************************/
-typedef struct _colortable_t colortable_t;
+class colortable_t;
diff --git a/src/emu/fileio.c b/src/emu/fileio.c
index 65f675dbfd9..53cc21cac08 100644
--- a/src/emu/fileio.c
+++ b/src/emu/fileio.c
@@ -9,11 +9,8 @@
***************************************************************************/
+#include "emu.h"
#include "osdepend.h"
-#include "corefile.h"
-#include "astring.h"
-#include "driver.h"
-#include "chd.h"
#include "hash.h"
#include "unzip.h"
#include "options.h"
diff --git a/src/emu/fileio.h b/src/emu/fileio.h
index d2b00bd4189..b41323d3732 100644
--- a/src/emu/fileio.h
+++ b/src/emu/fileio.h
@@ -14,11 +14,7 @@
#ifndef __FILEIO_H__
#define __FILEIO_H__
-#include "emucore.h"
-#include "osdcore.h"
#include "corefile.h"
-#include "mame.h"
-#include "emuopts.h"
@@ -63,8 +59,11 @@
TYPE DEFINITIONS
***************************************************************************/
+typedef struct _mame_file mame_file;
typedef struct _mame_path mame_path;
+typedef struct _core_options core_options;
+
/***************************************************************************
diff --git a/src/emu/hash.c b/src/emu/hash.c
index 00e227034ec..ae2079acf90 100644
--- a/src/emu/hash.c
+++ b/src/emu/hash.c
@@ -116,14 +116,13 @@
*
*/
-#include <stddef.h>
-#include <ctype.h>
-#include <zlib.h>
+#include "emu.h"
#include "hash.h"
#include "md5.h"
#include "sha1.h"
-#include "mame.h"
-#include "romload.h"
+
+#include <ctype.h>
+#include <zlib.h>
#define ASSERT(x)
diff --git a/src/emu/info.c b/src/emu/info.c
index 3c6ae7503b3..44c596eda20 100644
--- a/src/emu/info.c
+++ b/src/emu/info.c
@@ -9,14 +9,14 @@
***************************************************************************/
-#include <ctype.h>
-
-#include "driver.h"
+#include "emu.h"
#include "sound/samples.h"
#include "info.h"
#include "xmlfile.h"
#include "hash.h"
+#include <ctype.h>
+
#ifdef MESS
#include "infomess.h"
#endif /* MESS */
diff --git a/src/emu/info.h b/src/emu/info.h
index 09753b8ce5e..43697c3a979 100644
--- a/src/emu/info.h
+++ b/src/emu/info.h
@@ -14,8 +14,6 @@
#ifndef __INFO_H__
#define __INFO_H__
-#include "emucore.h"
-
/***************************************************************************
FUNCTION PROTOTYPES
diff --git a/src/emu/inptport.c b/src/emu/inptport.c
index 596106f50ec..6ab46545f22 100644
--- a/src/emu/inptport.c
+++ b/src/emu/inptport.c
@@ -91,15 +91,13 @@
***************************************************************************/
-#include "osdepend.h"
-#include "driver.h"
+#include "emu.h"
+#include "emuopts.h"
#include "config.h"
#include "xmlfile.h"
#include "profiler.h"
-#include "inputseq.h"
#include "ui.h"
#include "uiinput.h"
-#include "inptport.h"
#include <ctype.h>
#include <time.h>
@@ -713,13 +711,6 @@ void input_port_list_init(input_port_list *portlist, const input_port_token *tok
{
/* initialize fields */
portlist->head = NULL;
- portlist->map = NULL;
- if (allocmap)
- {
- portlist->map = tagmap_alloc();
- if (portlist->map == NULL)
- fatalerror("Out of memory for input port map");
- }
/* no tokens, no list */
if (tokens == NULL)
@@ -745,11 +736,6 @@ void input_port_list_deinit(input_port_list *portlist)
/* iterate over all ports and free them */
while (portlist->head != NULL)
port_config_free(&portlist->head);
-
- /* free the map if present */
- if (portlist->map != NULL)
- tagmap_free(portlist->map);
- portlist->map = NULL;
}
@@ -1290,7 +1276,7 @@ input_port_value input_port_read_direct(const input_port_config *port)
input_port_value input_port_read(running_machine *machine, const char *tag)
{
- const input_port_config *port = input_port_by_tag(&machine->portlist, tag);
+ const input_port_config *port = machine->port(tag);
if (port == NULL)
fatalerror("Unable to locate input port '%s'", tag);
return input_port_read_direct(port);
@@ -1305,7 +1291,7 @@ input_port_value input_port_read(running_machine *machine, const char *tag)
input_port_value input_port_read_safe(running_machine *machine, const char *tag, UINT32 defvalue)
{
- const input_port_config *port = input_port_by_tag(&machine->portlist, tag);
+ const input_port_config *port = machine->port(tag);
return (port == NULL) ? defvalue : input_port_read_direct(port);
}
@@ -1479,7 +1465,7 @@ void input_port_write_direct(const input_port_config *port, input_port_value dat
void input_port_write(running_machine *machine, const char *tag, input_port_value value, input_port_value mask)
{
- const input_port_config *port = input_port_by_tag(&machine->portlist, tag);
+ const input_port_config *port = machine->port(tag);
if (port == NULL)
fatalerror("Unable to locate input port '%s'", tag);
input_port_write_direct(port, value, mask);
@@ -1493,7 +1479,7 @@ void input_port_write(running_machine *machine, const char *tag, input_port_valu
void input_port_write_safe(running_machine *machine, const char *tag, input_port_value value, input_port_value mask)
{
- const input_port_config *port = input_port_by_tag(&machine->portlist, tag);
+ const input_port_config *port = machine->port(tag);
if (port != NULL)
input_port_write_direct(port, value, mask);
}
@@ -2432,6 +2418,7 @@ static void port_config_detokenize(input_port_list *portlist, const input_port_t
input_field_config *curfield = NULL;
input_port_config *curport = NULL;
input_port_value maskbits = 0;
+ tagmap_error err;
UINT16 category; /* (MESS-specific) category */
/* loop over tokens until we hit the end */
@@ -2471,14 +2458,11 @@ static void port_config_detokenize(input_port_list *portlist, const input_port_t
curport = port_config_alloc(&portlist->head);
curport->tag = TOKEN_GET_STRING(ipt);
- if (portlist->map != NULL)
+ err = portlist->map.add_unique_hash(curport->tag, curport, FALSE);
+ if (err == TMERR_DUPLICATE)
{
- tagmap_error err = tagmap_add_unique_hash(portlist->map, curport->tag, curport, FALSE);
- if (err == TMERR_DUPLICATE)
- {
- const input_port_config *match = (const input_port_config *)tagmap_find_hash_only(portlist->map, curport->tag);
- error_buf_append(errorbuf, errorbuflen, "tag '%s' has same hash as tag '%s'; please change one of them", curport->tag, match->tag);
- }
+ const input_port_config *match = portlist->map.find_hash_only(curport->tag);
+ error_buf_append(errorbuf, errorbuflen, "tag '%s' has same hash as tag '%s'; please change one of them", curport->tag, match->tag);
}
curfield = NULL;
cursetting = NULL;
diff --git a/src/emu/inptport.h b/src/emu/inptport.h
index d7e88308aea..f0bde41bc26 100644
--- a/src/emu/inptport.h
+++ b/src/emu/inptport.h
@@ -11,18 +11,15 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __INPTPORT_H__
#define __INPTPORT_H__
#include <time.h>
-#include "devcb.h"
-#include "memory.h"
-#include "inputseq.h"
-#include "tokenize.h"
-#include "unicode.h"
-#include "tagmap.h"
-
/***************************************************************************
@@ -709,14 +706,14 @@ typedef struct _input_port_list input_port_list;
struct _input_port_list
{
const input_port_config * head; /* head of the list */
- tagmap * map; /* map for fast lookups */
+ tagmap_t<const input_port_config *> map; /* map for fast lookups */
};
/* describes a fundamental input type, including default input sequences */
-typedef struct _input_type_desc input_type_desc;
-struct _input_type_desc
+class input_type_desc
{
+public:
input_type_desc * next; /* next description in the list */
UINT32 type; /* IPT_* for this entry */
UINT8 group; /* which group the port belongs to */
@@ -1156,11 +1153,7 @@ const char *input_port_string_from_token(const input_port_token token);
INLINE const input_port_config *input_port_by_tag(const input_port_list *portlist, const char *tag)
{
/* use the map if we have it */
- if (portlist->map != NULL)
- return (const input_port_config *)tagmap_find_hash_only(portlist->map, tag);
-
- /* otherwise, do it the slow way */
- return input_port_by_tag_slow(portlist, tag);
+ return portlist->map.find_hash_only(tag);
}
diff --git a/src/emu/input.c b/src/emu/input.c
index 14868d0dad6..890e526cf45 100644
--- a/src/emu/input.c
+++ b/src/emu/input.c
@@ -18,8 +18,7 @@
***************************************************************************/
-#include "input.h"
-#include "mame.h"
+#include "emu.h"
#include "emuopts.h"
#include "profiler.h"
diff --git a/src/emu/input.h b/src/emu/input.h
index 1ef605396e2..4f714eb4bd3 100644
--- a/src/emu/input.h
+++ b/src/emu/input.h
@@ -11,12 +11,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __INPUT_H__
#define __INPUT_H__
-#include "emucore.h"
-#include "astring.h"
-
/***************************************************************************
MACROS
diff --git a/src/emu/inputseq.c b/src/emu/inputseq.c
index f064522c618..adf9c0cf157 100644
--- a/src/emu/inputseq.c
+++ b/src/emu/inputseq.c
@@ -9,7 +9,7 @@
***************************************************************************/
-#include "mame.h"
+#include "emu.h"
#include <ctype.h>
diff --git a/src/emu/inputseq.h b/src/emu/inputseq.h
index d9b5e32aa99..aa1f65f841d 100644
--- a/src/emu/inputseq.h
+++ b/src/emu/inputseq.h
@@ -11,11 +11,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __INPUTSEQ_H__
#define __INPUTSEQ_H__
-#include "input.h"
-
/***************************************************************************
CONSTANTS
diff --git a/src/emu/machine/6522via.c b/src/emu/machine/6522via.c
index 60d463ad631..d4e86647193 100644
--- a/src/emu/machine/6522via.c
+++ b/src/emu/machine/6522via.c
@@ -306,7 +306,7 @@ static void via_set_int (const device_config *device, int data)
v->ifr |= data;
if (TRACE_VIA)
- logerror("%s:6522VIA chip %s: IFR = %02X\n", cpuexec_describe_context(device->machine), device->tag, v->ifr);
+ logerror("%s:6522VIA chip %s: IFR = %02X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), v->ifr);
if (v->ier & v->ifr)
{
@@ -327,7 +327,7 @@ static void via_clear_int (const device_config *device, int data)
v->ifr = (v->ifr & ~data) & 0x7f;
if (TRACE_VIA)
- logerror("%s:6522VIA chip %s: IFR = %02X\n", cpuexec_describe_context(device->machine), device->tag, v->ifr);
+ logerror("%s:6522VIA chip %s: IFR = %02X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), v->ifr);
if (v->ifr & v->ier)
v->ifr |= INT_ANY;
@@ -521,7 +521,7 @@ READ8_DEVICE_HANDLER(via_r)
if (v->in_b_func.read != NULL)
v->in_b = devcb_call_read8(&v->in_b_func, 0);
else
- logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag);
+ logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr());
}
CLR_PB_INT(device);
@@ -540,7 +540,7 @@ READ8_DEVICE_HANDLER(via_r)
if (v->in_a_func.read != NULL)
v->in_a = devcb_call_read8(&v->in_a_func, 0);
else
- logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag);
+ logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr());
}
/* combine input and output values */
@@ -571,7 +571,7 @@ READ8_DEVICE_HANDLER(via_r)
if (v->in_a_func.read != NULL)
v->in_a = devcb_call_read8(&v->in_a_func, 0);
else
- logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag);
+ logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr());
}
/* combine input and output values */
@@ -839,7 +839,7 @@ WRITE8_DEVICE_HANDLER(via_w)
v->pcr = data;
if (TRACE_VIA)
- logerror("%s:6522VIA chip %s: PCR = %02X\n", cpuexec_describe_context(device->machine), device->tag, data);
+ logerror("%s:6522VIA chip %s: PCR = %02X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), data);
if (CA2_FIX_OUTPUT(data) && CA2_OUTPUT_LEVEL(data) ^ v->out_ca2)
{
@@ -951,7 +951,7 @@ WRITE_LINE_DEVICE_HANDLER(via_ca1_w)
if (state != v->in_ca1)
{
if (TRACE_VIA)
- logerror("%s:6522VIA chip %s: CA1 = %02X\n", cpuexec_describe_context(device->machine), device->tag, state);
+ logerror("%s:6522VIA chip %s: CA1 = %02X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), state);
if ((CA1_LOW_TO_HIGH(v->pcr) && state) || (CA1_HIGH_TO_LOW(v->pcr) && !state))
{
@@ -960,7 +960,7 @@ WRITE_LINE_DEVICE_HANDLER(via_ca1_w)
if (v->in_a_func.read != NULL)
v->in_a = devcb_call_read8(&v->in_a_func, 0);
else
- logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag);
+ logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr());
}
via_set_int (device, INT_CA1);
@@ -1084,7 +1084,7 @@ WRITE_LINE_DEVICE_HANDLER(via_cb1_w)
if (v->in_b_func.read != NULL)
v->in_b = devcb_call_read8(&v->in_b_func, 0);
else
- logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag);
+ logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr());
}
if (SO_EXT_CONTROL(v->acr) || SI_EXT_CONTROL(v->acr))
via_shift (device);
diff --git a/src/emu/machine/6522via.h b/src/emu/machine/6522via.h
index 3a6d558a74d..16a44f0dc7f 100644
--- a/src/emu/machine/6522via.h
+++ b/src/emu/machine/6522via.h
@@ -14,7 +14,6 @@
#ifndef __6522VIA_H__
#define __6522VIA_H__
-#include "devcb.h"
/***************************************************************************
diff --git a/src/emu/machine/6526cia.h b/src/emu/machine/6526cia.h
index a7fd0552992..fc7cff2b11f 100644
--- a/src/emu/machine/6526cia.h
+++ b/src/emu/machine/6526cia.h
@@ -10,7 +10,6 @@
#ifndef __6526CIA_H__
#define __6526CIA_H__
-#include "devcb.h"
/***************************************************************************
diff --git a/src/emu/machine/6532riot.c b/src/emu/machine/6532riot.c
index 2a2ce8175d2..4e6d14f6813 100644
--- a/src/emu/machine/6532riot.c
+++ b/src/emu/machine/6532riot.c
@@ -262,7 +262,7 @@ WRITE8_DEVICE_HANDLER( riot6532_w )
if (port->out_func.write != NULL)
devcb_call_write8(&port->out_func, 0, data);
else
- logerror("%s:6532RIOT chip %s: Port %c is being written to but has no handler. %02X\n", cpuexec_describe_context(device->machine), device->tag, 'A' + (offset & 1), data);
+ logerror("%s:6532RIOT chip %s: Port %c is being written to but has no handler. %02X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), 'A' + (offset & 1), data);
}
/* writes to port A need to update the PA7 state */
@@ -331,7 +331,7 @@ READ8_DEVICE_HANDLER( riot6532_r )
update_pa7_state(device);
}
else
- logerror("%s:6532RIOT chip %s: Port %c is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag, 'A' + (offset & 1));
+ logerror("%s:6532RIOT chip %s: Port %c is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr(), 'A' + (offset & 1));
/* apply the DDR to the result */
val = apply_ddr(port);
@@ -429,7 +429,6 @@ static DEVICE_START( riot6532 )
/* validate arguments */
assert(device != NULL);
- assert(device->tag != NULL);
assert(strlen(device->tag) < 20);
/* set static values */
diff --git a/src/emu/machine/6532riot.h b/src/emu/machine/6532riot.h
index c7d604ae45b..07b7f9f48ad 100644
--- a/src/emu/machine/6532riot.h
+++ b/src/emu/machine/6532riot.h
@@ -7,7 +7,6 @@
#ifndef __RIOT6532_H__
#define __RIOT6532_H__
-#include "devcb.h"
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/emu/machine/6821pia.c b/src/emu/machine/6821pia.c
index bf54fbfa518..e2ffbee92ee 100644
--- a/src/emu/machine/6821pia.c
+++ b/src/emu/machine/6821pia.c
@@ -4,6 +4,7 @@
**********************************************************************/
+#include "emu.h"
#include "6821pia.h"
@@ -300,7 +301,7 @@ static UINT8 get_in_a_value(const device_config *device)
if (!p->logged_port_a_not_connected && (p->ddr_a != 0xff))
{
- logerror("PIA #%s: Warning! No port A read handler. Assuming pins 0x%02X not connected\n", device->tag, p->ddr_a ^ 0xff);
+ logerror("PIA #%s: Warning! No port A read handler. Assuming pins 0x%02X not connected\n", device->tag.cstr(), p->ddr_a ^ 0xff);
p->logged_port_a_not_connected = TRUE;
}
}
@@ -344,7 +345,7 @@ static UINT8 get_in_b_value(const device_config *device)
{
if (!p->logged_port_b_not_connected && (p->ddr_b != 0xff))
{
- logerror("PIA #%s: Error! No port B read handler. Three-state pins 0x%02X are undefined\n", device->tag, p->ddr_b ^ 0xff);
+ logerror("PIA #%s: Error! No port B read handler. Three-state pins 0x%02X are undefined\n", device->tag.cstr(), p->ddr_b ^ 0xff);
p->logged_port_b_not_connected = TRUE;
}
@@ -412,7 +413,7 @@ static void set_out_ca2(const device_config *device, int data)
else
{
if (p->out_ca2_needs_pulled)
- logerror("PIA #%s: Warning! No port CA2 write handler. Previous value has been lost!\n", device->tag);
+ logerror("PIA #%s: Warning! No port CA2 write handler. Previous value has been lost!\n", device->tag.cstr());
p->out_ca2_needs_pulled = TRUE;
}
@@ -441,7 +442,7 @@ static void set_out_cb2(const device_config *device, int data)
else
{
if (p->out_cb2_needs_pulled)
- logerror("PIA #%s: Warning! No port CB2 write handler. Previous value has been lost!\n", device->tag);
+ logerror("PIA #%s: Warning! No port CB2 write handler. Previous value has been lost!\n", device->tag.cstr());
p->out_cb2_needs_pulled = TRUE;
}
@@ -475,7 +476,7 @@ static UINT8 port_a_r(const device_config *device)
set_out_ca2(device, TRUE);
}
- LOG(("PIA #%s: port A read = %02X\n", device->tag, ret));
+ LOG(("PIA #%s: port A read = %02X\n", device->tag.cstr(), ret));
return ret;
}
@@ -491,7 +492,7 @@ static UINT8 ddr_a_r(const device_config *device)
UINT8 ret = p->ddr_a;
- LOG(("PIA #%s: DDR A read = %02X\n", device->tag, ret));
+ LOG(("PIA #%s: DDR A read = %02X\n", device->tag.cstr(), ret));
return ret;
}
@@ -519,7 +520,7 @@ static UINT8 port_b_r(const device_config *device)
p->irq_b2 = FALSE;
update_interrupts(device);
- LOG(("PIA #%s: port B read = %02X\n", device->tag, ret));
+ LOG(("PIA #%s: port B read = %02X\n", device->tag.cstr(), ret));
return ret;
}
@@ -535,7 +536,7 @@ static UINT8 ddr_b_r(const device_config *device)
UINT8 ret = p->ddr_b;
- LOG(("PIA #%s: DDR B read = %02X\n", device->tag, ret));
+ LOG(("PIA #%s: DDR B read = %02X\n", device->tag.cstr(), ret));
return ret;
}
@@ -555,7 +556,7 @@ static UINT8 control_a_r(const device_config *device)
pia6821_ca1_w(device, 0, devcb_call_read_line(&p->in_ca1_func));
else if (!p->logged_ca1_not_connected && (!p->in_ca1_pushed))
{
- logerror("PIA #%s: Warning! No CA1 read handler. Assuming pin not connected\n", device->tag);
+ logerror("PIA #%s: Warning! No CA1 read handler. Assuming pin not connected\n", device->tag.cstr());
p->logged_ca1_not_connected = TRUE;
}
@@ -563,7 +564,7 @@ static UINT8 control_a_r(const device_config *device)
pia6821_ca2_w(device, 0, devcb_call_read_line(&p->in_ca2_func));
else if ( !p->logged_ca2_not_connected && C2_INPUT(p->ctl_a) && !p->in_ca2_pushed)
{
- logerror("PIA #%s: Warning! No CA2 read handler. Assuming pin not connected\n", device->tag);
+ logerror("PIA #%s: Warning! No CA2 read handler. Assuming pin not connected\n", device->tag.cstr());
p->logged_ca2_not_connected = TRUE;
}
@@ -577,7 +578,7 @@ static UINT8 control_a_r(const device_config *device)
if (p->irq_a2 && C2_INPUT(p->ctl_a))
ret |= PIA_IRQ2;
- LOG(("PIA #%s: control A read = %02X\n", device->tag, ret));
+ LOG(("PIA #%s: control A read = %02X\n", device->tag.cstr(), ret));
return ret;
}
@@ -597,7 +598,7 @@ static UINT8 control_b_r(const device_config *device)
pia6821_cb1_w(device, 0, devcb_call_read_line(&p->in_cb1_func));
else if (!p->logged_cb1_not_connected && !p->in_cb1_pushed)
{
- logerror("PIA #%s: Error! no CB1 read handler. Three-state pin is undefined\n", device->tag);
+ logerror("PIA #%s: Error! no CB1 read handler. Three-state pin is undefined\n", device->tag.cstr());
p->logged_cb1_not_connected = TRUE;
}
@@ -605,7 +606,7 @@ static UINT8 control_b_r(const device_config *device)
pia6821_cb2_w(device, 0, devcb_call_read_line(&p->in_cb2_func));
else if (!p->logged_cb2_not_connected && C2_INPUT(p->ctl_b) && !p->in_cb2_pushed)
{
- logerror("PIA #%s: Error! No CB2 read handler. Three-state pin is undefined\n", device->tag);
+ logerror("PIA #%s: Error! No CB2 read handler. Three-state pin is undefined\n", device->tag.cstr());
p->logged_cb2_not_connected = TRUE;
}
@@ -619,7 +620,7 @@ static UINT8 control_b_r(const device_config *device)
if (p->irq_b2 && C2_INPUT(p->ctl_b))
ret |= PIA_IRQ2;
- LOG(("PIA #%s: control B read = %02X\n", device->tag, ret));
+ LOG(("PIA #%s: control B read = %02X\n", device->tag.cstr(), ret));
return ret;
}
@@ -696,14 +697,14 @@ static void send_to_out_a_func(const device_config *device, const char* message)
/* input pins are pulled high */
UINT8 data = get_out_a_value(device);
- LOG(("PIA #%s: %s = %02X\n", device->tag, message, data));
+ LOG(("PIA #%s: %s = %02X\n", device->tag.cstr(), message, data));
if (p->out_a_func.write != NULL)
devcb_call_write8(&p->out_a_func, 0, data);
else
{
if (p->out_a_needs_pulled)
- logerror("PIA #%s: Warning! No port A write handler. Previous value has been lost!\n", device->tag);
+ logerror("PIA #%s: Warning! No port A write handler. Previous value has been lost!\n", device->tag.cstr());
p->out_a_needs_pulled = TRUE;
}
@@ -721,14 +722,14 @@ static void send_to_out_b_func(const device_config *device, const char* message)
/* input pins are high-impedance - we just send them as zeros for backwards compatibility */
UINT8 data = get_out_b_value(device);
- LOG(("PIA #%s: %s = %02X\n", device->tag, message, data));
+ LOG(("PIA #%s: %s = %02X\n", device->tag.cstr(), message, data));
if (p->out_b_func.write != NULL)
devcb_call_write8(&p->out_b_func, 0, data);
else
{
if (p->out_b_needs_pulled)
- logerror("PIA #%s: Warning! No port B write handler. Previous value has been lost!\n", device->tag);
+ logerror("PIA #%s: Warning! No port B write handler. Previous value has been lost!\n", device->tag.cstr());
p->out_b_needs_pulled = TRUE;
}
@@ -759,11 +760,11 @@ static void ddr_a_w(const device_config *device, UINT8 data)
pia6821_state *p = get_token(device);
if (data == 0x00)
- LOG(("PIA #%s: DDR A write = %02X (input mode)\n", device->tag, data));
+ LOG(("PIA #%s: DDR A write = %02X (input mode)\n", device->tag.cstr(), data));
else if (data == 0xff)
- LOG(("PIA #%s: DDR A write = %02X (output mode)\n", device->tag, data));
+ LOG(("PIA #%s: DDR A write = %02X (output mode)\n", device->tag.cstr(), data));
else
- LOG(("PIA #%s: DDR A write = %02X (mixed mode)\n", device->tag, data));
+ LOG(("PIA #%s: DDR A write = %02X (mixed mode)\n", device->tag.cstr(), data));
if (p->ddr_a != data)
{
@@ -810,11 +811,11 @@ static void ddr_b_w(const device_config *device, UINT8 data)
pia6821_state *p = get_token(device);
if (data == 0x00)
- LOG(("PIA #%s: DDR B write = %02X (input mode)\n", device->tag, data));
+ LOG(("PIA #%s: DDR B write = %02X (input mode)\n", device->tag.cstr(), data));
else if (data == 0xff)
- LOG(("PIA #%s: DDR B write = %02X (output mode)\n", device->tag, data));
+ LOG(("PIA #%s: DDR B write = %02X (output mode)\n", device->tag.cstr(), data));
else
- LOG(("PIA #%s: DDR B write = %02X (mixed mode)\n", device->tag, data));
+ LOG(("PIA #%s: DDR B write = %02X (mixed mode)\n", device->tag.cstr(), data));
if (p->ddr_b != data)
{
@@ -837,7 +838,7 @@ static void control_a_w(const device_config *device, UINT8 data)
/* bit 7 and 6 are read only */
data &= 0x3f;
- LOG(("PIA #%s: control A write = %02X\n", device->tag, data));
+ LOG(("PIA #%s: control A write = %02X\n", device->tag.cstr(), data));
/* update the control register */
p->ctl_a = data;
@@ -874,7 +875,7 @@ static void control_b_w(const device_config *device, UINT8 data)
/* bit 7 and 6 are read only */
data &= 0x3f;
- LOG(("PIA #%s: control B write = %02X\n", device->tag, data));
+ LOG(("PIA #%s: control B write = %02X\n", device->tag.cstr(), data));
/* update the control register */
p->ctl_b = data;
@@ -973,7 +974,7 @@ void pia6821_set_input_a(const device_config *device, UINT8 data, UINT8 z_mask)
assert_always(p->in_a_func.read == NULL, "pia6821_porta_w() called when in_a_func implemented");
- LOG(("PIA #%s: set input port A = %02X\n", device->tag, data));
+ LOG(("PIA #%s: set input port A = %02X\n", device->tag.cstr(), data));
p->in_a = data;
p->port_a_z_mask = z_mask;
@@ -1028,13 +1029,13 @@ WRITE8_DEVICE_HANDLER( pia6821_ca1_w )
/* limit the data to 0 or 1 */
data = data ? TRUE : FALSE;
- LOG(("PIA #%s: set input CA1 = %d\n", device->tag, data));
+ LOG(("PIA #%s: set input CA1 = %d\n", device->tag.cstr(), data));
/* the new state has caused a transition */
if ((p->in_ca1 != data) &&
((data && C1_LOW_TO_HIGH(p->ctl_a)) || (!data && C1_HIGH_TO_LOW(p->ctl_a))))
{
- LOG(("PIA #%s: CA1 triggering\n", device->tag));
+ LOG(("PIA #%s: CA1 triggering\n", device->tag.cstr()));
/* mark the IRQ */
p->irq_a1 = TRUE;
@@ -1076,14 +1077,14 @@ WRITE8_DEVICE_HANDLER( pia6821_ca2_w )
/* limit the data to 0 or 1 */
data = data ? 1 : 0;
- LOG(("PIA #%s: set input CA2 = %d\n", device->tag, data));
+ LOG(("PIA #%s: set input CA2 = %d\n", device->tag.cstr(), data));
/* if input mode and the new state has caused a transition */
if (C2_INPUT(p->ctl_a) &&
(p->in_ca2 != data) &&
((data && C2_LOW_TO_HIGH(p->ctl_a)) || (!data && C2_HIGH_TO_LOW(p->ctl_a))))
{
- LOG(("PIA #%s: CA2 triggering\n", device->tag));
+ LOG(("PIA #%s: CA2 triggering\n", device->tag.cstr()));
/* mark the IRQ */
p->irq_a2 = TRUE;
@@ -1153,7 +1154,7 @@ WRITE8_DEVICE_HANDLER( pia6821_portb_w )
assert_always(p->in_b_func.read == NULL, "pia_set_input_b() called when in_b_func implemented");
- LOG(("PIA #%s: set input port B = %02X\n", device->tag, data));
+ LOG(("PIA #%s: set input port B = %02X\n", device->tag.cstr(), data));
p->in_b = data;
p->in_b_pushed = TRUE;
@@ -1197,13 +1198,13 @@ WRITE8_DEVICE_HANDLER( pia6821_cb1_w )
/* limit the data to 0 or 1 */
data = data ? 1 : 0;
- LOG(("PIA #%s: set input CB1 = %d\n", device->tag, data));
+ LOG(("PIA #%s: set input CB1 = %d\n", device->tag.cstr(), data));
/* the new state has caused a transition */
if ((p->in_cb1 != data) &&
((data && C1_LOW_TO_HIGH(p->ctl_b)) || (!data && C1_HIGH_TO_LOW(p->ctl_b))))
{
- LOG(("PIA #%s: CB1 triggering\n", device->tag));
+ LOG(("PIA #%s: CB1 triggering\n", device->tag.cstr()));
/* mark the IRQ */
p->irq_b1 = 1;
@@ -1246,14 +1247,14 @@ WRITE8_DEVICE_HANDLER( pia6821_cb2_w )
/* limit the data to 0 or 1 */
data = data ? 1 : 0;
- LOG(("PIA #%s: set input CB2 = %d\n", device->tag, data));
+ LOG(("PIA #%s: set input CB2 = %d\n", device->tag.cstr(), data));
/* if input mode and the new state has caused a transition */
if (C2_INPUT(p->ctl_b) &&
(p->in_cb2 != data) &&
((data && C2_LOW_TO_HIGH(p->ctl_b)) || (!data && C2_HIGH_TO_LOW(p->ctl_b))))
{
- LOG(("PIA #%s: CB2 triggering\n", device->tag));
+ LOG(("PIA #%s: CB2 triggering\n", device->tag.cstr()));
/* mark the IRQ */
p->irq_b2 = 1;
diff --git a/src/emu/machine/6821pia.h b/src/emu/machine/6821pia.h
index 45752eb056f..f8dd795db7a 100644
--- a/src/emu/machine/6821pia.h
+++ b/src/emu/machine/6821pia.h
@@ -21,9 +21,6 @@
#ifndef __6821NEW_H__
#define __6821NEW_H__
-#include "driver.h"
-#include "devcb.h"
-
/***************************************************************************
CONSTANTS
diff --git a/src/emu/machine/6840ptm.c b/src/emu/machine/6840ptm.c
index e2ff13e1bc5..a7933ab8c2e 100644
--- a/src/emu/machine/6840ptm.c
+++ b/src/emu/machine/6840ptm.c
@@ -290,7 +290,7 @@ static UINT16 compute_counter( const device_config *device, int counter )
/* If there's no timer, return the count */
if (!ptm6840->enabled[counter])
{
- PLOG(("MC6840 #%s: read counter(%d): %d\n", device->tag, counter, ptm6840->counter[counter]));
+ PLOG(("MC6840 #%s: read counter(%d): %d\n", device->tag.cstr(), counter, ptm6840->counter[counter]));
return ptm6840->counter[counter];
}
@@ -298,12 +298,12 @@ static UINT16 compute_counter( const device_config *device, int counter )
if (ptm6840->control_reg[counter] & 0x02)
{
clock = ptm6840->internal_clock;
- PLOG(("MC6840 #%s: %d internal clock freq %d \n", device->tag, counter, clock));
+ PLOG(("MC6840 #%s: %d internal clock freq %d \n", device->tag.cstr(), counter, clock));
}
else
{
clock = ptm6840->external_clock[counter];
- PLOG(("MC6840 #%s: %d external clock freq %d \n", device->tag, counter, clock));
+ PLOG(("MC6840 #%s: %d external clock freq %d \n", device->tag.cstr(), counter, clock));
}
/* See how many are left */
remaining = attotime_to_double(attotime_mul(timer_timeleft(ptm6840->timer[counter]), clock));
@@ -316,7 +316,7 @@ static UINT16 compute_counter( const device_config *device, int counter )
int lsb = remaining % divisor;
remaining = (msb << 8) | lsb;
}
- PLOG(("MC6840 #%s: read counter(%d): %d\n", device->tag, counter, remaining));
+ PLOG(("MC6840 #%s: read counter(%d): %d\n", device->tag.cstr(), counter, remaining));
return remaining;
}
@@ -338,12 +338,12 @@ static void reload_count( const device_config *device, int idx )
if (ptm6840->control_reg[idx] & 0x02)
{
clock = ptm6840->internal_clock;
- PLOG(("MC6840 #%s: %d internal clock freq %d \n", device->tag, idx, clock));
+ PLOG(("MC6840 #%s: %d internal clock freq %d \n", device->tag.cstr(), idx, clock));
}
else
{
clock = ptm6840->external_clock[idx];
- PLOG(("MC6840 #%s: %d external clock freq %d \n", device->tag, idx, clock));
+ PLOG(("MC6840 #%s: %d external clock freq %d \n", device->tag.cstr(), idx, clock));
}
/* Determine the number of clock periods before we expire */
@@ -363,13 +363,13 @@ static void reload_count( const device_config *device, int idx )
}
/* Set the timer */
- PLOG(("MC6840 #%s: reload_count(%d): clock = %d count = %d\n", device->tag, idx, clock, count));
+ PLOG(("MC6840 #%s: reload_count(%d): clock = %d count = %d\n", device->tag.cstr(), idx, clock, count));
duration = attotime_mul(ATTOTIME_IN_HZ(clock), count);
if (idx == 2)
duration = attotime_mul(duration, ptm6840->t3_divisor);
- PLOG(("MC6840 #%s: reload_count(%d): output = %lf\n", device->tag, idx, attotime_to_double(duration)));
+ PLOG(("MC6840 #%s: reload_count(%d): output = %lf\n", device->tag.cstr(), idx, attotime_to_double(duration)));
if (!(ptm6840->control_reg[idx] & 0x02))
{
@@ -407,7 +407,7 @@ READ8_DEVICE_HANDLER( ptm6840_read )
case PTM_6840_STATUS:
{
- PLOG(("%s: MC6840 #%s: Status read = %04X\n", cpuexec_describe_context(device->machine), device->tag, ptm6840->status_reg));
+ PLOG(("%s: MC6840 #%s: Status read = %04X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), ptm6840->status_reg));
ptm6840->status_read_since_int |= ptm6840->status_reg & 0x07;
val = ptm6840->status_reg;
break;
@@ -429,7 +429,7 @@ READ8_DEVICE_HANDLER( ptm6840_read )
ptm6840->lsb_buffer = result & 0xff;
- PLOG(("%s: MC6840 #%s: Counter %d read = %04X\n", cpuexec_describe_context(device->machine), device->tag, idx, result >> 8));
+ PLOG(("%s: MC6840 #%s: Counter %d read = %04X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), idx, result >> 8));
val = result >> 8;
break;
}
@@ -474,7 +474,7 @@ WRITE8_DEVICE_HANDLER( ptm6840_write )
ptm6840->mode[idx] = (data >> 3) & 0x07;
ptm6840->control_reg[idx] = data;
- PLOG(("MC6840 #%s : Control register %d selected\n", device->tag, idx));
+ PLOG(("MC6840 #%s : Control register %d selected\n", device->tag.cstr(), idx));
PLOG(("operation mode = %s\n", opmode[ ptm6840->mode[idx] ]));
PLOG(("value = %04X\n", ptm6840->control_reg[idx]));
PLOG(("t3divisor = %d\n", ptm6840->t3_divisor));
@@ -491,7 +491,7 @@ WRITE8_DEVICE_HANDLER( ptm6840_write )
/* Holding reset down */
if (data & 0x01)
{
- PLOG(("MC6840 #%s : Timer reset\n", device->tag));
+ PLOG(("MC6840 #%s : Timer reset\n", device->tag.cstr()));
for (i = 0; i < 3; i++)
{
timer_enable(ptm6840->timer[i], FALSE);
@@ -519,7 +519,7 @@ WRITE8_DEVICE_HANDLER( ptm6840_write )
case PTM_6840_MSBBUF2:
case PTM_6840_MSBBUF3:
{
- PLOG(("MC6840 #%s msbbuf%d = %02X\n", device->tag, offset / 2, data));
+ PLOG(("MC6840 #%s msbbuf%d = %02X\n", device->tag.cstr(), offset / 2, data));
ptm6840->msb_buffer = data;
break;
}
@@ -539,7 +539,7 @@ WRITE8_DEVICE_HANDLER( ptm6840_write )
if (!(ptm6840->control_reg[idx] & 0x10))
reload_count(device,idx);
- PLOG(("%s:MC6840 #%s: Counter %d latch = %04X\n", cpuexec_describe_context(device->machine), device->tag, idx, ptm6840->latch[idx]));
+ PLOG(("%s:MC6840 #%s: Counter %d latch = %04X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), idx, ptm6840->latch[idx]));
break;
}
}
@@ -553,7 +553,7 @@ static void ptm6840_timeout( const device_config *device, int idx )
{
ptm6840_state *ptm6840 = get_safe_token(device);
- PLOG(("**ptm6840 %s t%d timeout**\n", device->tag, idx + 1));
+ PLOG(("**ptm6840 %s t%d timeout**\n", device->tag.cstr(), idx + 1));
if ( ptm6840->control_reg[idx] & 0x40 )
{
@@ -568,7 +568,7 @@ static void ptm6840_timeout( const device_config *device, int idx )
if ((ptm6840->mode[idx] == 0)||(ptm6840->mode[idx] == 2))
{
ptm6840->output[idx] = ptm6840->output[idx] ? 0 : 1;
- PLOG(("**ptm6840 %s t%d output %d **\n", device->tag, idx + 1, ptm6840->output[idx]));
+ PLOG(("**ptm6840 %s t%d output %d **\n", device->tag.cstr(), idx + 1, ptm6840->output[idx]));
if (ptm6840->out_func[idx].write != NULL)
devcb_call_write8(&ptm6840->out_func[idx], 0, ptm6840->output[idx]);
@@ -578,7 +578,7 @@ static void ptm6840_timeout( const device_config *device, int idx )
if (!ptm6840->fired[idx])
{
ptm6840->output[idx] = 1;
- PLOG(("**ptm6840 %s t%d output %d **\n", device->tag, idx + 1, ptm6840->output[idx]));
+ PLOG(("**ptm6840 %s t%d output %d **\n", device->tag.cstr(), idx + 1, ptm6840->output[idx]));
if (ptm6840->out_func[idx].write != NULL)
devcb_call_write8(&ptm6840->out_func[idx], 0, ptm6840->output[idx]);
diff --git a/src/emu/machine/6840ptm.h b/src/emu/machine/6840ptm.h
index 4d0c9f0a673..568dfeaa1f4 100644
--- a/src/emu/machine/6840ptm.h
+++ b/src/emu/machine/6840ptm.h
@@ -9,7 +9,6 @@
#ifndef __6840PTM_H__
#define __6840PTM_H__
-#include "devcb.h"
/***************************************************************************
MACROS / CONSTANTS
diff --git a/src/emu/machine/6850acia.h b/src/emu/machine/6850acia.h
index f0034a0f917..a0d535410b2 100644
--- a/src/emu/machine/6850acia.h
+++ b/src/emu/machine/6850acia.h
@@ -9,7 +9,6 @@
#ifndef __ACIA6850_H__
#define __ACIA6850_H__
-#include "devcb.h"
/***************************************************************************
MACROS
diff --git a/src/emu/machine/68681.c b/src/emu/machine/68681.c
index 7ae0be7be0f..be9cf651242 100644
--- a/src/emu/machine/68681.c
+++ b/src/emu/machine/68681.c
@@ -462,7 +462,7 @@ READ8_DEVICE_HANDLER(duart68681_r)
offset &= 0xf;
- LOG(( "Reading 68681 (%s) reg %x (%s) ", device->tag, offset, duart68681_reg_read_names[offset] ));
+ LOG(( "Reading 68681 (%s) reg %x (%s) ", device->tag.cstr(), offset, duart68681_reg_read_names[offset] ));
switch (offset)
{
@@ -582,7 +582,7 @@ WRITE8_DEVICE_HANDLER(duart68681_w)
duart68681_state* duart68681 = get_safe_token(device);
offset &= 0x0f;
- LOG(( "Writing 68681 (%s) reg %x (%s) with %04x\n", device->tag, offset, duart68681_reg_write_names[offset], data ));
+ LOG(( "Writing 68681 (%s) reg %x (%s) with %04x\n", device->tag.cstr(), offset, duart68681_reg_write_names[offset], data ));
switch(offset)
{
@@ -605,7 +605,7 @@ WRITE8_DEVICE_HANDLER(duart68681_w)
switch ((data >> 4) & 0x07)
{
case 0: case 1: case 2: case 4: case 5: // TODO: handle these cases!
- logerror( "68681 (%s): Unhandled timer/counter mode %d\n", device->tag, (data >> 4) & 0x07);
+ logerror( "68681 (%s): Unhandled timer/counter mode %d\n", device->tag.cstr(), (data >> 4) & 0x07);
break;
case 3: case 6: case 7:
break;
@@ -641,7 +641,7 @@ WRITE8_DEVICE_HANDLER(duart68681_w)
break;
case 0x0d: /* OPCR */
if (data != 0x00)
- logerror( "68681 (%s): Unhandled OPCR value: %02x\n", device->tag, data);
+ logerror( "68681 (%s): Unhandled OPCR value: %02x\n", device->tag.cstr(), data);
duart68681->OPCR = data;
break;
case 0x0e: /* Set Output Port Bits */
@@ -689,7 +689,6 @@ static DEVICE_START(duart68681)
/* validate arguments */
assert(device != NULL);
- assert(device->tag != NULL);
duart68681->duart_config = (const duart68681_config *)device->static_config;
duart68681->device = device;
diff --git a/src/emu/machine/74123.c b/src/emu/machine/74123.c
index 4cf3484e2e0..0c4f21fbe55 100644
--- a/src/emu/machine/74123.c
+++ b/src/emu/machine/74123.c
@@ -87,7 +87,7 @@ static void set_output(const device_config *device)
timer_set( device->machine, attotime_zero, (void *) device, output, output_callback );
- if (LOG) logerror("74123 %s: Output: %d\n", device->tag, output);
+ if (LOG) logerror("74123 %s: Output: %d\n", device->tag.cstr(), output);
}
@@ -118,11 +118,11 @@ static void start_pulse(const device_config *device)
{
timer_adjust_oneshot(chip->timer, duration, 0);
- if (LOG) logerror("74123 %s: Retriggering pulse. Duration: %f\n", device->tag, attotime_to_double(duration));
+ if (LOG) logerror("74123 %s: Retriggering pulse. Duration: %f\n", device->tag.cstr(), attotime_to_double(duration));
}
else
{
- if (LOG) logerror("74123 %s: Retriggering failed.\n", device->tag);
+ if (LOG) logerror("74123 %s: Retriggering failed.\n", device->tag.cstr());
}
}
else
@@ -132,7 +132,7 @@ static void start_pulse(const device_config *device)
set_output(device);
- if (LOG) logerror("74123 %s: Starting pulse. Duration: %f\n", device->tag, attotime_to_double(duration));
+ if (LOG) logerror("74123 %s: Starting pulse. Duration: %f\n", device->tag.cstr(), attotime_to_double(duration));
}
}
@@ -172,7 +172,7 @@ WRITE8_DEVICE_HANDLER( ttl74123_clear_w )
{
timer_adjust_oneshot(chip->timer, attotime_zero, 0);
- if (LOG) logerror("74123 #%s: Cleared\n", device->tag );
+ if (LOG) logerror("74123 #%s: Cleared\n", device->tag.cstr() );
}
chip->clear = data;
}
diff --git a/src/emu/machine/8237dma.h b/src/emu/machine/8237dma.h
index 07eb7f799f2..773bbf1e265 100644
--- a/src/emu/machine/8237dma.h
+++ b/src/emu/machine/8237dma.h
@@ -33,7 +33,6 @@
#ifndef __I8237__
#define __I8237__
-#include "devcb.h"
/***************************************************************************
MACROS / CONSTANTS
diff --git a/src/emu/machine/8255ppi.h b/src/emu/machine/8255ppi.h
index 3363ac55dfa..0e6d80d692c 100644
--- a/src/emu/machine/8255ppi.h
+++ b/src/emu/machine/8255ppi.h
@@ -9,7 +9,6 @@
#ifndef __8255PPI_H_
#define __8255PPI_H_
-#include "devcb.h"
#define PPI8255 DEVICE_GET_INFO_NAME(ppi8255)
diff --git a/src/emu/machine/8257dma.c b/src/emu/machine/8257dma.c
index f263b1894bc..afe857934fb 100644
--- a/src/emu/machine/8257dma.c
+++ b/src/emu/machine/8257dma.c
@@ -389,7 +389,6 @@ static DEVICE_START( i8257 )
/* validate arguments */
assert(device != NULL);
- assert(device->tag != NULL);
/* resolve callbacks */
devcb_resolve_write_line(&i8257->out_hrq_func, &intf->out_hrq_func, device);
diff --git a/src/emu/machine/8257dma.h b/src/emu/machine/8257dma.h
index a71701d0a4d..1fc4e41ecb0 100644
--- a/src/emu/machine/8257dma.h
+++ b/src/emu/machine/8257dma.h
@@ -33,7 +33,6 @@
#ifndef __I8257__
#define __I8257__
-#include "devcb.h"
/***************************************************************************
MACROS / CONSTANTS
diff --git a/src/emu/machine/adc083x.c b/src/emu/machine/adc083x.c
index fa626aef952..858b753aaea 100644
--- a/src/emu/machine/adc083x.c
+++ b/src/emu/machine/adc083x.c
@@ -117,7 +117,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_cs_write )
if( adc083x->cs != state )
{
- verboselog( 2, device->machine, "adc083x_cs_write( %s, %d )\n", device->tag, state );
+ verboselog( 2, device->machine, "adc083x_cs_write( %s, %d )\n", device->tag.cstr(), state );
}
if( adc083x->cs == 0 && state != 0 )
@@ -235,7 +235,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
if( adc083x->clk != state )
{
- verboselog( 2, device->machine, "adc083x_clk_write( %s, %d )\n", device->tag, state );
+ verboselog( 2, device->machine, "adc083x_clk_write( %s, %d )\n", device->tag.cstr(), state );
}
if( adc083x->cs == 0 )
@@ -247,7 +247,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
case STATE_WAIT_FOR_START:
if( adc083x->di != 0 )
{
- verboselog( 1, device->machine, "adc083x %s got start bit\n", device->tag );
+ verboselog( 1, device->machine, "adc083x %s got start bit\n", device->tag.cstr() );
adc083x->state = STATE_SHIFT_MUX;
adc083x->sars = 0;
adc083x->sgl = 0;
@@ -258,7 +258,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
}
else
{
- verboselog( 1, device->machine, "adc083x %s not start bit\n", device->tag );
+ verboselog( 1, device->machine, "adc083x %s not start bit\n", device->tag.cstr() );
}
break;
@@ -270,7 +270,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
{
adc083x->sgl = 1;
}
- verboselog( 1, device->machine, "adc083x %s sgl <- %d\n", device->tag, adc083x->sgl );
+ verboselog( 1, device->machine, "adc083x %s sgl <- %d\n", device->tag.cstr(), adc083x->sgl );
break;
case 1:
@@ -278,7 +278,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
{
adc083x->odd = 1;
}
- verboselog( 1, device->machine, "adc083x %s odd <- %d\n", device->tag, adc083x->odd );
+ verboselog( 1, device->machine, "adc083x %s odd <- %d\n", device->tag.cstr(), adc083x->odd );
break;
case 2:
@@ -286,7 +286,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
{
adc083x->sel1 = 1;
}
- verboselog( 1, device->machine, "adc083x %s sel1 <- %d\n", device->tag, adc083x->sel1 );
+ verboselog( 1, device->machine, "adc083x %s sel1 <- %d\n", device->tag.cstr(), adc083x->sel1 );
break;
case 3:
@@ -294,7 +294,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
{
adc083x->sel0 = 1;
}
- verboselog( 1, device->machine, "adc083x %s sel0 <- %d\n", device->tag, adc083x->sel0 );
+ verboselog( 1, device->machine, "adc083x %s sel0 <- %d\n", device->tag.cstr(), adc083x->sel0 );
break;
}
@@ -310,11 +310,11 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
adc083x->sars = 0;
if( device->type == ADC0838 && adc083x->se != 0 )
{
- verboselog( 1, device->machine, "adc083x %s not se\n", device->tag );
+ verboselog( 1, device->machine, "adc083x %s not se\n", device->tag.cstr() );
}
else
{
- verboselog( 1, device->machine, "adc083x %s got se\n", device->tag );
+ verboselog( 1, device->machine, "adc083x %s got se\n", device->tag.cstr() );
adc083x->state = STATE_OUTPUT_LSB_FIRST;
adc083x->bit = 1;
}
@@ -327,7 +327,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
switch( adc083x->state )
{
case STATE_MUX_SETTLE:
- verboselog( 1, device->machine, "adc083x %s mux settle\n", device->tag );
+ verboselog( 1, device->machine, "adc083x %s mux settle\n", device->tag.cstr() );
adc083x->output = adc083x_conversion( device );
adc083x->state = STATE_OUTPUT_MSB_FIRST;
adc083x->bit = 7;
@@ -337,7 +337,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
case STATE_OUTPUT_MSB_FIRST:
adc083x->_do = ( adc083x->output >> adc083x->bit ) & 1;
- verboselog( 1, device->machine, "adc083x %s msb %d -> %d\n", device->tag, adc083x->bit, adc083x->_do );
+ verboselog( 1, device->machine, "adc083x %s msb %d -> %d\n", device->tag.cstr(), adc083x->bit, adc083x->_do );
adc083x->bit--;
if( adc083x->bit < 0 )
@@ -355,7 +355,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
case STATE_OUTPUT_LSB_FIRST:
adc083x->_do = ( adc083x->output >> adc083x->bit ) & 1;
- verboselog( 1, device->machine, "adc083x %s lsb %d -> %d\n", device->tag, adc083x->bit, adc083x->_do );
+ verboselog( 1, device->machine, "adc083x %s lsb %d -> %d\n", device->tag.cstr(), adc083x->bit, adc083x->_do );
adc083x->bit++;
if( adc083x->bit == 8 )
@@ -385,7 +385,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_di_write )
if( adc083x->di != state )
{
- verboselog( 2, device->machine, "adc083x_di_write( %s, %d )\n", device->tag, state );
+ verboselog( 2, device->machine, "adc083x_di_write( %s, %d )\n", device->tag.cstr(), state );
}
adc083x->di = state;
@@ -401,7 +401,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_se_write )
if( adc083x->se != state )
{
- verboselog( 2, device->machine, "adc083x_se_write( %s, %d )\n", device->tag, state );
+ verboselog( 2, device->machine, "adc083x_se_write( %s, %d )\n", device->tag.cstr(), state );
}
adc083x->se = state;
@@ -415,7 +415,7 @@ READ_LINE_DEVICE_HANDLER( adc083x_sars_read )
{
adc0831_state *adc083x = get_safe_token( device );
- verboselog( 1, device->machine, "adc083x_sars_read( %s ) %d\n", device->tag, adc083x->sars );
+ verboselog( 1, device->machine, "adc083x_sars_read( %s ) %d\n", device->tag.cstr(), adc083x->sars );
return adc083x->sars;
}
@@ -427,7 +427,7 @@ READ_LINE_DEVICE_HANDLER( adc083x_do_read )
{
adc0831_state *adc083x = get_safe_token( device );
- verboselog( 1, device->machine, "adc083x_do_read( %s ) %d\n", device->tag, adc083x->_do );
+ verboselog( 1, device->machine, "adc083x_do_read( %s ) %d\n", device->tag.cstr(), adc083x->_do );
return adc083x->_do;
}
diff --git a/src/emu/machine/adc083x.h b/src/emu/machine/adc083x.h
index 88101ccf6b7..b3be6b1d1fc 100644
--- a/src/emu/machine/adc083x.h
+++ b/src/emu/machine/adc083x.h
@@ -9,7 +9,6 @@
#ifndef __ADC083X_H__
#define __ADC083X_H__
-#include "devcb.h"
/***************************************************************************
CONSTANTS
diff --git a/src/emu/machine/adc1038.h b/src/emu/machine/adc1038.h
index 884d98c1d22..c9e648cbe12 100644
--- a/src/emu/machine/adc1038.h
+++ b/src/emu/machine/adc1038.h
@@ -10,7 +10,6 @@
#ifndef __ADC1038_H__
#define __ADC1038_H__
-#include "devcb.h"
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/emu/machine/adc1213x.h b/src/emu/machine/adc1213x.h
index 67c079fd064..2a38c806291 100644
--- a/src/emu/machine/adc1213x.h
+++ b/src/emu/machine/adc1213x.h
@@ -10,7 +10,6 @@
#ifndef __ADC1213X_H__
#define __ADC1213X_H__
-#include "devcb.h"
/***************************************************************************
MACROS / CONSTANTS
diff --git a/src/emu/machine/cdp1852.h b/src/emu/machine/cdp1852.h
index c0f2badf946..d36a721159e 100644
--- a/src/emu/machine/cdp1852.h
+++ b/src/emu/machine/cdp1852.h
@@ -25,7 +25,6 @@
#ifndef __CDP1852__
#define __CDP1852__
-#include "devcb.h"
/***************************************************************************
MACROS / CONSTANTS
diff --git a/src/emu/machine/eeprom.c b/src/emu/machine/eeprom.c
index b4b7d5408ea..61182741b29 100644
--- a/src/emu/machine/eeprom.c
+++ b/src/emu/machine/eeprom.c
@@ -360,14 +360,14 @@ static DEVICE_NVRAM( eeprom )
/* populate from a memory region if present */
if (device->region != NULL)
{
- UINT32 region_flags = memory_region_flags(device->machine, device->tag);
+ UINT32 region_flags = memory_region_flags(device->machine, device->tag.cstr());
if (device->regionbytes != eeprom_bytes)
- fatalerror("eeprom region '%s' wrong size (expected size = 0x%X)", device->tag, eeprom_bytes);
+ fatalerror("eeprom region '%s' wrong size (expected size = 0x%X)", device->tag.cstr(), eeprom_bytes);
if (eestate->intf->data_bits == 8 && (region_flags & ROMREGION_WIDTHMASK) != ROMREGION_8BIT)
- fatalerror("eeprom region '%s' needs to be an 8-bit region", device->tag);
+ fatalerror("eeprom region '%s' needs to be an 8-bit region", device->tag.cstr());
if (eestate->intf->data_bits == 16 && ((region_flags & ROMREGION_WIDTHMASK) != ROMREGION_16BIT || (region_flags & ROMREGION_ENDIANMASK) != ROMREGION_BE))
- fatalerror("eeprom region '%s' needs to be a 16-bit big-endian region (flags=%08x)", device->tag, region_flags);
+ fatalerror("eeprom region '%s' needs to be a 16-bit big-endian region (flags=%08x)", device->tag.cstr(), region_flags);
for (offs = 0; offs < eeprom_length; offs++)
if (eestate->intf->data_bits == 8)
diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c
index 194647e7f99..c5b58efd598 100644
--- a/src/emu/machine/generic.c
+++ b/src/emu/machine/generic.c
@@ -9,7 +9,8 @@
*********************************************************************/
-#include "driver.h"
+#include "emu.h"
+#include "emuopts.h"
#include "config.h"
#include "generic.h"
diff --git a/src/emu/machine/generic.h b/src/emu/machine/generic.h
index 477c6ca0a19..d37a58e5157 100644
--- a/src/emu/machine/generic.h
+++ b/src/emu/machine/generic.h
@@ -14,8 +14,6 @@
#ifndef __MACHINE_GENERIC_H__
#define __MACHINE_GENERIC_H__
-#include "emucore.h"
-
/***************************************************************************
diff --git a/src/emu/machine/i8243.c b/src/emu/machine/i8243.c
index e2e1f6a2b7e..d56d32e2c0d 100644
--- a/src/emu/machine/i8243.c
+++ b/src/emu/machine/i8243.c
@@ -8,6 +8,7 @@
***************************************************************************/
+#include "emu.h"
#include "i8243.h"
diff --git a/src/emu/machine/i8243.h b/src/emu/machine/i8243.h
index 6125c380218..ff5fea5ebac 100644
--- a/src/emu/machine/i8243.h
+++ b/src/emu/machine/i8243.h
@@ -13,7 +13,6 @@
#ifndef __I8243_H__
#define __I8243_H__
-#include "devintrf.h"
#include "cpu/mcs48/mcs48.h"
diff --git a/src/emu/machine/i8255a.c b/src/emu/machine/i8255a.c
index 2b59e9817d9..0869b211bae 100644
--- a/src/emu/machine/i8255a.c
+++ b/src/emu/machine/i8255a.c
@@ -466,7 +466,7 @@ READ8_DEVICE_HANDLER( i8255a_r )
case MODE_1: data = read_mode1(i8255a, PORT_A); break;
case MODE_2: data = read_mode2(i8255a); break;
}
- if (LOG) logerror("8255A '%s' Port A Read: %02x\n", device->tag, data);
+ if (LOG) logerror("8255A '%s' Port A Read: %02x\n", device->tag.cstr(), data);
break;
case PORT_B:
@@ -475,17 +475,17 @@ READ8_DEVICE_HANDLER( i8255a_r )
case MODE_0: data = read_mode0(i8255a, PORT_B); break;
case MODE_1: data = read_mode1(i8255a, PORT_B); break;
}
- if (LOG) logerror("8255A '%s' Port B Read: %02x\n", device->tag, data);
+ if (LOG) logerror("8255A '%s' Port B Read: %02x\n", device->tag.cstr(), data);
break;
case PORT_C:
data = read_pc(i8255a);
- //if (LOG) logerror("8255A '%s' Port C Read: %02x\n", device->tag, data);
+ //if (LOG) logerror("8255A '%s' Port C Read: %02x\n", device->tag.cstr(), data);
break;
case CONTROL:
data = i8255a->control;
- if (LOG) logerror("8255A '%s' Mode Control Word Read: %02x\n", device->tag, data);
+ if (LOG) logerror("8255A '%s' Mode Control Word Read: %02x\n", device->tag.cstr(), data);
break;
}
@@ -579,12 +579,12 @@ static void set_mode(const device_config *device, UINT8 data)
i8255a->inte1 = 0;
i8255a->inte2 = 0;
- if (LOG) logerror("8255A '%s' Group A Mode: %u\n", device->tag, group_mode(i8255a, GROUP_A));
- if (LOG) logerror("8255A '%s' Port A Mode: %s\n", device->tag, (port_mode(i8255a, PORT_A) == MODE_OUTPUT) ? "output" : "input");
- if (LOG) logerror("8255A '%s' Port C Upper Mode: %s\n", device->tag, (port_c_upper_mode(i8255a) == MODE_OUTPUT) ? "output" : "input");
- if (LOG) logerror("8255A '%s' Group B Mode: %u\n", device->tag, group_mode(i8255a, GROUP_B));
- if (LOG) logerror("8255A '%s' Port B Mode: %s\n", device->tag, (port_mode(i8255a, PORT_B) == MODE_OUTPUT) ? "output" : "input");
- if (LOG) logerror("8255A '%s' Port C Lower Mode: %s\n", device->tag, (port_c_lower_mode(i8255a) == MODE_OUTPUT) ? "output" : "input");
+ if (LOG) logerror("8255A '%s' Group A Mode: %u\n", device->tag.cstr(), group_mode(i8255a, GROUP_A));
+ if (LOG) logerror("8255A '%s' Port A Mode: %s\n", device->tag.cstr(), (port_mode(i8255a, PORT_A) == MODE_OUTPUT) ? "output" : "input");
+ if (LOG) logerror("8255A '%s' Port C Upper Mode: %s\n", device->tag.cstr(), (port_c_upper_mode(i8255a) == MODE_OUTPUT) ? "output" : "input");
+ if (LOG) logerror("8255A '%s' Group B Mode: %u\n", device->tag.cstr(), group_mode(i8255a, GROUP_B));
+ if (LOG) logerror("8255A '%s' Port B Mode: %s\n", device->tag.cstr(), (port_mode(i8255a, PORT_B) == MODE_OUTPUT) ? "output" : "input");
+ if (LOG) logerror("8255A '%s' Port C Lower Mode: %s\n", device->tag.cstr(), (port_c_lower_mode(i8255a) == MODE_OUTPUT) ? "output" : "input");
/* group B */
i8255a->output[PORT_B] = 0;
@@ -667,7 +667,7 @@ WRITE8_DEVICE_HANDLER( i8255a_w )
switch (offset & 0x03)
{
case PORT_A:
- if (LOG) logerror("8255A '%s' Port A Write: %02x\n", device->tag, data);
+ if (LOG) logerror("8255A '%s' Port A Write: %02x\n", device->tag.cstr(), data);
switch (group_mode(i8255a, GROUP_A))
{
@@ -678,7 +678,7 @@ WRITE8_DEVICE_HANDLER( i8255a_w )
break;
case PORT_B:
- if (LOG) logerror("8255A '%s' Port B Write: %02x\n", device->tag, data);
+ if (LOG) logerror("8255A '%s' Port B Write: %02x\n", device->tag.cstr(), data);
switch (group_mode(i8255a, GROUP_B))
{
@@ -688,7 +688,7 @@ WRITE8_DEVICE_HANDLER( i8255a_w )
break;
case PORT_C:
- if (LOG) logerror("8255A '%s' Port C Write: %02x\n", device->tag, data);
+ if (LOG) logerror("8255A '%s' Port C Write: %02x\n", device->tag.cstr(), data);
write_pc(i8255a, data);
break;
@@ -696,7 +696,7 @@ WRITE8_DEVICE_HANDLER( i8255a_w )
case CONTROL:
if (data & I8255A_CONTROL_MODE_SET)
{
- if (LOG) logerror("8255A '%s' Mode Control Word: %02x\n", device->tag, data);
+ if (LOG) logerror("8255A '%s' Mode Control Word: %02x\n", device->tag.cstr(), data);
set_mode(device, data);
}
@@ -705,7 +705,7 @@ WRITE8_DEVICE_HANDLER( i8255a_w )
int bit = (data >> 1) & 0x07;
int state = BIT(data, 0);
- if (LOG) logerror("8255A '%s' %s Bit %u\n", device->tag, state ? "Set" : "Reset", bit);
+ if (LOG) logerror("8255A '%s' %s Bit %u\n", device->tag.cstr(), state ? "Set" : "Reset", bit);
set_pc_bit(device, bit, state);
}
@@ -738,7 +738,7 @@ WRITE_LINE_DEVICE_HANDLER( i8255a_pc2_w )
/* port B acknowledge */
if (!i8255a->obf[PORT_B] && !state)
{
- if (LOG) logerror("8255A '%s' Port B Acknowledge\n", device->tag);
+ if (LOG) logerror("8255A '%s' Port B Acknowledge\n", device->tag.cstr());
/* clear output buffer flag */
set_obf(i8255a, PORT_B, 1);
@@ -749,7 +749,7 @@ WRITE_LINE_DEVICE_HANDLER( i8255a_pc2_w )
/* port B strobe */
if (!i8255a->ibf[PORT_B] && !state)
{
- if (LOG) logerror("8255A '%s' Port B Strobe\n", device->tag);
+ if (LOG) logerror("8255A '%s' Port B Strobe\n", device->tag.cstr());
/* read port into latch */
i8255a->input[PORT_B] = devcb_call_read8(&i8255a->in_port_func[PORT_B], 0);
@@ -770,7 +770,7 @@ WRITE_LINE_DEVICE_HANDLER( i8255a_pc4_w )
/* port A strobe */
if (!i8255a->ibf[PORT_A] && !state)
{
- if (LOG) logerror("8255A '%s' Port A Strobe\n", device->tag);
+ if (LOG) logerror("8255A '%s' Port A Strobe\n", device->tag.cstr());
/* read port into latch */
i8255a->input[PORT_A] = devcb_call_read8(&i8255a->in_port_func[PORT_A], 0);
@@ -790,7 +790,7 @@ WRITE_LINE_DEVICE_HANDLER( i8255a_pc6_w )
/* port A acknowledge */
if (!i8255a->obf[PORT_A] && !state)
{
- if (LOG) logerror("8255A '%s' Port A Acknowledge\n", device->tag);
+ if (LOG) logerror("8255A '%s' Port A Acknowledge\n", device->tag.cstr());
/* clear output buffer flag */
set_obf(i8255a, PORT_A, 1);
diff --git a/src/emu/machine/i8255a.h b/src/emu/machine/i8255a.h
index ad30db00163..84c9b84a9ba 100644
--- a/src/emu/machine/i8255a.h
+++ b/src/emu/machine/i8255a.h
@@ -33,7 +33,6 @@
#ifndef __I8255A__
#define __I8255A__
-#include "devcb.h"
/***************************************************************************
MACROS / CONSTANTS
diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c
index 7e2ccc01555..3bee7f7108c 100644
--- a/src/emu/machine/idectrl.c
+++ b/src/emu/machine/idectrl.c
@@ -1801,7 +1801,7 @@ static DEVICE_START( ide_controller )
/* set MAME harddisk handle */
config = (const ide_config *)device->inline_config;
- ide->handle = get_disk_handle(device->machine, (config->master != NULL) ? config->master : device->tag);
+ ide->handle = get_disk_handle(device->machine, (config->master != NULL) ? config->master : device->tag.cstr());
ide->disk = hard_disk_open(ide->handle);
assert_always(config->slave == NULL, "IDE controller does not yet support slave drives\n");
diff --git a/src/emu/machine/k033906.h b/src/emu/machine/k033906.h
index 3627b4bd536..daee3b323e9 100644
--- a/src/emu/machine/k033906.h
+++ b/src/emu/machine/k033906.h
@@ -7,7 +7,6 @@
#ifndef __K033906_H__
#define __K033906_H__
-#include "devcb.h"
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/emu/machine/k056230.h b/src/emu/machine/k056230.h
index 95daba0ffa0..4cf7389d9ac 100644
--- a/src/emu/machine/k056230.h
+++ b/src/emu/machine/k056230.h
@@ -7,7 +7,6 @@
#ifndef __K056230_H__
#define __K056230_H__
-#include "devcb.h"
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/emu/machine/latch8.c b/src/emu/machine/latch8.c
index c59a22c513b..0469583a34c 100644
--- a/src/emu/machine/latch8.c
+++ b/src/emu/machine/latch8.c
@@ -197,7 +197,7 @@ static DEVICE_START( latch8 )
if (latch8->intf->node_map[i] )
{
if (!latch8->intf->node_device[i])
- fatalerror("Device %s: Bit %d has invalid discrete device\n", device->tag, i);
+ fatalerror("Device %s: Bit %d has invalid discrete device\n", device->tag.cstr(), i);
latch8->has_node_map = 1;
}
@@ -206,11 +206,11 @@ static DEVICE_START( latch8 )
if (latch8->intf->devread[i].tag != NULL)
{
if (latch8->devices[i] != NULL)
- fatalerror("Device %s: Bit %d already has a handler.\n", device->tag, i);
+ fatalerror("Device %s: Bit %d already has a handler.\n", device->tag.cstr(), i);
latch8->devices[i] = devtag_get_device(device->machine,
latch8->intf->devread[i].tag);
if (latch8->devices[i] == NULL)
- fatalerror("Device %s: Unable to find device %s\n", device->tag, latch8->intf->devread[i].tag);
+ fatalerror("Device %s: Unable to find device %s\n", device->tag.cstr(), latch8->intf->devread[i].tag);
latch8->has_devread = 1;
}
@@ -219,7 +219,7 @@ static DEVICE_START( latch8 )
if (latch8->intf->devread[i].read_handler != NULL)
{
if (latch8->devices[i] != NULL)
- fatalerror("Device %s: Bit %d already has a handler.\n", device->tag, i);
+ fatalerror("Device %s: Bit %d already has a handler.\n", device->tag.cstr(), i);
latch8->has_read = 1;
}
diff --git a/src/emu/machine/ldcore.c b/src/emu/machine/ldcore.c
index 5336fad98e3..b15d7c721d7 100644
--- a/src/emu/machine/ldcore.c
+++ b/src/emu/machine/ldcore.c
@@ -9,12 +9,13 @@
*************************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "ldcore.h"
#include "avcomp.h"
#include "streams.h"
#include "vbiparse.h"
#include "config.h"
+#include "render.h"
diff --git a/src/emu/machine/ldcore.h b/src/emu/machine/ldcore.h
index 0e040cbbb5a..63a19d83b8d 100644
--- a/src/emu/machine/ldcore.h
+++ b/src/emu/machine/ldcore.h
@@ -14,7 +14,6 @@
#ifndef __LDCORE_H__
#define __LDCORE_H__
-#include "driver.h"
#include "laserdsc.h"
#include "vbiparse.h"
diff --git a/src/emu/machine/ldpr8210.c b/src/emu/machine/ldpr8210.c
index fbaf1a41d47..b574e078043 100644
--- a/src/emu/machine/ldpr8210.c
+++ b/src/emu/machine/ldpr8210.c
@@ -18,6 +18,7 @@
*************************************************************************/
+#include "emu.h"
#include "ldcore.h"
#include "cpu/mcs48/mcs48.h"
diff --git a/src/emu/machine/ldv1000.c b/src/emu/machine/ldv1000.c
index 5003f7138d6..b1392208202 100644
--- a/src/emu/machine/ldv1000.c
+++ b/src/emu/machine/ldv1000.c
@@ -16,6 +16,7 @@
*************************************************************************/
+#include "emu.h"
#include "ldcore.h"
#include "machine/8255ppi.h"
#include "machine/z80ctc.h"
diff --git a/src/emu/machine/ldvp931.c b/src/emu/machine/ldvp931.c
index 7e668b22e47..3b8476376e1 100644
--- a/src/emu/machine/ldvp931.c
+++ b/src/emu/machine/ldvp931.c
@@ -16,6 +16,7 @@
*************************************************************************/
+#include "emu.h"
#include "ldcore.h"
#include "cpu/mcs48/mcs48.h"
diff --git a/src/emu/machine/mb14241.h b/src/emu/machine/mb14241.h
index a5341169d89..f517c37d5c6 100644
--- a/src/emu/machine/mb14241.h
+++ b/src/emu/machine/mb14241.h
@@ -7,7 +7,6 @@
#ifndef __MB14241_H__
#define __MB14241_H__
-#include "devcb.h"
/***************************************************************************
FUNCTION PROTOTYPES
diff --git a/src/emu/machine/mb87078.h b/src/emu/machine/mb87078.h
index f439692dd35..f0fecb610ee 100644
--- a/src/emu/machine/mb87078.h
+++ b/src/emu/machine/mb87078.h
@@ -8,7 +8,6 @@
#ifndef __MB87078_H__
#define __MB87078_H__
-#include "devcb.h"
/***************************************************************************
diff --git a/src/emu/machine/mc146818.c b/src/emu/machine/mc146818.c
index 5efd5af61a6..d9aab406d12 100644
--- a/src/emu/machine/mc146818.c
+++ b/src/emu/machine/mc146818.c
@@ -74,7 +74,7 @@
#include "driver.h"
#include "memconv.h"
#include "machine/mc146818.h"
-
+#include "coreutil.h"
#define LOG_MC146818 0
diff --git a/src/emu/machine/pci.c b/src/emu/machine/pci.c
index cce00129ce7..4100fee8a02 100644
--- a/src/emu/machine/pci.c
+++ b/src/emu/machine/pci.c
@@ -136,7 +136,7 @@ READ32_DEVICE_HANDLER( pci_32le_r )
}
if (LOG_PCI)
- logerror("pci_32le_r('%s'): offset=%d result=0x%08X\n", device->tag, offset, result);
+ logerror("pci_32le_r('%s'): offset=%d result=0x%08X\n", device->tag.cstr(), offset, result);
return result;
}
@@ -150,7 +150,7 @@ WRITE32_DEVICE_HANDLER( pci_32le_w )
offset %= 2;
if (LOG_PCI)
- logerror("pci_32le_w('%s'): offset=%d data=0x%08X\n", device->tag, offset, data);
+ logerror("pci_32le_w('%s'): offset=%d data=0x%08X\n", device->tag.cstr(), offset, data);
switch (offset)
{
diff --git a/src/emu/machine/scsi.c b/src/emu/machine/scsi.c
index a60d2866eb8..1ddf429bed8 100644
--- a/src/emu/machine/scsi.c
+++ b/src/emu/machine/scsi.c
@@ -1,3 +1,4 @@
+#include "emu.h"
#include "scsi.h"
void SCSIAllocInstance( running_machine *machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion )
diff --git a/src/emu/machine/scsi.h b/src/emu/machine/scsi.h
index 38bb09df68f..3bc85c05417 100644
--- a/src/emu/machine/scsi.h
+++ b/src/emu/machine/scsi.h
@@ -8,7 +8,6 @@
#ifndef _SCSI_H_
#define _SCSI_H_
-#include "driver.h"
typedef int (*pSCSIDispatch)( int operation, void *file, INT64 intparm, void *ptrparm );
diff --git a/src/emu/machine/scsicd.c b/src/emu/machine/scsicd.c
index f169bfade5e..c9e3eb03837 100644
--- a/src/emu/machine/scsicd.c
+++ b/src/emu/machine/scsicd.c
@@ -4,10 +4,10 @@
***************************************************************************/
+#include "emu.h"
#include "scsidev.h"
#include "cdrom.h"
#include "sound/cdda.h"
-#include "state.h"
#ifdef MESS
#include "devices/chd_cd.h"
#endif
diff --git a/src/emu/machine/scsidev.c b/src/emu/machine/scsidev.c
index 9b410781f4d..4ab61ac2f6a 100644
--- a/src/emu/machine/scsidev.c
+++ b/src/emu/machine/scsidev.c
@@ -4,7 +4,8 @@
***************************************************************************/
-#include "scsidev.h"
+#include "emu.h"
+ #include "scsidev.h"
typedef struct
{
diff --git a/src/emu/machine/scsihd.c b/src/emu/machine/scsihd.c
index c098fe056de..1abf21d73b1 100644
--- a/src/emu/machine/scsihd.c
+++ b/src/emu/machine/scsihd.c
@@ -4,7 +4,7 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "scsidev.h"
#include "harddisk.h"
diff --git a/src/emu/machine/z80ctc.h b/src/emu/machine/z80ctc.h
index d4ffdb14fb4..e459b96db10 100644
--- a/src/emu/machine/z80ctc.h
+++ b/src/emu/machine/z80ctc.h
@@ -10,7 +10,6 @@
#ifndef __Z80CTC_H__
#define __Z80CTC_H__
-#include "devcb.h"
/***************************************************************************
CONSTANTS
diff --git a/src/emu/machine/z80dma.h b/src/emu/machine/z80dma.h
index 00e984b5fba..6c7366cd090 100644
--- a/src/emu/machine/z80dma.h
+++ b/src/emu/machine/z80dma.h
@@ -33,7 +33,6 @@
#ifndef __Z80DMA__
#define __Z80DMA__
-#include "devcb.h"
/***************************************************************************
MACROS / CONSTANTS
diff --git a/src/emu/machine/z80pio.h b/src/emu/machine/z80pio.h
index 333601752a7..6db02f5ea1b 100644
--- a/src/emu/machine/z80pio.h
+++ b/src/emu/machine/z80pio.h
@@ -33,7 +33,6 @@
#ifndef __Z80PIO_H__
#define __Z80PIO_H__
-#include "devcb.h"
/***************************************************************************
diff --git a/src/emu/mame.c b/src/emu/mame.c
index d2167cfac4c..78b19146d10 100644
--- a/src/emu/mame.c
+++ b/src/emu/mame.c
@@ -73,8 +73,9 @@
***************************************************************************/
+#include "emu.h"
+#include "emuopts.h"
#include "osdepend.h"
-#include "driver.h"
#include "config.h"
#include "cheat.h"
#include "debugger.h"
@@ -84,11 +85,10 @@
#include "uimenu.h"
#include "uiinput.h"
#include "streams.h"
+#include "crsshair.h"
#include "validity.h"
#include "debug/debugcon.h"
-#include "mame.h"
-#include <new>
-#include <stdarg.h>
+
#include <time.h>
@@ -150,7 +150,7 @@ struct _mame_private
/* list of memory regions, and a map for lookups */
region_info * regionlist;
- tagmap * regionmap;
+ tagmap_t<region_info *> regionmap;
/* random number seed */
UINT32 rand_seed;
@@ -189,6 +189,9 @@ const char mame_disclaimer[] =
"images is a violation of copyright law and should be promptly reported to the\n"
"authors so that appropriate legal action can be taken.\n";
+/* a giant string buffer for temporary strings */
+static char giant_string_buffer[65536] = { 0 };
+
/***************************************************************************
@@ -771,10 +774,10 @@ UINT8 *memory_region_alloc(running_machine *machine, const char *name, UINT32 le
info->base = auto_alloc_array(machine, UINT8, length);
/* attempt to put is in the hash table */
- tagerr = tagmap_add_unique_hash(mame->regionmap, name, info, FALSE);
+ tagerr = mame->regionmap.add_unique_hash(name, info, FALSE);
if (tagerr == TMERR_DUPLICATE)
{
- region_info *match = (region_info *)tagmap_find_hash_only(mame->regionmap, name);
+ region_info *match = mame->regionmap.find_hash_only(name);
fatalerror("Memory region '%s' has same hash as tag '%s'; please change one of them", name, match->name.cstr());
}
@@ -802,7 +805,7 @@ void memory_region_free(running_machine *machine, const char *name)
/* remove us from the list and the map */
*infoptr = info->next;
- tagmap_remove(mame->regionmap, info->name);
+ mame->regionmap.remove(info->name);
/* free the region */
auto_free(machine, info->base);
@@ -817,7 +820,7 @@ void memory_region_free(running_machine *machine, const char *name)
region
-------------------------------------------------*/
-UINT8 *memory_region(running_machine *machine, const char *name)
+UINT8 *memory_region(running_machine *machine, const char *name, UINT32 *length, UINT32 *flags)
{
mame_private *mame = machine->mame_data;
region_info *info;
@@ -827,8 +830,14 @@ UINT8 *memory_region(running_machine *machine, const char *name)
return NULL;
/* look up the region and return the base */
- info = (region_info *)tagmap_find_hash_only(mame->regionmap, name);
- return (info != NULL) ? info->base : NULL;
+ info = mame->regionmap.find_hash_only(name);
+ if (info == NULL)
+ return NULL;
+ if (length != NULL)
+ *length = info->length;
+ if (flags != NULL)
+ *flags = info->flags;
+ return info->base;
}
@@ -847,7 +856,7 @@ UINT32 memory_region_length(running_machine *machine, const char *name)
return 0;
/* look up the region and return the length */
- info = (region_info *)tagmap_find_hash_only(mame->regionmap, name);
+ info = mame->regionmap.find_hash_only(name);
return (info != NULL) ? info->length : 0;
}
@@ -867,7 +876,7 @@ UINT32 memory_region_flags(running_machine *machine, const char *name)
return 0;
/* look up the region and return the flags */
- info = (region_info *)tagmap_find_hash_only(mame->regionmap, name);
+ info = mame->regionmap.find_hash_only(name);
return (info != NULL) ? info->flags : 0;
}
@@ -891,7 +900,7 @@ const char *memory_region_next(running_machine *machine, const char *name)
return mame->regionlist->name;
/* look up the region and return the next guy */
- info = (region_info *)tagmap_find_hash_only(mame->regionmap, name);
+ info = mame->regionmap.find_hash_only(name);
return (info != NULL && info->next != NULL) ? info->next->name.cstr() : NULL;
}
@@ -1115,7 +1124,7 @@ void CLIB_DECL popmessage(const char *format, ...)
/* dump to the buffer */
va_start(arg, format);
- vsnprintf(giant_string_buffer, GIANT_STRING_BUFFER_SIZE, format, arg);
+ vsnprintf(giant_string_buffer, ARRAY_LENGTH(giant_string_buffer), format, arg);
va_end(arg);
/* pop it in the UI */
@@ -1148,7 +1157,7 @@ void CLIB_DECL logerror(const char *format, ...)
/* dump to the buffer */
va_start(arg, format);
- vsnprintf(giant_string_buffer, GIANT_STRING_BUFFER_SIZE, format, arg);
+ vsnprintf(giant_string_buffer, ARRAY_LENGTH(giant_string_buffer), format, arg);
va_end(arg);
/* log to all callbacks */
@@ -1359,11 +1368,6 @@ running_machine::running_machine(const game_driver *driver)
/* allocate memory for the internal mame_data */
mame_data = auto_alloc_clear(this, mame_private);
- /* allocate memory for the memory region map */
- mame_data->regionmap = tagmap_alloc();
- if (mame_data->regionmap == NULL)
- throw std::bad_alloc();
-
/* initialize the driver-related variables in the machine */
basename = mame_strdup(driver->name);
config = machine_config_alloc(driver->machine_config);
@@ -1405,10 +1409,6 @@ running_machine::~running_machine()
if (config != NULL)
machine_config_free((machine_config *)config);
- if (mame_data != NULL && mame_data->regionmap != NULL)
- tagmap_free(mame_data->regionmap);
- if (basename != NULL)
- auto_free(this, basename);
global_machine = NULL;
}
diff --git a/src/emu/mame.h b/src/emu/mame.h
index d1a3bfe2299..1a3a1e3e32f 100644
--- a/src/emu/mame.h
+++ b/src/emu/mame.h
@@ -9,21 +9,14 @@
***************************************************************************/
-#ifndef __MAME_H__
-#define __MAME_H__
+#pragma once
-#include "emucore.h"
-#include "video.h"
-#include "crsshair.h"
-#include "options.h"
-#include "inptport.h"
-#include "cpuintrf.h"
-#include <stdarg.h>
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
-#ifdef MESS
-#include "image.h"
-#include "uimess.h"
-#endif /* MESS */
+#ifndef __MAME_H__
+#define __MAME_H__
@@ -31,6 +24,8 @@
CONSTANTS
***************************************************************************/
+const int MAX_GFX_ELEMENTS = 32;
+
/* return values from run_game */
enum
{
@@ -69,10 +64,6 @@ enum
#define DEBUG_FLAG_WPW_IO 0x00000400 /* watchpoints are enabled for IO memory writes */
-/* maxima */
-#define MAX_GFX_ELEMENTS 32
-
-
/* MESS vs. MAME abstractions */
#ifndef MESS
#define APPNAME "MAME"
@@ -134,11 +125,10 @@ typedef enum _output_channel output_channel;
TYPE DEFINITIONS
***************************************************************************/
-/* output channel callback */
-typedef void (*output_callback_func)(void *param, const char *format, va_list argptr);
-
+// forward declarations
+class gfx_element;
+class colortable_t;
-/* forward type declarations */
typedef struct _mame_private mame_private;
typedef struct _cpuexec_private cpuexec_private;
typedef struct _timer_private timer_private;
@@ -161,18 +151,13 @@ typedef struct _generic_video_private generic_video_private;
typedef struct _generic_audio_private generic_audio_private;
-/* structure to hold a pointer/size pair for generic pointers */
-typedef union _generic_ptr generic_ptr;
-union _generic_ptr
-{
- void * v;
- UINT8 * u8;
- UINT16 * u16;
- UINT32 * u32;
- UINT64 * u64;
-};
+/* output channel callback */
+typedef void (*output_callback_func)(void *param, const char *format, va_list argptr);
+/* return a pointer to a specified memory region */
+UINT8 *memory_region(running_machine *machine, const char *name, UINT32 *length = NULL, UINT32 *flags = NULL);
+
/* this structure holds generic pointers that are commonly used */
typedef struct _generic_pointers generic_pointers;
struct _generic_pointers
@@ -202,6 +187,10 @@ public:
running_machine(const game_driver *driver);
~running_machine();
+ inline const device_config *device(const char *tag);
+ inline const input_port_config *port(const char *tag);
+ template<class T> T *region(const char *tag, UINT32 *length = NULL, UINT32 *flags = NULL);
+
resource_pool respool; /* pool of resources for this machine */
/* configuration data */
@@ -222,7 +211,7 @@ public:
/* palette-related information */
const pen_t * pens; /* remapped palette pen numbers */
- struct _colortable_t * colortable; /* global colortable for remapping */
+ colortable_t * colortable; /* global colortable for remapping */
pen_t * shadow_table; /* table for looking up a shadowed pen */
bitmap_t * priority_bitmap; /* priority bitmap */
@@ -266,6 +255,8 @@ public:
};
+
+
typedef struct _mame_system_tm mame_system_tm;
struct _mame_system_tm
{
@@ -296,7 +287,6 @@ struct _mame_system_time
***************************************************************************/
extern const char mame_disclaimer[];
-extern char giant_string_buffer[];
extern const char build_version[];
@@ -381,7 +371,7 @@ UINT8 *memory_region_alloc(running_machine *machine, const char *name, UINT32 le
void memory_region_free(running_machine *machine, const char *name);
/* return a pointer to a specified memory region */
-UINT8 *memory_region(running_machine *machine, const char *name);
+//UINT8 *memory_region(running_machine *machine, const char *name, UINT32 *length = NULL, UINT32 *flags = NULL);
/* return the size (in bytes) of a specified memory region */
UINT32 memory_region_length(running_machine *machine, const char *name);
@@ -447,4 +437,26 @@ void mame_get_current_datetime(running_machine *machine, mame_system_time *systi
#include "mess.h"
#endif /* MESS */
+
+
+/***************************************************************************
+ INLINE FUNCTIONS
+***************************************************************************/
+
+inline const device_config *running_machine::device(const char *tag)
+{
+ return device_list_find_by_tag(&config->devicelist, tag);
+}
+
+inline const input_port_config *running_machine::port(const char *tag)
+{
+ return input_port_by_tag(&portlist, tag);
+}
+
+template<class T> T *running_machine::region(const char *tag, UINT32 *length, UINT32 *flags)
+{
+ return reinterpret_cast<T *>(memory_region(this, tag, length, flags));
+}
+
+
#endif /* __MAME_H__ */
diff --git a/src/emu/mconfig.c b/src/emu/mconfig.c
index b1960c31fbd..32e48dbd221 100644
--- a/src/emu/mconfig.c
+++ b/src/emu/mconfig.c
@@ -9,10 +9,7 @@
***************************************************************************/
-#include "driver.h"
-#include "devintrf.h"
-#include "mconfig.h"
-
+#include "emu.h"
#include <ctype.h>
#if defined(_MSC_VER)
diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h
index b7f5d2bc34f..565369a3fcc 100644
--- a/src/emu/mconfig.h
+++ b/src/emu/mconfig.h
@@ -11,13 +11,85 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __MCONFIG_H__
#define __MCONFIG_H__
-#include "devintrf.h"
-#include "cpuexec.h"
-#include "sndintrf.h"
-#include <stddef.h>
+
+#define NVRAM_HANDLER_NAME(name) nvram_handler_##name
+#define NVRAM_HANDLER(name) void NVRAM_HANDLER_NAME(name)(running_machine *machine, mame_file *file, int read_or_write)
+#define NVRAM_HANDLER_CALL(name) NVRAM_HANDLER_NAME(name)(machine, file, read_or_write)
+
+#define MEMCARD_HANDLER_NAME(name) memcard_handler_##name
+#define MEMCARD_HANDLER(name) void MEMCARD_HANDLER_NAME(name)(running_machine *machine, mame_file *file, int action)
+#define MEMCARD_HANDLER_CALL(name) MEMCARD_HANDLER_NAME(name)(machine, file, action)
+
+#define MACHINE_START_NAME(name) machine_start_##name
+#define MACHINE_START(name) void MACHINE_START_NAME(name)(running_machine *machine)
+#define MACHINE_START_CALL(name) MACHINE_START_NAME(name)(machine)
+
+#define MACHINE_RESET_NAME(name) machine_reset_##name
+#define MACHINE_RESET(name) void MACHINE_RESET_NAME(name)(running_machine *machine)
+#define MACHINE_RESET_CALL(name) MACHINE_RESET_NAME(name)(machine)
+
+#define SOUND_START_NAME(name) sound_start_##name
+#define SOUND_START(name) void SOUND_START_NAME(name)(running_machine *machine)
+#define SOUND_START_CALL(name) SOUND_START_NAME(name)(machine)
+
+#define SOUND_RESET_NAME(name) sound_reset_##name
+#define SOUND_RESET(name) void SOUND_RESET_NAME(name)(running_machine *machine)
+#define SOUND_RESET_CALL(name) SOUND_RESET_NAME(name)(machine)
+
+#define VIDEO_START_NAME(name) video_start_##name
+#define VIDEO_START(name) void VIDEO_START_NAME(name)(running_machine *machine)
+#define VIDEO_START_CALL(name) VIDEO_START_NAME(name)(machine)
+
+#define VIDEO_RESET_NAME(name) video_reset_##name
+#define VIDEO_RESET(name) void VIDEO_RESET_NAME(name)(running_machine *machine)
+#define VIDEO_RESET_CALL(name) VIDEO_RESET_NAME(name)(machine)
+
+#define PALETTE_INIT_NAME(name) palette_init_##name
+#define PALETTE_INIT(name) void PALETTE_INIT_NAME(name)(running_machine *machine, const UINT8 *color_prom)
+#define PALETTE_INIT_CALL(name) PALETTE_INIT_NAME(name)(machine, color_prom)
+
+#define VIDEO_EOF_NAME(name) video_eof_##name
+#define VIDEO_EOF(name) void VIDEO_EOF_NAME(name)(running_machine *machine)
+#define VIDEO_EOF_CALL(name) VIDEO_EOF_NAME(name)(machine)
+
+#define VIDEO_UPDATE_NAME(name) video_update_##name
+#define VIDEO_UPDATE(name) UINT32 VIDEO_UPDATE_NAME(name)(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect)
+#define VIDEO_UPDATE_CALL(name) VIDEO_UPDATE_NAME(name)(screen, bitmap, cliprect)
+
+
+/* NULL versions */
+#define nvram_handler_0 NULL
+#define memcard_handler_0 NULL
+#define machine_start_0 NULL
+#define machine_reset_0 NULL
+#define sound_start_0 NULL
+#define sound_reset_0 NULL
+#define video_start_0 NULL
+#define video_reset_0 NULL
+#define palette_init_0 NULL
+#define video_eof_0 NULL
+#define video_update_0 NULL
+
+
+typedef void (*nvram_handler_func)(running_machine *machine, mame_file *file, int read_or_write);
+typedef void (*memcard_handler_func)(running_machine *machine, mame_file *file, int action);
+typedef void (*machine_start_func)(running_machine *machine);
+typedef void (*machine_reset_func)(running_machine *machine);
+typedef void (*sound_start_func)(running_machine *machine);
+typedef void (*sound_reset_func)(running_machine *machine);
+typedef void (*video_start_func)(running_machine *machine);
+typedef void (*video_reset_func)(running_machine *machine);
+typedef void (*palette_init_func)(running_machine *machine, const UINT8 *color_prom);
+typedef void (*video_eof_func)(running_machine *machine);
+typedef UINT32 (*video_update_func)(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect);
+
/***************************************************************************
@@ -113,7 +185,11 @@ enum
TYPE DEFINITIONS
***************************************************************************/
-/* In emucore.h: typedef struct _machine_config machine_config; */
+// forward references
+struct gfx_decode_entry;
+
+
+typedef struct _machine_config machine_config;
struct _machine_config
{
UINT32 driver_data_size; /* amount of memory needed for driver_data */
@@ -153,15 +229,13 @@ struct _machine_config
***************************************************************************/
/* this type is used to encode machine configuration definitions */
-typedef union _machine_config_token machine_config_token;
-union _machine_config_token
+union machine_config_token
{
TOKEN_COMMON_FIELDS
const machine_config_token *tokenptr;
const gfx_decode_entry *gfxdecode;
const addrmap_token *addrmap;
device_type devtype;
- driver_init_func driver_init;
nvram_handler_func nvram_handler;
memcard_handler_func memcard_handler;
machine_start_func machine_start;
diff --git a/src/emu/memory.c b/src/emu/memory.c
index 77a879e55a4..16f79518386 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -172,10 +172,9 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "profiler.h"
#include "debug/debugcpu.h"
-#include "memory.h"
/***************************************************************************
@@ -340,11 +339,11 @@ struct _memory_private
memory_block * memory_block_list; /* head of the list of memory blocks */
- tagmap * bankmap; /* map for fast bank lookups */
+ tagmap_t<bank_info *> bankmap; /* map for fast bank lookups */
bank_info * banklist; /* data gathered for each bank */
UINT8 banknext; /* next bank to allocate */
- tagmap * sharemap; /* map for share lookups */
+ tagmap_t<void *> sharemap; /* map for share lookups */
UINT8 * wptable; /* watchpoint-fill table */
};
@@ -800,10 +799,6 @@ void memory_init(running_machine *machine)
/* allocate our private data */
memdata = machine->memory_data = auto_alloc_clear(machine, memory_private);
- memdata->bankmap = tagmap_alloc();
- memdata->sharemap = tagmap_alloc();
- if (memdata->bankmap == NULL || memdata->sharemap == NULL)
- fatalerror("Out of memory allocating maps for memory constructs!");
/* build up the list of address spaces */
memory_init_spaces(machine);
@@ -940,13 +935,13 @@ void memory_set_decrypted_region(const address_space *space, offs_t addrstart, o
/* fatal error if the decrypted region straddles the bank */
else if (bank->bytestart < byteend && bank->byteend > bytestart)
- fatalerror("memory_set_decrypted_region found straddled region %08X-%08X for device '%s'", bytestart, byteend, space->cpu->tag);
+ fatalerror("memory_set_decrypted_region found straddled region %08X-%08X for device '%s'", bytestart, byteend, space->cpu->tag.cstr());
}
}
/* fatal error as well if we didn't find any relevant memory banks */
if (!found)
- fatalerror("memory_set_decrypted_region unable to find matching region %08X-%08X for device '%s'", bytestart, byteend, space->cpu->tag);
+ fatalerror("memory_set_decrypted_region unable to find matching region %08X-%08X for device '%s'", bytestart, byteend, space->cpu->tag.cstr());
}
@@ -1008,7 +1003,7 @@ int memory_set_direct_region(const address_space *space, offs_t *byteaddress)
spacerw->direct.byteend = 0;
spacerw->direct.bytestart = 1;
if (!spacerw->debugger_access)
- logerror("Device '%s': warning - attempt to direct-map address %s in %s space\n", space->cpu->tag, core_i64_hex_format(overrideaddress, space->addrchars), space->name);
+ logerror("Device '%s': warning - attempt to direct-map address %s in %s space\n", space->cpu->tag.cstr(), core_i64_hex_format(overrideaddress, space->addrchars), space->name);
return FALSE;
}
@@ -1097,7 +1092,7 @@ void *memory_get_write_ptr(const address_space *space, offs_t byteaddress)
void memory_configure_bank(running_machine *machine, const char *tag, int startentry, int numentries, void *base, offs_t stride)
{
memory_private *memdata = machine->memory_data;
- bank_info *bank = (bank_info *)tagmap_find_hash_only(memdata->bankmap, tag);
+ bank_info *bank = memdata->bankmap.find_hash_only(tag);
int entrynum;
/* validation checks */
@@ -1126,7 +1121,7 @@ void memory_configure_bank(running_machine *machine, const char *tag, int starte
void memory_configure_bank_decrypted(running_machine *machine, const char *tag, int startentry, int numentries, void *base, offs_t stride)
{
memory_private *memdata = machine->memory_data;
- bank_info *bank = (bank_info *)tagmap_find_hash_only(memdata->bankmap, tag);
+ bank_info *bank = memdata->bankmap.find_hash_only(tag);
int entrynum;
/* validation checks */
@@ -1155,7 +1150,7 @@ void memory_configure_bank_decrypted(running_machine *machine, const char *tag,
void memory_set_bank(running_machine *machine, const char *tag, int entrynum)
{
memory_private *memdata = machine->memory_data;
- bank_info *bank = (bank_info *)tagmap_find_hash_only(memdata->bankmap, tag);
+ bank_info *bank = memdata->bankmap.find_hash_only(tag);
bank_reference *ref;
/* validation checks */
@@ -1185,7 +1180,7 @@ void memory_set_bank(running_machine *machine, const char *tag, int entrynum)
int memory_get_bank(running_machine *machine, const char *tag)
{
memory_private *memdata = machine->memory_data;
- bank_info *bank = (bank_info *)tagmap_find_hash_only(memdata->bankmap, tag);
+ bank_info *bank = memdata->bankmap.find_hash_only(tag);
/* validation checks */
if (bank == NULL)
@@ -1201,7 +1196,7 @@ int memory_get_bank(running_machine *machine, const char *tag)
void memory_set_bankptr(running_machine *machine, const char *tag, void *base)
{
memory_private *memdata = machine->memory_data;
- bank_info *bank = (bank_info *)tagmap_find_hash_only(memdata->bankmap, tag);
+ bank_info *bank = memdata->bankmap.find_hash_only(tag);
bank_reference *ref;
/* validation checks */
@@ -1237,9 +1232,9 @@ void *_memory_install_handler(const address_space *space, offs_t addrstart, offs
{
address_space *spacerw = (address_space *)space;
if (rhandler >= STATIC_COUNT)
- fatalerror("Attempted to install non-static read handler via memory_install_handler() in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install non-static read handler via memory_install_handler() in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (whandler >= STATIC_COUNT)
- fatalerror("Attempted to install non-static write handler via memory_install_handler() in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install non-static write handler via memory_install_handler() in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (rhandler != 0)
space_map_range(spacerw, ROW_READ, spacerw->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, spacerw, NULL);
if (whandler != 0)
@@ -1258,9 +1253,9 @@ UINT8 *_memory_install_handler8(const address_space *space, offs_t addrstart, of
{
address_space *spacerw = (address_space *)space;
if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (rhandler != NULL)
space_map_range(spacerw, ROW_READ, 8, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
if (whandler != NULL)
@@ -1279,9 +1274,9 @@ UINT16 *_memory_install_handler16(const address_space *space, offs_t addrstart,
{
address_space *spacerw = (address_space *)space;
if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (rhandler != NULL)
space_map_range(spacerw, ROW_READ, 16, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
if (whandler != NULL)
@@ -1300,9 +1295,9 @@ UINT32 *_memory_install_handler32(const address_space *space, offs_t addrstart,
{
address_space *spacerw = (address_space *)space;
if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (rhandler != NULL)
space_map_range(spacerw, ROW_READ, 32, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
if (whandler != NULL)
@@ -1321,9 +1316,9 @@ UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart,
{
address_space *spacerw = (address_space *)space;
if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (rhandler != NULL)
space_map_range(spacerw, ROW_READ, 64, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
if (whandler != NULL)
@@ -1342,9 +1337,9 @@ UINT8 *_memory_install_device_handler8(const address_space *space, const device_
{
address_space *spacerw = (address_space *)space;
if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag, space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag, space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (rhandler != NULL)
space_map_range(spacerw, ROW_READ, 8, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
if (whandler != NULL)
@@ -1363,9 +1358,9 @@ UINT16 *_memory_install_device_handler16(const address_space *space, const devic
{
address_space *spacerw = (address_space *)space;
if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag, space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag, space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (rhandler != NULL)
space_map_range(spacerw, ROW_READ, 16, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
if (whandler != NULL)
@@ -1384,9 +1379,9 @@ UINT32 *_memory_install_device_handler32(const address_space *space, const devic
{
address_space *spacerw = (address_space *)space;
if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag, space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag, space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (rhandler != NULL)
space_map_range(spacerw, ROW_READ, 32, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
if (whandler != NULL)
@@ -1405,9 +1400,9 @@ UINT64 *_memory_install_device_handler64(const address_space *space, const devic
{
address_space *spacerw = (address_space *)space;
if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag, space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
- fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag, space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
if (rhandler != NULL)
space_map_range(spacerw, ROW_READ, 64, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
if (whandler != NULL)
@@ -1440,18 +1435,18 @@ void _memory_install_port(const address_space *space, offs_t addrstart, offs_t a
/* assign the read handler */
if (rtag != NULL)
{
- const input_port_config *port = input_port_by_tag(&space->machine->portlist, rtag);
+ const input_port_config *port = space->machine->port(rtag);
if (port == NULL)
- fatalerror("Attempted to map non-existent port '%s' for read in space %s of device '%s'\n", rtag, space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to map non-existent port '%s' for read in space %s of device '%s'\n", rtag, space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
space_map_range(spacerw, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, rhandler, (void *)port, rtag);
}
/* assign the write handler */
if (wtag != NULL)
{
- const input_port_config *port = input_port_by_tag(&space->machine->portlist, wtag);
+ const input_port_config *port = space->machine->port(wtag);
if (port == NULL)
- fatalerror("Attempted to map non-existent port '%s' for write in space %s of device '%s'\n", wtag, space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to map non-existent port '%s' for write in space %s of device '%s'\n", wtag, space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
space_map_range(spacerw, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, whandler, (void *)port, wtag);
}
@@ -1682,13 +1677,13 @@ void memory_dump(running_machine *machine, FILE *file)
fprintf(file, "\n\n"
"====================================================\n"
"Device '%s' %s address space read handler dump\n"
- "====================================================\n", space->cpu->tag, space->name);
+ "====================================================\n", space->cpu->tag.cstr(), space->name);
dump_map(file, space, &space->read);
fprintf(file, "\n\n"
"====================================================\n"
"Device '%s' %s address space write handler dump\n"
- "====================================================\n", space->cpu->tag, space->name);
+ "====================================================\n", space->cpu->tag.cstr(), space->name);
dump_map(file, space, &space->read);
}
}
@@ -1868,9 +1863,9 @@ static void memory_init_preflight(running_machine *machine)
/* validate the region */
if (base == NULL)
- fatalerror("Error: device '%s' %s space memory map entry %X-%X references non-existant region \"%s\"", space->cpu->tag, space->name, entry->addrstart, entry->addrend, entry->region);
+ fatalerror("Error: device '%s' %s space memory map entry %X-%X references non-existant region \"%s\"", space->cpu->tag.cstr(), space->name, entry->addrstart, entry->addrend, entry->region);
if (entry->rgnoffs + (entry->byteend - entry->bytestart + 1) > length)
- fatalerror("Error: device '%s' %s space memory map entry %X-%X extends beyond region \"%s\" size (%X)", space->cpu->tag, space->name, entry->addrstart, entry->addrend, entry->region, length);
+ fatalerror("Error: device '%s' %s space memory map entry %X-%X extends beyond region \"%s\" size (%X)", space->cpu->tag.cstr(), space->name, entry->addrstart, entry->addrend, entry->region, length);
}
/* convert any region-relative entries to their memory pointers */
@@ -1995,7 +1990,7 @@ static void memory_init_map_entry(address_space *space, const address_map_entry
case AMH_DEVICE_HANDLER:
device = devtag_get_device(space->machine, handler->tag);
if (device == NULL)
- fatalerror("Attempted to map a non-existent device '%s' in space %s of device '%s'\n", handler->tag, space->name, (space->cpu != NULL) ? space->cpu->tag : "??");
+ fatalerror("Attempted to map a non-existent device '%s' in space %s of device '%s'\n", handler->tag, space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
switch ((handler->bits != 0) ? handler->bits : space->dbits)
{
case 8:
@@ -2202,12 +2197,6 @@ static void memory_exit(running_machine *machine)
if (space->map != NULL)
address_map_free(space->map);
}
-
- /* free the maps */
- if (memdata->bankmap != NULL)
- tagmap_free(memdata->bankmap);
- if (memdata->sharemap != NULL)
- tagmap_free(memdata->sharemap);
}
@@ -2384,7 +2373,7 @@ static void map_detokenize(memory_private *memdata, address_map *map, const game
check_entry_field(share);
entry->share = TOKEN_GET_STRING(tokens);
if (memdata != NULL)
- tagmap_add(memdata->sharemap, entry->share, UNMAPPED_SHARE_PTR, FALSE);
+ memdata->sharemap.add(entry->share, UNMAPPED_SHARE_PTR, FALSE);
break;
case ADDRMAP_TOKEN_BASEPTR:
@@ -2520,7 +2509,7 @@ static void *space_find_backing_memory(const address_space *space, offs_t addrst
address_map_entry *entry;
memory_block *block;
- VPRINTF(("space_find_backing_memory('%s',%s,%08X-%08X) -> ", space->cpu->tag, space->name, bytestart, byteend));
+ VPRINTF(("space_find_backing_memory('%s',%s,%08X-%08X) -> ", space->cpu->tag.cstr(), space->name, bytestart, byteend));
/* look in the address map first */
for (entry = space->map->entrylist; entry != NULL; entry = entry->next)
@@ -2600,7 +2589,7 @@ static genf *bank_find_or_allocate(const address_space *space, const char *tag,
/* if this bank is named, look it up */
if (tag != NULL)
- bank = (bank_info *)tagmap_find_hash_only(memdata->bankmap, tag);
+ bank = memdata->bankmap.find_hash_only(tag);
/* else try to find an exact match */
else
@@ -2654,7 +2643,7 @@ static genf *bank_find_or_allocate(const address_space *space, const char *tag,
/* for named banks, add to the map and register for save states */
if (tag[0] != '~')
{
- tagmap_add_unique_hash(memdata->bankmap, tag, bank, FALSE);
+ memdata->bankmap.add_unique_hash(tag, bank, FALSE);
if (state_save_registration_allowed(space->machine))
state_save_register_item(space->machine, "memory", bank->tag, 0, bank->curentry);
}
@@ -3350,7 +3339,7 @@ static void *block_allocate(const address_space *space, offs_t bytestart, offs_t
size_t bytestoalloc;
const char *region;
- VPRINTF(("block_allocate('%s',%s,%08X,%08X,%p)\n", space->cpu->tag, space->name, bytestart, byteend, memory));
+ VPRINTF(("block_allocate('%s',%s,%08X,%08X,%p)\n", space->cpu->tag.cstr(), space->name, bytestart, byteend, memory));
/* determine how much memory to allocate for this */
bytestoalloc = sizeof(*block);
@@ -3415,7 +3404,7 @@ static address_map_entry *block_assign_intersecting(address_space *space, offs_t
/* if we haven't assigned this block yet, see if we have a mapped shared pointer for it */
if (entry->memory == NULL && entry->share != NULL)
{
- void *shareptr = tagmap_find(memdata->sharemap, entry->share);
+ void *shareptr = memdata->sharemap.find(entry->share);
if (shareptr != UNMAPPED_SHARE_PTR)
{
entry->memory = shareptr;
@@ -3433,9 +3422,9 @@ static address_map_entry *block_assign_intersecting(address_space *space, offs_t
/* if we're the first match on a shared pointer, assign it now */
if (entry->memory != NULL && entry->share != NULL)
{
- void *shareptr = tagmap_find(memdata->sharemap, entry->share);
+ void *shareptr = memdata->sharemap.find(entry->share);
if (shareptr == UNMAPPED_SHARE_PTR)
- tagmap_add(memdata->sharemap, entry->share, entry->memory, TRUE);
+ memdata->sharemap.add(entry->share, entry->memory, TRUE);
}
/* keep track of the first unassigned entry */
diff --git a/src/emu/memory.h b/src/emu/memory.h
index 66fbe8a63dc..0ef3ae106b1 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -11,13 +11,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __MEMORY_H__
#define __MEMORY_H__
-#include "emucore.h"
-#include "tokenize.h"
-#include "astring.h"
-
/***************************************************************************
@@ -85,6 +85,11 @@ enum
TYPE DEFINITIONS
***************************************************************************/
+/* referenced types from other classes */
+class device_config;
+struct game_driver;
+
+
/* handler_data and subtable_data are opaque types used to hold information about a particular handler */
typedef struct _handler_data handler_data;
typedef struct _subtable_data subtable_data;
diff --git a/src/emu/output.c b/src/emu/output.c
index 86bba23e363..2ea6fe6d19e 100644
--- a/src/emu/output.c
+++ b/src/emu/output.c
@@ -9,8 +9,7 @@
***************************************************************************/
-#include "output.h"
-#include "mame.h"
+#include "emu.h"
#include <zlib.h>
diff --git a/src/emu/output.h b/src/emu/output.h
index d0dff350d8f..308d5c764c7 100644
--- a/src/emu/output.h
+++ b/src/emu/output.h
@@ -11,11 +11,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __OUTPUT_H__
#define __OUTPUT_H__
-#include "emucore.h"
-
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/emu/profiler.c b/src/emu/profiler.c
index 374afa45478..33f1e30f25c 100644
--- a/src/emu/profiler.c
+++ b/src/emu/profiler.c
@@ -9,8 +9,7 @@
***************************************************************************/
-#include "osdepend.h"
-#include "driver.h"
+#include "emu.h"
#include "profiler.h"
@@ -187,7 +186,7 @@ astring &_profiler_get_text(running_machine *machine, astring &string)
/* and then the text */
if (curtype >= PROFILER_CPU_FIRST && curtype <= PROFILER_CPU_MAX)
- string.catprintf("CPU '%s'", device_list_find_by_index(&machine->config->devicelist, CPU, curtype - PROFILER_CPU_FIRST)->tag);
+ string.catprintf("CPU '%s'", device_list_find_by_index(&machine->config->devicelist, CPU, curtype - PROFILER_CPU_FIRST)->tag.cstr());
else
for (nameindex = 0; nameindex < ARRAY_LENGTH(names); nameindex++)
if (names[nameindex].type == curtype)
diff --git a/src/emu/profiler.h b/src/emu/profiler.h
index a6a24b79013..216e1e0f783 100644
--- a/src/emu/profiler.h
+++ b/src/emu/profiler.h
@@ -24,7 +24,6 @@
#ifndef __PROFILER_H__
#define __PROFILER_H__
-#include "astring.h"
/***************************************************************************
diff --git a/src/emu/render.c b/src/emu/render.c
index 4f3a21d894f..50a39891841 100644
--- a/src/emu/render.c
+++ b/src/emu/render.c
@@ -37,12 +37,13 @@
***************************************************************************/
+#include "emu.h"
+#include "emuopts.h"
#include "render.h"
#include "rendfont.h"
#include "rendlay.h"
#include "rendutil.h"
#include "config.h"
-#include "output.h"
#include "xmlfile.h"
@@ -92,7 +93,6 @@ enum
***************************************************************************/
/* typedef struct _render_texture render_texture; -- defined in render.h */
-/* typedef struct _render_target render_target; -- defined in render.h */
/* typedef struct _render_container render_container; -- defined in render.h */
typedef struct _object_transform object_transform;
typedef struct _scaled_texture scaled_texture;
@@ -144,8 +144,9 @@ struct _render_texture
/* a render_target describes a surface that is being rendered to */
-struct _render_target
+class render_target
{
+public:
render_target * next; /* keep a linked list of targets */
running_machine * machine; /* pointer to the machine we are connected with */
layout_view * curview; /* current view */
diff --git a/src/emu/render.h b/src/emu/render.h
index a2b62768b80..a690cc45842 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -178,7 +178,7 @@ typedef void (*texture_scaler_func)(bitmap_t *dest, const bitmap_t *source, cons
-------------------------------------------------*/
typedef struct _render_container render_container;
-typedef struct _render_target render_target;
+class render_target;
typedef struct _render_texture render_texture;
typedef struct _render_font render_font;
typedef struct _render_ref render_ref;
diff --git a/src/emu/rendfont.c b/src/emu/rendfont.c
index a14ce310085..1383734adee 100644
--- a/src/emu/rendfont.c
+++ b/src/emu/rendfont.c
@@ -9,8 +9,10 @@
***************************************************************************/
+#include "emu.h"
#include "rendfont.h"
#include "rendutil.h"
+#include "emuopts.h"
#include "zlib.h"
#include "uismall.fh"
diff --git a/src/emu/rendfont.h b/src/emu/rendfont.h
index 1932f2e280e..36445c248b8 100644
--- a/src/emu/rendfont.h
+++ b/src/emu/rendfont.h
@@ -13,7 +13,6 @@
#define __RENDFONT_H__
#include "render.h"
-#include "unicode.h"
diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c
index 4c4d6b94a47..1bbf8ca92f5 100644
--- a/src/emu/rendlay.c
+++ b/src/emu/rendlay.c
@@ -55,6 +55,9 @@
***************************************************************************/
#include <ctype.h>
+
+#include "emu.h"
+#include "emuopts.h"
#include "render.h"
#include "rendfont.h"
#include "rendlay.h"
diff --git a/src/emu/rendlay.h b/src/emu/rendlay.h
index 95c545d834f..64592fc6d1d 100644
--- a/src/emu/rendlay.h
+++ b/src/emu/rendlay.h
@@ -12,8 +12,6 @@
#ifndef __RENDLAY_H__
#define __RENDLAY_H__
-#include "driver.h"
-#include "osdepend.h"
#include "render.h"
#include <math.h>
diff --git a/src/emu/rendutil.c b/src/emu/rendutil.c
index eac515c40dc..feee0a9dc4a 100644
--- a/src/emu/rendutil.c
+++ b/src/emu/rendutil.c
@@ -9,6 +9,7 @@
***************************************************************************/
+#include "emu.h"
#include "render.h"
#include "rendutil.h"
#include "png.h"
diff --git a/src/emu/rendutil.h b/src/emu/rendutil.h
index 279276186d7..1331dd1282f 100644
--- a/src/emu/rendutil.h
+++ b/src/emu/rendutil.h
@@ -12,7 +12,6 @@
#ifndef __RENDUTIL_H__
#define __RENDUTIL_H__
-#include "driver.h"
#include "osdepend.h"
#include "render.h"
diff --git a/src/emu/romload.c b/src/emu/romload.c
index 847149810e3..7cd98447a69 100644
--- a/src/emu/romload.c
+++ b/src/emu/romload.c
@@ -9,14 +9,14 @@
*********************************************************************/
+#include "emu.h"
+#include "emuopts.h"
#include "osdepend.h"
-#include "driver.h"
#include "hash.h"
#include "png.h"
#include "harddisk.h"
#include "config.h"
#include "ui.h"
-#include "romload.h"
#define LOG_LOAD 0
@@ -274,7 +274,7 @@ astring &rom_region_name(astring &result, const game_driver *drv, const rom_sour
else
{
const device_config *device = (const device_config *)source;
- result.printf("%s:%s", device->tag, ROMREGION_GETTAG(romp));
+ result.printf("%s:%s", device->tag.cstr(), ROMREGION_GETTAG(romp));
}
return result;
}
diff --git a/src/emu/romload.h b/src/emu/romload.h
index 19eec69ca09..a00ce1a69ac 100644
--- a/src/emu/romload.h
+++ b/src/emu/romload.h
@@ -11,13 +11,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __ROMLOAD_H__
#define __ROMLOAD_H__
-#include "emucore.h"
-#include "chd.h"
-#include "options.h"
-
/***************************************************************************
@@ -126,8 +126,7 @@ enum
typedef struct _rom_source rom_source;
-typedef struct _rom_entry rom_entry;
-struct _rom_entry
+struct rom_entry
{
const char * _name; /* name of the file to load */
const char * _hashdata; /* hashing informations (checksums) */
diff --git a/src/emu/sndintrf.h b/src/emu/sndintrf.h
deleted file mode 100644
index 647d12b9dd0..00000000000
--- a/src/emu/sndintrf.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/***************************************************************************
-
- sndintrf.h
-
- Core sound interface functions and definitions.
-
- Copyright Nicola Salmoria and the MAME Team.
- Visit http://mamedev.org for licensing and usage restrictions.
-
-***************************************************************************/
-
-#pragma once
-
-#ifndef __SNDINTRF_H__
-#define __SNDINTRF_H__
-
-#include "memory.h"
-#include "mame.h"
-#include "state.h"
-#include "sound.h"
-
-
-#endif /* __SNDINTRF_H__ */
diff --git a/src/emu/sound.c b/src/emu/sound.c
index 84f19475ced..fdc627866af 100644
--- a/src/emu/sound.c
+++ b/src/emu/sound.c
@@ -9,13 +9,13 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
+#include "emuopts.h"
#include "osdepend.h"
#include "streams.h"
#include "config.h"
#include "profiler.h"
#include "sound/wavwrite.h"
-#include "sound.h"
@@ -315,9 +315,9 @@ static DEVICE_START( sound )
/* if no state registered for saving, we can't save */
if (num_regs == 0)
{
- logerror("Sound chip '%s' did not register any state to save!\n", device->tag);
+ logerror("Sound chip '%s' did not register any state to save!\n", device->tag.cstr());
if (device->machine->gamedrv->flags & GAME_SUPPORTS_SAVE)
- fatalerror("Sound chip '%s' did not register any state to save!", device->tag);
+ fatalerror("Sound chip '%s' did not register any state to save!", device->tag.cstr());
}
}
@@ -488,7 +488,7 @@ static void route_sound(running_machine *machine)
speaker_info *speakerinfo = get_safe_token(target_device);
/* generate text for the UI */
- tempstring.printf("Speaker '%s': %s '%s'", target_device->tag, device_get_name(sound), sound->tag);
+ tempstring.printf("Speaker '%s': %s '%s'", target_device->tag.cstr(), device_get_name(sound), sound->tag.cstr());
if (numoutputs > 1)
tempstring.catprintf(" Ch.%d", outputnum);
diff --git a/src/emu/sound.h b/src/emu/sound.h
index 08836b5ad57..4dcbc0b47c4 100644
--- a/src/emu/sound.h
+++ b/src/emu/sound.h
@@ -11,11 +11,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __SOUND_H__
#define __SOUND_H__
-#include "driver.h"
-
/***************************************************************************
CONSTANTS
diff --git a/src/emu/sound/2151intf.c b/src/emu/sound/2151intf.c
index b3b25351c52..3916f5fb5c9 100644
--- a/src/emu/sound/2151intf.c
+++ b/src/emu/sound/2151intf.c
@@ -6,7 +6,7 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "fm.h"
#include "2151intf.h"
diff --git a/src/emu/sound/2203intf.c b/src/emu/sound/2203intf.c
index 26349969ddd..88b76fcc4e3 100644
--- a/src/emu/sound/2203intf.c
+++ b/src/emu/sound/2203intf.c
@@ -1,5 +1,5 @@
#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "2203intf.h"
#include "fm.h"
diff --git a/src/emu/sound/2413intf.c b/src/emu/sound/2413intf.c
index f1c111018ea..201235d9909 100644
--- a/src/emu/sound/2413intf.c
+++ b/src/emu/sound/2413intf.c
@@ -4,7 +4,7 @@
****************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "ym2413.h"
#include "2413intf.h"
diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c
index f1a88166168..a66ebc3d043 100644
--- a/src/emu/sound/2608intf.c
+++ b/src/emu/sound/2608intf.c
@@ -11,7 +11,7 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "ay8910.h"
#include "2608intf.h"
diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c
index af84bd12e41..19e425f0523 100644
--- a/src/emu/sound/2610intf.c
+++ b/src/emu/sound/2610intf.c
@@ -11,7 +11,7 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "ay8910.h"
#include "2610intf.h"
@@ -167,7 +167,7 @@ static DEVICE_START( ym2610 )
/* setup adpcm buffers */
pcmbufa = device->region;
pcmsizea = device->regionbytes;
- name.printf("%s.deltat", device->tag);
+ name.printf("%s.deltat", device->tag.cstr());
pcmbufb = (void *)(memory_region(device->machine, name));
pcmsizeb = memory_region_length(device->machine, name);
if (pcmbufb == NULL || pcmsizeb == 0)
diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c
index 85372874c18..745dd08e87d 100644
--- a/src/emu/sound/2612intf.c
+++ b/src/emu/sound/2612intf.c
@@ -11,7 +11,7 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "sound/fm.h"
#include "sound/2612intf.h"
diff --git a/src/emu/sound/262intf.c b/src/emu/sound/262intf.c
index 40f750e49da..c763dcecb2f 100644
--- a/src/emu/sound/262intf.c
+++ b/src/emu/sound/262intf.c
@@ -5,7 +5,7 @@
MAME interface for YMF262 (OPL3) emulator
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "262intf.h"
#include "ymf262.h"
diff --git a/src/emu/sound/3526intf.c b/src/emu/sound/3526intf.c
index 7ec8deecf76..833b9c33a3b 100644
--- a/src/emu/sound/3526intf.c
+++ b/src/emu/sound/3526intf.c
@@ -16,9 +16,8 @@
* NOTES
*
******************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
#include "3526intf.h"
#include "fm.h"
#include "sound/fmopl.h"
diff --git a/src/emu/sound/3812intf.c b/src/emu/sound/3812intf.c
index 321f24c28c7..9487c477e11 100644
--- a/src/emu/sound/3812intf.c
+++ b/src/emu/sound/3812intf.c
@@ -16,9 +16,8 @@
* NOTES
*
******************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
#include "3812intf.h"
#include "fm.h"
#include "sound/fmopl.h"
diff --git a/src/emu/sound/8950intf.c b/src/emu/sound/8950intf.c
index c677bcff9d7..fcf6968447c 100644
--- a/src/emu/sound/8950intf.c
+++ b/src/emu/sound/8950intf.c
@@ -16,9 +16,8 @@
* NOTES
*
******************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
#include "8950intf.h"
#include "fm.h"
#include "sound/fmopl.h"
diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c
index 8757e3c891f..1104c4f7839 100644
--- a/src/emu/sound/aica.c
+++ b/src/emu/sound/aica.c
@@ -11,9 +11,8 @@
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
#include "aica.h"
#include "aicadsp.h"
diff --git a/src/emu/sound/aicadsp.c b/src/emu/sound/aicadsp.c
index 475179cb401..e7332d8124b 100644
--- a/src/emu/sound/aicadsp.c
+++ b/src/emu/sound/aicadsp.c
@@ -1,6 +1,5 @@
#include <math.h>
-#include "sndintrf.h"
-#include "cpuintrf.h"
+#include "emu.h"
#include "aica.h"
#include "aicadsp.h"
diff --git a/src/emu/sound/astrocde.c b/src/emu/sound/astrocde.c
index cea3b6ad936..17a5f50cc47 100644
--- a/src/emu/sound/astrocde.c
+++ b/src/emu/sound/astrocde.c
@@ -39,7 +39,7 @@
***********************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "astrocde.h"
diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c
index 51db7748fe5..cc139197986 100644
--- a/src/emu/sound/ay8910.c
+++ b/src/emu/sound/ay8910.c
@@ -104,10 +104,8 @@ has twice the steps, happening twice as fast.
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
-#include "cpuexec.h"
#include "ay8910.h"
/*************************************
@@ -529,11 +527,11 @@ static void ay8910_write_reg(ay8910_context *psg, int r, int v)
if (psg->portAwrite.write)
devcb_call_write8(&psg->portAwrite, 0, psg->regs[AY_PORTA]);
else
- logerror("warning - write %02x to 8910 '%s' Port A\n",psg->regs[AY_PORTA],psg->device->tag);
+ logerror("warning - write %02x to 8910 '%s' Port A\n",psg->regs[AY_PORTA],psg->device->tag.cstr());
}
else
{
- logerror("warning: write to 8910 '%s' Port A set as input - ignored\n",psg->device->tag);
+ logerror("warning: write to 8910 '%s' Port A set as input - ignored\n",psg->device->tag.cstr());
}
break;
case AY_PORTB:
@@ -542,11 +540,11 @@ static void ay8910_write_reg(ay8910_context *psg, int r, int v)
if (psg->portBwrite.write)
devcb_call_write8(&psg->portBwrite, 0, psg->regs[AY_PORTB]);
else
- logerror("warning - write %02x to 8910 '%s' Port B\n",psg->regs[AY_PORTB],psg->device->tag);
+ logerror("warning - write %02x to 8910 '%s' Port B\n",psg->regs[AY_PORTB],psg->device->tag.cstr());
}
else
{
- logerror("warning: write to 8910 '%s' Port B set as input - ignored\n",psg->device->tag);
+ logerror("warning: write to 8910 '%s' Port B set as input - ignored\n",psg->device->tag.cstr());
}
break;
}
@@ -883,7 +881,7 @@ int ay8910_read_ym(void *chip)
{
case AY_PORTA:
if ((psg->regs[AY_ENABLE] & 0x40) != 0)
- logerror("warning: read from 8910 '%s' Port A set as output\n",psg->device->tag);
+ logerror("warning: read from 8910 '%s' Port A set as output\n",psg->device->tag.cstr());
/*
even if the port is set as output, we still need to return the external
data. Some games, like kidniki, need this to work.
@@ -891,15 +889,15 @@ int ay8910_read_ym(void *chip)
if (psg->portAread.read)
psg->regs[AY_PORTA] = devcb_call_read8(&psg->portAread, 0);
else
- logerror("%s: warning - read 8910 '%s' Port A\n",cpuexec_describe_context(psg->device->machine),psg->device->tag);
+ logerror("%s: warning - read 8910 '%s' Port A\n",cpuexec_describe_context(psg->device->machine),psg->device->tag.cstr());
break;
case AY_PORTB:
if ((psg->regs[AY_ENABLE] & 0x80) != 0)
- logerror("warning: read from 8910 '%s' Port B set as output\n",psg->device->tag);
+ logerror("warning: read from 8910 '%s' Port B set as output\n",psg->device->tag.cstr());
if (psg->portBread.read)
psg->regs[AY_PORTB] = devcb_call_read8(&psg->portBread, 0);
else
- logerror("%s: warning - read 8910 '%s' Port B\n",cpuexec_describe_context(psg->device->machine),psg->device->tag);
+ logerror("%s: warning - read 8910 '%s' Port B\n",cpuexec_describe_context(psg->device->machine),psg->device->tag.cstr());
break;
}
return psg->regs[r];
diff --git a/src/emu/sound/ay8910.h b/src/emu/sound/ay8910.h
index 13c615a255a..d208638ccca 100644
--- a/src/emu/sound/ay8910.h
+++ b/src/emu/sound/ay8910.h
@@ -3,8 +3,6 @@
#ifndef __AY8910_H__
#define __AY8910_H__
-#include "devcb.h"
-
/*
AY-3-8910A: 2 I/O ports
AY-3-8912A: 1 I/O port
diff --git a/src/emu/sound/beep.c b/src/emu/sound/beep.c
index d5479f05366..466f5730def 100644
--- a/src/emu/sound/beep.c
+++ b/src/emu/sound/beep.c
@@ -11,9 +11,9 @@
****************************************************************************/
-#include "sndintrf.h"
-#include "sound/beep.h"
+#include "emu.h"
#include "streams.h"
+#include "sound/beep.h"
#define BEEP_RATE 48000
diff --git a/src/emu/sound/bsmt2000.c b/src/emu/sound/bsmt2000.c
index f1e9825792d..0e3db3535f4 100644
--- a/src/emu/sound/bsmt2000.c
+++ b/src/emu/sound/bsmt2000.c
@@ -13,7 +13,7 @@
#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "bsmt2000.h"
diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c
index 7e6c592493d..7c37ab4b63e 100644
--- a/src/emu/sound/c140.c
+++ b/src/emu/sound/c140.c
@@ -44,7 +44,7 @@ Unmapped registers:
#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "c140.h"
diff --git a/src/emu/sound/c352.c b/src/emu/sound/c352.c
index ce63816c7df..5645e8afaab 100644
--- a/src/emu/sound/c352.c
+++ b/src/emu/sound/c352.c
@@ -13,8 +13,7 @@
Output sample rate is the input clock / 384.
*/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "c352.h"
diff --git a/src/emu/sound/c6280.c b/src/emu/sound/c6280.c
index de6184ee2e9..deca0fff361 100644
--- a/src/emu/sound/c6280.c
+++ b/src/emu/sound/c6280.c
@@ -53,7 +53,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "c6280.h"
@@ -112,7 +112,7 @@ static void c6280_init(const device_config *device, c6280_t *p, double clk, doub
p->device = device;
p->cpudevice = devtag_get_device(device->machine, intf->cpu);
if (p->cpudevice == NULL)
- fatalerror("c6280_init: no CPU found with tag of '%s'\n", device->tag);
+ fatalerror("c6280_init: no CPU found with tag of '%s'\n", device->tag.cstr());
/* Make waveform frequency table */
for(i = 0; i < 4096; i += 1)
diff --git a/src/emu/sound/cdda.c b/src/emu/sound/cdda.c
index 7c99a6aa766..2949ac5c24a 100644
--- a/src/emu/sound/cdda.c
+++ b/src/emu/sound/cdda.c
@@ -3,12 +3,10 @@
Relies on the actual CD logic and reading in cdrom.c.
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "cdrom.h"
#include "cdda.h"
-#include "sound.h"
-#include "driver.h"
typedef struct _cdda_info cdda_info;
struct _cdda_info
diff --git a/src/emu/sound/cdp1863.c b/src/emu/sound/cdp1863.c
index 47927f00e09..d3ec336333f 100644
--- a/src/emu/sound/cdp1863.c
+++ b/src/emu/sound/cdp1863.c
@@ -15,8 +15,7 @@
*/
-#include "driver.h"
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "cpu/cdp1802/cdp1802.h"
#include "cdp1863.h"
diff --git a/src/emu/sound/cdp1864.c b/src/emu/sound/cdp1864.c
index ceac8e3ed5b..9c49db55bc7 100644
--- a/src/emu/sound/cdp1864.c
+++ b/src/emu/sound/cdp1864.c
@@ -22,10 +22,9 @@
*/
-#include "driver.h"
-#include "cdp1864.h"
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
+#include "cdp1864.h"
#include "cpu/cdp1802/cdp1802.h"
/***************************************************************************
diff --git a/src/emu/sound/cdp1864.h b/src/emu/sound/cdp1864.h
index e1ef15511b7..f495966ff61 100644
--- a/src/emu/sound/cdp1864.h
+++ b/src/emu/sound/cdp1864.h
@@ -36,7 +36,6 @@
#ifndef __CDP1864__
#define __CDP1864__
-#include "devcb.h"
/***************************************************************************
PARAMETERS
diff --git a/src/emu/sound/cdp1869.c b/src/emu/sound/cdp1869.c
index 8aa7e5bd833..da9cbf7daaf 100644
--- a/src/emu/sound/cdp1869.c
+++ b/src/emu/sound/cdp1869.c
@@ -1,5 +1,4 @@
-#include "driver.h"
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "cpu/cdp1802/cdp1802.h"
#include "sound/cdp1869.h"
diff --git a/src/emu/sound/cdp1869.h b/src/emu/sound/cdp1869.h
index a3fdfe2dcf9..b340dc9286f 100644
--- a/src/emu/sound/cdp1869.h
+++ b/src/emu/sound/cdp1869.h
@@ -34,7 +34,6 @@
#ifndef __CDP1869__
#define __CDP1869__
-#include "devcb.h"
/***************************************************************************
MACROS / CONSTANTS
diff --git a/src/emu/sound/cem3394.c b/src/emu/sound/cem3394.c
index f01a02230cf..ed969435b70 100644
--- a/src/emu/sound/cem3394.c
+++ b/src/emu/sound/cem3394.c
@@ -11,10 +11,9 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "cem3394.h"
-#include <math.h>
diff --git a/src/emu/sound/dac.c b/src/emu/sound/dac.c
index ccfe6cba39c..3375835fc8e 100644
--- a/src/emu/sound/dac.c
+++ b/src/emu/sound/dac.c
@@ -1,7 +1,6 @@
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "dac.h"
-#include <math.h>
/* default to 4x oversampling */
diff --git a/src/emu/sound/digitalk.c b/src/emu/sound/digitalk.c
index 444ac01d461..e4c65eedc91 100644
--- a/src/emu/sound/digitalk.c
+++ b/src/emu/sound/digitalk.c
@@ -1,5 +1,4 @@
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "digitalk.h"
diff --git a/src/emu/sound/disc_sys.c b/src/emu/sound/disc_sys.c
index be38961ddba..a3687fb0dbc 100644
--- a/src/emu/sound/disc_sys.c
+++ b/src/emu/sound/disc_sys.c
@@ -176,7 +176,7 @@ static DISCRETE_START( dso_csvlog )
log_num = node_module_index(node);
context->sample_num = 0;
- sprintf(context->name, "discrete_%s_%d.csv", node->info->device->tag, log_num);
+ sprintf(context->name, "discrete_%s_%d.csv", node->info->device->tag.cstr(), log_num);
context->csv_file = fopen(context->name, "w");
/* Output some header info */
fprintf(context->csv_file, "\"MAME Discrete System Node Log\"\n");
@@ -220,7 +220,7 @@ static DISCRETE_START( dso_wavelog )
int log_num;
log_num = node_module_index(node);
- sprintf(context->name, "discrete_%s_%d.wav", node->info->device->tag, log_num);
+ sprintf(context->name, "discrete_%s_%d.wav", node->info->device->tag.cstr(), log_num);
context->wavfile = wav_open(context->name, node->info->sample_rate, node->active_inputs/2);
}
diff --git a/src/emu/sound/discrete.c b/src/emu/sound/discrete.c
index 00dd4c16dc3..0204ff62088 100644
--- a/src/emu/sound/discrete.c
+++ b/src/emu/sound/discrete.c
@@ -33,12 +33,11 @@
*
************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "inptport.h"
#include "wavwrite.h"
#include "discrete.h"
-#include "eminline.h"
+
/*************************************
*
@@ -497,7 +496,7 @@ static DEVICE_START( discrete )
info->total_stream_updates = 0;
/* create the logfile */
- sprintf(name, "discrete%s.log", device->tag);
+ sprintf(name, "discrete%s.log", device->tag.cstr());
if (DISCRETE_DEBUGLOG)
info->disclogfile = fopen(name, "w");
diff --git a/src/emu/sound/dmadac.c b/src/emu/sound/dmadac.c
index 5209961d0da..baf3afa1c09 100644
--- a/src/emu/sound/dmadac.c
+++ b/src/emu/sound/dmadac.c
@@ -5,7 +5,7 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "dmadac.h"
diff --git a/src/emu/sound/es5503.c b/src/emu/sound/es5503.c
index a8dbc7794ca..e28cf731aac 100644
--- a/src/emu/sound/es5503.c
+++ b/src/emu/sound/es5503.c
@@ -33,12 +33,9 @@
1.0 (RB) - properly respects the input clock
*/
-#include <math.h>
-#include "sndintrf.h"
-#include "cpuintrf.h"
-#include "es5503.h"
+#include "emu.h"
#include "streams.h"
-#include "state.h"
+#include "es5503.h"
typedef struct
{
diff --git a/src/emu/sound/es5506.c b/src/emu/sound/es5506.c
index 288260bc8a3..ca86ecc933c 100644
--- a/src/emu/sound/es5506.c
+++ b/src/emu/sound/es5506.c
@@ -5,13 +5,8 @@
*
**********************************************************************************************/
-
-#include <math.h>
-
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
-#include "cpuexec.h"
#include "es5506.h"
diff --git a/src/emu/sound/es8712.c b/src/emu/sound/es8712.c
index 8142aea0e29..7508602cb6e 100644
--- a/src/emu/sound/es8712.c
+++ b/src/emu/sound/es8712.c
@@ -12,9 +12,7 @@
**********************************************************************************************/
-#include <math.h>
-
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "es8712.h"
@@ -322,7 +320,7 @@ void es8712_play(const device_config *device)
/* invalid samples go here */
else
{
- logerror("ES871295:'%s' requested to play invalid sample range %06x-%06x\n",device->tag,chip->start,chip->end);
+ logerror("ES871295:'%s' requested to play invalid sample range %06x-%06x\n",device->tag.cstr(),chip->start,chip->end);
if (chip->playing)
{
diff --git a/src/emu/sound/filter.c b/src/emu/sound/filter.c
index 960dd4e3c00..734f17389e4 100644
--- a/src/emu/sound/filter.c
+++ b/src/emu/sound/filter.c
@@ -1,4 +1,4 @@
-#include "sndintrf.h"
+#include "emu.h"
#include "filter.h"
static filter* filter_alloc(void) {
diff --git a/src/emu/sound/flt_rc.c b/src/emu/sound/flt_rc.c
index 786347c73d9..75cac16d8ee 100644
--- a/src/emu/sound/flt_rc.c
+++ b/src/emu/sound/flt_rc.c
@@ -1,4 +1,4 @@
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "flt_rc.h"
diff --git a/src/emu/sound/flt_vol.c b/src/emu/sound/flt_vol.c
index 9ba9aa4b746..2f1d5877439 100644
--- a/src/emu/sound/flt_vol.c
+++ b/src/emu/sound/flt_vol.c
@@ -1,4 +1,4 @@
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "flt_vol.h"
diff --git a/src/emu/sound/fm.c b/src/emu/sound/fm.c
index 2c36d3154e1..203d2402e80 100644
--- a/src/emu/sound/fm.c
+++ b/src/emu/sound/fm.c
@@ -111,18 +111,7 @@
/* YM2610B : PSG:3ch FM:6ch ADPCM(18.5KHz):6ch DeltaT ADPCM:1ch */
/************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <math.h>
-
-#ifndef __RAINE__
-#include "sndintrf.h" /* use M.A.M.E. */
-#else
-#include "deftypes.h" /* use RAINE */
-#include "support.h" /* use RAINE */
-#endif
+#include "emu.h"
#include "fm.h"
diff --git a/src/emu/sound/fm2612.c b/src/emu/sound/fm2612.c
index 8860ea8dc90..a4593e930a8 100644
--- a/src/emu/sound/fm2612.c
+++ b/src/emu/sound/fm2612.c
@@ -122,18 +122,7 @@
/* YM2610B : PSG:3ch FM:6ch ADPCM(18.5KHz):6ch DeltaT ADPCM:1ch */
/************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <math.h>
-
-#ifndef __RAINE__
-#include "sndintrf.h" /* use M.A.M.E. */
-#else
-#include "deftypes.h" /* use RAINE */
-#include "support.h" /* use RAINE */
-#endif
+#include "emu.h"
#include "fm.h"
/* shared function building option */
diff --git a/src/emu/sound/fmopl.c b/src/emu/sound/fmopl.c
index 05812c5f7cd..f2d10ec69ea 100644
--- a/src/emu/sound/fmopl.c
+++ b/src/emu/sound/fmopl.c
@@ -67,8 +67,7 @@ Revision History:
verify volume of the FM part on the Y8950
*/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "ymdeltat.h"
#include "fmopl.h"
diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c
index 3cde4ba0c8a..09a358de25c 100644
--- a/src/emu/sound/gaelco.c
+++ b/src/emu/sound/gaelco.c
@@ -33,8 +33,7 @@ Registers per channel:
***************************************************************************/
-#include "sndintrf.h"
-#include "cpuintrf.h"
+#include "emu.h"
#include "streams.h"
#include "gaelco.h"
#include "wavwrite.h"
diff --git a/src/emu/sound/hc55516.c b/src/emu/sound/hc55516.c
index 99242a30b9e..966e341adba 100644
--- a/src/emu/sound/hc55516.c
+++ b/src/emu/sound/hc55516.c
@@ -6,10 +6,9 @@
*****************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "hc55516.h"
-#include <math.h>
/* 4x oversampling */
diff --git a/src/emu/sound/ics2115.c b/src/emu/sound/ics2115.c
index 7e90da435e7..a24bd88981b 100644
--- a/src/emu/sound/ics2115.c
+++ b/src/emu/sound/ics2115.c
@@ -5,11 +5,8 @@
ics emulation by Elsemi.
*/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
-#include "cpuexec.h"
#include "ics2115.h"
#define ICS2115LOGERROR 0
diff --git a/src/emu/sound/iremga20.c b/src/emu/sound/iremga20.c
index acc1b32d536..b536830ebbd 100644
--- a/src/emu/sound/iremga20.c
+++ b/src/emu/sound/iremga20.c
@@ -25,8 +25,8 @@ Revisions:
- Cleaned up faux x86 assembly.
*********************************************************/
-#include <math.h>
-#include "sndintrf.h"
+
+#include "emu.h"
#include "streams.h"
#include "iremga20.h"
diff --git a/src/emu/sound/k005289.c b/src/emu/sound/k005289.c
index 35b0c8ee362..051eee5289a 100644
--- a/src/emu/sound/k005289.c
+++ b/src/emu/sound/k005289.c
@@ -25,7 +25,7 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "k005289.h"
diff --git a/src/emu/sound/k007232.c b/src/emu/sound/k007232.c
index 903809028c3..2a199394c70 100644
--- a/src/emu/sound/k007232.c
+++ b/src/emu/sound/k007232.c
@@ -23,10 +23,9 @@ added external port callback, and functions to set the volume of the channels
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "k007232.h"
-#include <math.h>
#define KDAC_A_PCM_MAX (2) /* Channels per chip */
diff --git a/src/emu/sound/k051649.c b/src/emu/sound/k051649.c
index 1f8ace78b32..578ca53e925 100644
--- a/src/emu/sound/k051649.c
+++ b/src/emu/sound/k051649.c
@@ -22,7 +22,7 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "k051649.h"
diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c
index 83904ca07a7..651dac7345f 100644
--- a/src/emu/sound/k053260.c
+++ b/src/emu/sound/k053260.c
@@ -4,10 +4,8 @@
*********************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
-#include "cpuexec.h"
#include "k053260.h"
/* 2004-02-28: Fixed ppcm decoding. Games sound much better now.*/
diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c
index 7faac2c8a0b..2a2c7a635b6 100644
--- a/src/emu/sound/k054539.c
+++ b/src/emu/sound/k054539.c
@@ -17,10 +17,9 @@ CHANNEL_DEBUG enables the following keys:
*********************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "k054539.h"
-#include <math.h>
#define CHANNEL_DEBUG 0
#define VERBOSE 0
diff --git a/src/emu/sound/k056800.c b/src/emu/sound/k056800.c
index 8bb57570024..8a43fe05e90 100644
--- a/src/emu/sound/k056800.c
+++ b/src/emu/sound/k056800.c
@@ -6,7 +6,7 @@
***********************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "sound/k056800.h"
typedef struct _k056800_state k056800_state;
diff --git a/src/emu/sound/k056800.h b/src/emu/sound/k056800.h
index 03da1724bbf..739d8039df7 100644
--- a/src/emu/sound/k056800.h
+++ b/src/emu/sound/k056800.h
@@ -7,7 +7,6 @@
#ifndef __K056800_H__
#define __K056800_H__
-#include "devcb.h"
/***************************************************************************
diff --git a/src/emu/sound/msm5205.c b/src/emu/sound/msm5205.c
index c8af8bc95db..8cb6a0c03e7 100644
--- a/src/emu/sound/msm5205.c
+++ b/src/emu/sound/msm5205.c
@@ -14,7 +14,7 @@
* separate MSM5205 emulator form adpcm.c and some fix
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "msm5205.h"
@@ -217,7 +217,7 @@ void msm5205_vclk_w (const device_config *device, int vclk)
if( voice->prescaler != 0 )
{
- logerror("error: msm5205_vclk_w() called with chip = '%s', but VCLK selected master mode\n", device->tag);
+ logerror("error: msm5205_vclk_w() called with chip = '%s', but VCLK selected master mode\n", device->tag.cstr());
}
else
{
diff --git a/src/emu/sound/msm5232.c b/src/emu/sound/msm5232.c
index 4e9e75eecd6..821f85f0a43 100644
--- a/src/emu/sound/msm5232.c
+++ b/src/emu/sound/msm5232.c
@@ -1,6 +1,4 @@
-#include <math.h>
-
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "msm5232.h"
diff --git a/src/emu/sound/multipcm.c b/src/emu/sound/multipcm.c
index 4d554ca2bd7..294137ce4fc 100644
--- a/src/emu/sound/multipcm.c
+++ b/src/emu/sound/multipcm.c
@@ -31,8 +31,7 @@
*
*/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "multipcm.h"
diff --git a/src/emu/sound/n63701x.c b/src/emu/sound/n63701x.c
index 2607ef8575d..2c8eff2669b 100644
--- a/src/emu/sound/n63701x.c
+++ b/src/emu/sound/n63701x.c
@@ -13,7 +13,7 @@ silence compression: '00 nn' must be replaced by nn+1 times '80'.
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "n63701x.h"
diff --git a/src/emu/sound/namco.c b/src/emu/sound/namco.c
index 6d4ae62be26..e6e2c0a55e6 100644
--- a/src/emu/sound/namco.c
+++ b/src/emu/sound/namco.c
@@ -11,7 +11,7 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "namco.h"
diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c
index b2f9d983244..2358a2dd642 100644
--- a/src/emu/sound/nes_apu.c
+++ b/src/emu/sound/nes_apu.c
@@ -44,11 +44,9 @@
*****************************************************************************/
-#include "sndintrf.h"
-#include "cpuexec.h"
+#include "emu.h"
#include "streams.h"
#include "nes_apu.h"
-#include "driver.h"
#include "cpu/m6502/m6502.h"
#include "nes_defs.h"
diff --git a/src/emu/sound/nes_apu.h b/src/emu/sound/nes_apu.h
index 9fbf995ab3d..cda9e93c1ec 100644
--- a/src/emu/sound/nes_apu.h
+++ b/src/emu/sound/nes_apu.h
@@ -26,7 +26,6 @@
#ifndef __NES_APU_H__
#define __NES_APU_H__
-#include "sndintrf.h"
/* AN EXPLANATION
*
diff --git a/src/emu/sound/nile.c b/src/emu/sound/nile.c
index 5bd3136b19b..64d08ecb489 100644
--- a/src/emu/sound/nile.c
+++ b/src/emu/sound/nile.c
@@ -24,10 +24,8 @@
************************************/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
#include "nile.h"
#define NILE_VOICES 8
diff --git a/src/emu/sound/okim6258.c b/src/emu/sound/okim6258.c
index 33028d00de3..e21ec375980 100644
--- a/src/emu/sound/okim6258.c
+++ b/src/emu/sound/okim6258.c
@@ -9,9 +9,7 @@
**********************************************************************************************/
-#include <math.h>
-
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "okim6258.h"
diff --git a/src/emu/sound/okim6295.c b/src/emu/sound/okim6295.c
index 6d3cb0a0dc4..e54c47a2f96 100644
--- a/src/emu/sound/okim6295.c
+++ b/src/emu/sound/okim6295.c
@@ -21,9 +21,7 @@
**********************************************************************************************/
-#include <math.h>
-
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "okim6295.h"
@@ -524,13 +522,13 @@ WRITE8_DEVICE_HANDLER( okim6295_w )
}
else
{
- logerror("OKIM6295:'%s' requested to play sample %02x on non-stopped voice\n",device->tag,info->command);
+ logerror("OKIM6295:'%s' requested to play sample %02x on non-stopped voice\n",device->tag.cstr(),info->command);
}
}
/* invalid samples go here */
else
{
- logerror("OKIM6295:'%s' requested to play invalid sample %02x\n",device->tag,info->command);
+ logerror("OKIM6295:'%s' requested to play invalid sample %02x\n",device->tag.cstr(),info->command);
voice->playing = 0;
}
}
diff --git a/src/emu/sound/okim6376.c b/src/emu/sound/okim6376.c
index 80a14348e04..89368ca252c 100644
--- a/src/emu/sound/okim6376.c
+++ b/src/emu/sound/okim6376.c
@@ -10,9 +10,7 @@
**********************************************************************************************/
-#include <math.h>
-
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "okim6376.h"
@@ -431,7 +429,7 @@ WRITE8_DEVICE_HANDLER( okim6376_w )
}
else
{
- logerror("OKIM6376:'%s' requested to play sample %02x on non-stopped voice\n",device->tag,info->command);
+ logerror("OKIM6376:'%s' requested to play sample %02x on non-stopped voice\n",device->tag.cstr(),info->command);
}
}
}
diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c
index e4e9a10fd7b..47e7e0f0613 100644
--- a/src/emu/sound/pokey.c
+++ b/src/emu/sound/pokey.c
@@ -49,10 +49,8 @@
*
*****************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
-#include "cpuexec.h"
#include "pokey.h"
/*
@@ -807,7 +805,7 @@ static void pokey_potgo(pokey_state *p)
{
int r = devcb_call_read8(&p->pot_r[pot], pot);
- LOG(("POKEY %s pot_r(%d) returned $%02x\n", p->device->tag, pot, r));
+ LOG(("POKEY %s pot_r(%d) returned $%02x\n", p->device->tag.cstr(), pot, r));
if( r != -1 )
{
if (r > 228)
@@ -842,16 +840,16 @@ READ8_DEVICE_HANDLER( pokey_r )
if( p->ALLPOT & (1 << pot) )
{
data = timer_timeelapsed(p->ptimer[pot]).attoseconds / AD_TIME.attoseconds;
- LOG(("POKEY '%s' read POT%d (interpolated) $%02x\n", p->device->tag, pot, data));
+ LOG(("POKEY '%s' read POT%d (interpolated) $%02x\n", p->device->tag.cstr(), pot, data));
}
else
{
data = p->POTx[pot];
- LOG(("POKEY '%s' read POT%d (final value) $%02x\n", p->device->tag, pot, data));
+ LOG(("POKEY '%s' read POT%d (final value) $%02x\n", p->device->tag.cstr(), pot, data));
}
}
else
- logerror("%s: warning - read '%s' POT%d\n", cpuexec_describe_context(p->device->machine), p->device->tag, pot);
+ logerror("%s: warning - read '%s' POT%d\n", cpuexec_describe_context(p->device->machine), p->device->tag.cstr(), pot);
break;
case ALLPOT_C:
@@ -862,17 +860,17 @@ READ8_DEVICE_HANDLER( pokey_r )
if( (p->SKCTL & SK_RESET) == 0)
{
data = 0;
- LOG(("POKEY '%s' ALLPOT internal $%02x (reset)\n", p->device->tag, data));
+ LOG(("POKEY '%s' ALLPOT internal $%02x (reset)\n", p->device->tag.cstr(), data));
}
else if( p->allpot_r.read )
{
data = devcb_call_read8(&p->allpot_r, offset);
- LOG(("POKEY '%s' ALLPOT callback $%02x\n", p->device->tag, data));
+ LOG(("POKEY '%s' ALLPOT callback $%02x\n", p->device->tag.cstr(), data));
}
else
{
data = p->ALLPOT;
- LOG(("POKEY '%s' ALLPOT internal $%02x\n", p->device->tag, data));
+ LOG(("POKEY '%s' ALLPOT internal $%02x\n", p->device->tag.cstr(), data));
}
break;
@@ -900,17 +898,17 @@ READ8_DEVICE_HANDLER( pokey_r )
adjust = 1;
p->r9 = 0;
p->r17 = 0;
- LOG_RAND(("POKEY '%s' rand17 frozen (SKCTL): $%02x\n", p->device->tag, p->RANDOM));
+ LOG_RAND(("POKEY '%s' rand17 frozen (SKCTL): $%02x\n", p->device->tag.cstr(), p->RANDOM));
}
if( p->AUDCTL & POLY9 )
{
p->RANDOM = p->rand9[p->r9];
- LOG_RAND(("POKEY '%s' adjust %u rand9[$%05x]: $%02x\n", p->device->tag, adjust, p->r9, p->RANDOM));
+ LOG_RAND(("POKEY '%s' adjust %u rand9[$%05x]: $%02x\n", p->device->tag.cstr(), adjust, p->r9, p->RANDOM));
}
else
{
p->RANDOM = p->rand17[p->r17];
- LOG_RAND(("POKEY '%s' adjust %u rand17[$%05x]: $%02x\n", p->device->tag, adjust, p->r17, p->RANDOM));
+ LOG_RAND(("POKEY '%s' adjust %u rand17[$%05x]: $%02x\n", p->device->tag.cstr(), adjust, p->r17, p->RANDOM));
}
if (adjust > 0)
timer_adjust_oneshot(p->rtimer, attotime_never, 0);
@@ -921,24 +919,24 @@ READ8_DEVICE_HANDLER( pokey_r )
if( p->serin_r.read )
p->SERIN = devcb_call_read8(&p->serin_r, offset);
data = p->SERIN;
- LOG(("POKEY '%s' SERIN $%02x\n", p->device->tag, data));
+ LOG(("POKEY '%s' SERIN $%02x\n", p->device->tag.cstr(), data));
break;
case IRQST_C:
/* IRQST is an active low input port; we keep it active high */
/* internally to ease the (un-)masking of bits */
data = p->IRQST ^ 0xff;
- LOG(("POKEY '%s' IRQST $%02x\n", p->device->tag, data));
+ LOG(("POKEY '%s' IRQST $%02x\n", p->device->tag.cstr(), data));
break;
case SKSTAT_C:
/* SKSTAT is also an active low input port */
data = p->SKSTAT ^ 0xff;
- LOG(("POKEY '%s' SKSTAT $%02x\n", p->device->tag, data));
+ LOG(("POKEY '%s' SKSTAT $%02x\n", p->device->tag.cstr(), data));
break;
default:
- LOG(("POKEY '%s' register $%02x\n", p->device->tag, offset));
+ LOG(("POKEY '%s' register $%02x\n", p->device->tag.cstr(), offset));
break;
}
return data;
@@ -968,7 +966,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case AUDF1_C:
if( data == p->AUDF[CHAN1] )
return;
- LOG_SOUND(("POKEY '%s' AUDF1 $%02x\n", p->device->tag, data));
+ LOG_SOUND(("POKEY '%s' AUDF1 $%02x\n", p->device->tag.cstr(), data));
p->AUDF[CHAN1] = data;
ch_mask = 1 << CHAN1;
if( p->AUDCTL & CH12_JOINED ) /* if ch 1&2 tied together */
@@ -978,7 +976,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case AUDC1_C:
if( data == p->AUDC[CHAN1] )
return;
- LOG_SOUND(("POKEY '%s' AUDC1 $%02x (%s)\n", p->device->tag, data, audc2str(data)));
+ LOG_SOUND(("POKEY '%s' AUDC1 $%02x (%s)\n", p->device->tag.cstr(), data, audc2str(data)));
p->AUDC[CHAN1] = data;
ch_mask = 1 << CHAN1;
break;
@@ -986,7 +984,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case AUDF2_C:
if( data == p->AUDF[CHAN2] )
return;
- LOG_SOUND(("POKEY '%s' AUDF2 $%02x\n", p->device->tag, data));
+ LOG_SOUND(("POKEY '%s' AUDF2 $%02x\n", p->device->tag.cstr(), data));
p->AUDF[CHAN2] = data;
ch_mask = 1 << CHAN2;
break;
@@ -994,7 +992,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case AUDC2_C:
if( data == p->AUDC[CHAN2] )
return;
- LOG_SOUND(("POKEY '%s' AUDC2 $%02x (%s)\n", p->device->tag, data, audc2str(data)));
+ LOG_SOUND(("POKEY '%s' AUDC2 $%02x (%s)\n", p->device->tag.cstr(), data, audc2str(data)));
p->AUDC[CHAN2] = data;
ch_mask = 1 << CHAN2;
break;
@@ -1002,7 +1000,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case AUDF3_C:
if( data == p->AUDF[CHAN3] )
return;
- LOG_SOUND(("POKEY '%s' AUDF3 $%02x\n", p->device->tag, data));
+ LOG_SOUND(("POKEY '%s' AUDF3 $%02x\n", p->device->tag.cstr(), data));
p->AUDF[CHAN3] = data;
ch_mask = 1 << CHAN3;
@@ -1013,7 +1011,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case AUDC3_C:
if( data == p->AUDC[CHAN3] )
return;
- LOG_SOUND(("POKEY '%s' AUDC3 $%02x (%s)\n", p->device->tag, data, audc2str(data)));
+ LOG_SOUND(("POKEY '%s' AUDC3 $%02x (%s)\n", p->device->tag.cstr(), data, audc2str(data)));
p->AUDC[CHAN3] = data;
ch_mask = 1 << CHAN3;
break;
@@ -1021,7 +1019,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case AUDF4_C:
if( data == p->AUDF[CHAN4] )
return;
- LOG_SOUND(("POKEY '%s' AUDF4 $%02x\n", p->device->tag, data));
+ LOG_SOUND(("POKEY '%s' AUDF4 $%02x\n", p->device->tag.cstr(), data));
p->AUDF[CHAN4] = data;
ch_mask = 1 << CHAN4;
break;
@@ -1029,7 +1027,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case AUDC4_C:
if( data == p->AUDC[CHAN4] )
return;
- LOG_SOUND(("POKEY '%s' AUDC4 $%02x (%s)\n", p->device->tag, data, audc2str(data)));
+ LOG_SOUND(("POKEY '%s' AUDC4 $%02x (%s)\n", p->device->tag.cstr(), data, audc2str(data)));
p->AUDC[CHAN4] = data;
ch_mask = 1 << CHAN4;
break;
@@ -1037,7 +1035,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case AUDCTL_C:
if( data == p->AUDCTL )
return;
- LOG_SOUND(("POKEY '%s' AUDCTL $%02x (%s)\n", p->device->tag, data, audctl2str(data)));
+ LOG_SOUND(("POKEY '%s' AUDCTL $%02x (%s)\n", p->device->tag.cstr(), data, audctl2str(data)));
p->AUDCTL = data;
ch_mask = 15; /* all channels */
/* determine the base multiplier for the 'div by n' calculations */
@@ -1046,7 +1044,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case STIMER_C:
/* first remove any existing timers */
- LOG_TIMER(("POKEY '%s' STIMER $%02x\n", p->device->tag, data));
+ LOG_TIMER(("POKEY '%s' STIMER $%02x\n", p->device->tag.cstr(), data));
timer_adjust_oneshot(p->timer[TIMER1], attotime_never, p->timer_param[TIMER1]);
timer_adjust_oneshot(p->timer[TIMER2], attotime_never, p->timer_param[TIMER2]);
@@ -1064,7 +1062,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
{
if( p->divisor[CHAN2] > 4 )
{
- LOG_TIMER(("POKEY '%s' timer1+2 after %d clocks\n", p->device->tag, p->divisor[CHAN2]));
+ LOG_TIMER(("POKEY '%s' timer1+2 after %d clocks\n", p->device->tag.cstr(), p->divisor[CHAN2]));
/* set timer #1 _and_ #2 event after timer_div clocks of joined CHAN1+CHAN2 */
p->timer_period[TIMER2] = attotime_mul(p->clock_period, p->divisor[CHAN2]);
p->timer_param[TIMER2] = IRQ_TIMR2|IRQ_TIMR1;
@@ -1075,7 +1073,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
{
if( p->divisor[CHAN1] > 4 )
{
- LOG_TIMER(("POKEY '%s' timer1 after %d clocks\n", p->device->tag, p->divisor[CHAN1]));
+ LOG_TIMER(("POKEY '%s' timer1 after %d clocks\n", p->device->tag.cstr(), p->divisor[CHAN1]));
/* set timer #1 event after timer_div clocks of CHAN1 */
p->timer_period[TIMER1] = attotime_mul(p->clock_period, p->divisor[CHAN1]);
p->timer_param[TIMER1] = IRQ_TIMR1;
@@ -1084,7 +1082,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
if( p->divisor[CHAN2] > 4 )
{
- LOG_TIMER(("POKEY '%s' timer2 after %d clocks\n", p->device->tag, p->divisor[CHAN2]));
+ LOG_TIMER(("POKEY '%s' timer2 after %d clocks\n", p->device->tag.cstr(), p->divisor[CHAN2]));
/* set timer #2 event after timer_div clocks of CHAN2 */
p->timer_period[TIMER2] = attotime_mul(p->clock_period, p->divisor[CHAN2]);
p->timer_param[TIMER2] = IRQ_TIMR2;
@@ -1101,7 +1099,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
{
if( p->divisor[CHAN4] > 4 )
{
- LOG_TIMER(("POKEY '%s' timer4 after %d clocks\n", p->device->tag, p->divisor[CHAN4]));
+ LOG_TIMER(("POKEY '%s' timer4 after %d clocks\n", p->device->tag.cstr(), p->divisor[CHAN4]));
/* set timer #4 event after timer_div clocks of CHAN4 */
p->timer_period[TIMER4] = attotime_mul(p->clock_period, p->divisor[CHAN4]);
p->timer_param[TIMER4] = IRQ_TIMR4;
@@ -1113,7 +1111,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
{
if( p->divisor[CHAN4] > 4 )
{
- LOG_TIMER(("POKEY '%s' timer4 after %d clocks\n", p->device->tag, p->divisor[CHAN4]));
+ LOG_TIMER(("POKEY '%s' timer4 after %d clocks\n", p->device->tag.cstr(), p->divisor[CHAN4]));
/* set timer #4 event after timer_div clocks of CHAN4 */
p->timer_period[TIMER4] = attotime_mul(p->clock_period, p->divisor[CHAN4]);
p->timer_param[TIMER4] = IRQ_TIMR4;
@@ -1128,17 +1126,17 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case SKREST_C:
/* reset SKSTAT */
- LOG(("POKEY '%s' SKREST $%02x\n", p->device->tag, data));
+ LOG(("POKEY '%s' SKREST $%02x\n", p->device->tag.cstr(), data));
p->SKSTAT &= ~(SK_FRAME|SK_OVERRUN|SK_KBERR);
break;
case POTGO_C:
- LOG(("POKEY '%s' POTGO $%02x\n", p->device->tag, data));
+ LOG(("POKEY '%s' POTGO $%02x\n", p->device->tag.cstr(), data));
pokey_potgo(p);
break;
case SEROUT_C:
- LOG(("POKEY '%s' SEROUT $%02x\n", p->device->tag, data));
+ LOG(("POKEY '%s' SEROUT $%02x\n", p->device->tag.cstr(), data));
devcb_call_write8(&p->serout_w, offset, data);
p->SKSTAT |= SK_SEROUT;
/*
@@ -1152,7 +1150,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
break;
case IRQEN_C:
- LOG(("POKEY '%s' IRQEN $%02x\n", p->device->tag, data));
+ LOG(("POKEY '%s' IRQEN $%02x\n", p->device->tag.cstr(), data));
/* acknowledge one or more IRQST bits ? */
if( p->IRQST & ~data )
@@ -1178,7 +1176,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
case SKCTL_C:
if( data == p->SKCTL )
return;
- LOG(("POKEY '%s' SKCTL $%02x\n", p->device->tag, data));
+ LOG(("POKEY '%s' SKCTL $%02x\n", p->device->tag.cstr(), data));
p->SKCTL = data;
if( !(data & SK_RESET) )
{
@@ -1206,7 +1204,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
else
new_val = (p->AUDF[CHAN1] + DIVADD_LOCLK) * p->clockmult;
- LOG_SOUND(("POKEY '%s' chan1 %d\n", p->device->tag, new_val));
+ LOG_SOUND(("POKEY '%s' chan1 %d\n", p->device->tag.cstr(), new_val));
p->volume[CHAN1] = (p->AUDC[CHAN1] & VOLUME_MASK) * POKEY_DEFAULT_GAIN;
p->divisor[CHAN1] = new_val;
@@ -1236,12 +1234,12 @@ WRITE8_DEVICE_HANDLER( pokey_w )
new_val = p->AUDF[CHAN2] * 256 + p->AUDF[CHAN1] + DIVADD_HICLK_JOINED;
else
new_val = (p->AUDF[CHAN2] * 256 + p->AUDF[CHAN1] + DIVADD_LOCLK) * p->clockmult;
- LOG_SOUND(("POKEY '%s' chan1+2 %d\n", p->device->tag, new_val));
+ LOG_SOUND(("POKEY '%s' chan1+2 %d\n", p->device->tag.cstr(), new_val));
}
else
{
new_val = (p->AUDF[CHAN2] + DIVADD_LOCLK) * p->clockmult;
- LOG_SOUND(("POKEY '%s' chan2 %d\n", p->device->tag, new_val));
+ LOG_SOUND(("POKEY '%s' chan2 %d\n", p->device->tag.cstr(), new_val));
}
p->volume[CHAN2] = (p->AUDC[CHAN2] & VOLUME_MASK) * POKEY_DEFAULT_GAIN;
@@ -1271,7 +1269,7 @@ WRITE8_DEVICE_HANDLER( pokey_w )
else
new_val = (p->AUDF[CHAN3] + DIVADD_LOCLK) * p->clockmult;
- LOG_SOUND(("POKEY '%s' chan3 %d\n", p->device->tag, new_val));
+ LOG_SOUND(("POKEY '%s' chan3 %d\n", p->device->tag.cstr(), new_val));
p->volume[CHAN3] = (p->AUDC[CHAN3] & VOLUME_MASK) * POKEY_DEFAULT_GAIN;
p->divisor[CHAN3] = new_val;
@@ -1301,12 +1299,12 @@ WRITE8_DEVICE_HANDLER( pokey_w )
new_val = p->AUDF[CHAN4] * 256 + p->AUDF[CHAN3] + DIVADD_HICLK_JOINED;
else
new_val = (p->AUDF[CHAN4] * 256 + p->AUDF[CHAN3] + DIVADD_LOCLK) * p->clockmult;
- LOG_SOUND(("POKEY '%s' chan3+4 %d\n", p->device->tag, new_val));
+ LOG_SOUND(("POKEY '%s' chan3+4 %d\n", p->device->tag.cstr(), new_val));
}
else
{
new_val = (p->AUDF[CHAN4] + DIVADD_LOCLK) * p->clockmult;
- LOG_SOUND(("POKEY '%s' chan4 %d\n", p->device->tag, new_val));
+ LOG_SOUND(("POKEY '%s' chan4 %d\n", p->device->tag.cstr(), new_val));
}
p->volume[CHAN4] = (p->AUDC[CHAN4] & VOLUME_MASK) * POKEY_DEFAULT_GAIN;
diff --git a/src/emu/sound/pokey.h b/src/emu/sound/pokey.h
index 12a68a24438..2e17d8e5e82 100644
--- a/src/emu/sound/pokey.h
+++ b/src/emu/sound/pokey.h
@@ -19,9 +19,6 @@
#ifndef __POKEY_H__
#define __POKEY_H__
-#include "sndintrf.h"
-#include "devcb.h"
-
/* CONSTANT DEFINITIONS */
/* POKEY WRITE LOGICALS */
diff --git a/src/emu/sound/psx.c b/src/emu/sound/psx.c
index 7054c197bc5..b0878cb6c99 100644
--- a/src/emu/sound/psx.c
+++ b/src/emu/sound/psx.c
@@ -8,11 +8,8 @@
***************************************************************************/
-#include <stdarg.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
-#include "cpuexec.h"
#include "psx.h"
#define VERBOSE_LEVEL ( 0 )
diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c
index e01041821a5..931019445d2 100644
--- a/src/emu/sound/qsound.c
+++ b/src/emu/sound/qsound.c
@@ -31,8 +31,7 @@
***************************************************************************/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "qsound.h"
diff --git a/src/emu/sound/rf5c400.c b/src/emu/sound/rf5c400.c
index b6d7342aafd..cd847d7869f 100644
--- a/src/emu/sound/rf5c400.c
+++ b/src/emu/sound/rf5c400.c
@@ -15,7 +15,7 @@
fixed volume table
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "rf5c400.h"
diff --git a/src/emu/sound/rf5c68.c b/src/emu/sound/rf5c68.c
index 2775de83ea6..9e41f9ca225 100644
--- a/src/emu/sound/rf5c68.c
+++ b/src/emu/sound/rf5c68.c
@@ -2,10 +2,9 @@
/* ricoh RF5C68(or clone) PCM controller */
/*********************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "rf5c68.h"
-#include <math.h>
#define NUM_CHANNELS (8)
diff --git a/src/emu/sound/s14001a.c b/src/emu/sound/s14001a.c
index a66e47c1007..63cf0f0c8e6 100644
--- a/src/emu/sound/s14001a.c
+++ b/src/emu/sound/s14001a.c
@@ -230,7 +230,7 @@ and off as it normally does during speech). Once START has gone low-high-low, th
*
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "s14001a.h"
diff --git a/src/emu/sound/saa1099.c b/src/emu/sound/saa1099.c
index 4f2a90afed7..cd19f562f29 100644
--- a/src/emu/sound/saa1099.c
+++ b/src/emu/sound/saa1099.c
@@ -63,12 +63,9 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
-#include "cpuexec.h"
#include "saa1099.h"
-#include <math.h>
#define LEFT 0x00
@@ -343,7 +340,7 @@ WRITE8_DEVICE_HANDLER( saa1099_control_w )
if ((data & 0xff) > 0x1c)
{
/* Error! */
- logerror("%s: (SAA1099 '%s') Unknown register selected\n",cpuexec_describe_context(device->machine), device->tag);
+ logerror("%s: (SAA1099 '%s') Unknown register selected\n",cpuexec_describe_context(device->machine), device->tag.cstr());
}
saa->selected_reg = data & 0x1f;
@@ -429,7 +426,7 @@ WRITE8_DEVICE_HANDLER( saa1099_data_w )
int i;
/* Synch & Reset generators */
- logerror("%s: (SAA1099 '%s') -reg 0x1c- Chip reset\n",cpuexec_describe_context(device->machine), device->tag);
+ logerror("%s: (SAA1099 '%s') -reg 0x1c- Chip reset\n",cpuexec_describe_context(device->machine), device->tag.cstr());
for (i = 0; i < 6; i++)
{
saa->channels[i].level = 0;
@@ -438,7 +435,7 @@ WRITE8_DEVICE_HANDLER( saa1099_data_w )
}
break;
default: /* Error! */
- logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n",cpuexec_describe_context(device->machine), device->tag, reg, data);
+ logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n",cpuexec_describe_context(device->machine), device->tag.cstr(), reg, data);
}
}
diff --git a/src/emu/sound/samples.c b/src/emu/sound/samples.c
index e0413c430bf..611102facf9 100644
--- a/src/emu/sound/samples.c
+++ b/src/emu/sound/samples.c
@@ -1,4 +1,5 @@
-#include "driver.h"
+#include "emu.h"
+#include "emuopts.h"
#include "streams.h"
#include "samples.h"
diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c
index 3cae40a088b..682272d57a9 100644
--- a/src/emu/sound/scsp.c
+++ b/src/emu/sound/scsp.c
@@ -25,10 +25,8 @@
* January 5, 2008 (kingshriek+RB) Working, good-sounding FM, removed obsolete non-USEDSP code.
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
-#include "cpuexec.h"
#include "scsp.h"
#include "scspdsp.h"
diff --git a/src/emu/sound/scspdsp.c b/src/emu/sound/scspdsp.c
index a1261398b77..6beab9db278 100644
--- a/src/emu/sound/scspdsp.c
+++ b/src/emu/sound/scspdsp.c
@@ -1,6 +1,4 @@
-#include <math.h>
-#include "sndintrf.h"
-#include "cpuintrf.h"
+#include "emu.h"
#include "scsp.h"
#include "scspdsp.h"
diff --git a/src/emu/sound/segapcm.c b/src/emu/sound/segapcm.c
index 2999e72c733..62900b6e756 100644
--- a/src/emu/sound/segapcm.c
+++ b/src/emu/sound/segapcm.c
@@ -2,7 +2,7 @@
/* SEGA 16ch 8bit PCM */
/*********************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "segapcm.h"
diff --git a/src/emu/sound/sid.c b/src/emu/sound/sid.c
index 01221310efa..11a966583ea 100644
--- a/src/emu/sound/sid.c
+++ b/src/emu/sound/sid.c
@@ -12,7 +12,7 @@
MOS-8580 R5 combined waveforms recorded by Dennis "Deadman" Lindroos.
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "sidvoice.h"
#include "sidenvel.h"
#include "sid.h"
diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c
index b6c3bc1c6fe..f7ce4e4c07f 100644
--- a/src/emu/sound/sid6581.c
+++ b/src/emu/sound/sid6581.c
@@ -6,7 +6,7 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "sid6581.h"
#include "sid.h"
diff --git a/src/emu/sound/sid6581.h b/src/emu/sound/sid6581.h
index a7964b354db..bf37dcad281 100644
--- a/src/emu/sound/sid6581.h
+++ b/src/emu/sound/sid6581.h
@@ -11,7 +11,6 @@
#ifndef __SID6581_H__
#define __SID6581_H__
-#include "sndintrf.h"
typedef enum
{
diff --git a/src/emu/sound/sidenvel.c b/src/emu/sound/sidenvel.c
index 7fd1d074ac9..d27158783f1 100644
--- a/src/emu/sound/sidenvel.c
+++ b/src/emu/sound/sidenvel.c
@@ -30,8 +30,6 @@
/* */
/*========================================================================= */
-#include <math.h>
-
#include "sidvoice.h"
#include "sid.h"
diff --git a/src/emu/sound/sidvoice.c b/src/emu/sound/sidvoice.c
index 64b2f8df0a2..e6b77f0f517 100644
--- a/src/emu/sound/sidvoice.c
+++ b/src/emu/sound/sidvoice.c
@@ -1,5 +1,3 @@
-#include <math.h>
-
#include "sidvoice.h"
#include "sid.h"
#include "sidenvel.h"
diff --git a/src/emu/sound/sidvoice.h b/src/emu/sound/sidvoice.h
index 81241196275..b5ca75796e7 100644
--- a/src/emu/sound/sidvoice.h
+++ b/src/emu/sound/sidvoice.h
@@ -3,7 +3,6 @@
#ifndef __SIDVOICE_H__
#define __SIDVOICE_H__
-#include "sndintrf.h"
/*
approximation of the sid6581 chip
diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c
index 3216753d47f..8c52b34576a 100644
--- a/src/emu/sound/sn76477.c
+++ b/src/emu/sound/sn76477.c
@@ -27,8 +27,7 @@
*****************************************************************************/
-#include <math.h> /* for pow() */
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "wavwrite.h"
#include "sn76477.h"
@@ -652,7 +651,7 @@ static void log_enable_line(sn76477_state *sn)
"Enabled", "Inhibited"
};
- LOG(1, ("SN76477 '%s': Enable line (9): %d [%s]\n", sn->device->tag, sn->enable, desc[sn->enable]));
+ LOG(1, ("SN76477 '%s': Enable line (9): %d [%s]\n", sn->device->tag.cstr(), sn->enable, desc[sn->enable]));
}
@@ -664,7 +663,7 @@ static void log_mixer_mode(sn76477_state *sn)
"SLF/Noise", "SLF/VCO/Noise", "SLF/VCO", "Inhibit"
};
- LOG(1, ("SN76477 '%s': Mixer mode (25-27): %d [%s]\n", sn->device->tag, sn->mixer_mode, desc[sn->mixer_mode]));
+ LOG(1, ("SN76477 '%s': Mixer mode (25-27): %d [%s]\n", sn->device->tag.cstr(), sn->mixer_mode, desc[sn->mixer_mode]));
}
@@ -675,7 +674,7 @@ static void log_envelope_mode(sn76477_state *sn)
"VCO", "One-Shot", "Mixer Only", "VCO with Alternating Polarity"
};
- LOG(1, ("SN76477 '%s': Envelope mode (1,28): %d [%s]\n", sn->device->tag, sn->envelope_mode, desc[sn->envelope_mode]));
+ LOG(1, ("SN76477 '%s': Envelope mode (1,28): %d [%s]\n", sn->device->tag.cstr(), sn->envelope_mode, desc[sn->envelope_mode]));
}
@@ -686,7 +685,7 @@ static void log_vco_mode(sn76477_state *sn)
"External (Pin 16)", "Internal (SLF)"
};
- LOG(1, ("SN76477 '%s': VCO mode (22): %d [%s]\n", sn->device->tag, sn->vco_mode, desc[sn->vco_mode]));
+ LOG(1, ("SN76477 '%s': VCO mode (22): %d [%s]\n", sn->device->tag.cstr(), sn->vco_mode, desc[sn->vco_mode]));
}
@@ -696,16 +695,16 @@ static void log_one_shot_time(sn76477_state *sn)
{
if (compute_one_shot_cap_charging_rate(sn) > 0)
{
- LOG(1, ("SN76477 '%s': One-shot time (23,24): %.4f sec\n", sn->device->tag, ONE_SHOT_CAP_VOLTAGE_RANGE * (1 / compute_one_shot_cap_charging_rate(sn))));
+ LOG(1, ("SN76477 '%s': One-shot time (23,24): %.4f sec\n", sn->device->tag.cstr(), ONE_SHOT_CAP_VOLTAGE_RANGE * (1 / compute_one_shot_cap_charging_rate(sn))));
}
else
{
- LOG(1, ("SN76477 '%s': One-shot time (23,24): N/A\n", sn->device->tag));
+ LOG(1, ("SN76477 '%s': One-shot time (23,24): N/A\n", sn->device->tag.cstr()));
}
}
else
{
- LOG(1, ("SN76477 '%s': One-shot time (23,24): External (cap = %.2fV)\n", sn->device->tag, sn->one_shot_cap_voltage));
+ LOG(1, ("SN76477 '%s': One-shot time (23,24): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->one_shot_cap_voltage));
}
}
@@ -719,29 +718,29 @@ static void log_slf_freq(sn76477_state *sn)
double charging_time = (1 / compute_slf_cap_charging_rate(sn)) * SLF_CAP_VOLTAGE_RANGE;
double discharging_time = (1 / compute_slf_cap_discharging_rate(sn)) * SLF_CAP_VOLTAGE_RANGE;
- LOG(1, ("SN76477 '%s': SLF frequency (20,21): %.2f Hz\n", sn->device->tag, 1 / (charging_time + discharging_time)));
+ LOG(1, ("SN76477 '%s': SLF frequency (20,21): %.2f Hz\n", sn->device->tag.cstr(), 1 / (charging_time + discharging_time)));
}
else
{
- LOG(1, ("SN76477 '%s': SLF frequency (20,21): N/A\n", sn->device->tag));
+ LOG(1, ("SN76477 '%s': SLF frequency (20,21): N/A\n", sn->device->tag.cstr()));
}
}
else
{
- LOG(1, ("SN76477 '%s': SLF frequency (20,21): External (cap = %.2fV)\n", sn->device->tag, sn->slf_cap_voltage));
+ LOG(1, ("SN76477 '%s': SLF frequency (20,21): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->slf_cap_voltage));
}
}
static void log_vco_pitch_voltage(sn76477_state *sn)
{
- LOG(1, ("SN76477 '%s': VCO pitch voltage (19): %.2fV\n", sn->device->tag, sn->pitch_voltage));
+ LOG(1, ("SN76477 '%s': VCO pitch voltage (19): %.2fV\n", sn->device->tag.cstr(), sn->pitch_voltage));
}
static void log_vco_duty_cycle(sn76477_state *sn)
{
- LOG(1, ("SN76477 '%s': VCO duty cycle (16,19): %.0f%%\n", sn->device->tag, compute_vco_duty_cycle(sn) * 100.0));
+ LOG(1, ("SN76477 '%s': VCO duty cycle (16,19): %.0f%%\n", sn->device->tag.cstr(), compute_vco_duty_cycle(sn) * 100.0));
}
@@ -754,16 +753,16 @@ static void log_vco_freq(sn76477_state *sn)
double min_freq = compute_vco_cap_charging_discharging_rate(sn) / (2 * VCO_CAP_VOLTAGE_RANGE);
double max_freq = compute_vco_cap_charging_discharging_rate(sn) / (2 * VCO_TO_SLF_VOLTAGE_DIFF);
- LOG(1, ("SN76477 '%s': VCO frequency (17,18): %.2f Hz - %.1f Hz\n", sn->device->tag, min_freq, max_freq));
+ LOG(1, ("SN76477 '%s': VCO frequency (17,18): %.2f Hz - %.1f Hz\n", sn->device->tag.cstr(), min_freq, max_freq));
}
else
{
- LOG(1, ("SN76477 '%s': VCO frequency (17,18): N/A\n", sn->device->tag));
+ LOG(1, ("SN76477 '%s': VCO frequency (17,18): N/A\n", sn->device->tag.cstr()));
}
}
else
{
- LOG(1, ("SN76477 '%s': VCO frequency (17,18): External (cap = %.2fV)\n", sn->device->tag, sn->vco_cap_voltage));
+ LOG(1, ("SN76477 '%s': VCO frequency (17,18): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->vco_cap_voltage));
}
}
@@ -775,13 +774,13 @@ static void log_vco_ext_voltage(sn76477_state *sn)
double min_freq = compute_vco_cap_charging_discharging_rate(sn) / (2 * VCO_CAP_VOLTAGE_RANGE);
double max_freq = compute_vco_cap_charging_discharging_rate(sn) / (2 * VCO_TO_SLF_VOLTAGE_DIFF);
- LOG(1, ("SN76477 '%s': VCO ext. voltage (16): %.2fV (%.2f Hz)\n", sn->device->tag,
+ LOG(1, ("SN76477 '%s': VCO ext. voltage (16): %.2fV (%.2f Hz)\n", sn->device->tag.cstr(),
sn->vco_voltage,
min_freq + ((max_freq - min_freq) * sn->vco_voltage / VCO_MAX_EXT_VOLTAGE)));
}
else
{
- LOG(1, ("SN76477 '%s': VCO ext. voltage (16): %.2fV (saturated, no output)\n", sn->device->tag, sn->vco_voltage));
+ LOG(1, ("SN76477 '%s': VCO ext. voltage (16): %.2fV (saturated, no output)\n", sn->device->tag.cstr(), sn->vco_voltage));
}
}
@@ -790,17 +789,17 @@ static void log_noise_gen_freq(sn76477_state *sn)
{
if (sn->noise_clock_ext)
{
- LOG(1, ("SN76477 '%s': Noise gen frequency (4): External\n", sn->device->tag));
+ LOG(1, ("SN76477 '%s': Noise gen frequency (4): External\n", sn->device->tag.cstr()));
}
else
{
if (compute_noise_gen_freq(sn) > 0)
{
- LOG(1, ("SN76477 '%s': Noise gen frequency (4): %d Hz\n", sn->device->tag, compute_noise_gen_freq(sn)));
+ LOG(1, ("SN76477 '%s': Noise gen frequency (4): %d Hz\n", sn->device->tag.cstr(), compute_noise_gen_freq(sn)));
}
else
{
- LOG(1, ("SN76477 '%s': Noise gen frequency (4): N/A\n", sn->device->tag));
+ LOG(1, ("SN76477 '%s': Noise gen frequency (4): N/A\n", sn->device->tag.cstr()));
}
}
}
@@ -819,21 +818,21 @@ static void log_noise_filter_freq(sn76477_state *sn)
double charging_time = (1 / charging_rate) * NOISE_CAP_VOLTAGE_RANGE;
double discharging_time = (1 / charging_rate) * NOISE_CAP_VOLTAGE_RANGE;
- LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): %.0f Hz\n", sn->device->tag, 1 / (charging_time + discharging_time)));
+ LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): %.0f Hz\n", sn->device->tag.cstr(), 1 / (charging_time + discharging_time)));
}
else
{
- LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): Very Large (Filtering Disabled)\n", sn->device->tag));
+ LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): Very Large (Filtering Disabled)\n", sn->device->tag.cstr()));
}
}
else
{
- LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): N/A\n", sn->device->tag));
+ LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): N/A\n", sn->device->tag.cstr()));
}
}
else
{
- LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): External (cap = %.2fV)\n", sn->device->tag, sn->noise_filter_cap));
+ LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->noise_filter_cap));
}
}
@@ -844,16 +843,16 @@ static void log_attack_time(sn76477_state *sn)
{
if (compute_attack_decay_cap_charging_rate(sn) > 0)
{
- LOG(1, ("SN76477 '%s': Attack time (8,10): %.4f sec\n", sn->device->tag, AD_CAP_VOLTAGE_RANGE * (1 / compute_attack_decay_cap_charging_rate(sn))));
+ LOG(1, ("SN76477 '%s': Attack time (8,10): %.4f sec\n", sn->device->tag.cstr(), AD_CAP_VOLTAGE_RANGE * (1 / compute_attack_decay_cap_charging_rate(sn))));
}
else
{
- LOG(1, ("SN76477 '%s': Attack time (8,10): N/A\n", sn->device->tag));
+ LOG(1, ("SN76477 '%s': Attack time (8,10): N/A\n", sn->device->tag.cstr()));
}
}
else
{
- LOG(1, ("SN76477 '%s': Attack time (8,10): External (cap = %.2fV)\n", sn->device->tag, sn->attack_decay_cap_voltage));
+ LOG(1, ("SN76477 '%s': Attack time (8,10): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->attack_decay_cap_voltage));
}
}
@@ -864,16 +863,16 @@ static void log_decay_time(sn76477_state *sn)
{
if (compute_attack_decay_cap_discharging_rate(sn) > 0)
{
- LOG(1, ("SN76477 '%s': Decay time (7,8): %.4f sec\n", sn->device->tag, AD_CAP_VOLTAGE_RANGE * (1 / compute_attack_decay_cap_discharging_rate(sn))));
+ LOG(1, ("SN76477 '%s': Decay time (7,8): %.4f sec\n", sn->device->tag.cstr(), AD_CAP_VOLTAGE_RANGE * (1 / compute_attack_decay_cap_discharging_rate(sn))));
}
else
{
- LOG(1, ("SN76477 '%s': Decay time (8,10): N/A\n", sn->device->tag));
+ LOG(1, ("SN76477 '%s': Decay time (8,10): N/A\n", sn->device->tag.cstr()));
}
}
else
{
- LOG(1, ("SN76477 '%s': Decay time (7, 8): External (cap = %.2fV)\n", sn->device->tag, sn->attack_decay_cap_voltage));
+ LOG(1, ("SN76477 '%s': Decay time (7, 8): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->attack_decay_cap_voltage));
}
}
@@ -881,7 +880,7 @@ static void log_decay_time(sn76477_state *sn)
static void log_voltage_out(sn76477_state *sn)
{
LOG(1, ("SN76477 '%s': Voltage OUT range (11,12): %.2fV - %.2fV (clips above %.2fV)\n",
- sn->device->tag,
+ sn->device->tag.cstr(),
OUT_CENTER_LEVEL_VOLTAGE + compute_center_to_peak_voltage_out(sn) * out_neg_gain[(int)(AD_CAP_VOLTAGE_MAX * 10)],
OUT_CENTER_LEVEL_VOLTAGE + compute_center_to_peak_voltage_out(sn) * out_pos_gain[(int)(AD_CAP_VOLTAGE_MAX * 10)],
OUT_HIGH_CLIP_THRESHOLD));
@@ -920,10 +919,10 @@ static void open_wav_file(sn76477_state *sn)
{
char wav_file_name[30];
- sprintf(wav_file_name, LOG_WAV_FILE_NAME, sn->device->tag);
+ sprintf(wav_file_name, LOG_WAV_FILE_NAME, sn->device->tag.cstr());
sn->file = wav_open(wav_file_name, sn->sample_rate, 2);
- LOG(1, ("SN76477 '%s': Logging output: %s\n", sn->device->tag, wav_file_name));
+ LOG(1, ("SN76477 '%s': Logging output: %s\n", sn->device->tag.cstr(), wav_file_name));
}
diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c
index fe412057289..0f8a1603e5d 100644
--- a/src/emu/sound/sn76496.c
+++ b/src/emu/sound/sn76496.c
@@ -81,7 +81,7 @@
* Factor out common code so that the SAA1099 can share some code.
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "sn76496.h"
diff --git a/src/emu/sound/snkwave.c b/src/emu/sound/snkwave.c
index 27d1deab1ee..77bd7be31c0 100644
--- a/src/emu/sound/snkwave.c
+++ b/src/emu/sound/snkwave.c
@@ -6,7 +6,7 @@
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "snkwave.h"
diff --git a/src/emu/sound/sp0250.c b/src/emu/sound/sp0250.c
index 2672c6a07f9..61e2ee5bb5c 100644
--- a/src/emu/sound/sp0250.c
+++ b/src/emu/sound/sp0250.c
@@ -16,11 +16,8 @@
Sound quite reasonably already though.
*/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
-#include "cpuexec.h"
#include "sp0250.h"
/*
diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c
index 59137e34a27..130b05990ef 100644
--- a/src/emu/sound/sp0256.c
+++ b/src/emu/sound/sp0256.c
@@ -31,10 +31,8 @@
section of ROM is modified.
*/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
#include "sp0256.h"
#define CLOCK_DIVIDER (7*6*8)
diff --git a/src/emu/sound/sp0256.h b/src/emu/sound/sp0256.h
index a157fa81c89..b5c8ca74ed6 100644
--- a/src/emu/sound/sp0256.h
+++ b/src/emu/sound/sp0256.h
@@ -49,7 +49,6 @@
#ifndef __SP0256_H__
#define __SP0256_H__
-#include "devcb.h"
typedef struct _sp0256_interface sp0256_interface;
struct _sp0256_interface
diff --git a/src/emu/sound/speaker.c b/src/emu/sound/speaker.c
index 4a7e4bd6cb2..569693860af 100644
--- a/src/emu/sound/speaker.c
+++ b/src/emu/sound/speaker.c
@@ -70,7 +70,7 @@
* - Generalise this approach to other DAC-based sound types if susceptible to aliasing
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "speaker.h"
diff --git a/src/emu/sound/st0016.c b/src/emu/sound/st0016.c
index 19519a4756b..e30f172611e 100644
--- a/src/emu/sound/st0016.c
+++ b/src/emu/sound/st0016.c
@@ -3,10 +3,8 @@
sound emulation by R. Belmont, Tomasz Slanina, and David Haywood
************************************/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
#include "st0016.h"
#define VERBOSE (0)
diff --git a/src/emu/sound/t6w28.c b/src/emu/sound/t6w28.c
index 1e4a27218e9..ba83494d6e1 100644
--- a/src/emu/sound/t6w28.c
+++ b/src/emu/sound/t6w28.c
@@ -29,7 +29,7 @@ Offset 0:
***************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "t6w28.h"
diff --git a/src/emu/sound/tiaintf.c b/src/emu/sound/tiaintf.c
index feedcf70333..df97fecbd8b 100644
--- a/src/emu/sound/tiaintf.c
+++ b/src/emu/sound/tiaintf.c
@@ -1,4 +1,4 @@
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "tiaintf.h"
#include "tiasound.h"
diff --git a/src/emu/sound/tiasound.c b/src/emu/sound/tiasound.c
index 7d75d42b05d..43587416208 100644
--- a/src/emu/sound/tiasound.c
+++ b/src/emu/sound/tiasound.c
@@ -39,7 +39,7 @@
/* */
/*****************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "tiaintf.h"
#include "tiasound.h"
diff --git a/src/emu/sound/tms3615.c b/src/emu/sound/tms3615.c
index c5375865a58..185736d956b 100644
--- a/src/emu/sound/tms3615.c
+++ b/src/emu/sound/tms3615.c
@@ -1,4 +1,4 @@
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "tms3615.h"
diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c
index 2846c9cbef0..d7ebd5d550e 100644
--- a/src/emu/sound/tms36xx.c
+++ b/src/emu/sound/tms36xx.c
@@ -1,4 +1,4 @@
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "tms36xx.h"
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index eea5a08e64a..aaaebbcf023 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -60,7 +60,7 @@
***********************************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "tms5110.h"
diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c
index 7e393ebb7aa..d434b517fde 100644
--- a/src/emu/sound/tms5220.c
+++ b/src/emu/sound/tms5220.c
@@ -139,7 +139,7 @@ device), PES Speech adapter (serial port connection)
***********************************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "tms5220.h"
diff --git a/src/emu/sound/tms5220.h b/src/emu/sound/tms5220.h
index 2bf07d9b3f7..024ca089e44 100644
--- a/src/emu/sound/tms5220.h
+++ b/src/emu/sound/tms5220.h
@@ -3,7 +3,6 @@
#ifndef __TMS5220_H__
#define __TMS5220_H__
-#include "devcb.h"
/* clock rate = 80 * output sample rate, */
/* usually 640000 for 8000 Hz sample rate or */
diff --git a/src/emu/sound/upd7759.c b/src/emu/sound/upd7759.c
index be053bb0f78..bc379a92028 100644
--- a/src/emu/sound/upd7759.c
+++ b/src/emu/sound/upd7759.c
@@ -97,9 +97,7 @@
*************************************************************/
-#include <math.h>
-
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "upd7759.h"
diff --git a/src/emu/sound/vlm5030.c b/src/emu/sound/vlm5030.c
index 92a56433f28..720448e5da9 100644
--- a/src/emu/sound/vlm5030.c
+++ b/src/emu/sound/vlm5030.c
@@ -73,7 +73,7 @@ chirp 12-..: vokume 0 : silent
[DAC output value(signed 6bit)] = A9 ? A0..8 : -(A0..8)
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "vlm5030.h"
diff --git a/src/emu/sound/votrax.c b/src/emu/sound/votrax.c
index a988ca8618d..0dbc9ac6d23 100644
--- a/src/emu/sound/votrax.c
+++ b/src/emu/sound/votrax.c
@@ -15,7 +15,7 @@ the variable VotraxBaseFrequency, this is defaulted to 8000
**************************************************************************/
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "samples.h"
#include "votrax.h"
diff --git a/src/emu/sound/vrender0.c b/src/emu/sound/vrender0.c
index bf4057d823b..3472b57d817 100644
--- a/src/emu/sound/vrender0.c
+++ b/src/emu/sound/vrender0.c
@@ -1,6 +1,5 @@
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
#include "vrender0.h"
/***********************************
diff --git a/src/emu/sound/wave.c b/src/emu/sound/wave.c
index fa92069308c..c62a428ce7a 100644
--- a/src/emu/sound/wave.c
+++ b/src/emu/sound/wave.c
@@ -8,7 +8,7 @@
****************************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "streams.h"
#ifdef MESS
#include "messdrv.h"
diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c
index 57582cabf8d..d14cf3e7857 100644
--- a/src/emu/sound/x1_010.c
+++ b/src/emu/sound/x1_010.c
@@ -48,8 +48,7 @@ Registers:
***************************************************************************/
-#include "sndintrf.h"
-#include "cpuintrf.h"
+#include "emu.h"
#include "streams.h"
#include "x1_010.h"
diff --git a/src/emu/sound/ym2151.c b/src/emu/sound/ym2151.c
index 1ce0b07fa95..d6ed7d859e1 100644
--- a/src/emu/sound/ym2151.c
+++ b/src/emu/sound/ym2151.c
@@ -4,9 +4,7 @@
*
******************************************************************************/
-#include <math.h>
-
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "ym2151.h"
diff --git a/src/emu/sound/ym2413.c b/src/emu/sound/ym2413.c
index cb21173c85a..5ea997e2c3c 100644
--- a/src/emu/sound/ym2413.c
+++ b/src/emu/sound/ym2413.c
@@ -37,8 +37,7 @@ to do:
*/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "ym2413.h"
diff --git a/src/emu/sound/ymdeltat.c b/src/emu/sound/ymdeltat.c
index 1dd08fd0042..a4681bdcc9f 100644
--- a/src/emu/sound/ymdeltat.c
+++ b/src/emu/sound/ymdeltat.c
@@ -62,7 +62,7 @@
**
*/
-#include "sndintrf.h"
+#include "emu.h"
#include "ymdeltat.h"
#define YM_DELTAT_DELTA_MAX (24576)
diff --git a/src/emu/sound/ymf262.c b/src/emu/sound/ymf262.c
index 7a9c39c0dbc..f28798097fb 100644
--- a/src/emu/sound/ymf262.c
+++ b/src/emu/sound/ymf262.c
@@ -53,8 +53,7 @@ differences between OPL2 and OPL3 shown in datasheets:
*/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "ymf262.h"
diff --git a/src/emu/sound/ymf271.c b/src/emu/sound/ymf271.c
index 842d63c31e9..7f9d36b1903 100644
--- a/src/emu/sound/ymf271.c
+++ b/src/emu/sound/ymf271.c
@@ -12,8 +12,7 @@
You may read the LGPL at http://www.gnu.org/licenses/lgpl.html
*/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "ymf271.h"
diff --git a/src/emu/sound/ymf271.h b/src/emu/sound/ymf271.h
index 8cb9e339cce..093c096ff2e 100644
--- a/src/emu/sound/ymf271.h
+++ b/src/emu/sound/ymf271.h
@@ -3,7 +3,6 @@
#ifndef __YMF271_H__
#define __YMF271_H__
-#include "devcb.h"
typedef struct _ymf271_interface ymf271_interface;
struct _ymf271_interface
diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c
index 3ea20c7ee04..6061811d027 100644
--- a/src/emu/sound/ymf278b.c
+++ b/src/emu/sound/ymf278b.c
@@ -57,10 +57,8 @@
not being addressed properly, causing pitch fluctuation.
*/
-#include <math.h>
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
-#include "cpuintrf.h"
#include "ymf278b.h"
#define VERBOSE 0
diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c
index 7708a28da57..1e765c920c9 100644
--- a/src/emu/sound/ymz280b.c
+++ b/src/emu/sound/ymz280b.c
@@ -21,9 +21,7 @@
*/
-#include <math.h>
-
-#include "sndintrf.h"
+#include "emu.h"
#include "streams.h"
#include "ymz280b.h"
diff --git a/src/emu/sound/ymz280b.h b/src/emu/sound/ymz280b.h
index f61622b95fc..6709255377f 100644
--- a/src/emu/sound/ymz280b.h
+++ b/src/emu/sound/ymz280b.h
@@ -10,7 +10,6 @@
#ifndef __YMZ280B_H__
#define __YMZ280B_H__
-#include "devcb.h"
typedef struct _ymz280b_interface ymz280b_interface;
struct _ymz280b_interface
diff --git a/src/emu/state.c b/src/emu/state.c
index 7be6eb2b19b..01f6ca18de6 100644
--- a/src/emu/state.c
+++ b/src/emu/state.c
@@ -23,9 +23,7 @@
***************************************************************************/
-#include "driver.h"
-#include "astring.h"
-#include "state.h"
+#include "emu.h"
#include <zlib.h>
diff --git a/src/emu/state.h b/src/emu/state.h
index bb1c5a0ae29..31de65ee824 100644
--- a/src/emu/state.h
+++ b/src/emu/state.h
@@ -11,11 +11,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __STATE_H__
#define __STATE_H__
-#include "emucore.h"
-
/***************************************************************************
diff --git a/src/emu/streams.c b/src/emu/streams.c
index 24bedbf56a6..38cf6dd4427 100644
--- a/src/emu/streams.c
+++ b/src/emu/streams.c
@@ -43,7 +43,7 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "streams.h"
#include "profiler.h"
diff --git a/src/emu/streams.h b/src/emu/streams.h
index 772c01d834b..6f649999b29 100644
--- a/src/emu/streams.h
+++ b/src/emu/streams.h
@@ -12,7 +12,6 @@
#ifndef STREAMS_H
#define STREAMS_H
-#include "emucore.h"
/***************************************************************************
diff --git a/src/emu/tilemap.c b/src/emu/tilemap.c
index 0e895954255..01cf7ad16f7 100644
--- a/src/emu/tilemap.c
+++ b/src/emu/tilemap.c
@@ -9,8 +9,7 @@
***************************************************************************/
-#include "driver.h"
-#include "tilemap.h"
+#include "emu.h"
#include "profiler.h"
diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h
index cd325da30d3..e1070049b9c 100644
--- a/src/emu/tilemap.h
+++ b/src/emu/tilemap.h
@@ -294,12 +294,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __TILEMAP_H__
#define __TILEMAP_H__
-#include "emucore.h"
-#include "drawgfx.h"
-
/***************************************************************************
CONSTANTS
diff --git a/src/emu/timer.c b/src/emu/timer.c
index a62f88b546f..052cc860aae 100644
--- a/src/emu/timer.c
+++ b/src/emu/timer.c
@@ -10,9 +10,8 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
#include "profiler.h"
-#include "timer.h"
/***************************************************************************
diff --git a/src/emu/timer.h b/src/emu/timer.h
index d49dbce15ad..3c01ff312e2 100644
--- a/src/emu/timer.h
+++ b/src/emu/timer.h
@@ -12,13 +12,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __TIMER_H__
#define __TIMER_H__
-#include "emucore.h"
-#include "devintrf.h"
-#include "attotime.h"
-
/***************************************************************************
CONSTANTS
diff --git a/src/emu/ui.c b/src/emu/ui.c
index db385e93171..d0a835d964b 100644
--- a/src/emu/ui.c
+++ b/src/emu/ui.c
@@ -9,8 +9,8 @@
*********************************************************************/
-#include "driver.h"
-#include "osdepend.h"
+#include "emu.h"
+#include "emuopts.h"
#include "video/vector.h"
#include "machine/laserdsc.h"
#include "profiler.h"
@@ -1457,7 +1457,7 @@ static slider_state *slider_init(running_machine *machine)
for (device = machine->firstcpu; device != NULL; device = cpu_next(device))
{
void *param = (void *)device;
- string.printf("Overclock CPU %s", device->tag);
+ string.printf("Overclock CPU %s", device->tag.cstr());
*tailptr = slider_alloc(machine, string, 10, 1000, 2000, 1, slider_overclock, param);
tailptr = &(*tailptr)->next;
}
@@ -1951,7 +1951,7 @@ static char *slider_get_screen_desc(const device_config *screen)
static char descbuf[256];
if (screen_count > 1)
- sprintf(descbuf, "Screen '%s'", screen->tag);
+ sprintf(descbuf, "Screen '%s'", screen->tag.cstr());
else
strcpy(descbuf, "Screen");
@@ -1970,7 +1970,7 @@ static char *slider_get_laserdisc_desc(const device_config *laserdisc)
static char descbuf[256];
if (ldcount > 1)
- sprintf(descbuf, "Laserdisc '%s'", laserdisc->tag);
+ sprintf(descbuf, "Laserdisc '%s'", laserdisc->tag.cstr());
else
strcpy(descbuf, "Laserdisc");
diff --git a/src/emu/ui.h b/src/emu/ui.h
index 1ab46256d0c..f90a958fa60 100644
--- a/src/emu/ui.h
+++ b/src/emu/ui.h
@@ -14,9 +14,7 @@
#ifndef __USRINTRF_H__
#define __USRINTRF_H__
-#include "emucore.h"
#include "render.h"
-#include "unicode.h"
/***************************************************************************
diff --git a/src/emu/uigfx.c b/src/emu/uigfx.c
index b3326df0d3b..1eacbafee91 100644
--- a/src/emu/uigfx.c
+++ b/src/emu/uigfx.c
@@ -9,6 +9,7 @@
*********************************************************************/
+#include "emu.h"
#include "ui.h"
#include "uiinput.h"
#include "render.h"
diff --git a/src/emu/uigfx.h b/src/emu/uigfx.h
index a19188d1007..b87aa6a6e21 100644
--- a/src/emu/uigfx.h
+++ b/src/emu/uigfx.h
@@ -14,7 +14,6 @@
#ifndef __UIGFX_H__
#define __UIGFX_H__
-#include "emucore.h"
/***************************************************************************
diff --git a/src/emu/uiinput.c b/src/emu/uiinput.c
index 03799ae2916..3eddf98a2d2 100644
--- a/src/emu/uiinput.c
+++ b/src/emu/uiinput.c
@@ -9,9 +9,8 @@
***************************************************************************/
+#include "emu.h"
#include "uiinput.h"
-#include "mame.h"
-#include "inptport.h"
#include "profiler.h"
#include "render.h"
diff --git a/src/emu/uiinput.h b/src/emu/uiinput.h
index 75907085fa2..949eae52b9b 100644
--- a/src/emu/uiinput.h
+++ b/src/emu/uiinput.h
@@ -14,9 +14,7 @@
#ifndef __UIINPUT_H__
#define __UIINPUT_H__
-#include "emucore.h"
#include "render.h"
-#include "unicode.h"
/***************************************************************************
diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c
index 93790edbc71..6b24433cca5 100644
--- a/src/emu/uimenu.c
+++ b/src/emu/uimenu.c
@@ -9,13 +9,15 @@
*********************************************************************/
+#include "emu.h"
+#include "emuopts.h"
#include "ui.h"
#include "rendutil.h"
#include "cheat.h"
#include "uiinput.h"
#include "uimenu.h"
#include "audit.h"
-#include "eminline.h"
+#include "crsshair.h"
#ifdef MESS
#include "uimess.h"
diff --git a/src/emu/uimenu.h b/src/emu/uimenu.h
index cbf7a0dbc2b..24ad7d3a9fe 100644
--- a/src/emu/uimenu.h
+++ b/src/emu/uimenu.h
@@ -14,7 +14,6 @@
#ifndef __UIMENU_H__
#define __UIMENU_H__
-#include "emucore.h"
/***************************************************************************
diff --git a/src/emu/validity.c b/src/emu/validity.c
index 628f665e6f6..d810a776ef7 100644
--- a/src/emu/validity.c
+++ b/src/emu/validity.c
@@ -9,16 +9,11 @@
***************************************************************************/
-#include "osdepend.h"
-#include "eminline.h"
-#include "driver.h"
+#include "emu.h"
#include "hash.h"
-#include "unicode.h"
#include "validity.h"
#include <ctype.h>
-#include <stdarg.h>
-#include <zlib.h>
/***************************************************************************
@@ -47,6 +42,10 @@ UINT8 your_ptr64_flag_is_wrong[(int)(5 - sizeof(void *))];
TYPE DEFINITIONS
***************************************************************************/
+typedef tagmap_t<const game_driver *> game_driver_map;
+
+typedef tagmap_t<FPTR> int_map;
+
class region_entry
{
public:
@@ -316,7 +315,7 @@ static int validate_inlines(void)
information
-------------------------------------------------*/
-static int validate_driver(int drivnum, const machine_config *config, tagmap *names, tagmap *descriptions)
+static int validate_driver(int drivnum, const machine_config *config, game_driver_map &names, game_driver_map &descriptions)
{
const game_driver *driver = drivers[drivnum];
const game_driver *clone_of;
@@ -326,17 +325,17 @@ static int validate_driver(int drivnum, const machine_config *config, tagmap *na
enum { NAME_LEN_PARENT = 8, NAME_LEN_CLONE = 16 };
/* check for duplicate names */
- if (tagmap_add(names, driver->name, (void *)driver, FALSE) == TMERR_DUPLICATE)
+ if (names.add(driver->name, driver, FALSE) == TMERR_DUPLICATE)
{
- const game_driver *match = (const game_driver *)tagmap_find(names, driver->name);
+ const game_driver *match = names.find(driver->name);
mame_printf_error("%s: %s is a duplicate name (%s, %s)\n", driver->source_file, driver->name, match->source_file, match->name);
error = TRUE;
}
/* check for duplicate descriptions */
- if (tagmap_add(descriptions, driver->description, (void *)driver, FALSE) == TMERR_DUPLICATE)
+ if (descriptions.add(driver->description, driver, FALSE) == TMERR_DUPLICATE)
{
- const game_driver *match = (const game_driver *)tagmap_find(descriptions, driver->description);
+ const game_driver *match = descriptions.find(driver->description);
mame_printf_error("%s: %s is a duplicate description (%s, %s)\n", driver->source_file, driver->description, match->source_file, match->description);
error = TRUE;
}
@@ -403,7 +402,7 @@ static int validate_driver(int drivnum, const machine_config *config, tagmap *na
validate_roms - validate ROM definitions
-------------------------------------------------*/
-static int validate_roms(int drivnum, const machine_config *config, region_info *rgninfo, tagmap *roms)
+static int validate_roms(int drivnum, const machine_config *config, region_info *rgninfo, game_driver_map &roms)
{
const game_driver *driver = drivers[drivnum];
int bios_flags = 0, last_bios = 0;
@@ -420,9 +419,9 @@ static int validate_roms(int drivnum, const machine_config *config, region_info
{
char romaddr[20];
sprintf(romaddr, "%p", driver->rom);
- if (tagmap_add(roms, romaddr, (void *)driver, FALSE) == TMERR_DUPLICATE)
+ if (roms.add(romaddr, driver, FALSE) == TMERR_DUPLICATE)
{
- const game_driver *match = (const game_driver *)tagmap_find(roms, romaddr);
+ const game_driver *match = roms.find(romaddr);
mame_printf_error("%s: %s uses the same ROM set as (%s, %s)\n", driver->source_file, driver->description, match->source_file, match->name);
error = TRUE;
}
@@ -595,39 +594,39 @@ static int validate_cpu(int drivnum, const machine_config *config)
{
if (video_screen_count(config) == 0)
{
- mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt, but the driver is screenless !\n", driver->source_file, driver->name, device->tag);
+ mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt, but the driver is screenless !\n", driver->source_file, driver->name, device->tag.cstr());
error = TRUE;
}
else if (cpuconfig->vblank_interrupt_screen != NULL && cpuconfig->vblank_interrupts_per_frame != 0)
{
- mame_printf_error("%s: %s cpu '%s' has a new VBLANK interrupt handler with >1 interrupts!\n", driver->source_file, driver->name, device->tag);
+ mame_printf_error("%s: %s cpu '%s' has a new VBLANK interrupt handler with >1 interrupts!\n", driver->source_file, driver->name, device->tag.cstr());
error = TRUE;
}
else if (cpuconfig->vblank_interrupt_screen != NULL && device_list_find_by_tag(&config->devicelist, cpuconfig->vblank_interrupt_screen) == NULL)
{
- mame_printf_error("%s: %s cpu '%s' VBLANK interrupt with a non-existant screen tag (%s)!\n", driver->source_file, driver->name, device->tag, cpuconfig->vblank_interrupt_screen);
+ mame_printf_error("%s: %s cpu '%s' VBLANK interrupt with a non-existant screen tag (%s)!\n", driver->source_file, driver->name, device->tag.cstr(), cpuconfig->vblank_interrupt_screen);
error = TRUE;
}
else if (cpuconfig->vblank_interrupt_screen == NULL && cpuconfig->vblank_interrupts_per_frame == 0)
{
- mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt handler with 0 interrupts!\n", driver->source_file, driver->name, device->tag);
+ mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt handler with 0 interrupts!\n", driver->source_file, driver->name, device->tag.cstr());
error = TRUE;
}
}
else if (cpuconfig->vblank_interrupts_per_frame != 0)
{
- mame_printf_error("%s: %s cpu '%s' has no VBLANK interrupt handler but a non-0 interrupt count is given!\n", driver->source_file, driver->name, device->tag);
+ mame_printf_error("%s: %s cpu '%s' has no VBLANK interrupt handler but a non-0 interrupt count is given!\n", driver->source_file, driver->name, device->tag.cstr());
error = TRUE;
}
if (cpuconfig->timed_interrupt != NULL && cpuconfig->timed_interrupt_period == 0)
{
- mame_printf_error("%s: %s cpu '%s' has a timer interrupt handler with 0 period!\n", driver->source_file, driver->name, device->tag);
+ mame_printf_error("%s: %s cpu '%s' has a timer interrupt handler with 0 period!\n", driver->source_file, driver->name, device->tag.cstr());
error = TRUE;
}
else if (cpuconfig->timed_interrupt == NULL && cpuconfig->timed_interrupt_period != 0)
{
- mame_printf_error("%s: %s cpu '%s' has a no timer interrupt handler but has a non-0 period given!\n", driver->source_file, driver->name, device->tag);
+ mame_printf_error("%s: %s cpu '%s' has a no timer interrupt handler but has a non-0 period given!\n", driver->source_file, driver->name, device->tag.cstr());
error = TRUE;
}
}
@@ -656,7 +655,7 @@ static int validate_display(int drivnum, const machine_config *config)
/* sanity check dimensions */
if ((scrconfig->width <= 0) || (scrconfig->height <= 0))
{
- mame_printf_error("%s: %s screen '%s' has invalid display dimensions\n", driver->source_file, driver->name, device->tag);
+ mame_printf_error("%s: %s screen '%s' has invalid display dimensions\n", driver->source_file, driver->name, device->tag.cstr());
error = TRUE;
}
@@ -668,7 +667,7 @@ static int validate_display(int drivnum, const machine_config *config)
(scrconfig->visarea.max_x >= scrconfig->width) ||
(scrconfig->visarea.max_y >= scrconfig->height))
{
- mame_printf_error("%s: %s screen '%s' has an invalid display area\n", driver->source_file, driver->name, device->tag);
+ mame_printf_error("%s: %s screen '%s' has an invalid display area\n", driver->source_file, driver->name, device->tag.cstr());
error = TRUE;
}
@@ -677,7 +676,7 @@ static int validate_display(int drivnum, const machine_config *config)
scrconfig->format != BITMAP_FORMAT_RGB15 &&
scrconfig->format != BITMAP_FORMAT_RGB32)
{
- mame_printf_error("%s: %s screen '%s' has unsupported format\n", driver->source_file, driver->name, device->tag);
+ mame_printf_error("%s: %s screen '%s' has unsupported format\n", driver->source_file, driver->name, device->tag.cstr());
error = TRUE;
}
if (scrconfig->format == BITMAP_FORMAT_INDEXED16)
@@ -687,7 +686,7 @@ static int validate_display(int drivnum, const machine_config *config)
/* check for zero frame rate */
if (scrconfig->refresh == 0)
{
- mame_printf_error("%s: %s screen '%s' has a zero refresh rate\n", driver->source_file, driver->name, device->tag);
+ mame_printf_error("%s: %s screen '%s' has a zero refresh rate\n", driver->source_file, driver->name, device->tag.cstr());
error = TRUE;
}
}
@@ -823,11 +822,10 @@ static int validate_gfx(int drivnum, const machine_config *config, region_info *
strings
-------------------------------------------------*/
-static int get_defstr_index(tagmap *defstr_map, const char *name, const game_driver *driver, int *error)
+static int get_defstr_index(int_map &defstr_map, const char *name, const game_driver *driver, int *error)
{
/* check for strings that should be DEF_STR */
- void *result = tagmap_find(defstr_map, name);
- FPTR strindex = (FPTR)result;
+ int strindex = defstr_map.find(name);
if (strindex != 0 && name != input_port_string_from_index(strindex) && error != NULL)
{
mame_printf_error("%s: %s must use DEF_STR( %s )\n", driver->source_file, driver->name, name);
@@ -952,7 +950,7 @@ static void validate_analog_input_field(const input_field_config *field, const g
setting
-------------------------------------------------*/
-static void validate_dip_settings(const input_field_config *field, const game_driver *driver, tagmap *defstr_map, int *error)
+static void validate_dip_settings(const input_field_config *field, const game_driver *driver, int_map &defstr_map, int *error)
{
const char *demo_sounds = input_port_string_from_index(INPUT_STRING_Demo_Sounds);
const char *flipscreen = input_port_string_from_index(INPUT_STRING_Flip_Screen);
@@ -1043,7 +1041,7 @@ static void validate_dip_settings(const input_field_config *field, const game_dr
validate_inputs - validate input configuration
-------------------------------------------------*/
-static int validate_inputs(int drivnum, const machine_config *config, tagmap *defstr_map, input_port_list *portlist)
+static int validate_inputs(int drivnum, const machine_config *config, int_map &defstr_map, input_port_list *portlist)
{
const input_port_config *scanport;
const input_port_config *port;
@@ -1197,7 +1195,7 @@ static int validate_sound(int drivnum, const machine_config *config)
for (checkspeak = speaker_output_first(config); checkspeak != NULL; checkspeak = speaker_output_next(checkspeak))
if (checkspeak != curspeak && strcmp(checkspeak->tag, curspeak->tag) == 0)
{
- mame_printf_error("%s: %s has multiple speakers tagged as '%s'\n", driver->source_file, driver->name, checkspeak->tag);
+ mame_printf_error("%s: %s has multiple speakers tagged as '%s'\n", driver->source_file, driver->name, checkspeak->tag.cstr());
error = TRUE;
}
@@ -1205,7 +1203,7 @@ static int validate_sound(int drivnum, const machine_config *config)
for (checksound = sound_first(config); checksound != NULL; checksound = sound_next(checksound))
if (strcmp(curspeak->tag, checksound->tag) == 0)
{
- mame_printf_error("%s: %s has both a speaker and a sound chip tagged as '%s'\n", driver->source_file, driver->name, curspeak->tag);
+ mame_printf_error("%s: %s has both a speaker and a sound chip tagged as '%s'\n", driver->source_file, driver->name, curspeak->tag.cstr());
error = TRUE;
}
}
@@ -1270,7 +1268,7 @@ static int validate_devices(int drivnum, const machine_config *config, const inp
for (scandevice = device_list_first(&config->devicelist, DEVICE_TYPE_WILDCARD); scandevice != device; scandevice = device_list_next(scandevice, DEVICE_TYPE_WILDCARD))
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, device->tag);
+ mame_printf_warning("%s: %s has multiple devices with the tag '%s'\n", driver->source_file, driver->name, device->tag.cstr());
break;
}
@@ -1302,12 +1300,12 @@ static int validate_devices(int drivnum, const machine_config *config, const inp
/* validate the global map parameters */
if (map->spacenum != spacenum)
{
- mame_printf_error("%s: %s device '%s' space %d has address space %d handlers!\n", driver->source_file, driver->name, device->tag, spacenum, map->spacenum);
+ mame_printf_error("%s: %s device '%s' space %d has address space %d handlers!\n", driver->source_file, driver->name, device->tag.cstr(), spacenum, map->spacenum);
error = TRUE;
}
if (map->databits != databus_width)
{
- mame_printf_error("%s: %s device '%s' uses wrong memory handlers for %s space! (width = %d, memory = %08x)\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum], databus_width, map->databits);
+ mame_printf_error("%s: %s device '%s' uses wrong memory handlers for %s space! (width = %d, memory = %08x)\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], databus_width, map->databits);
error = TRUE;
}
@@ -1326,7 +1324,7 @@ static int validate_devices(int drivnum, const machine_config *config, const inp
((entry->read.type != AMH_NONE && scan->read.type != AMH_NONE) ||
(entry->write.type != AMH_NONE && scan->write.type != AMH_NONE)))
{
- mame_printf_warning("%s: %s '%s' %s space has overlapping memory (%X-%X,%d,%d) vs (%X-%X,%d,%d)\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum], entry->addrstart, entry->addrend, entry->read.type, entry->write.type, scan->addrstart, scan->addrend, scan->read.type, scan->write.type);
+ mame_printf_warning("%s: %s '%s' %s space has overlapping memory (%X-%X,%d,%d) vs (%X-%X,%d,%d)\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->read.type, entry->write.type, scan->addrstart, scan->addrend, scan->read.type, scan->write.type);
detected_overlap = TRUE;
break;
}
@@ -1364,7 +1362,7 @@ static int validate_devices(int drivnum, const machine_config *config, const inp
/* stop if we hit an empty */
if (rgninfo->entries[rgnnum].tag == NULL)
{
- mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X references non-existant region '%s'\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region);
+ mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X references non-existant region '%s'\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region);
error = TRUE;
break;
}
@@ -1375,7 +1373,7 @@ static int validate_devices(int drivnum, const machine_config *config, const inp
offs_t length = rgninfo->entries[rgnnum].length;
if (entry->rgnoffs + (byteend - bytestart + 1) > length)
{
- mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X extends beyond region '%s' size (%X)\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region, length);
+ mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X extends beyond region '%s' size (%X)\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region, length);
error = TRUE;
}
break;
@@ -1387,7 +1385,7 @@ static int validate_devices(int drivnum, const machine_config *config, const inp
if ((entry->read.type == AMH_DEVICE_HANDLER && entry->read.tag != NULL && device_list_find_by_tag(&config->devicelist, entry->read.tag) == NULL) ||
(entry->write.type == AMH_DEVICE_HANDLER && entry->write.tag != NULL && device_list_find_by_tag(&config->devicelist, entry->write.tag) == NULL))
{
- mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant device '%s'\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum], entry->write.tag);
+ mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant device '%s'\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], entry->write.tag);
error = TRUE;
}
@@ -1395,7 +1393,7 @@ static int validate_devices(int drivnum, const machine_config *config, const inp
if ((entry->read.type == AMH_PORT && entry->read.tag != NULL && input_port_by_tag(portlist, entry->read.tag) == NULL) ||
(entry->write.type == AMH_PORT && entry->write.tag != NULL && input_port_by_tag(portlist, entry->write.tag) == NULL))
{
- mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant port tag '%s'\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum], entry->read.tag);
+ mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant port tag '%s'\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum], entry->read.tag);
error = TRUE;
}
@@ -1410,12 +1408,12 @@ static int validate_devices(int drivnum, const machine_config *config, const inp
/* if there are base or size members, check that they are within bounds */
if (entry->baseptroffs_plus1 != 0 && (entry->baseptroffs_plus1 - 1) >= config->driver_data_size)
{
- mame_printf_error("%s: %s device '%s' %s space memory map has an out of bounds AM_BASE_MEMBER entry\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum]);
+ mame_printf_error("%s: %s device '%s' %s space memory map has an out of bounds AM_BASE_MEMBER entry\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum]);
error = TRUE;
}
if (entry->sizeptroffs_plus1 != 0 && (entry->sizeptroffs_plus1 - 1) >= config->driver_data_size)
{
- mame_printf_error("%s: %s device '%s' %s space memory map has an out of bounds AM_SIZE_MEMBER entry\n", driver->source_file, driver->name, device->tag, address_space_names[spacenum]);
+ mame_printf_error("%s: %s device '%s' %s space memory map has an out of bounds AM_SIZE_MEMBER entry\n", driver->source_file, driver->name, device->tag.cstr(), address_space_names[spacenum]);
error = TRUE;
}
}
@@ -1453,14 +1451,10 @@ int mame_validitychecks(const game_driver *curdriver)
UINT16 lsbtest;
UINT8 a, b;
- tagmap *names = tagmap_alloc();
- tagmap *descriptions = tagmap_alloc();
- tagmap *roms = tagmap_alloc();
- tagmap *defstr = tagmap_alloc();
-
- /* check for memory */
- if (descriptions == NULL || names == NULL || roms == NULL || defstr == NULL)
- fatalerror("Out of memory for string maps!");
+ game_driver_map names;
+ game_driver_map descriptions;
+ game_driver_map roms;
+ int_map defstr;
/* basic system checks */
a = 0xff;
@@ -1499,7 +1493,7 @@ int mame_validitychecks(const game_driver *curdriver)
{
const char *string = input_port_string_from_index(strnum);
if (string != NULL)
- tagmap_add(defstr, string, (void *)(FPTR)strnum, FALSE);
+ defstr.add(string, strnum, FALSE);
}
prep += get_profile_ticks();
@@ -1586,10 +1580,5 @@ int mame_validitychecks(const game_driver *curdriver)
#endif
#endif
- tagmap_free(defstr);
- tagmap_free(roms);
- tagmap_free(descriptions);
- tagmap_free(names);
-
return error;
}
diff --git a/src/emu/validity.h b/src/emu/validity.h
index 66b512b4249..0fe324c9425 100644
--- a/src/emu/validity.h
+++ b/src/emu/validity.h
@@ -11,8 +11,6 @@
#pragma once
-#include "emucore.h"
-
#ifndef __VALIDITY_H__
#define __VALIDITY_H__
diff --git a/src/emu/video.c b/src/emu/video.c
index 5bc7ec1381d..90c396ec354 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -9,14 +9,15 @@
***************************************************************************/
-#include "driver.h"
+#include "emu.h"
+#include "emuopts.h"
#include "profiler.h"
#include "png.h"
#include "debugger.h"
#include "rendutil.h"
#include "ui.h"
#include "aviio.h"
-#include "video.h"
+#include "crsshair.h"
#include "snap.lh"
@@ -608,7 +609,7 @@ int video_screen_update_partial(const device_config *screen, int scanline)
/* validate arguments */
assert(scanline >= 0);
- LOG_PARTIAL_UPDATES(("Partial: video_screen_update_partial(%s, %d): ", screen->tag, scanline));
+ LOG_PARTIAL_UPDATES(("Partial: video_screen_update_partial(%s, %d): ", screen->tag.cstr(), scanline));
/* these two checks only apply if we're allowed to skip frames */
if (!(screen->machine->config->video_attributes & VIDEO_ALWAYS_UPDATE))
@@ -2073,7 +2074,7 @@ static void create_snapshot_bitmap(const device_config *screen)
/* select the appropriate view in our dummy target */
if (global.snap_native && screen != NULL)
{
- view_index = device_list_index(&screen->machine->config->devicelist, VIDEO_SCREEN, screen->tag);
+ view_index = device_list_index(&screen->machine->config->devicelist, VIDEO_SCREEN, screen->tag.cstr());
assert(view_index != -1);
render_target_set_view(global.snap_target, view_index);
}
@@ -2582,7 +2583,7 @@ static void video_finalize_burnin(const device_config *screen)
/* write the final PNG */
/* compute the name and create the file */
- fname.printf("%s" PATH_SEPARATOR "burnin-%s.png", screen->machine->basename, screen->tag);
+ fname.printf("%s" PATH_SEPARATOR "burnin-%s.png", screen->machine->basename, screen->tag.cstr());
filerr = mame_fopen(SEARCHPATH_SCREENSHOT, fname, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file);
if (filerr == FILERR_NONE)
{
diff --git a/src/emu/video.h b/src/emu/video.h
index 466e214b76e..ed27983d160 100644
--- a/src/emu/video.h
+++ b/src/emu/video.h
@@ -11,14 +11,13 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __VIDEO_H__
#define __VIDEO_H__
-#include "emucore.h"
-#include "devintrf.h"
-#include "timer.h"
-#include "render.h"
-
/***************************************************************************
CONSTANTS
@@ -61,6 +60,10 @@ enum
TYPE DEFINITIONS
***************************************************************************/
+// forward references
+class render_target;
+
+
/*-------------------------------------------------
screen_config - configuration of a single
screen
diff --git a/src/emu/video/generic.h b/src/emu/video/generic.h
index e6f50fff8c1..9a048eb15cc 100644
--- a/src/emu/video/generic.h
+++ b/src/emu/video/generic.h
@@ -14,8 +14,6 @@
#ifndef __VIDEO_GENERIC_H__
#define __VIDEO_GENERIC_H__
-#include "emucore.h"
-
/***************************************************************************
diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c
index f623a34a387..1ba45871490 100644
--- a/src/emu/video/mc6845.c
+++ b/src/emu/video/mc6845.c
@@ -860,7 +860,6 @@ static void common_start(const device_config *device, int device_type)
/* validate arguments */
assert(device != NULL);
- assert(device->tag != NULL);
mc6845->intf = (const mc6845_interface *)device->static_config;
mc6845->device_type = device_type;
diff --git a/src/emu/video/mc6845.h b/src/emu/video/mc6845.h
index 6d9e771280f..73c34365220 100644
--- a/src/emu/video/mc6845.h
+++ b/src/emu/video/mc6845.h
@@ -10,8 +10,6 @@
#ifndef __MC6845__
#define __MC6845__
-#include "devcb.h"
-
#define MC6845 DEVICE_GET_INFO_NAME(mc6845)
#define MC6845_1 DEVICE_GET_INFO_NAME(mc6845_1)
#define R6545_1 DEVICE_GET_INFO_NAME(r6545_1)
diff --git a/src/emu/video/poly.c b/src/emu/video/poly.c
index 995d33aa070..f6ff70959d3 100644
--- a/src/emu/video/poly.c
+++ b/src/emu/video/poly.c
@@ -6,9 +6,9 @@
***************************************************************************/
+#include "driver.h"
#include "poly.h"
#include "eminline.h"
-#include "mame.h"
#include "state.h"
#include <math.h>
diff --git a/src/emu/video/poly.h b/src/emu/video/poly.h
index eb2efd089b6..e6fc8c54fa3 100644
--- a/src/emu/video/poly.h
+++ b/src/emu/video/poly.h
@@ -35,8 +35,6 @@
#ifndef __POLYNEW_H__
#define __POLYNEW_H__
-#include "emucore.h"
-
/***************************************************************************
CONSTANTS
diff --git a/src/emu/video/s2636.h b/src/emu/video/s2636.h
index 0f07d30eb50..d0702ce4f42 100644
--- a/src/emu/video/s2636.h
+++ b/src/emu/video/s2636.h
@@ -7,7 +7,6 @@
#ifndef __S2636_H__
#define __S2636_H__
-#include "devcb.h"
#define S2636_IS_PIXEL_DRAWN(p) (((p) & 0x08) ? TRUE : FALSE)
#define S2636_PIXEL_COLOR(p) ((p) & 0x07)
diff --git a/src/emu/video/saa5050.h b/src/emu/video/saa5050.h
index 91bf6f53c9a..d0f772e2e1c 100644
--- a/src/emu/video/saa5050.h
+++ b/src/emu/video/saa5050.h
@@ -9,8 +9,6 @@
#ifndef __SAA5050_H__
#define __SAA5050_H__
-#include "devcb.h"
-
#define SAA5050_VBLANK 2500
diff --git a/src/emu/video/tms9927.c b/src/emu/video/tms9927.c
index 293ef7b3b66..8b665aa8b9c 100644
--- a/src/emu/video/tms9927.c
+++ b/src/emu/video/tms9927.c
@@ -259,7 +259,6 @@ static DEVICE_START( tms9927 )
/* validate arguments */
assert(device != NULL);
- assert(device->tag != NULL);
tms->intf = (const tms9927_interface *)device->static_config;
diff --git a/src/emu/video/vector.c b/src/emu/video/vector.c
index 0c664e77178..67eb5199892 100644
--- a/src/emu/video/vector.c
+++ b/src/emu/video/vector.c
@@ -30,6 +30,8 @@
*
**************************************************************************** */
+#include "emu.h"
+#include "emuopts.h"
#include "rendutil.h"
#include "vector.h"
diff --git a/src/emu/watchdog.c b/src/emu/watchdog.c
index abe685de2c2..6d0e91b827c 100644
--- a/src/emu/watchdog.c
+++ b/src/emu/watchdog.c
@@ -9,8 +9,7 @@
***************************************************************************/
-#include "driver.h"
-#include "watchdog.h"
+#include "emu.h"
diff --git a/src/emu/watchdog.h b/src/emu/watchdog.h
index de524f2f716..acebfb96818 100644
--- a/src/emu/watchdog.h
+++ b/src/emu/watchdog.h
@@ -11,6 +11,10 @@
#pragma once
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
#ifndef __WATCHDOG_H__
#define __WATCHDOG_H__
diff --git a/src/lib/util/tagmap.h b/src/lib/util/tagmap.h
index b1fd0fee829..a841562caa7 100644
--- a/src/lib/util/tagmap.h
+++ b/src/lib/util/tagmap.h
@@ -67,6 +67,7 @@ typedef enum _tagmap_error tagmap_error;
TYPE DEFINITIONS
***************************************************************************/
+/* an entry in a tagmap */
typedef struct _tagmap_entry tagmap_entry;
struct _tagmap_entry
{
@@ -77,6 +78,7 @@ struct _tagmap_entry
};
+/* base tagmap structure */
typedef struct _tagmap tagmap;
struct _tagmap
{
@@ -102,6 +104,7 @@ void tagmap_free(tagmap *map);
void tagmap_reset(tagmap *map);
+
/* ----- object management ----- */
/* add a new entry to a tagmap */
@@ -116,6 +119,38 @@ void tagmap_remove(tagmap *map, const char *tag);
/***************************************************************************
+ C++ WRAPPERS
+***************************************************************************/
+
+#ifdef __cplusplus
+
+/* derived class for C++ */
+template<class T> class tagmap_t : public tagmap
+{
+private:
+ tagmap_t(const tagmap &);
+ tagmap_t &operator=(const tagmap &);
+
+public:
+ tagmap_t() { memset(table, 0, sizeof(table)); }
+ ~tagmap_t() { reset(); }
+
+ void reset() { tagmap_reset(this); }
+
+ tagmap_error add(const char *tag, T object, bool replace_if_duplicate = false) { return tagmap_add(this, tag, (void *)object, replace_if_duplicate); }
+ tagmap_error add_unique_hash(const char *tag, T object, bool replace_if_duplicate = false) { return tagmap_add_unique_hash(this, tag, (void *)object, replace_if_duplicate); }
+ void remove(const char *tag) { tagmap_remove(this, tag); }
+
+ T find(const char *tag) const { return reinterpret_cast<T>(tagmap_find(this, tag)); }
+ T find(const char *tag, UINT32 hash) const { return reinterpret_cast<T>(tagmap_find_prehashed(this, tag, hash)); }
+ T find_hash_only(const char *tag) const { return reinterpret_cast<T>(tagmap_find_hash_only(this, tag)); }
+};
+
+#endif
+
+
+
+/***************************************************************************
INLINE FUNCTIONS
***************************************************************************/
@@ -141,7 +176,7 @@ INLINE UINT32 tagmap_hash(const char *string)
hash
-------------------------------------------------*/
-INLINE void *tagmap_find_prehashed(tagmap *map, const char *tag, UINT32 fullhash)
+INLINE void *tagmap_find_prehashed(const tagmap *map, const char *tag, UINT32 fullhash)
{
tagmap_entry *entry;
@@ -157,7 +192,7 @@ INLINE void *tagmap_find_prehashed(tagmap *map, const char *tag, UINT32 fullhash
with a tag
-------------------------------------------------*/
-INLINE void *tagmap_find(tagmap *map, const char *tag)
+INLINE void *tagmap_find(const tagmap *map, const char *tag)
{
return tagmap_find_prehashed(map, tag, tagmap_hash(tag));
}
@@ -170,7 +205,7 @@ INLINE void *tagmap_find(tagmap *map, const char *tag)
return a false positive
-------------------------------------------------*/
-INLINE void *tagmap_find_hash_only(tagmap *map, const char *tag)
+INLINE void *tagmap_find_hash_only(const tagmap *map, const char *tag)
{
UINT32 fullhash = tagmap_hash(tag);
tagmap_entry *entry;
diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c
index 2d6584acb1a..9d31d92f865 100644
--- a/src/mame/drivers/btime.c
+++ b/src/mame/drivers/btime.c
@@ -250,7 +250,7 @@ static WRITE8_HANDLER( lnc_w )
else if (offset == 0x9000) { return; } /* AM_NOP */
else if (offset == 0x9002) { audio_command_w(space, 0, data); return; }
else if (offset >= 0xb000 && offset <= 0xb1ff) ;
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
state->rambase[offset] = data;
@@ -270,7 +270,7 @@ static WRITE8_HANDLER( mmonkey_w )
else if (offset == 0x9000) { return; } /* AM_NOP */
else if (offset == 0x9002) { audio_command_w(space, 0, data); return; }
else if (offset >= 0xb000 && offset <= 0xbfff) { mmonkey_protection_w(space, offset - 0xb000, data); return; }
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
state->rambase[offset] = data;
@@ -290,7 +290,7 @@ static WRITE8_HANDLER( btime_w )
else if (offset == 0x4002) btime_video_control_w(space, 0, data);
else if (offset == 0x4003) audio_command_w(space, 0, data);
else if (offset == 0x4004) bnj_scroll1_w(space, 0, data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
state->rambase[offset] = data;
@@ -311,7 +311,7 @@ static WRITE8_HANDLER( tisland_w )
else if (offset == 0x4004) bnj_scroll1_w(space, 0, data);
else if (offset == 0x4005) bnj_scroll2_w(space, 0, data);
// else if (offset == 0x8000) btime_video_control_w(space,0,data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
state->rambase[offset] = data;
@@ -331,7 +331,7 @@ static WRITE8_HANDLER( zoar_w )
else if (offset == 0x9804) bnj_scroll2_w(space, 0, data);
else if (offset == 0x9805) bnj_scroll1_w(space, 0, data);
else if (offset == 0x9806) audio_command_w(space, 0, data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
state->rambase[offset] = data;
@@ -347,7 +347,7 @@ static WRITE8_HANDLER( disco_w )
else if (offset >= 0x8000 && offset <= 0x881f) ;
else if (offset == 0x9a00) audio_command_w(space, 0, data);
else if (offset == 0x9c00) disco_video_control_w(space, 0, data);
- else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), data, offset);
+ else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
state->rambase[offset] = data;
diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c
index a243e689669..06079701d61 100644
--- a/src/mame/drivers/cybertnk.c
+++ b/src/mame/drivers/cybertnk.c
@@ -183,7 +183,7 @@ static UINT16 *tx_vram;
static UINT16 *shared_ram;
static UINT16 *io_ram;
-#define LOG_UNKNOWN_WRITE logerror("unknown io write CPU '%s':%08x 0x%08x 0x%04x & 0x%04x\n", space->cpu->tag, cpu_get_pc(space->cpu), offset*2, data, mem_mask);
+#define LOG_UNKNOWN_WRITE logerror("unknown io write CPU '%s':%08x 0x%08x 0x%04x & 0x%04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset*2, data, mem_mask);
#define IGNORE_MISSING_ROM 1
static TILE_GET_INFO( get_tx_tile_info )
diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c
index 603fa67e46a..af12d080c89 100644
--- a/src/mame/drivers/firefox.c
+++ b/src/mame/drivers/firefox.c
@@ -25,7 +25,6 @@ but requires a special level III player for proper control. Video: CAV. Audio: A
*/
-#include "mame.h"
#include "driver.h"
#include "cpu/m6809/m6809.h"
#include "cpu/m6502/m6502.h"
diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c
index 7ae6619d699..667354579af 100644
--- a/src/mame/drivers/galpani2.c
+++ b/src/mame/drivers/galpani2.c
@@ -276,14 +276,14 @@ static WRITE8_HANDLER( galpani2_coin_lockout_w )
static WRITE8_DEVICE_HANDLER( galpani2_oki1_bank_w )
{
UINT8 *ROM = memory_region(device->machine, "oki1");
- logerror("%s : %s bank %08X\n",cpuexec_describe_context(device->machine),device->tag,data);
+ logerror("%s : %s bank %08X\n",cpuexec_describe_context(device->machine),device->tag.cstr(),data);
memcpy(ROM + 0x30000, ROM + 0x40000 + 0x10000 * (~data & 0xf), 0x10000);
}
static WRITE8_DEVICE_HANDLER( galpani2_oki2_bank_w )
{
okim6295_set_bank_base(device, 0x40000 * (data & 0xf) );
- logerror("%s : %s bank %08X\n",cpuexec_describe_context(device->machine),device->tag,data);
+ logerror("%s : %s bank %08X\n",cpuexec_describe_context(device->machine),device->tag.cstr(),data);
}
diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c
index cc9f842831e..b65ea0671db 100644
--- a/src/mame/drivers/galpani3.c
+++ b/src/mame/drivers/galpani3.c
@@ -527,7 +527,7 @@ GALPANI3_MCU_COM_W(3)
static READ16_HANDLER( galpani3_mcu_status_r )
{
- logerror("cpu '%s' (PC=%06X): read mcu status\n", space->cpu->tag, cpu_get_previouspc(space->cpu));
+ logerror("cpu '%s' (PC=%06X): read mcu status\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu));
return 0;
}
@@ -549,7 +549,7 @@ static READ16_HANDLER( galpani3_regs1_r )
}
default:
- logerror("cpu '%s' (PC=%06X): galpani3_regs1_r %02x %04x\n", space->cpu->tag, cpu_get_previouspc(space->cpu), offset, mem_mask);
+ logerror("cpu '%s' (PC=%06X): galpani3_regs1_r %02x %04x\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu), offset, mem_mask);
break;
}
@@ -574,7 +574,7 @@ static READ16_HANDLER( galpani3_regs2_r )
}
default:
- logerror("cpu '%s' (PC=%06X): galpani3_regs2_r %02x %04x\n", space->cpu->tag, cpu_get_previouspc(space->cpu), offset, mem_mask);
+ logerror("cpu '%s' (PC=%06X): galpani3_regs2_r %02x %04x\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu), offset, mem_mask);
break;
}
@@ -599,7 +599,7 @@ static READ16_HANDLER( galpani3_regs3_r )
}
default:
- logerror("cpu '%s' (PC=%06X): galpani3_regs3_r %02x %04x\n", space->cpu->tag, cpu_get_previouspc(space->cpu), offset, mem_mask);
+ logerror("cpu '%s' (PC=%06X): galpani3_regs3_r %02x %04x\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu), offset, mem_mask);
break;
}
diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c
index 19276a55f1d..b7c89222c4d 100644
--- a/src/mame/drivers/igs011.c
+++ b/src/mame/drivers/igs011.c
@@ -46,8 +46,8 @@ Notes:
***************************************************************************/
-#include "deprecat.h"
#include "driver.h"
+#include "deprecat.h"
#include "cpu/m68000/m68000.h"
#include "sound/okim6295.h"
#include "sound/2413intf.h"
diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c
index cdb5b15cb2d..6fa128b09a1 100644
--- a/src/mame/drivers/jchan.c
+++ b/src/mame/drivers/jchan.c
@@ -286,7 +286,7 @@ JCHAN_MCU_COM_W(3)
static READ16_HANDLER( jchan_mcu_status_r )
{
- logerror("cpu '%s' (PC=%06X): read mcu status\n", space->cpu->tag, cpu_get_previouspc(space->cpu));
+ logerror("cpu '%s' (PC=%06X): read mcu status\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu));
return 0;
}
diff --git a/src/mame/drivers/konamim2.c b/src/mame/drivers/konamim2.c
index b515bc8b44b..e2cecd1b026 100644
--- a/src/mame/drivers/konamim2.c
+++ b/src/mame/drivers/konamim2.c
@@ -317,7 +317,7 @@ static WRITE64_HANDLER(unk4_w)
{
if (data & 0x800000)
{
- mame_printf_debug("CPU '%s': CPU1 IRQ at %08X\n", space->cpu->tag, cpu_get_pc(space->cpu));
+ mame_printf_debug("CPU '%s': CPU1 IRQ at %08X\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
cputag_set_input_line(space->machine, "sub", INPUT_LINE_IRQ0, ASSERT_LINE);
}
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index b42bb2c8be6..e4ad75fcf8d 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -1407,7 +1407,7 @@ static WRITE8_HANDLER( s12_mcu_settings_w )
static READ8_HANDLER( s12_mcu_gun_h_r )
{
- const input_port_config *port = input_port_by_tag(&space->machine->portlist, "LIGHT0_X");
+ const input_port_config *port = space->machine->port("LIGHT0_X");
if( port != NULL )
{
int rv = input_port_read_direct( port ) << 6;
@@ -1426,7 +1426,7 @@ static READ8_HANDLER( s12_mcu_gun_h_r )
static READ8_HANDLER( s12_mcu_gun_v_r )
{
- const input_port_config *port = input_port_by_tag(&space->machine->portlist, "LIGHT0_Y");
+ const input_port_config *port = space->machine->port("LIGHT0_Y");
if( port != NULL )
{
int rv = input_port_read_direct( port ) << 6;
diff --git a/src/mame/drivers/route16.c b/src/mame/drivers/route16.c
index e0dd0892de5..472557603a5 100644
--- a/src/mame/drivers/route16.c
+++ b/src/mame/drivers/route16.c
@@ -943,7 +943,7 @@ static READ8_HANDLER( routex_prot_read )
{
if (cpu_get_pc(space->cpu) == 0x2f) return 0xfb;
- logerror ("cpu '%s' (PC=%08X): unmapped prot read\n", space->cpu->tag, cpu_get_pc(space->cpu));
+ logerror ("cpu '%s' (PC=%08X): unmapped prot read\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
return 0x00;
}
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index 97bfa03db41..d9db98c50c7 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -700,7 +700,7 @@ static void reset_reset(running_machine *machine)
static void resetcontrol_w(const address_space *space, UINT8 data)
{
resetcontrol = data;
- logerror("Reset control %02x ('%s':%x)\n", resetcontrol, space->cpu->tag, cpu_get_pc(space->cpu));
+ logerror("Reset control %02x ('%s':%x)\n", resetcontrol, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
reset_reset(space->machine);
}
@@ -757,7 +757,7 @@ static WRITE16_HANDLER( mlatch_w )
int i;
UINT8 mxor = 0;
if(!mlatch_table) {
- logerror("Protection: magic latch accessed but no table loaded (%s:%x)\n", space->cpu->tag, cpu_get_pc(space->cpu));
+ logerror("Protection: magic latch accessed but no table loaded (%s:%x)\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
return;
}
@@ -768,9 +768,9 @@ static WRITE16_HANDLER( mlatch_w )
if(mlatch & (1<<i))
mxor |= 1 << mlatch_table[i];
mlatch = data ^ mxor;
- logerror("Magic latching %02x ^ %02x as %02x (%s:%x)\n", data & 0xff, mxor, mlatch, space->cpu->tag, cpu_get_pc(space->cpu));
+ logerror("Magic latching %02x ^ %02x as %02x (%s:%x)\n", data & 0xff, mxor, mlatch, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
} else {
- logerror("Magic latch reset (%s:%x)\n", space->cpu->tag, cpu_get_pc(space->cpu));
+ logerror("Magic latch reset (%s:%x)\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
mlatch = 0x00;
}
}
diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c
index 0b0ac25418b..6e81cbd6535 100644
--- a/src/mame/drivers/stv.c
+++ b/src/mame/drivers/stv.c
@@ -481,7 +481,7 @@ static UINT8 stv_SMPC_r8 (const address_space *space, int offset)
if (cpu_get_pc(space->cpu)==0x060020E6) return_data = 0x10;//???
- //if(LOG_SMPC) logerror ("cpu %s (PC=%08X) SMPC: Read from Byte Offset %02x Returns %02x\n", space->cpu->tag, cpu_get_pc(space->cpu), offset, return_data);
+ //if(LOG_SMPC) logerror ("cpu %s (PC=%08X) SMPC: Read from Byte Offset %02x Returns %02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset, return_data);
return return_data;
@@ -705,7 +705,7 @@ static void stv_SMPC_w8 (const address_space *space, int offset, UINT8 data)
smpc_ram[0x21] = (0x80) | ((NMI_reset & 1) << 6);
break;
default:
- if(LOG_SMPC) logerror ("cpu '%s' (PC=%08X) SMPC: undocumented Command %02x\n", space->cpu->tag, cpu_get_pc(space->cpu), data);
+ if(LOG_SMPC) logerror ("cpu '%s' (PC=%08X) SMPC: undocumented Command %02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data);
}
// we've processed the command, clear status flag
@@ -895,7 +895,7 @@ static READ32_HANDLER ( stv_io_r32 )
return 0xffffffff;
}
case 0x1c/4:
- if(LOG_IOGA) logerror("(PC %s=%06x) Warning: READ from PORT_AD\n", space->cpu->tag, cpu_get_pc(space->cpu));
+ if(LOG_IOGA) logerror("(PC %s=%06x) Warning: READ from PORT_AD\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
popmessage("Read from PORT_AD");
port_i++;
return port_ad[port_i & 7];
@@ -1357,7 +1357,7 @@ static WRITE32_HANDLER( stv_scu_w32 )
stv_scu[40] != 0xffffffff)
{
if(LOG_SCU) logerror("cpu %s (PC=%08X) IRQ mask reg set %08x = %d%d%d%d|%d%d%d%d|%d%d%d%d|%d%d%d%d\n",
- space->cpu->tag, cpu_get_pc(space->cpu),
+ space->cpu->tag.cstr(), cpu_get_pc(space->cpu),
stv_scu[offset],
stv_scu[offset] & 0x8000 ? 1 : 0, /*A-Bus irq*/
stv_scu[offset] & 0x4000 ? 1 : 0, /*<reserved>*/
@@ -1965,7 +1965,7 @@ static READ32_HANDLER( stv_sh2_soundram_r )
* Enter into Radiant Silver Gun specific menu for a test... */
static WRITE32_HANDLER( minit_w )
{
- logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->cpu->tag, cpu_get_pc(space->cpu),data);
+ logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu),data);
cpuexec_boost_interleave(space->machine, minit_boost_timeslice, ATTOTIME_IN_USEC(minit_boost));
cpuexec_trigger(space->machine, 1000);
sh2_set_frt_input(devtag_get_device(space->machine, "slave"), PULSE_LINE);
@@ -1973,7 +1973,7 @@ static WRITE32_HANDLER( minit_w )
static WRITE32_HANDLER( sinit_w )
{
- logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->cpu->tag, cpu_get_pc(space->cpu),data);
+ logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu),data);
cpuexec_boost_interleave(space->machine, sinit_boost_timeslice, ATTOTIME_IN_USEC(sinit_boost));
sh2_set_frt_input(devtag_get_device(space->machine, "maincpu"), PULSE_LINE);
}
@@ -2315,7 +2315,7 @@ static WRITE32_HANDLER ( w60ffc44_write )
{
COMBINE_DATA(&stv_workram_h[0xffc44/4]);
- logerror("cpu %s (PC=%08X): 60ffc44_write write = %08X & %08X\n", space->cpu->tag, cpu_get_pc(space->cpu), data, mem_mask);
+ logerror("cpu %s (PC=%08X): 60ffc44_write write = %08X & %08X\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, mem_mask);
//sinit_w(offset,data,mem_mask);
}
@@ -2323,7 +2323,7 @@ static WRITE32_HANDLER ( w60ffc48_write )
{
COMBINE_DATA(&stv_workram_h[0xffc48/4]);
- logerror("cpu %s (PC=%08X): 60ffc48_write write = %08X & %08X\n", space->cpu->tag, cpu_get_pc(space->cpu), data, mem_mask);
+ logerror("cpu %s (PC=%08X): 60ffc48_write write = %08X & %08X\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, mem_mask);
//minit_w(offset,data,mem_mask);
}
diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c
index cf32f8341ce..fdc96ba5d3a 100644
--- a/src/mame/drivers/vcombat.c
+++ b/src/mame/drivers/vcombat.c
@@ -198,18 +198,18 @@ static void wiggle_i860_common(const device_config *device, UINT16 data)
if (bus_hold)
{
- fprintf(stderr, "M0 asserting bus HOLD to i860 %s\n", device->tag);
+ fprintf(stderr, "M0 asserting bus HOLD to i860 %s\n", device->tag.cstr());
i860_set_pin(device, DEC_PIN_BUS_HOLD, 1);
}
else
{
- fprintf(stderr, "M0 clearing bus HOLD to i860 %s\n", device->tag);
+ fprintf(stderr, "M0 clearing bus HOLD to i860 %s\n", device->tag.cstr());
i860_set_pin(device, DEC_PIN_BUS_HOLD, 0);
}
if (reset)
{
- fprintf(stderr, "M0 asserting RESET to i860 %s\n", device->tag);
+ fprintf(stderr, "M0 asserting RESET to i860 %s\n", device->tag.cstr());
i860_set_pin(device, DEC_PIN_RESET, 1);
}
else
diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c
index e3a7693fb46..fab82816e39 100644
--- a/src/mame/machine/atari.c
+++ b/src/mame/machine/atari.c
@@ -342,9 +342,9 @@ void atari_machine_start(running_machine *machine)
/* GTIA */
memset(&gtia_intf, 0, sizeof(gtia_intf));
- if (input_port_by_tag(&machine->portlist, "console") != NULL)
+ if (machine->port("console") != NULL)
gtia_intf.console_read = console_read;
- if (devtag_get_device(machine, "dac") != NULL)
+ if (machine->device("dac") != NULL)
gtia_intf.console_write = console_write;
gtia_init(machine, &gtia_intf);
diff --git a/src/mame/machine/atari_vg.c b/src/mame/machine/atari_vg.c
index 7cc4d5fb77d..f5840984305 100644
--- a/src/mame/machine/atari_vg.c
+++ b/src/mame/machine/atari_vg.c
@@ -108,7 +108,6 @@ static DEVICE_START( atari_vg_earom )
/* validate arguments */
assert(device != NULL);
- assert(device->tag != NULL);
assert(strlen(device->tag) < 20);
/* set static values */
diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c
index 2e8e31a7bb8..041d12e9372 100644
--- a/src/mame/machine/atarigen.c
+++ b/src/mame/machine/atarigen.c
@@ -70,7 +70,7 @@ INLINE const atarigen_screen_timer *get_screen_timer(const device_config *screen
if (state->screen_timer[i].screen == screen)
return &state->screen_timer[i];
- fatalerror("Unexpected: no atarivc_eof_update_timer for screen '%s'\n", screen->tag);
+ fatalerror("Unexpected: no atarivc_eof_update_timer for screen '%s'\n", screen->tag.cstr());
return NULL;
}
diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c
index 506f952c69e..d93f069c823 100644
--- a/src/mame/machine/decocass.c
+++ b/src/mame/machine/decocass.c
@@ -59,7 +59,7 @@ WRITE8_HANDLER( decocass_coin_counter_w )
WRITE8_HANDLER( decocass_sound_command_w )
{
decocass_state *state = (decocass_state *)space->machine->driver_data;
- LOG(2,("CPU %s sound command -> $%02x\n", space->cpu->tag, data));
+ LOG(2,("CPU %s sound command -> $%02x\n", space->cpu->tag.cstr(), data));
soundlatch_w(space, 0, data);
state->sound_ack |= 0x80;
/* remove snd cpu data ack bit. i don't see it in the schems, but... */
@@ -70,7 +70,7 @@ WRITE8_HANDLER( decocass_sound_command_w )
READ8_HANDLER( decocass_sound_data_r )
{
UINT8 data = soundlatch2_r(space, 0);
- LOG(2,("CPU %s sound data <- $%02x\n", space->cpu->tag, data));
+ LOG(2,("CPU %s sound data <- $%02x\n", space->cpu->tag.cstr(), data));
return data;
}
@@ -78,14 +78,14 @@ READ8_HANDLER( decocass_sound_ack_r )
{
decocass_state *state = (decocass_state *)space->machine->driver_data;
UINT8 data = state->sound_ack; /* D6+D7 */
- LOG(4,("CPU %s sound ack <- $%02x\n", space->cpu->tag, data));
+ LOG(4,("CPU %s sound ack <- $%02x\n", space->cpu->tag.cstr(), data));
return data;
}
WRITE8_HANDLER( decocass_sound_data_w )
{
decocass_state *state = (decocass_state *)space->machine->driver_data;
- LOG(2,("CPU %s sound data -> $%02x\n", space->cpu->tag, data));
+ LOG(2,("CPU %s sound data -> $%02x\n", space->cpu->tag.cstr(), data));
soundlatch2_w(space, 0, data);
state->sound_ack |= 0x40;
}
@@ -94,7 +94,7 @@ READ8_HANDLER( decocass_sound_command_r )
{
decocass_state *state = (decocass_state *)space->machine->driver_data;
UINT8 data = soundlatch_r(space, 0);
- LOG(4,("CPU %s sound command <- $%02x\n", space->cpu->tag, data));
+ LOG(4,("CPU %s sound command <- $%02x\n", space->cpu->tag.cstr(), data));
cpu_set_input_line(state->audiocpu, M6502_IRQ_LINE, CLEAR_LINE);
state->sound_ack &= ~0x80;
return data;
@@ -127,7 +127,7 @@ READ8_HANDLER( decocass_sound_data_ack_reset_r )
{
decocass_state *state = (decocass_state *)space->machine->driver_data;
UINT8 data = 0xff;
- LOG(2,("CPU %s sound ack rst <- $%02x\n", space->cpu->tag, data));
+ LOG(2,("CPU %s sound ack rst <- $%02x\n", space->cpu->tag.cstr(), data));
state->sound_ack &= ~0x40;
return data;
}
@@ -135,7 +135,7 @@ READ8_HANDLER( decocass_sound_data_ack_reset_r )
WRITE8_HANDLER( decocass_sound_data_ack_reset_w )
{
decocass_state *state = (decocass_state *)space->machine->driver_data;
- LOG(2,("CPU %s sound ack rst -> $%02x\n", space->cpu->tag, data));
+ LOG(2,("CPU %s sound ack rst -> $%02x\n", space->cpu->tag.cstr(), data));
state->sound_ack &= ~0x40;
}
diff --git a/src/mame/machine/kaneko16.c b/src/mame/machine/kaneko16.c
index e649dd45d33..756e0865e47 100644
--- a/src/mame/machine/kaneko16.c
+++ b/src/mame/machine/kaneko16.c
@@ -2425,7 +2425,7 @@ TOYBOX_MCU_COM_W(3)
*/
READ16_HANDLER( toybox_mcu_status_r )
{
- logerror("CPU %s (PC=%06X) : read MCU status\n", space->cpu->tag, cpu_get_previouspc(space->cpu));
+ logerror("CPU %s (PC=%06X) : read MCU status\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu));
return 0; // most games test bit 0 for failure
}
diff --git a/src/mame/machine/mathbox.c b/src/mame/machine/mathbox.c
index 13c564ad1b2..41cc7121425 100644
--- a/src/mame/machine/mathbox.c
+++ b/src/mame/machine/mathbox.c
@@ -320,7 +320,6 @@ static DEVICE_START( mathbox )
/* validate arguments */
assert(device != NULL);
- assert(device->tag != NULL);
assert(strlen(device->tag) < 20);
/* set static values */
diff --git a/src/mame/machine/namco06.c b/src/mame/machine/namco06.c
index 00294d7be47..34501683224 100644
--- a/src/mame/machine/namco06.c
+++ b/src/mame/machine/namco06.c
@@ -122,12 +122,12 @@ static TIMER_CALLBACK( nmi_generate )
if (!cpu_is_suspended(state->nmicpu, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
{
- LOG(("NMI cpu '%s'\n",state->nmicpu->tag));
+ LOG(("NMI cpu '%s'\n",state->nmicpu->tag.cstr()));
cpu_set_input_line(state->nmicpu, INPUT_LINE_NMI, PULSE_LINE);
}
else
- LOG(("NMI not generated because cpu '%s' is suspended\n",state->nmicpu->tag));
+ LOG(("NMI not generated because cpu '%s' is suspended\n",state->nmicpu->tag.cstr()));
}
@@ -137,11 +137,11 @@ READ8_DEVICE_HANDLER( namco_06xx_data_r )
UINT8 result = 0xff;
int devnum;
- LOG(("%s: 06XX '%s' read offset %d\n",cpuexec_describe_context(device->machine),device->tag,offset));
+ LOG(("%s: 06XX '%s' read offset %d\n",cpuexec_describe_context(device->machine),device->tag.cstr(),offset));
if (!(state->control & 0x10))
{
- logerror("%s: 06XX '%s' read in write mode %02x\n",cpuexec_describe_context(device->machine),device->tag,state->control);
+ logerror("%s: 06XX '%s' read in write mode %02x\n",cpuexec_describe_context(device->machine),device->tag.cstr(),state->control);
return 0;
}
@@ -158,11 +158,11 @@ WRITE8_DEVICE_HANDLER( namco_06xx_data_w )
namco_06xx_state *state = get_safe_token(device);
int devnum;
- LOG(("%s: 06XX '%s' write offset %d = %02x\n",cpuexec_describe_context(device->machine),device->tag,offset,data));
+ LOG(("%s: 06XX '%s' write offset %d = %02x\n",cpuexec_describe_context(device->machine),device->tag.cstr(),offset,data));
if (state->control & 0x10)
{
- logerror("%s: 06XX '%s' write in read mode %02x\n",cpuexec_describe_context(device->machine),device->tag,state->control);
+ logerror("%s: 06XX '%s' write in read mode %02x\n",cpuexec_describe_context(device->machine),device->tag.cstr(),state->control);
return;
}
@@ -175,7 +175,7 @@ WRITE8_DEVICE_HANDLER( namco_06xx_data_w )
READ8_DEVICE_HANDLER( namco_06xx_ctrl_r )
{
namco_06xx_state *state = get_safe_token(device);
- LOG(("%s: 06XX '%s' ctrl_r\n",cpuexec_describe_context(device->machine),device->tag));
+ LOG(("%s: 06XX '%s' ctrl_r\n",cpuexec_describe_context(device->machine),device->tag.cstr()));
return state->control;
}
@@ -184,7 +184,7 @@ WRITE8_DEVICE_HANDLER( namco_06xx_ctrl_w )
namco_06xx_state *state = get_safe_token(device);
int devnum;
- LOG(("%s: 06XX '%s' control %02x\n",cpuexec_describe_context(device->machine),device->tag,data));
+ LOG(("%s: 06XX '%s' control %02x\n",cpuexec_describe_context(device->machine),device->tag.cstr(),data));
state->control = data;
diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c
index b13e2db1520..d83eff53d98 100644
--- a/src/mame/machine/namcos1.c
+++ b/src/mame/machine/namcos1.c
@@ -99,13 +99,13 @@ static READ8_HANDLER( faceoff_inputs_r );
static READ8_HANDLER( no_key_r )
{
- popmessage("CPU %s PC %08x: keychip read %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), offset);
+ popmessage("CPU %s PC %08x: keychip read %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
return 0;
}
static WRITE8_HANDLER( no_key_w )
{
- popmessage("CPU %s PC %08x: keychip write %04x=%02x\n", space->cpu->tag, cpu_get_pc(space->cpu), offset, data);
+ popmessage("CPU %s PC %08x: keychip write %04x=%02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset, data);
}
@@ -210,7 +210,7 @@ CPU #0 PC e3d4: keychip read 0003 [AND #$37 = key no.]
*/
static READ8_HANDLER( key_type1_r )
{
-// logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), offset);
+// logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
if (offset < 3)
{
@@ -241,7 +241,7 @@ static READ8_HANDLER( key_type1_r )
static WRITE8_HANDLER( key_type1_w )
{
-// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag, cpu_get_pc(space->cpu), offset, data);
+// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset, data);
if (offset < 4)
key[offset] = data;
@@ -393,7 +393,7 @@ CPU #0 PC e574: keychip read 0001
static READ8_HANDLER( key_type2_r )
{
-// logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), offset);
+// logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
key_numerator_high_word = 0;
@@ -412,7 +412,7 @@ static READ8_HANDLER( key_type2_r )
static WRITE8_HANDLER( key_type2_w )
{
-// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag, cpu_get_pc(space->cpu), offset, data);
+// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset, data);
if (offset < 5)
{
@@ -521,7 +521,7 @@ static READ8_HANDLER( key_type3_r )
{
int op;
-// logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), offset);
+// logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
/* I need to handle blastoff's read from 0858. The game previously writes to 0858,
using it as temporary storage, so maybe it expects to act as RAM, however
@@ -537,14 +537,14 @@ static READ8_HANDLER( key_type3_r )
if (op == key_bottom4) return (offset << 4) | (key[key_swap4_arg] & 0x0f);
if (op == key_top4) return (offset << 4) | (key[key_swap4_arg] >> 4);
- popmessage("CPU %s PC %08x: keychip read %04x", space->cpu->tag, cpu_get_pc(space->cpu), offset);
+ popmessage("CPU %s PC %08x: keychip read %04x", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
return 0;
}
static WRITE8_HANDLER( key_type3_w )
{
-// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag, cpu_get_pc(space->cpu), offset, data);
+// logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset, data);
key[(offset & 0x70) >> 4] = data;
}
@@ -647,21 +647,21 @@ static WRITE8_HANDLER( soundram_w )
static WRITE8_HANDLER( rom_w )
{
- logerror("CPU %s PC %04x: warning - write %02x to rom address %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), data, offset);
+ logerror("CPU %s PC %04x: warning - write %02x to rom address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
}
/* error handlers */
static READ8_HANDLER( unknown_r )
{
- logerror("CPU %s PC %04x: warning - read from unknown chip\n", space->cpu->tag, cpu_get_pc(space->cpu) );
-// popmessage("CPU %s PC %04x: read from unknown chip", space->cpu->tag, cpu_get_pc(space->cpu) );
+ logerror("CPU %s PC %04x: warning - read from unknown chip\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu) );
+// popmessage("CPU %s PC %04x: read from unknown chip", space->cpu->tag.cstr(), cpu_get_pc(space->cpu) );
return 0;
}
static WRITE8_HANDLER( unknown_w )
{
- logerror("CPU %s PC %04x: warning - wrote to unknown chip\n", space->cpu->tag, cpu_get_pc(space->cpu) );
-// popmessage("CPU %s PC %04x: wrote to unknown chip", space->cpu->tag, cpu_get_pc(space->cpu) );
+ logerror("CPU %s PC %04x: warning - wrote to unknown chip\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu) );
+// popmessage("CPU %s PC %04x: wrote to unknown chip", space->cpu->tag.cstr(), cpu_get_pc(space->cpu) );
}
/* Main bankswitching routine */
@@ -737,7 +737,7 @@ static void namcos1_bankswitch(running_machine *machine, int cpu, offs_t offset,
WRITE8_HANDLER( namcos1_bankswitch_w )
{
-// logerror("cpu %s: namcos1_bankswitch_w offset %04x data %02x\n", space->cpu->tag, offset, data);
+// logerror("cpu %s: namcos1_bankswitch_w offset %04x data %02x\n", space->cpu->tag.cstr(), offset, data);
namcos1_bankswitch(space->machine, (space->cpu == devtag_get_device(space->machine, "maincpu")) ? 0 : 1, offset, data);
}
diff --git a/src/mame/machine/pckeybrd.c b/src/mame/machine/pckeybrd.c
index cfe14b4a17f..ecdb65cb2db 100644
--- a/src/mame/machine/pckeybrd.c
+++ b/src/mame/machine/pckeybrd.c
@@ -340,9 +340,9 @@ void at_keyboard_init(running_machine *machine, AT_KEYBOARD_TYPE type)
/* locate the keyboard ports */
for (i = 0; i < sizeof(keyboard.ports) / sizeof(keyboard.ports[0]); i++)
{
- char buf[40];
- sprintf(buf, "pc_keyboard_%d", i);
- keyboard.ports[i] = input_port_by_tag(&machine->portlist, buf);
+ astring buf;
+ buf.printf("pc_keyboard_%d", i);
+ keyboard.ports[i] = machine->port(buf);
}
#ifdef MESS
diff --git a/src/mame/machine/segas24.c b/src/mame/machine/segas24.c
index f86bf5f0b31..72c74899a80 100644
--- a/src/mame/machine/segas24.c
+++ b/src/mame/machine/segas24.c
@@ -50,7 +50,7 @@ void system24temp_sys16_io_set_callbacks(UINT8 (*io_r)(running_machine *machine,
READ16_HANDLER ( system24temp_sys16_io_r )
{
- // logerror("IO read %02x (%s:%x)\n", offset, space->cpu->tag, cpu_get_pc(space->cpu));
+ // logerror("IO read %02x (%s:%x)\n", offset, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
if(offset < 8)
return system24temp_sys16_io_io_r ? system24temp_sys16_io_io_r(space->machine,offset) : 0xff;
else if (offset < 0x20) {
@@ -68,7 +68,7 @@ READ16_HANDLER ( system24temp_sys16_io_r )
case 0xf:
return system24temp_sys16_io_dir;
default:
- logerror("IO control read %02x (%s:%x)\n", offset, space->cpu->tag, cpu_get_pc(space->cpu));
+ logerror("IO control read %02x (%s:%x)\n", offset, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
return 0xff;
}
} else
@@ -86,7 +86,7 @@ WRITE16_HANDLER( system24temp_sys16_io_w )
if(ACCESSING_BITS_0_7) {
if(offset < 8) {
if(!(system24temp_sys16_io_dir & (1 << offset))) {
- logerror("IO port write on input-only port (%d, [%02x], %02x, %s:%x)\n", offset, system24temp_sys16_io_dir, data & 0xff, space->cpu->tag, cpu_get_pc(space->cpu));
+ logerror("IO port write on input-only port (%d, [%02x], %02x, %s:%x)\n", offset, system24temp_sys16_io_dir, data & 0xff, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
return;
}
if(system24temp_sys16_io_io_w)
@@ -102,7 +102,7 @@ WRITE16_HANDLER( system24temp_sys16_io_w )
system24temp_sys16_io_dir = data;
break;
default:
- logerror("IO control write %02x, %02x (%s:%x)\n", offset, data & 0xff, space->cpu->tag, cpu_get_pc(space->cpu));
+ logerror("IO control write %02x, %02x (%s:%x)\n", offset, data & 0xff, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
}
}
}
diff --git a/src/mame/mamedriv.c b/src/mame/mamedriv.c
index eeba4da38f7..bad2b2e7f6a 100644
--- a/src/mame/mamedriv.c
+++ b/src/mame/mamedriv.c
@@ -15,7 +15,7 @@
******************************************************************************/
-#include "driver.h"
+#include "emu.h"
#ifndef DRIVER_RECURSIVE
diff --git a/src/mame/video/dkong.c b/src/mame/video/dkong.c
index baee631f912..9144521ba08 100644
--- a/src/mame/video/dkong.c
+++ b/src/mame/video/dkong.c
@@ -894,7 +894,7 @@ static void check_palette(running_machine *machine)
const input_port_config *port;
int newset;
- port = input_port_by_tag(&machine->portlist, "VIDHW");
+ port = machine->port("VIDHW");
if (port != NULL)
{
newset = input_port_read_direct(port);
diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c
index 51d66c868dd..3c82cc8f8d9 100644
--- a/src/mame/video/ppu2c0x.c
+++ b/src/mame/video/ppu2c0x.c
@@ -1029,7 +1029,7 @@ READ8_DEVICE_HANDLER( ppu2c0x_r )
if (offset >= PPU_MAX_REG)
{
- logerror("PPU %s(r): Attempting to read past the chip\n", device->tag);
+ logerror("PPU %s(r): Attempting to read past the chip\n", device->tag.cstr());
offset &= PPU_MAX_REG - 1;
}
diff --git a/src/mame/video/stvvdp1.c b/src/mame/video/stvvdp1.c
index 5d041da6f4b..85a31ab9b15 100644
--- a/src/mame/video/stvvdp1.c
+++ b/src/mame/video/stvvdp1.c
@@ -192,7 +192,7 @@ READ32_HANDLER( stv_vdp1_regs_r )
// x ^= 0x00020000;
- logerror ("cpu %s (PC=%08X) VDP1: Read from Registers, Offset %04x\n", space->cpu->tag, cpu_get_pc(space->cpu), offset);
+ logerror ("cpu %s (PC=%08X) VDP1: Read from Registers, Offset %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
// if (offset == 0x04) return x;
return stv_vdp1_regs[offset];
@@ -348,7 +348,7 @@ WRITE32_HANDLER ( stv_vdp1_vram_w )
// if (((offset * 4) > 0xdf) && ((offset * 4) < 0x140))
// {
-// logerror("cpu %s (PC=%08X): VRAM dword write to %08X = %08X & %08X\n", space->cpu->tag, cpu_get_pc(space->cpu), offset*4, data, mem_mask);
+// logerror("cpu %s (PC=%08X): VRAM dword write to %08X = %08X & %08X\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset*4, data, mem_mask);
// }
data = stv_vdp1_vram[offset];
diff --git a/src/mame/video/stvvdp2.c b/src/mame/video/stvvdp2.c
index dbc9183faf7..b18b0c5ac92 100644
--- a/src/mame/video/stvvdp2.c
+++ b/src/mame/video/stvvdp2.c
@@ -5366,7 +5366,7 @@ READ32_HANDLER ( stv_vdp2_regs_r )
h_count = video_screen_get_hpos(space->machine->primary_screen) & 0x3ff;
v_count = video_screen_get_vpos(space->machine->primary_screen) & (STV_VDP2_LSMD == 3 ? 0x7ff : 0x3ff);
stv_vdp2_regs[offset] = (h_count<<16)|(v_count);
- if(LOG_VDP2) logerror("CPU %s PC(%08x) = VDP2: H/V counter read : %08x\n", space->cpu->tag, cpu_get_pc(space->cpu),stv_vdp2_regs[offset]);
+ if(LOG_VDP2) logerror("CPU %s PC(%08x) = VDP2: H/V counter read : %08x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu),stv_vdp2_regs[offset]);
break;
}
}
diff --git a/src/mame/video/vdc.h b/src/mame/video/vdc.h
index f4968b0882e..286911f05f3 100644
--- a/src/mame/video/vdc.h
+++ b/src/mame/video/vdc.h
@@ -1,5 +1,4 @@
-#include "driver.h"
#include "video/generic.h"
VIDEO_START( pce );
diff --git a/src/osd/osdepend.h b/src/osd/osdepend.h
index b2d1484085e..25d01c7d8d9 100644
--- a/src/osd/osdepend.h
+++ b/src/osd/osdepend.h
@@ -68,8 +68,10 @@
#include "emucore.h"
#include "osdcore.h"
-#include "inptport.h"
-#include "timer.h"
+
+
+class input_type_desc;
+class device_config;
/*-----------------------------------------------------------------------------
@@ -124,7 +126,6 @@
-----------------------------------------------------------------------------*/
void osd_init(running_machine *machine);
-
void osd_wait_for_debugger(const device_config *device, int firststop);
diff --git a/src/osd/windows/d3d8intf.c b/src/osd/windows/d3d8intf.c
index 1d8c02c8da3..a37d16c22c7 100644
--- a/src/osd/windows/d3d8intf.c
+++ b/src/osd/windows/d3d8intf.c
@@ -45,7 +45,7 @@
#include <d3d8.h>
// MAME headers
-#include "mame.h"
+#include "driver.h"
// MAMEOS headers
#include "d3dintf.h"
diff --git a/src/osd/windows/d3d9intf.c b/src/osd/windows/d3d9intf.c
index 805ba7f8c28..c90234bddac 100644
--- a/src/osd/windows/d3d9intf.c
+++ b/src/osd/windows/d3d9intf.c
@@ -45,7 +45,7 @@
#include <d3d9.h>
// MAME headers
-#include "mame.h"
+#include "driver.h"
// MAMEOS headers
#include "d3dintf.h"
diff --git a/src/osd/windows/drawd3d.c b/src/osd/windows/drawd3d.c
index 7d2267f9da4..5c2429d8eff 100644
--- a/src/osd/windows/drawd3d.c
+++ b/src/osd/windows/drawd3d.c
@@ -58,9 +58,11 @@
#include <math.h>
// MAME headers
+#include "emu.h"
#include "render.h"
#include "rendutil.h"
#include "options.h"
+#include "emuopts.h"
// MAMEOS headers
#include "d3dintf.h"
diff --git a/src/osd/windows/drawdd.c b/src/osd/windows/drawdd.c
index 66773379d45..4a5b26d552e 100644
--- a/src/osd/windows/drawdd.c
+++ b/src/osd/windows/drawdd.c
@@ -49,6 +49,7 @@
#include <math.h>
// MAME headers
+#include "emu.h"
#include "render.h"
#include "rendutil.h"
#include "options.h"
diff --git a/src/osd/windows/sound.c b/src/osd/windows/sound.c
index d3f28a1cd45..a94b936d801 100644
--- a/src/osd/windows/sound.c
+++ b/src/osd/windows/sound.c
@@ -49,9 +49,9 @@
#include <dsound.h>
// MAME headers
-#include "osdepend.h"
#include "driver.h"
#include "osdepend.h"
+#include "emuopts.h"
// MAMEOS headers
#include "winmain.h"
diff --git a/src/osd/windows/video.c b/src/osd/windows/video.c
index d3d119cede7..fb29b9faae7 100644
--- a/src/osd/windows/video.c
+++ b/src/osd/windows/video.c
@@ -52,8 +52,9 @@
#endif
// MAME headers
-#include "osdepend.h"
#include "driver.h"
+#include "emuopts.h"
+#include "osdepend.h"
#include "video/vector.h"
#include "render.h"
#include "rendutil.h"
diff --git a/src/osd/windows/window.c b/src/osd/windows/window.c
index 330b9c2bd02..1ba7f905610 100644
--- a/src/osd/windows/window.c
+++ b/src/osd/windows/window.c
@@ -56,8 +56,8 @@
#include <process.h>
// MAME headers
-#include "osdepend.h"
#include "driver.h"
+#include "emuopts.h"
#include "uiinput.h"
// MAMEOS headers
diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c
index 6725b0183bf..13299b979a1 100644
--- a/src/osd/windows/winmain.c
+++ b/src/osd/windows/winmain.c
@@ -53,6 +53,7 @@
// MAME headers
#include "driver.h"
#include "clifront.h"
+#include "emuopts.h"
// MAMEOS headers
#include "winmain.h"
diff --git a/src/osd/windows/winmain.h b/src/osd/windows/winmain.h
index 4142c4b5fa7..0f4b8ff619a 100644
--- a/src/osd/windows/winmain.h
+++ b/src/osd/windows/winmain.h
@@ -39,6 +39,8 @@
//
//============================================================
+#include "options.h"
+
//============================================================
// CONSTANTS
diff --git a/src/tools/romcmp.c b/src/tools/romcmp.c
index 265fd427caa..0797dbbd180 100644
--- a/src/tools/romcmp.c
+++ b/src/tools/romcmp.c
@@ -11,6 +11,7 @@
#include "unzip.h"
#include "osdcore.h"
+#include "osdcomm.h"
#include <stdarg.h>
diff --git a/src/tools/unidasm.c b/src/tools/unidasm.c
index 67b05304028..77c9fa1f572 100644
--- a/src/tools/unidasm.c
+++ b/src/tools/unidasm.c
@@ -37,9 +37,8 @@
****************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#include <ctype.h>
-#include <iostream>
enum _display_type
{
@@ -618,7 +617,7 @@ int main(int argc, char *argv[])
if (fatal.exitcode() != 0)
result = fatal.exitcode();
}
- catch (emu_exception &exception)
+ catch (emu_exception &)
{
fprintf(stderr, "Caught unhandled emulator exception\n");
}